org.argouml.uml.diagram.ui
Class CompartmentFigText

java.lang.Object
  extended by FigText
      extended by org.argouml.uml.diagram.ui.ArgoFigText
          extended by org.argouml.uml.diagram.ui.FigSingleLineText
              extended by org.argouml.uml.diagram.ui.FigSingleLineTextWithNotation
                  extended by org.argouml.uml.diagram.ui.CompartmentFigText
All Implemented Interfaces:
java.util.EventListener, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ArgoEventListener, ArgoNotationEventListener, TargetListener, ArgoFig
Direct Known Subclasses:
FigEnumerationLiteral, FigExtensionPoint, FigFeature

public abstract class CompartmentFigText
extends FigSingleLineTextWithNotation
implements TargetListener

A single line FigText class extension for editable FigClass/FigInterface/FigUseCase compartments that use notation. When selected, this compartment is highlighted.

This implementation now supports the extension point compartment in a use case.


Field Summary
 
Fields inherited from interface org.argouml.uml.diagram.ui.ArgoFig
DEBUG, DEBUG_COLOR, FILL_COLOR, INVISIBLE_LINE_COLOR, LINE_COLOR, LINE_WIDTH, ROWHEIGHT, SOLID_FILL_COLOR, STEREOHEIGHT, TEXT_COLOR, X0, Y0
 
Constructor Summary
CompartmentFigText(java.lang.Object element, java.awt.Rectangle bounds, DiagramSettings settings)
          Construct a CompartmentFigText.
CompartmentFigText(java.lang.Object owner, java.awt.Rectangle bounds, DiagramSettings settings, java.lang.String property)
          Build a new compartment figText of the given dimensions, within the compartment described by aFig.
CompartmentFigText(java.lang.Object owner, java.awt.Rectangle bounds, DiagramSettings settings, java.lang.String[] properties)
          Build a new compartment figText of the given dimensions, within the compartment described by aFig.
 
Method Summary
 java.awt.Color getLineColor()
          Override for correct graphical behaviour.
 boolean isFilled()
           
 boolean isHighlighted()
          Return whether this item is highlighted.
 void paint(java.awt.Graphics g)
          Extends the normal paint function in order to display a similar selection-box to that given for a non-resizable FigNode.
 void removeFromDiagram()
           
 void setHighlighted(boolean flag)
          This is actually used to mark this Fig as selected, however setSelected is set final in GEF.
 void targetAdded(TargetEvent e)
          Fired when a target is added to the list of targets.
 void targetRemoved(TargetEvent e)
          Fired when a target is removed from the list of targets
 void targetSet(TargetEvent e)
          Fired when a total new set of targets is set
protected  void textEdited()
          Called when text editing has completed on this Fig.
 
Methods inherited from class org.argouml.uml.diagram.ui.FigSingleLineTextWithNotation
getNotationProvider, getNotationProviderType, getNotationSettings, initNotationProviders, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, propertyChange, renderingChanged, setText, showHelp, textEditStarted, updateLayout
 
Methods inherited from class org.argouml.uml.diagram.ui.FigSingleLineText
getMinimumSize, isStartEditingKey, setFilled
 
Methods inherited from class org.argouml.uml.diagram.ui.ArgoFigText
addNotificationListener, deleteFromModel, getFigFontStyle, getNotificationInfo, getProject, getSettings, removeNotificationListener, removeNotificationListener, setOwner, setProject, setSettings, updateFont, updateListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompartmentFigText

public CompartmentFigText(java.lang.Object element,
                          java.awt.Rectangle bounds,
                          DiagramSettings settings)
Construct a CompartmentFigText.

Parameters:
element - owning uml element
bounds - position and size
settings - render settings

CompartmentFigText

public CompartmentFigText(java.lang.Object owner,
                          java.awt.Rectangle bounds,
                          DiagramSettings settings,
                          java.lang.String property)
Build a new compartment figText of the given dimensions, within the compartment described by aFig.

Invoke the parent constructor, then set the reference to the associated compartment figure. The associated FigText is marked as expand only.

Parameters:
owner - owning UML element
bounds - position and size
settings - render settings
property - The property this Fig should listen for

CompartmentFigText

public CompartmentFigText(java.lang.Object owner,
                          java.awt.Rectangle bounds,
                          DiagramSettings settings,
                          java.lang.String[] properties)
Build a new compartment figText of the given dimensions, within the compartment described by aFig.

Invoke the parent constructor, then set the reference to the associated compartment figure. The associated FigText is marked as expand only.

Parameters:
owner - owning UML element
bounds - position and size
settings - render settings
properties - The properties this Fig should listen for
Method Detail

removeFromDiagram

public void removeFromDiagram()
Overrides:
removeFromDiagram in class FigSingleLineTextWithNotation

isFilled

public boolean isFilled()
Returns:
Current fill status—always false.

getLineColor

public java.awt.Color getLineColor()
Override for correct graphical behaviour.

Returns:
Current fill colour—always the fill colour of the associated compartment fig.

setHighlighted

public void setHighlighted(boolean flag)
This is actually used to mark this Fig as selected, however setSelected is set final in GEF. TODO: Can setSelected be used without side-effect if GEF is adjusted? Otherwise consider renaming as setSelectedChild and try to make protected.

Parameters:
flag - true if the entry is to be highlighted, false otherwise.

paint

public void paint(java.awt.Graphics g)
Extends the normal paint function in order to display a similar selection-box to that given for a non-resizable FigNode.

Parameters:
g - the graphics object
See Also:
org.tigris.gef.presentation.FigText#paint(java.awt.Graphics)

isHighlighted

public boolean isHighlighted()
Return whether this item is highlighted.

Returns:
true if the entry is highlighted, false otherwise.

textEdited

protected void textEdited()
Called when text editing has completed on this Fig.

Overrides:
textEdited in class FigSingleLineTextWithNotation

targetAdded

public void targetAdded(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is added to the list of targets.

Specified by:
targetAdded in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_ADDED

targetRemoved

public void targetRemoved(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is removed from the list of targets

Specified by:
targetRemoved in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_REMOVED

targetSet

public void targetSet(TargetEvent e)
Description copied from interface: TargetListener
Fired when a total new set of targets is set

Specified by:
targetSet in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_SET


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook