org.argouml.uml.diagram.ui
Class CompartmentFigText

java.lang.Object
  extended byorg.tigris.gef.presentation.Fig
      extended byorg.tigris.gef.presentation.FigText
          extended byorg.argouml.uml.diagram.ui.CompartmentFigText
All Implemented Interfaces:
Cloneable, EventListener, KeyListener, MouseListener, org.tigris.gef.ui.PopupGenerator, PropertyChangeListener, Serializable
Direct Known Subclasses:
FigFeature

public class CompartmentFigText
extends org.tigris.gef.presentation.FigText

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

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

See Also:
Serialized Form

Field Summary
private  boolean isHighlighted
          Record whether we are currently highlighted.
private static Logger LOG
           
private  Object modelElement
          The model element with which we are associated.
private  org.tigris.gef.presentation.Fig refFig
          The bounding figure of the compartment containing this fig text.
 
Fields inherited from class org.tigris.gef.presentation.FigText
JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, MIN_TEXT_WIDTH
 
Fields inherited from class org.tigris.gef.presentation.Fig
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _displayed, _fillColor, _filled, _group, _h, _layer, _lineColor, _lineWidth, _locked, _resource, _selected, _shown, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE
 
Constructor Summary
CompartmentFigText(int x, int y, int w, int h, org.tigris.gef.presentation.Fig aFig)
          Build a new compartment figText of the given dimensions, within the compartment described by aFig.
 
Method Summary
 Color getFillColor()
          Override for correct graphical behaviour.
 boolean getFilled()
          Override for correct graphical behaviour.
 Color getLineColor()
          Override for correct graphical behaviour.
 boolean isHighlighted()
          Return whether this item is highlighted.
 void setHighlighted(boolean flag)
          Mark whether this item is to be highlighted.
 
Methods inherited from class org.tigris.gef.presentation.FigText
append, append, calcBounds, deleteLastChar, deleteLastCharFromString, drawString, getAllowsTab, getBold, getBotMargin, getEditable, getExpandOnly, getFont, getFontFamily, getFontSize, getItalic, getJustification, getJustificationByName, getLeftMargin, getLineSpacing, getMinimumHeight, getMinimumSize, getMultiLine, getRightMargin, getText, getTextBounds, getTextColor, getTextEditorClass, getTextFillColor, getTextFilled, getTopMargin, getUnderline, hit, isNonStartEditingKey, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, OK, paint, setAllowsTab, setBold, setBotMargin, setEditable, setExpandOnly, setFont, setFontFamily, setFontSize, setItalic, setJustification, setJustificationByName, setLeftMargin, setLineSpacing, setMultiLine, setRightMargin, setText, setText, setTextColor, setTextEditorClass, setTextFillColor, setTextFilled, setTopMargin, setUnderline, startTextEditor, stuffMinimumSize
 
Methods inherited from class org.tigris.gef.presentation.Fig
addAnnotation, addPoint, addPropertyChangeListener, align, center, classNameAndBounds, cleanUp, clone, connectionPoint, contains, contains, contains, countCornersContained, createDrag, damage, delete, deleteFromModel, dispose, drawDashedLine, drawDashedPerimeter, endTrans, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getBounds, getClosestPoint, getContext, getDashed, getDashed01, getDashedString, getEnclosedFigs, getEnclosingFig, getFilled01, getFirstPoint, getGravityPoints, getGroup, getHalfHeight, getHalfWidth, getHandleBox, getHeight, getId, getLastPoint, getLayer, getLineWidth, getLocation, getLocked, getNumPoints, getOwner, getPerimeterLength, getPoint, getPoints, getPopUpActions, getPreferredSize, getPrivateData, getResource, getSingle, getSize, getTipString, getTrapRect, getUseTrapRect, getVisState, getWidth, getX, getXs, getY, getYs, hasFillColor, hasLineColor, initAnnotations, insertPoint, intersects, intersectsPerimeter, isAnnotation, isCopieable, isCopyable, isCutable, isDisplayed, isLowerRightResizable, isMovable, isReshapable, isResizable, isRotatable, isSelected, isVisible, makeSelection, pointAlongPerimeter, postLoad, postSave, preSave, print, propertyChange, redraw, removeAnnotation, removeAnnotation, removeFromDiagram, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setBounds, setCenter, setContext, setDashed, setDashedString, setDisplayed, setEnclosingFig, setFillColor, setFilled, setGroup, setHandleBox, setHeight, setLayer, setLineColor, setLineWidth, setLocation, setLocation, setLocked, setMovable, setNumPoints, setOwner, setPoint, setPoint, setPoint, setPoint, setPoints, setPoints, setPoints, setPoints, setPoints, setPrivateData, setResizable, setResource, setSavingAllowed, setSelected, setSingle, setSize, setSize, setVisible, setVisState, setWidth, setX, setXs, setY, setYs, stuffBounds, stuffPointAlongPerimeter, translate, translateAnnotations, unsetAnnotationOwner, updateAnnotationPositions, updateVisState, within
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

refFig

private org.tigris.gef.presentation.Fig refFig
The bounding figure of the compartment containing this fig text.


isHighlighted

private boolean isHighlighted
Record whether we are currently highlighted.


modelElement

private Object modelElement
The model element with which we are associated.

Constructor Detail

CompartmentFigText

public CompartmentFigText(int x,
                          int y,
                          int w,
                          int h,
                          org.tigris.gef.presentation.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

getFilled

public boolean getFilled()
Override for correct graphical behaviour.

Returns:
Current fill status—always true.

getFillColor

public Color getFillColor()
Override for correct graphical behaviour.

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

getLineColor

public 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.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook