org.argouml.uml.diagram.ui
Class CompartmentFigText

java.lang.Object
  |
  +--FigText
        |
        +--org.argouml.uml.diagram.ui.CompartmentFigText
Direct Known Subclasses:
FigFeature

public class CompartmentFigText
extends FigText

A FigText class extension for FigClass/FigInterface/FigUseCase compartments.

This implementation now supports the extension point compartment in a use case. The getFeature() and setFeature(MFeature) methods are now deprecated in favour of the more generic getModelElement() and setModelElement(MModelElement) methods.

See Also:
Serialized Form

Field Summary
protected  boolean _isHighlighted
          Record whether we are currently highlighted.
protected  MModelElement _modelElement
          The model element with which we are associated.
protected  Fig _refFig
          The bounding figure of the compartment containing this fig text.
protected static Category cat
           
 
Constructor Summary
CompartmentFigText(int x, int y, int w, int h, Fig aFig)
          Build a new compartment figText of the given dimensions, within the compartment described by aFig.
 
Method Summary
 MFeature getFeature()
          Deprecated. As of ArgoUml version 0.9.9, Use the more general #getOwner() instead.
 java.awt.Color getFillColor()
          Override for correct graphical behaviour.
 boolean getFilled()
          Override for correct graphical behaviour.
 java.awt.Color getLineColor()
          Override for correct graphical behaviour.
 int getLineWidth()
          Override for correct graphical behaviour.
 MModelElement getModelElement()
          Deprecated. As of ArgoUml version 0.9.9, use getOwner()
 boolean isHighlighted()
          Return whether this item is highlighted.
 void setFeature(MFeature feature)
          Deprecated. As of ArgoUml version 0.9.9, Use the more general setModelElement(MModelElement) instead.
 void setHighlighted(boolean flag)
          Mark whether this item is to be highlighted.
 void setLineWidth(int w)
          Override for correct graphical behaviour.
 void setModelElement(MModelElement modelElement)
          Deprecated. As of ArgoUml version 0.9.9, use the more general setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static Category cat

_refFig

protected Fig _refFig

The bounding figure of the compartment containing this fig text.


_isHighlighted

protected boolean _isHighlighted

Record whether we are currently highlighted.


_modelElement

protected MModelElement _modelElement

The model element with which we are associated.

Constructor Detail

CompartmentFigText

public CompartmentFigText(int x,
                          int y,
                          int w,
                          int h,
                          Fig aFig)

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.

Warning. Won't work properly if aFig is null. A warning is printed.

Parameters:
x - X coordinate of the top left of the FigText.
y - Y coordinate of the top left of the FigText.
w - Width of the FigText.
h - Height of the FigText.
aFig - The figure describing the whole compartment
Method Detail

setLineWidth

public void setLineWidth(int w)

Override for correct graphical behaviour.

Parameters:
w - Desired line width. Overridden and set to zero anyway.

getLineWidth

public int getLineWidth()

Override for correct graphical behaviour.

Returns:
Current line width—always 1.

getFilled

public boolean getFilled()

Override for correct graphical behaviour.

Returns:
Current fill status—always true.

getFillColor

public java.awt.Color getFillColor()

Override for correct graphical behaviour.

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

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)

Mark whether this item is to be highlighted.

If it is highlighted, make the superclass line width 1 rather than 0 and set the associated component fig as the target in the browser.

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

isHighlighted

public boolean isHighlighted()

Return whether this item is highlighted.

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

setFeature

public void setFeature(MFeature feature)
Deprecated. As of ArgoUml version 0.9.9, Use the more general setModelElement(MModelElement) instead.

Set the NSUML feature associated with this compartment.

Note. This is implemented using setModelElement(MModelElement).

Parameters:
feature - The feature to set.

getFeature

public MFeature getFeature()
Deprecated. As of ArgoUml version 0.9.9, Use the more general #getOwner() instead.

Get the NSUML feature associated with this compartment.

Note. This is implemented using getModelElement() and will return null if that does not return an instance of MFeature.

Returns:
The feature associated with this compartment or null if none can be found.

setModelElement

public void setModelElement(MModelElement modelElement)
Deprecated. As of ArgoUml version 0.9.9, use the more general setOwner

Set the NSUML model element associated with this compartment.

Parameters:
modelElement - The model element to set.

getModelElement

public MModelElement getModelElement()
Deprecated. As of ArgoUml version 0.9.9, use getOwner()

Get the NSUML modelElement associated with this compartment.

Returns:
The modelElement associated with this compartment.


ArgoUML © 1996-2003 (20030919)ArgoUML Project HomeArgoUML Cookbook