JHotDraw 7.2

org.jhotdraw.draw
Class LineFigure

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractFigure
          extended by org.jhotdraw.draw.AbstractAttributedFigure
              extended by org.jhotdraw.draw.BezierFigure
                  extended by org.jhotdraw.draw.LineFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Figure, DOMStorable
Direct Known Subclasses:
LineConnectionFigure, SeparatorLineFigure

public class LineFigure
extends BezierFigure

LineFigure.

Version:
2.1 2008-07-06 Create BezierOutlineHandle on mouse over.
2.0 2006-02-27 Support point editing at handle level 0.
2.0 2006-01-14 Changed to support double precison coordinates.
1.0 2003-12-01 Derived from JHotDraw 5.4b1.
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.draw.BezierFigure
path
 
Fields inherited from class org.jhotdraw.draw.AbstractFigure
changingDepth, listenerList
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
LineFigure()
          Creates a new instance.
 
Method Summary
 boolean canConnect()
          Checks if this figure can be connected.
 java.util.Collection<Handle> createHandles(int detailLevel)
          Creates handles used to manipulate the figure.
 boolean handleMouseClick(java.awt.geom.Point2D.Double p, java.awt.event.MouseEvent evt, DrawingView view)
          Handles a mouse click.
 
Methods inherited from class org.jhotdraw.draw.BezierFigure
addNode, addNode, chop, clone, contains, drawCaps, drawFill, drawStroke, findCompatibleConnector, findConnector, findNode, findSegment, getBezierPath, getBounds, getCappedPath, getCenter, getDrawingArea, getEndPoint, getNode, getNodeCount, getOutermostPoint, getPoint, getPoint, getPointOnPath, getStartPoint, getTransformRestoreData, invalidate, isClosed, joinSegments, joinSegments, layout, read, readPoints, removeAllNodes, removeNode, restoreTransformTo, setAttribute, setBezierPath, setBounds, setClosed, setEndPoint, setNode, setPoint, setPoint, setStartPoint, splitSegment, splitSegment, transform, validate, write, writePoints
 
Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure
applyAttributesTo, draw, drawText, getAttribute, getAttributeKey, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, setAttributeEnabled, setAttributes, writeAttributes
 
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addNotify, basicClone, changed, findFigureInside, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDecomposition, getDrawing, getFontRenderContext, getLayer, getLock, getPreferredSize, getTool, getToolTipText, handleDrop, includes, isChanging, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, requestRemove, setBounds, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineFigure

public LineFigure()
Creates a new instance.

Method Detail

createHandles

public java.util.Collection<Handle> createHandles(int detailLevel)
Description copied from interface: Figure
Creates handles used to manipulate the figure.

Specified by:
createHandles in interface Figure
Overrides:
createHandles in class BezierFigure
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

canConnect

public boolean canConnect()
Description copied from class: BezierFigure
Checks if this figure can be connected. By default filled BezierFigures can be connected.

Specified by:
canConnect in interface Figure
Overrides:
canConnect in class BezierFigure

handleMouseClick

public boolean handleMouseClick(java.awt.geom.Point2D.Double p,
                                java.awt.event.MouseEvent evt,
                                DrawingView view)
Handles a mouse click.

Specified by:
handleMouseClick in interface Figure
Overrides:
handleMouseClick in class BezierFigure
Parameters:
p - The location of the mouse event.
evt - The mouse event.
view - The drawing view which is the source of the mouse event.
Returns:
Returns true, if the event was consumed.

Copyright 1996-2009 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.