-
Notifications
You must be signed in to change notification settings - Fork 110
JTree rendering with Raven #82
Comments
For 2) look at SubstanceCortex..setFlatBackground Everything you used to do with putClientProperty has been centralized in SubstanceCortex which imo is a much cleaner API. |
I'm not seeing the tree selection issue in the main Substance demo app. This maybe is a custom tree since it has checkboxes? Can you attach a small, standalone sample app that reproduces this issue under 8.0.01 build? As for the client properties, they have all been replaced by various scoped APIs in SubstanceCortex as pointed above. Some of them are still implemented internally by client properties, but that is an implementation detail and should not be relied on going forward. |
Thanks for your prompt reply. For 2), I just replaced by I can reproduce the issue with a simple JTree. The problem is related to DefaultTreeCellRenderer: import javax.swing.JFrame;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
public class TreeExample extends JFrame {
public TreeExample() {
try {
UIManager.setLookAndFeel("org.pushingpixels.substance.api.skin.SubstanceRavenLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}
JTree tree = new JTree();
DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
DefaultMutableTreeNode vegetableNode = new DefaultMutableTreeNode("Vegetables");
vegetableNode.add(new DefaultMutableTreeNode("Capsicum"));
vegetableNode.add(new DefaultMutableTreeNode("Carrot"));
vegetableNode.add(new DefaultMutableTreeNode("Tomato"));
vegetableNode.add(new DefaultMutableTreeNode("Potato"));
DefaultMutableTreeNode fruitNode = new DefaultMutableTreeNode("Fruits");
fruitNode.add(new DefaultMutableTreeNode("Banana"));
fruitNode.add(new DefaultMutableTreeNode("Mango"));
fruitNode.add(new DefaultMutableTreeNode("Apple"));
fruitNode.add(new DefaultMutableTreeNode("Grapes"));
fruitNode.add(new DefaultMutableTreeNode("Orange"));
root.add(vegetableNode);
root.add(fruitNode);
DefaultTreeModel model = new DefaultTreeModel(root, false);
tree.setModel(model);
DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
renderer.setOpenIcon(null);
renderer.setClosedIcon(null);
renderer.setLeafIcon(null);
tree.setCellRenderer(renderer);
tree.expandPath(new TreePath(vegetableNode.getPath()));
tree.expandPath(new TreePath(fruitNode.getPath()));
add(tree);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("JTree Example");
this.pack();
this.setVisible(true);
}
public static void main(String[] args) throws Exception {
SwingUtilities.invokeLater(TreeExample::new);
}
} |
The tree renderer is due to "Tree.rendererFillBackground" -> false entry getting added to the UIManager defaults table. This is not needed. Will remove tonight for 8.0.02. |
Version of Substance
8.0.1
Version of Java
8_161
Version of OS
Linux
The issue you're experiencing (expected vs actual, screenshot, stack trace etc)
Try to migrate from the version 7.0.1 to 8.0.1. I've noticed some small issues with dark themes like Raven:
Version 7.0.1:
Version 8.0.1:
button.putClientProperty("substancelaf.componentFlat", Boolean.TRUE);
The text was updated successfully, but these errors were encountered: