|
JHotDraw 7.0.9 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.draw.AbstractFigure
org.jhotdraw.draw.AbstractAttributedFigure
org.jhotdraw.draw.BezierFigure
org.jhotdraw.draw.LineFigure
org.jhotdraw.draw.LineConnectionFigure
org.jhotdraw.draw.LabeledLineConnectionFigure
public class LabeledLineConnectionFigure
A LineConnection with labels.
Usage:
LineConnectionFigure lcf = new LineConnectionFigure(); lcf.setLayouter(new LocatorLayouter()); TextFigure label = new TextFigure(); label.setText("Hello"); LocatorLayouter.LAYOUT_LOCATOR.set(label, new BezierLabelLocator(0, -Math.PI / 4, 8)); lcf.add(label);
Field Summary |
---|
Fields inherited from class org.jhotdraw.draw.BezierFigure |
---|
path |
Fields inherited from class org.jhotdraw.draw.AbstractFigure |
---|
changingDepth, listenerList |
Fields inherited from interface org.jhotdraw.draw.CompositeFigure |
---|
LAYOUT_INSETS |
Constructor Summary | |
---|---|
LabeledLineConnectionFigure()
Creates a new instance. |
Method Summary | |
---|---|
void |
add(Figure figure)
Adds a child to the figure. |
void |
add(int index,
Figure figure)
Adds a child to the figure at the specified index. |
void |
addNotify(Drawing drawing)
This method is invoked, when the Figure is being removed from a Drawing. |
void |
basicAdd(Figure figure)
Adds a child to the figure without firing events. |
void |
basicAdd(int index,
Figure figure)
Adds a child to the figure at the specified index without firing events. |
boolean |
basicRemove(Figure figure)
Removes the specified child without firing events. |
void |
basicRemoveAllChildren()
Removes all children from the composite figure without firing events. |
Figure |
basicRemoveChild(int index)
Removes the child at the specified index without firing events. |
LabeledLineConnectionFigure |
clone()
Informs that a figure changed the area of its display box. |
boolean |
contains(java.awt.geom.Point2D.Double p)
Checks if a point is contained by the figure. |
void |
draw(java.awt.Graphics2D g)
Draw the figure. |
Figure |
findFigureInside(java.awt.geom.Point2D.Double p)
Returns the figure that contains the given point. |
java.awt.geom.Rectangle2D.Double |
getBounds()
Returns the untransformed logicalbounds of the figure as a Rectangle. |
Figure |
getChild(int index)
Returns the child figure at the specified index. |
int |
getChildCount()
Returns the number of children. |
java.util.List<Figure> |
getChildren()
Returns an unchangeable list view on the children. |
java.util.List<Figure> |
getChildrenFrontToBack()
Returns an iterator to iterate in Z-order front to back over the children. |
java.awt.geom.Rectangle2D.Double |
getDrawingArea()
Returns the drawing area of the figure as a Rectangle. |
Layouter |
getLayouter()
Get a Layouter object which encapsulated a layout algorithm for this figure. |
void |
invalidate()
Informs that a figure needs to be redrawn. |
protected void |
invalidateBounds()
|
void |
layout()
A layout algorithm is used to define how the child components should be laid out in relation to each other. |
void |
remap(java.util.HashMap<Figure,Figure> oldToNew)
|
boolean |
remove(Figure figure)
Removes the specified child. |
void |
removeAllChildren()
Removes all children from the composite figure. |
Figure |
removeChild(int index)
Removes the child at the specified index. |
void |
removeNotify(Drawing drawing)
This method is invoked, when the Figure is being removed from a Drawing. |
void |
set(int index,
Figure child)
|
void |
setAttribute(AttributeKey key,
java.lang.Object newValue)
Sets an attribute of the figure. |
void |
setBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
Sets the location of the first and the last BezierPath.Node
of the BezierFigure. |
void |
setLayouter(Layouter newLayouter)
Set a Layouter object which encapsulated a layout algorithm for this figure. |
void |
transform(java.awt.geom.AffineTransform tx)
Transforms the figure. |
void |
updateConnection()
Updates the start and end point of the figure and fires figureChanged events. |
void |
validate()
|
Methods inherited from class org.jhotdraw.draw.LineConnectionFigure |
---|
canConnect, canConnect, canConnect, createHandles, getBezierPath, getEndConnector, getEndFigure, getLiner, getStartConnector, getStartFigure, handleConnect, handleDisconnect, handleMouseClick, lineout, read, readLiner, readPoints, remap, reverseConnection, setEndConnector, setEndPoint, setLiner, setNode, setPoint, setStartConnector, setStartPoint, write, writeLiner, writePoints |
Methods inherited from class org.jhotdraw.draw.BezierFigure |
---|
addNode, addNode, chop, drawCaps, drawFill, drawStroke, findCompatibleConnector, findConnector, findNode, findSegment, getCappedPath, getCenter, getEndPoint, getNode, getNodeCount, getOutermostPoint, getPoint, getPoint, getPointOnPath, getStartPoint, getTransformRestoreData, isClosed, joinSegments, joinSegments, removeAllNodes, removeNode, restoreTransformTo, setBezierPath, setClosed, setPoint, splitSegment, splitSegment |
Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure |
---|
applyAttributesTo, drawText, getAttribute, getAttributeKey, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, setAttributeEnabled, setAttributes, writeAttributes |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jhotdraw.draw.Figure |
---|
addFigureListener, canConnect, changed, createHandles, findCompatibleConnector, findConnector, getActions, getAttribute, getAttributes, getAttributesRestoreData, getConnectors, getCursor, getDecomposition, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isInteractive, isVisible, remap, removeFigureListener, requestRemove, restoreAttributesTo, restoreTransformTo, setVisible, willChange |
Methods inherited from interface org.jhotdraw.xml.DOMStorable |
---|
read, write |
Methods inherited from interface org.jhotdraw.draw.ConnectionFigure |
---|
getEndPoint, getNode, getNodeCount, getPoint, getStartPoint |
Constructor Detail |
---|
public LabeledLineConnectionFigure()
Method Detail |
---|
public void draw(java.awt.Graphics2D g)
draw
in interface Figure
draw
in class AbstractAttributedFigure
g
- The Graphics2D to draw to.public void transform(java.awt.geom.AffineTransform tx)
transform
in interface Figure
transform
in class LineConnectionFigure
tx
- The transformation.Figure.getTransformRestoreData()
,
Figure.restoreTransformTo(java.lang.Object)
public void setBounds(java.awt.geom.Point2D.Double anchor, java.awt.geom.Point2D.Double lead)
BezierFigure
BezierPath.Node
of the BezierFigure.
If the BezierFigure has not at least two nodes, nodes are added
to the figure until the BezierFigure has at least two nodes.
setBounds
in interface Figure
setBounds
in class BezierFigure
anchor
- the start point of the boundslead
- the end point of the boundsFigure.getBounds()
public java.awt.geom.Rectangle2D.Double getBounds()
Figure
getBounds
in interface Figure
getBounds
in class BezierFigure
public java.awt.geom.Rectangle2D.Double getDrawingArea()
Figure
The drawing area needs to be large enough, to take line width, line caps and other decorations into account that exceed the bounds of the Figure.
getDrawingArea
in interface Figure
getDrawingArea
in class BezierFigure
public boolean contains(java.awt.geom.Point2D.Double p)
Figure
This is used for hit testing by Tool's.
contains
in interface Figure
contains
in class BezierFigure
protected void invalidateBounds()
public void setAttribute(AttributeKey key, java.lang.Object newValue)
setAttribute
in interface Figure
setAttribute
in class BezierFigure
AttributeKey.basicSet(org.jhotdraw.draw.Figure, T)
public Figure findFigureInside(java.awt.geom.Point2D.Double p)
Figure
findFigureInside
in interface Figure
findFigureInside
in class AbstractFigure
public void updateConnection()
ConnectionFigure
updateConnection
in interface ConnectionFigure
updateConnection
in class LineConnectionFigure
public java.util.List<Figure> getChildren()
CompositeFigure
getChildren
in interface CompositeFigure
public int getChildCount()
CompositeFigure
getChildCount
in interface CompositeFigure
public Figure getChild(int index)
CompositeFigure
getChild
in interface CompositeFigure
public void set(int index, Figure child)
public java.util.List<Figure> getChildrenFrontToBack()
public void add(Figure figure)
CompositeFigure
add
in interface CompositeFigure
public void add(int index, Figure figure)
CompositeFigure
add
in interface CompositeFigure
public void basicAdd(Figure figure)
CompositeFigure
basicAdd
in interface CompositeFigure
public void basicAdd(int index, Figure figure)
CompositeFigure
basicAdd
in interface CompositeFigure
public boolean remove(Figure figure)
CompositeFigure
remove
in interface CompositeFigure
public Figure removeChild(int index)
CompositeFigure
removeChild
in interface CompositeFigure
public boolean basicRemove(Figure figure)
CompositeFigure
basicRemove
in interface CompositeFigure
public Figure basicRemoveChild(int index)
CompositeFigure
basicRemoveChild
in interface CompositeFigure
public void removeAllChildren()
CompositeFigure
removeAllChildren
in interface CompositeFigure
public void basicRemoveAllChildren()
CompositeFigure
basicRemoveAllChildren
in interface CompositeFigure
public Layouter getLayouter()
getLayouter
in interface CompositeFigure
public void setLayouter(Layouter newLayouter)
CompositeFigure
setLayouter
in interface CompositeFigure
newLayouter
- encapsulation of a layout algorithm.public void layout()
layout
in interface CompositeFigure
layout
in class BezierFigure
public void invalidate()
AbstractFigure
invalidate
in interface Figure
invalidate
in class BezierFigure
public void validate()
validate
in class LineConnectionFigure
public void addNotify(Drawing drawing)
LineConnectionFigure
addNotify
in interface Figure
addNotify
in class LineConnectionFigure
LineConnectionFigure.handleConnect(org.jhotdraw.draw.Connector, org.jhotdraw.draw.Connector)
public void removeNotify(Drawing drawing)
LineConnectionFigure
removeNotify
in interface Figure
removeNotify
in class LineConnectionFigure
LineConnectionFigure.handleDisconnect(org.jhotdraw.draw.Connector, org.jhotdraw.draw.Connector)
public LabeledLineConnectionFigure clone()
clone
in interface Figure
clone
in class LineConnectionFigure
public void remap(java.util.HashMap<Figure,Figure> oldToNew)
remap
in class AbstractFigure
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |