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;
88 super(text, textComponent, animationObjects, faceObjectProviders);
96 faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener);
103 super.actionPerformed(e);
113 if (animationName.isEmpty() || animationName.equals(
"NONE")) {
116 final NamedObject animationObject = animationObjects.
get(animationName);
117 if (animationObject == null) {
120 final Icon tmp = faceObjectProviders.
getDisplayIcon(animationObject);
130 return super.clone();
135 super.setEnabled(newValue);
136 icon.setEnabled(newValue);
The data package contains classes for handling data that is organized in a tree.
String getFaceName()
Returns the current face name.
void actionPerformed(@NotNull final ActionEvent e)
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
final void updateIconLabel()
Updates the icon of icon to reflect the current animation name.
final JTextComponent textComponent
The JTextComponent that holds the current face/animation name.
ImageIcon getDisplayIcon(@NotNull final NamedObject namedObject)
Returns the display icon for a NamedObject.
Base package of all Gridarta classes.
E get(@NotNull String objectName)
Gets a AbstractNamedObject.
void setEnabled(final boolean newValue)
final ImageIcon noFaceSquareIcon
The ImageIcon for no animations.
AnimationObjects is a container for AnimationObjects.
final ImageIcon unknownSquareIcon
The ImageIcon for undefined animations.
final AbstractButton icon
The button showing the icon.
Action for choosing a face or animation.
A TreeChooseAction that updates an animation label.
Interface for listeners interested in FaceObjectProviders related events.
Provider for faces of GameObjects and Archetypes.
The face is the appearance of an object.
AnimTreeChooseAction(@NotNull final String text, @NotNull final JTextComponent textComponent, @NotNull final AbstractButton icon, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final ImageIcon noFaceSquareIcon, @NotNull final ImageIcon unknownSquareIcon)
Create a TreeChooseAction.
static final long serialVersionUID
The serial version UID.
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
final AnimationObjects animationObjects
The AnimationObjects to select from.