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.FigSingleLineText
              extended byorg.argouml.uml.diagram.ui.CompartmentFigText
All Implemented Interfaces:
Cloneable, EventListener, org.tigris.gef.di.GraphicElement, KeyListener, MouseListener, PopupGenerator, PropertyChangeListener, Serializable
Direct Known Subclasses:
FigFeature

public class CompartmentFigText
extends FigSingleLineText

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
 
Fields inherited from class org.tigris.gef.presentation.FigText
END_EDITING, IGNORE, INSERT, JUSTIFY_CENTER, JUSTIFY_LEFT, JUSTIFY_RIGHT, MIN_TEXT_WIDTH
 
Fields inherited from class org.tigris.gef.presentation.Fig
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _filled, _h, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE, plotter
 
Constructor Summary
CompartmentFigText(int x, int y, int w, int h, Fig aFig, NotationProvider4 np)
          Build a new compartment figText of the given dimensions, within the compartment described by aFig.
 
Method Summary
 boolean getFilled()
          Override for correct graphical behaviour.
 Color getLineColor()
          Override for correct graphical behaviour.
 NotationProvider4 getNotationProvider()
           
 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.argouml.uml.diagram.ui.FigSingleLineText
getMinimumSize, isStartEditingKey
 
Methods inherited from class org.tigris.gef.presentation.FigText
append, append, calcBounds, deleteLastChar, deleteLastCharFromString, drawString, getAllowsTab, getBold, getBotMargin, getEditable, getExpandOnly, getFont, getFontFamily, getFontMetrics, getFontSize, getItalic, getJustification, getJustificationByName, getLeftMargin, getLineSpacing, getMinimumHeight, getMultiLine, getReturnAction, getRightMargin, getTabAction, getText, getTextBounds, getTextColor, getTextEditorClass, getTextFillColor, getTextFilled, getTextFriend, getTopMargin, getUnderline, hit, isWordWrap, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, paint, setAllowsTab, setBold, setBotMargin, setBoundsImpl, setEditable, setExpandOnly, setFont, setFontFamily, setFontSize, setItalic, setJustification, setJustificationByName, setLeftMargin, setLineSeparator, setLineSpacing, setMultiLine, setReturnAction, setRightMargin, setTabAction, setText, setText, setTextColor, setTextEditorClass, setTextFillColor, setTextFilled, setTopMargin, setUnderline, setWordWrap, 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, deleteFromModel, endTrans, firePropChange, firePropChange, firePropChange, getAnnotationOwner, getAnnotationStrategy, getBounds, getBounds, getCenter, getClosestPoint, getContext, getDashed, getDashed01, getDashedString, getEnclosedFigs, getEnclosingFig, getFillColor, 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, isCopyable, isCutable, isLowerRightResizable, isMovable, isRemoveStarted, isReshapable, isResizable, isRotatable, isSelectable, isSelected, isVisible, makeSelection, paint, pointAlongPerimeter, postLoad, postSave, preSave, print, propertyChange, redraw, removeAnnotation, removeFromDiagram, removePoint, removePropertyChangeListener, reorder, routingRect, savingAllowed, setAnnotationOwner, setAnnotationStatus, setAnnotationStrategy, setBounds, setBounds, setCenter, setContext, setDashed, setDashedString, setEnclosingFig, setFillColor, setFilled, setGroup, setHandleBox, setHeight, setLayer, setLineColor, setLineWidth, setLocation, setLocation, setLocked, setMovable, setNumPoints, setOwner, setPoint, setPoint, setPoint, setPoint, setPoints, setPrivateData, setResizable, setResource, setSavingAllowed, setSize, setSize, setVisible, setWidth, setX, setXs, setY, setYs, stuffBounds, stuffPointAlongPerimeter, translate, translateAnnotations, translateImpl, unsetAnnotationOwner, updateAnnotationPositions, within
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompartmentFigText

public CompartmentFigText(int x,
                          int y,
                          int w,
                          int h,
                          Fig aFig,
                          NotationProvider4 np)
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
np - The notationProvider. See NotationProviderFactory2.
Method Detail

getFilled

public boolean getFilled()
Override for correct graphical behaviour.

Returns:
Current fill status—always true.

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.

getNotationProvider

public NotationProvider4 getNotationProvider()
Returns:
Returns the notationProvider for the text in this compartment.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook