org.jhotdraw.draw
Class LabelFigure
- java.lang.Object
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.EventListener, DecoratedFigure, FigureListener, Figure, TextHolderFigure, DOMStorable
public class LabelFigure extends TextFigure implements FigureListener
A LabelFigure can be used to provide more double clickable area for a TextHolderFigure. FIXME - Move FigureListener into inner class.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
-
-
Constructor Summary
Constructors Constructor and Description LabelFigure()Creates a new instance.LabelFigure(java.lang.String text)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidareaInvalidated(FigureEvent e)Sent when the drawing area used by the figure needs to be repainted.voidattributeChanged(FigureEvent e)Sent when an attribute of the figure has changed.voidfigureAdded(FigureEvent e)Sent when a figure was added to a drawing.voidfigureChanged(FigureEvent e)Sent when the geometry (for example the bounds) of the figure has changed.voidfigureHandlesChanged(FigureEvent e)Sent when handles of a Figure have been added, removed or replaced.voidfigureRemoved(FigureEvent e)Sent when a figure was removed from a drawing.voidfigureRequestRemove(FigureEvent e)Sent when the figure requests to be removed from a drawing.TextHolderFiguregetLabelFor()Sometimes we want to use a TextHolderFigure as a label for another TextHolderFigure.ToolgetTool(java.awt.geom.Point2D.Double p)Returns a specialized tool for the given coordinate.voidremap(java.util.Map<Figure,Figure> oldToNew, boolean disconnectIfNotInMap)After cloning a collection of figures, the ConnectionFigures contained in this collection still connect to the original figures instead of to the clones.voidsetLabelFor(TextHolderFigure target)-
Methods inherited from class org.jhotdraw.draw.TextFigure
clone, createHandles, figureContains, getBaseline, getBounds, getFillColor, getFont, getFontSize, getInsets, getPreferredSize, getTabSize, getText, getTextColor, getTextColumns, getTransformRestoreData, invalidate, isEditable, isTextOverflow, read, restoreTransformTo, setBounds, setEditable, setFontSize, setText, transform, write
-
Methods inherited from class org.jhotdraw.draw.AbstractAttributedDecoratedFigure
contains, draw, getDecorator, getDrawingArea, setDecorator
-
Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure
get, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, removeAttribute, restoreAttributesTo, set, setAttributeEnabled, setAttributes
-
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addNotify, changed, findCompatibleConnector, findConnector, findFigureInside, fireAreaInvalidated, fireFigureChanged, getActions, getConnectors, getCursor, getDecomposition, getEndPoint, getLayer, getStartPoint, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, removeFigureListener, removeNotify, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
-
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, addNotify, addPropertyChangeListener, changed, contains, draw, findCompatibleConnector, findConnector, findFigureInside, get, getActions, getAttributes, getAttributesRestoreData, getConnectors, getCursor, getDecomposition, getDrawingArea, getEndPoint, getLayer, getStartPoint, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, removeFigureListener, removeNotify, removePropertyChangeListener, requestRemove, restoreAttributesTo, set, willChange
-
-
-
-
Constructor Detail
-
LabelFigure
public LabelFigure()
Creates a new instance.
-
LabelFigure
public LabelFigure(java.lang.String text)
-
-
Method Detail
-
setLabelFor
public void setLabelFor(TextHolderFigure target)
-
getLabelFor
public TextHolderFigure getLabelFor()
Description copied from interface:TextHolderFigureSometimes we want to use a TextHolderFigure as a label for another TextHolderFigure. Returns the TextHolderFigure that should be really used.- Specified by:
getLabelForin interfaceTextHolderFigure- Overrides:
getLabelForin classTextFigure
-
getTool
public Tool getTool(java.awt.geom.Point2D.Double p)
Returns a specialized tool for the given coordinate.Returns null, if no specialized tool is available.
- Specified by:
getToolin interfaceFigure- Overrides:
getToolin classTextFigure
-
areaInvalidated
public void areaInvalidated(FigureEvent e)
Description copied from interface:FigureListenerSent when the drawing area used by the figure needs to be repainted.- Specified by:
areaInvalidatedin interfaceFigureListener
-
attributeChanged
public void attributeChanged(FigureEvent e)
Description copied from interface:FigureListenerSent when an attribute of the figure has changed.- Specified by:
attributeChangedin interfaceFigureListener
-
figureAdded
public void figureAdded(FigureEvent e)
Description copied from interface:FigureListenerSent when a figure was added to a drawing.- Specified by:
figureAddedin interfaceFigureListener
-
figureChanged
public void figureChanged(FigureEvent e)
Description copied from interface:FigureListenerSent when the geometry (for example the bounds) of the figure has changed.- Specified by:
figureChangedin interfaceFigureListener
-
figureRemoved
public void figureRemoved(FigureEvent e)
Description copied from interface:FigureListenerSent when a figure was removed from a drawing.- Specified by:
figureRemovedin interfaceFigureListener
-
figureRequestRemove
public void figureRequestRemove(FigureEvent e)
Description copied from interface:FigureListenerSent when the figure requests to be removed from a drawing.- Specified by:
figureRequestRemovein interfaceFigureListener
-
remap
public void remap(java.util.Map<Figure,Figure> oldToNew, boolean disconnectIfNotInMap)
Description copied from interface:FigureAfter cloning a collection of figures, the ConnectionFigures contained in this collection still connect to the original figures instead of to the clones. Using This operation and providing a map, which maps from the original collection of figures to the new collection, connections can be remapped to the new figures.- Specified by:
remapin interfaceFigure- Overrides:
remapin classAbstractFigure
-
figureHandlesChanged
public void figureHandlesChanged(FigureEvent e)
Description copied from interface:FigureListenerSent when handles of a Figure have been added, removed or replaced.DrawingViews listen to this event to repopulate the Handles.
A Figure should not fire this event, if just the state or the location of Handle has changed.
- Specified by:
figureHandlesChangedin interfaceFigureListener
-
-
DataMelt 3.0 © DataMelt by jWork.ORG