org.jhotdraw.samples.net.figures
Class NodeFigure
- java.lang.Object
-
- org.jhotdraw.beans.AbstractBean
-
- org.jhotdraw.draw.AbstractFigure
-
- org.jhotdraw.draw.AbstractAttributedFigure
-
- org.jhotdraw.draw.AbstractAttributedDecoratedFigure
-
- org.jhotdraw.draw.TextFigure
-
- org.jhotdraw.samples.net.figures.NodeFigure
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, DecoratedFigure, Figure, TextHolderFigure, DOMStorable
public class NodeFigure extends TextFigure
NodeFigure.- 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 NodeFigure()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description NodeFigureclone()Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators.java.util.Collection<Handle>createHandles(int detailLevel)Creates handles used to manipulate the figure.ConnectorfindCompatibleConnector(Connector c, boolean isStart)Gets a compatible connector.ConnectorfindConnector(java.awt.geom.Point2D.Double p, ConnectionFigure figure)Returns the Figures connector for the specified location.java.util.Collection<Connector>getConnectors(ConnectionFigure prototype)Returns all connectors of this Figure for the specified prototype of a ConnectionFigure.java.awt.geom.Rectangle2D.DoublegetFigureDrawingArea()Gets the drawing area without taking the decorator into account.intgetLayer()AbstractFigure always returns 0.<T> voidset(AttributeKey<T> key, T newValue)Sets an attribute of the figure.-
Methods inherited from class org.jhotdraw.draw.TextFigure
figureContains, getBaseline, getBounds, getFillColor, getFont, getFontSize, getInsets, getLabelFor, getPreferredSize, getTabSize, getText, getTextColor, getTextColumns, getTool, 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, setAttributeEnabled, setAttributes
-
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addNotify, changed, findFigureInside, fireAreaInvalidated, fireFigureChanged, getActions, getCursor, getDecomposition, getEndPoint, getStartPoint, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, 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, findFigureInside, get, getActions, getAttributes, getAttributesRestoreData, getCursor, getDecomposition, getDrawingArea, getEndPoint, getStartPoint, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, removePropertyChangeListener, requestRemove, restoreAttributesTo, willChange
-
-
-
-
Method Detail
-
getConnectors
public java.util.Collection<Connector> getConnectors(ConnectionFigure prototype)
Description copied from interface:FigureReturns all connectors of this Figure for the specified prototype of a ConnectionFigure.This is used by connection tools and connection handles to visualize the connectors when the user is about to create a ConnectionFigure to this Figure.
- Specified by:
getConnectorsin interfaceFigure- Overrides:
getConnectorsin classAbstractFigure- Parameters:
prototype- The prototype used to create a connection or null if unknown. This allows for specific connectors for different connection figures.
-
createHandles
public java.util.Collection<Handle> createHandles(int detailLevel)
Description copied from interface:FigureCreates handles used to manipulate the figure.- Specified by:
createHandlesin interfaceFigure- Overrides:
createHandlesin classTextFigure- Parameters:
detailLevel- The detail level of the handles. Usually this is 0 for bounding box handles and 1 for point handles. The value -1 is used by the SelectAreaTracker and the HandleTracker to highlight figures, over which the mouse pointer is hovering.- Returns:
- a Collection of handles
- See Also:
Handle
-
getFigureDrawingArea
public java.awt.geom.Rectangle2D.Double getFigureDrawingArea()
Description copied from class:TextFigureGets the drawing area without taking the decorator into account.
-
findConnector
public Connector findConnector(java.awt.geom.Point2D.Double p, ConnectionFigure figure)
Description copied from class:AbstractFigureReturns the Figures connector for the specified location. By default a ChopBoxConnector is returned.- Specified by:
findConnectorin interfaceFigure- Overrides:
findConnectorin classAbstractFigure- Parameters:
p- the location of the connector.figure- The prototype used to create a connection or null if unknown. This allows for specific connectors for different connection figures.- See Also:
ChopRectangleConnector
-
findCompatibleConnector
public Connector findCompatibleConnector(Connector c, boolean isStart)
Description copied from interface:FigureGets a compatible connector. If the provided connector is part of this figure, return the connector. If the provided connector is part of another figure, return a connector with the same semantics for this figure. Returns null, if no compatible connector is available.- Specified by:
findCompatibleConnectorin interfaceFigure- Overrides:
findCompatibleConnectorin classAbstractFigure
-
clone
public NodeFigure clone()
Description copied from interface:FigureReturns a clone of the figure, with clones of all aggregated figures, such as children and decorators. The cloned figure does not clone the list of FigureListeners from its original.- Specified by:
clonein interfaceFigure- Overrides:
clonein classTextFigure
-
getLayer
public int getLayer()
Description copied from class:AbstractFigureAbstractFigure always returns 0. Override this method if your figure needs to be on a different layer.- Specified by:
getLayerin interfaceFigure- Overrides:
getLayerin classAbstractFigure
-
set
public <T> void set(AttributeKey<T> key, T newValue)
Description copied from class:AbstractAttributedFigureSets an attribute of the figure. AttributeKey name and semantics are defined by the class implementing the figure interface.- Specified by:
setin interfaceFigure- Overrides:
setin classAbstractAttributedFigure- See Also:
AttributeKey.set(org.jhotdraw.draw.Figure, T)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG