fr.lri.swingstates.sm
Class JExtensionalTag

java.lang.Object
  extended by fr.lri.swingstates.sm.Tag
      extended by fr.lri.swingstates.sm.JTag
          extended by fr.lri.swingstates.sm.JExtensionalTag
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
JNamedTag

public abstract class JExtensionalTag
extends JTag

A JExtensionalTag tag is a tag that can be explicitely attached to and detached from a JComponent, i.e. this JComponent can be added to or removed to the tag's collection.

Author:
Caroline Appert
See Also:
JTag

Constructor Summary
JExtensionalTag()
          Builds a SMExtensionalTag that can tag any object.
 
Method Summary
 void added(java.awt.Component c)
          Method called when this tag is added to an JComponent.
 JExtensionalTag addTo(java.awt.Component c)
          Adds the JComponent c to the collection containing all the components having this tag.
 void removed(java.awt.Component c)
          Method called when this tag is removed from an JComponent.
 JExtensionalTag removeFrom(java.awt.Component c)
          Removes the component c from the collection containing all the components having this tag.
 void reset()
          Inits the tag's iterator.
 
Methods inherited from class fr.lri.swingstates.sm.JTag
action, action, getTaggedComponents, hasNext, next, nextComponent, setBackground, tagsComponent, tagsComponent
 
Methods inherited from class fr.lri.swingstates.sm.Tag
getCollection, remove, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JExtensionalTag

public JExtensionalTag()
Builds a SMExtensionalTag that can tag any object. This tag can be explicitely removed to any object.

Method Detail

reset

public final void reset()
Inits the tag's iterator.

Specified by:
reset in class Tag

added

public void added(java.awt.Component c)
Method called when this tag is added to an JComponent. By default, this method does nothing. Redefine it in a subclass to specify side effects, such as changing the color of the attached JComponent.

Parameters:
c - The Component

removed

public void removed(java.awt.Component c)
Method called when this tag is removed from an JComponent. By default, this method does nothing. Redefine it in a subclass to specify side effects, such as changing the color of the attached JComponent.

Parameters:
c - The JComponent

addTo

public final JExtensionalTag addTo(java.awt.Component c)
Adds the JComponent c to the collection containing all the components having this tag. This method calls begin(JComponent), which can be redefined in subclasses to specify side effects, such as changing the color of the attached object when the tag is added.

Parameters:
c - The JComponent
Returns:
this tag
See Also:
added(Component)

removeFrom

public final JExtensionalTag removeFrom(java.awt.Component c)
Removes the component c from the collection containing all the components having this tag. This method calls end(JComponent), which can be redefined in subclasses to specify side effects, such as changing the color of the attached object when the tag is removed.

Parameters:
c - The JComponent
Returns:
this tag
See Also:
removed(Component)