net.sourceforge.nite.nstyle.handler
Class LabelHandler

java.lang.Object
  extended by net.sourceforge.nite.nstyle.handler.NDisplayObjectHandler
      extended by net.sourceforge.nite.nstyle.handler.JComponentHandler
          extended by net.sourceforge.nite.nstyle.handler.LabelHandler
All Implemented Interfaces:
OutputComponent

public class LabelHandler
extends JComponentHandler
implements OutputComponent

Author:
judyr

Constructor Summary
LabelHandler()
           
 
Method Summary
 javax.swing.JComponent displayElement(ObjectModelElement e, boolean selected)
          Display this element on the user interface
 void insertDisplayElement(ObjectModelElement newElement, ObjectModelElement parent, int position)
          Used to update the display after an addChild operation.
 void redisplayElement(ObjectModelElement e)
          Used to refresh the display of an element on the screen after changes to textual content or attribute values on underlying xml
 void removeDisplayComponent(ObjectModelElement e)
          Remove the on screen representation of an element once it has been removed from the object model
 void setElement(ObjectModelElement e)
          Sets the element.
 
Methods inherited from class net.sourceforge.nite.nstyle.handler.JComponentHandler
addActionReference, addChild, getImage, getJComponent, registerAction, setImage, setUpBackgroundColour, setUpFont, setUpForegroundColour, setUpImage, setUpToolTip
 
Methods inherited from class net.sourceforge.nite.nstyle.handler.NDisplayObjectHandler
addActionReference, getActionReferences, getChildren, getClock, getElement, getEndTime, getID, getParent, getSourceID, getStartTime, init, setChildren, setClock, setEndTime, setID, setParent, setSourceID, setStartTime, setUpTimes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelHandler

public LabelHandler()
Method Detail

setElement

public void setElement(ObjectModelElement e)
Description copied from class: NDisplayObjectHandler
Sets the element.

Overrides:
setElement in class NDisplayObjectHandler
Parameters:
e - The element to set

redisplayElement

public void redisplayElement(ObjectModelElement e)
Description copied from interface: OutputComponent
Used to refresh the display of an element on the screen after changes to textual content or attribute values on underlying xml

Specified by:
redisplayElement in interface OutputComponent
Parameters:
e - The element which should have its representation refreshed.
See Also:
OutputComponent.redisplayElement(net.sourceforge.nite.nxt.ObjectModelElement)

removeDisplayComponent

public void removeDisplayComponent(ObjectModelElement e)
Description copied from interface: OutputComponent
Remove the on screen representation of an element once it has been removed from the object model

Specified by:
removeDisplayComponent in interface OutputComponent
See Also:
OutputComponent.removeDisplayComponent(net.sourceforge.nite.nxt.ObjectModelElement)

insertDisplayElement

public void insertDisplayElement(ObjectModelElement newElement,
                                 ObjectModelElement parent,
                                 int position)
Description copied from interface: OutputComponent
Used to update the display after an addChild operation. Place the new element "after" the positionth child of the parent element. After is easily defined a tree component, but it is far less obvious how this shoud be implemented for text areas.

Specified by:
insertDisplayElement in interface OutputComponent
Parameters:
newElement - The element which is to be inserted
parent - The parent of the element to be added
position - The index into the list of children belonging to the parent
See Also:
OutputComponent.insertDisplayElement(net.sourceforge.nite.nxt.ObjectModelElement, net.sourceforge.nite.nxt.ObjectModelElement, int)

displayElement

public javax.swing.JComponent displayElement(ObjectModelElement e,
                                             boolean selected)
Description copied from interface: OutputComponent
Display this element on the user interface

Specified by:
displayElement in interface OutputComponent
See Also:
FIX ME At the moment this tries to display the value of displayAttribute, but if there isn't one it displays the textual content. Maybe should make this more explicit somewhere