|
JHotDraw 7.0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jhotdraw.draw.AbstractFigure
public abstract class AbstractFigure
AbstractFigure provides the functionality for managing listeners for a Figure.
| Field Summary | |
|---|---|
protected int |
changingDepth
We increase this number on each invocation of willChange() and decrease it on each invocation of changed(). |
protected Figure |
decorator
|
protected javax.swing.event.EventListenerList |
listenerList
|
| Constructor Summary | |
|---|---|
AbstractFigure()
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addFigureListener(FigureListener l)
Adds a listener for FigureEvent's. |
void |
addNotify(Drawing d)
Informs a figure, that it has been added to the specified drawing. |
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Adds a listener for UndoableEdit events. |
AbstractFigure |
basicClone(java.util.HashMap<Figure,Figure> oldToNew)
|
abstract void |
basicTransform(java.awt.geom.AffineTransform ty)
Moves the figure. |
boolean |
canConnect()
Checks if this figure can be connected. |
void |
changed()
Informs that a figure changed the area of its display box. |
AbstractFigure |
clone()
Returns a clone of the figure. |
java.util.Collection<Handle> |
createHandles(int detailLevel)
Creates handles used to manipulate the figure. |
void |
draw(java.awt.Graphics2D g)
Draws the figure and its decorator figure. |
protected void |
drawDecorator(java.awt.Graphics2D g)
|
protected abstract void |
drawFigure(java.awt.Graphics2D g)
|
Connector |
findCompatibleConnector(Connector c,
boolean isStart)
Gets a compatible connector. |
Connector |
findConnector(java.awt.geom.Point2D.Double p,
ConnectionFigure prototype)
Returns the Figures connector for the specified location. |
Figure |
findFigureInside(java.awt.geom.Point2D.Double p)
Returns the figure that contains the given point. |
void |
fireAreaInvalidated()
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireAreaInvalidated(java.awt.geom.Rectangle2D.Double invalidatedArea)
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireAttributeChanged(AttributeKey attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireFigureAdded()
Notify all listenerList that have registered interest for notification on this event type. |
void |
fireFigureChanged()
|
protected void |
fireFigureChanged(FigureEvent event)
|
protected void |
fireFigureChanged(java.awt.geom.Rectangle2D.Double changedArea)
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireFigureRemoved()
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireFigureRequestRemove()
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
Notify all listenerList that have registered interest for notification on this event type. |
java.util.Collection<javax.swing.Action> |
getActions(java.awt.geom.Point2D.Double p)
Returns a collection of actions which are presented to the user in a popup menu. |
protected int |
getChangingDepth()
|
protected ConnectionFigure |
getCourtingConnection()
|
java.awt.Cursor |
getCursor(java.awt.geom.Point2D.Double p)
Returns a cursor for the specified location. |
java.util.Collection<Figure> |
getDecomposition()
Returns a decompositon of a figure into its parts. |
Figure |
getDecorator()
Gets the decorator figure. |
java.awt.geom.Rectangle2D.Double |
getDrawBounds()
Returns the drawing bounding box of the figure and of its decorator figure. |
protected Drawing |
getDrawing()
|
java.awt.geom.Point2D.Double |
getEndPoint()
Returns the end point of the bounds. |
protected abstract java.awt.geom.Rectangle2D.Double |
getFigureDrawBounds()
|
protected java.awt.font.FontRenderContext |
getFontRenderContext()
|
int |
getLayer()
Gets the layer of the figure. |
protected java.lang.Object |
getLock()
|
Dimension2DDouble |
getPreferredSize()
The preferred size is used by Layouter to determine the preferred size of a Figure. |
java.awt.geom.Point2D.Double |
getStartPoint()
Returns the start point of the bounds. |
Tool |
getTool(java.awt.geom.Point2D.Double p)
Returns a specialized tool for the given coordinate. |
java.lang.String |
getTooltip(java.awt.geom.Point2D.Double p)
Returns a tooltip for the specified location. |
boolean |
handleDrop(java.awt.geom.Point2D.Double p,
java.util.Collection<Figure> droppedFigures,
DrawingView view)
Handles a drop. |
boolean |
handleMouseClick(java.awt.geom.Point2D.Double p,
java.awt.event.MouseEvent evt,
DrawingView view)
Handles a mouse click. |
boolean |
includes(Figure figure)
Checks whether the given figure is contained in this figure. |
void |
invalidate()
Informs that a figure needs to be redrawn. |
protected boolean |
isChanging()
|
boolean |
isConnectorsVisible()
Returns true, if this figure draws its connectors. |
boolean |
isDrawDecoratorFirst()
|
boolean |
isInteractive()
Returns true, if the user can manipulate this figure. |
boolean |
isVisible()
A Figure is only drawn by a Drawing and by CompositeFigure, if it is visible. |
void |
remap(java.util.HashMap<Figure,Figure> oldToNew)
|
void |
remap(java.util.Map oldToNew)
After cloning a collection of figures, the ConnectionFigures contained in this collection still connect to the original figures instead of to the clones. |
void |
removeFigureListener(FigureListener l)
Removes a listener for FigureEvent's. |
void |
removeNotify(Drawing d)
Informs a figure, that it has been removed from the specified drawing. |
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Removes a listener for UndoableEdit events. |
void |
requestRemove()
Fires a FigureListener.figureRequestRemove event. |
void |
setBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
|
void |
setBounds(java.awt.geom.Rectangle2D.Double bounds)
|
void |
setConnectorsVisible(boolean isVisible,
ConnectionFigure connection)
Sets whether the connectors should be visible for the specified courting connector. |
void |
setDecorator(Figure newValue)
Sets a decorator figure. |
void |
setDrawDecoratorFirst(boolean newValue)
|
void |
setInteractive(boolean b)
|
void |
setVisible(boolean newValue)
Changes the visible state of the Figure. |
java.lang.String |
toString()
|
void |
transform(java.awt.geom.AffineTransform tx)
Transforms the geometry of the figure. |
protected void |
updateDecoratorBounds()
|
protected void |
validate()
|
void |
willChange()
Informs that a figure is about to change something that affects the contents of its display box. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jhotdraw.draw.Figure |
|---|
basicSetAttribute, basicSetBounds, contains, getAttribute, getAttributes, getBounds, getRestoreData, restoreTo, setAttribute |
| Methods inherited from interface org.jhotdraw.xml.DOMStorable |
|---|
read, write |
| Field Detail |
|---|
protected javax.swing.event.EventListenerList listenerList
protected Figure decorator
protected int changingDepth
| Constructor Detail |
|---|
public AbstractFigure()
| Method Detail |
|---|
public void addFigureListener(FigureListener l)
Figure
addFigureListener in interface Figurepublic void removeFigureListener(FigureListener l)
Figure
removeFigureListener in interface Figurepublic void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Figure
addUndoableEditListener in interface Figurepublic void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Figure
removeUndoableEditListener in interface Figurepublic void addNotify(Drawing d)
Figure
addNotify in interface Figurepublic void removeNotify(Drawing d)
Figure
removeNotify in interface Figureprotected Drawing getDrawing()
protected java.lang.Object getLock()
public void setDrawDecoratorFirst(boolean newValue)
public boolean isDrawDecoratorFirst()
public void fireAreaInvalidated()
protected void fireAreaInvalidated(java.awt.geom.Rectangle2D.Double invalidatedArea)
protected void fireFigureRequestRemove()
protected void fireFigureAdded()
protected void fireFigureRemoved()
public void fireFigureChanged()
protected void fireFigureChanged(java.awt.geom.Rectangle2D.Double changedArea)
protected void fireFigureChanged(FigureEvent event)
protected void fireAttributeChanged(AttributeKey attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
protected void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
public AbstractFigure clone()
Figure
clone in interface Figureclone in class java.lang.Objectpublic final AbstractFigure basicClone(java.util.HashMap<Figure,Figure> oldToNew)
public void remap(java.util.HashMap<Figure,Figure> oldToNew)
public java.util.Collection<Handle> createHandles(int detailLevel)
Figure
createHandles in interface FiguredetailLevel - The detail level of the handles. Usually this is 0 for
bounding box handles and 1 for point handles.
Handlepublic java.awt.Cursor getCursor(java.awt.geom.Point2D.Double p)
Figure
getCursor in interface Figurepublic final void setBounds(java.awt.geom.Rectangle2D.Double bounds)
public void setBounds(java.awt.geom.Point2D.Double anchor,
java.awt.geom.Point2D.Double lead)
public boolean canConnect()
canConnect in interface Figurepublic void invalidate()
invalidate in interface Figureprotected boolean isChanging()
protected int getChangingDepth()
public void willChange()
willChange in interface Figureprotected void validate()
public void changed()
changed in interface FigureFigure.willChange()public void transform(java.awt.geom.AffineTransform tx)
public abstract void basicTransform(java.awt.geom.AffineTransform ty)
This is a basic operation for which no events are fired.
basicTransform in interface Figurety - The transformation.
public Connector findConnector(java.awt.geom.Point2D.Double p,
ConnectionFigure prototype)
findConnector in interface Figurep - the location of the connector.prototype - The prototype used to create a connection or null if
unknown. This allows for specific connectors for different
connection figures.ChopBoxConnectorpublic boolean includes(Figure figure)
Figure
includes in interface Figurepublic Figure findFigureInside(java.awt.geom.Point2D.Double p)
Figure
findFigureInside in interface Figure
public Connector findCompatibleConnector(Connector c,
boolean isStart)
Figure
findCompatibleConnector in interface Figurepublic java.util.Collection<javax.swing.Action> getActions(java.awt.geom.Point2D.Double p)
The collection may contain null entries. These entries are used interpreted as separators in the popup menu.
getActions in interface Figurepublic Tool getTool(java.awt.geom.Point2D.Double p)
Returns null, if no specialized tool is available.
getTool in interface Figure
public boolean handleMouseClick(java.awt.geom.Point2D.Double p,
java.awt.event.MouseEvent evt,
DrawingView view)
handleMouseClick in interface Figurep - The location of the mouse event.evt - The mouse event.view - The drawing view which is the source of the mouse event.
public boolean handleDrop(java.awt.geom.Point2D.Double p,
java.util.Collection<Figure> droppedFigures,
DrawingView view)
Figure
handleDrop in interface Figurep - The location of the mouse event.droppedFigures - The dropped figures.view - The drawing view which is the source of the mouse event.
public java.awt.geom.Point2D.Double getEndPoint()
Figure
getEndPoint in interface FigureFigure.basicSetBounds(java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Double)public java.awt.geom.Point2D.Double getStartPoint()
Figure
getStartPoint in interface FigureFigure.basicSetBounds(java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Double)public Dimension2DDouble getPreferredSize()
Figure
getPreferredSize in interface Figurepublic void remap(java.util.Map oldToNew)
Figure
remap in interface Figurepublic boolean isInteractive()
Figure
isInteractive in interface Figurepublic void setInteractive(boolean b)
public boolean isVisible()
Figure
isVisible in interface Figurepublic void setVisible(boolean newValue)
Figure
The Figure fires FigureListener.figureChanged and
UndoableEditListener.undoableEditHappened,
if this operation changed its visible state.
setVisible in interface Figure
public void setConnectorsVisible(boolean isVisible,
ConnectionFigure connection)
Figure
setConnectorsVisible in interface Figurepublic boolean isConnectorsVisible()
Figure
isConnectorsVisible in interface Figureprotected ConnectionFigure getCourtingConnection()
public java.util.Collection<Figure> getDecomposition()
Figure
getDecomposition in interface Figureprotected java.awt.font.FontRenderContext getFontRenderContext()
public void requestRemove()
FigureFigureListener.figureRequestRemove event.
requestRemove in interface Figurepublic int getLayer()
FigureFigureListener.figureChanged event to
its figure listeners.
FIXME - Replace int value by a Layer object.
getLayer in interface Figurepublic java.lang.String getTooltip(java.awt.geom.Point2D.Double p)
Figure
getTooltip in interface Figurepublic void setDecorator(Figure newValue)
Figure
setDecorator in interface Figurepublic Figure getDecorator()
Figure
getDecorator in interface Figurepublic final void draw(java.awt.Graphics2D g)
Figure
draw in interface Figureg - The Graphics2D to draw to.protected abstract void drawFigure(java.awt.Graphics2D g)
protected void drawDecorator(java.awt.Graphics2D g)
protected void updateDecoratorBounds()
public final java.awt.geom.Rectangle2D.Double getDrawBounds()
Figure
getDrawBounds in interface Figureprotected abstract java.awt.geom.Rectangle2D.Double getFigureDrawBounds()
public java.lang.String toString()
toString in class java.lang.Object
|
Copyright 1996-2006 © JHotDraw.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||