public class JNamedTag extends JExtensionalTag
A JNamedTag
tag is a JExtensionalTag
.
A JNamedTag
tag is a set of components having the same label.
One can create a CNamedTag named "colorable":
CNamedTag tag = new CNamedTag("colorable");and use transitions in state machine like:
Transition onAnyColor = new Press("colorable", BUTTON1) { public void action() { ... } };
JExtensionalTag
Constructor and Description |
---|
JNamedTag(java.lang.String n)
Builds a
JNamedTag tag. |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clear all registered tags.
|
java.lang.String |
getName()
Returns the name of this tag.
|
static JNamedTag |
getTag(java.lang.String t)
Returns the tag object given its name.
|
static java.util.LinkedList |
getTaggedComponents(java.lang.String t)
Returns the list of components that have a given tag.
|
boolean |
setName(java.lang.String n)
Sets the name of this tag.
|
added, addTo, removed, removeFrom, reset
action, action, getAllJTags, getTaggedComponents, hasNext, next, nextComponent, setBackground, tagsComponent, tagsComponent
getCollection, remove, size
public JNamedTag(java.lang.String n)
JNamedTag
tag.
Note that if a tag with the same name already exists, this new tag is not registered and the results are undefined.
This constructor is left public and does not throw an exception in order to make it possible to create anonymous classes derived from JNamedTag
.n
- The name of the tagpublic static void clear()
public static java.util.LinkedList getTaggedComponents(java.lang.String t)
t
- The name of the tagpublic static JNamedTag getTag(java.lang.String t)
t
- The name of the tagpublic java.lang.String getName()
public boolean setName(java.lang.String n)
n
- The name.