20 package net.sf.gridarta.gui.utils;
22 import java.awt.event.ActionEvent;
23 import javax.swing.AbstractButton;
24 import javax.swing.Icon;
25 import javax.swing.ImageIcon;
26 import javax.swing.text.JTextComponent;
31 import org.jetbrains.annotations.NotNull;
48 private final AbstractButton
icon;
80 super(text, textComponent, namedObjects, faceObjectProviders);
87 faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener);
94 super.actionPerformed(e);
104 if (faceName.isEmpty() || faceName.equals(
"NONE")) {
116 return super.clone();
121 super.setEnabled(newValue);
122 icon.setEnabled(newValue);
final NamedObjects<? extends NamedObject > namedObjects
The NamedObjects providing the face/animation names tree.
The data package contains classes for handling data that is organized in a tree.
String getFaceName()
Returns the current face name.
void setEnabled(final boolean newValue)
This class manages NamedObjects, managing their tree as well as providing a method for showing a dial...
final void updateIconLabel()
Updates the icon of icon to reflect the current face name.
FaceTreeChooseAction(@NotNull final String text, @NotNull final JTextComponent textComponent, @NotNull final AbstractButton icon, @NotNull final NamedObjects<? extends NamedObject > namedObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon)
Create a TreeChooseAction.
final JTextComponent textComponent
The JTextComponent that holds the current face/animation name.
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
Base package of all Gridarta classes.
void actionPerformed(@NotNull final ActionEvent e)
static final long serialVersionUID
The serial version UID.
final AbstractButton icon
The button showing the icon.
A TreeChooseAction that updates a face label.
Action for choosing a face or animation.
Interface for listeners interested in FaceObjectProviders related events.
Provider for faces of GameObjects and Archetypes.
The face is the appearance of an object.
ImageIcon getImageIconForFacename(@NotNull final String faceObjName)
Returns the ImageIcon for a given face object name.
final ImageIcon noFaceSquareIcon
The ImageIcon for no animations.
final ImageIcon unknownSquareIcon
The ImageIcon for undefined animations.