20 package net.sf.gridarta.gui.mapmenu;
22 import java.awt.Component;
23 import java.awt.Image;
24 import javax.swing.ImageIcon;
25 import javax.swing.JTree;
26 import javax.swing.tree.DefaultMutableTreeNode;
27 import javax.swing.tree.DefaultTreeCellRenderer;
30 import org.jetbrains.annotations.NotNull;
65 public Component
getTreeCellRendererComponent(
final JTree tree,
final Object value,
final boolean sel,
final boolean expanded,
final boolean leaf,
final int row,
final boolean hasFocus) {
66 super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
67 final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
71 mapMenuEntry.
visit(
this);
77 setIcon(expanded ? getOpenIcon() : getClosedIcon());
82 final MapFile mapFile = mapMenuEntry.getMapFile();
86 setIcon(
new ImageIcon(icon));
Image getOrCreateIcon(@NotNull final File mapFile)
Returns an icon Image for a given map file.
Graphical User Interface of Gridarta.
AbsoluteMapPath getMapPath()
Returns the map path within getMapsDir().
Base package of all Gridarta classes.
Caches icon and preview images for map files.
File getFile()
Returns a File for this map file.
The location of a map file with a map directory.