|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.rolemodelsoft.drawlet.basics.AbstractPaintable
|
+--com.rolemodelsoft.drawlet.basics.AbstractFigure
|
+--com.rolemodelsoft.drawlet.shapes.AbstractShape
|
+--com.rolemodelsoft.drawlet.shapes.lines.LinearShape
|
+--com.rolemodelsoft.drawlet.shapes.lines.Line
This provides a basic implementation of Lines. It is not expected that the locators that make up this line be connected to other figures.
| Field Summary | |
protected Locator[] |
points
The locators which define the points of the line. |
protected java.awt.Polygon |
polygon
A cache to keep the bounds for efficient reference. |
| Fields inherited from class com.rolemodelsoft.drawlet.shapes.lines.LinearShape |
lineColor |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
listeners,
locationListeners |
| Constructor Summary | |
Line(int beginX,
int beginY,
int endX,
int endY)
Constructs and initializes a new instance of a line. |
|
Line(Locator[] locators)
Constructs and initializes a new instance of a line. |
|
Line(Locator begin,
Locator end)
Constructs and initializes a new instance of a line. |
|
| Method Summary | |
protected void |
basicAddLocator(int index,
Locator locator)
Add the locator at the given position. |
protected void |
basicRemoveLocator(int index)
Remove the locator at the given position. |
protected void |
basicReshape(int x,
int y,
int width,
int height)
Reshapes the receiver to the specified bounding box. |
protected void |
basicSetLocator(int index,
Locator locator)
Set the locator at the given position. |
protected void |
basicTranslate(int x,
int y)
Moves the receiver in the x and y direction. |
boolean |
contains(int x,
int y)
Checks whether a specified x,y location is "inside" this Figure, where x and y are defined to be relative to the coordinate system of this figure. |
java.lang.Object |
duplicateIn(java.util.Hashtable duplicates)
Duplicates the receiver in the given Hashtable. |
protected int |
estimatedDuplicateSize()
Answers the expected number of significant duplicates when duplicating the receiver. |
java.awt.Rectangle |
getBounds()
Returns the current bounds of the receiver. |
Locator |
getLocator(int index)
Answer the indexth locator. |
int |
getNumberOfPoints()
Answer the number of points which define the receiver. |
protected java.awt.Polygon |
getPolygon()
Answer the Polygon associated with the receiver. |
boolean |
intersects(java.awt.Rectangle bounds)
Answers whether the receiver intersects a Rectangular area. |
void |
paint(java.awt.Graphics g)
Paints the receiver. |
void |
postDuplicate(java.util.Hashtable duplicates)
After a series of Figures are duplicated, this can be sent to each of the duplicates to resolve any changes it might like to reconcile. |
protected void |
resetBoundsCache()
Flush caches with respect to determining bounds. |
protected void |
resetLocationCache()
Flush caches with respect to determining location. |
protected void |
resetSizeCache()
Flush caches with respect to determining size. |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.lines.LinearShape |
addLocator,
addLocator,
defaultLineColor,
getHandles,
getLineColor,
getStyle,
insideSegment,
insideTolerance,
insideTolerance,
locatorAt,
removeLocator,
requestConnection,
setLineColor,
setLocator,
setStyle |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.AbstractShape |
basicResize,
reshapedPolygon,
reshapedPolygon,
setBounds,
setSize |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
addPropertyChangeListener,
addRelatedLocationListener,
basicMove,
changedLocation,
changedShape,
changedSize,
contains,
contains,
deleteLocationListeners,
disconnect,
duplicate,
editTool,
figureFromLocator,
fireLocationChange,
firePropertyChange,
firePropertyChange,
fireRelationChange,
fireShapeChange,
fireSizeChange,
getLocation,
getLocator,
intersects,
isObsolete,
isWithin,
isWithin,
move,
move,
relatedLocationListeners,
removePropertyChangeListener,
removeRelatedLocationListener,
setSize,
translate |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractPaintable |
getBottom,
getHeight,
getLeft,
getRight,
getSize,
getTop,
getWidth |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Locator[] points
protected transient java.awt.Polygon polygon
| Constructor Detail |
public Line(Locator[] locators)
locators - the locators which define the points of the line
public Line(int beginX,
int beginY,
int endX,
int endY)
beginX - the x coordinate for the first point defining the linebeginY - the y coordinate for the first point defining the lineendX - the x coordinate for the second point defining the lineendY - the y coordinate for the second point defining the line
public Line(Locator begin,
Locator end)
begin - the locator which is the first point defining the lineend - the locator which is the second point defining the line| Method Detail |
protected void basicAddLocator(int index,
Locator locator)
index - the index of the locator desired.locator - the new Locator.protected void basicRemoveLocator(int index)
index - the index of the locator no longer desired.
protected void basicReshape(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the width of the receiverheight - the height of the receivergetBounds()
protected void basicSetLocator(int index,
Locator locator)
index - the index of the locator desired.locator - the new Locator.
protected void basicTranslate(int x,
int y)
x - amount to move in the x directiony - amount to move in the y direction
public boolean contains(int x,
int y)
x - the x coordinatey - the y coordinatetrue if the specified x,y location is
"inside this Figure;
false otherwise.public java.lang.Object duplicateIn(java.util.Hashtable duplicates)
duplicates - the Hashtable to put the new duplicate inprotected int estimatedDuplicateSize()
public java.awt.Rectangle getBounds()
public Locator getLocator(int index)
index - the index of the locator desired.public int getNumberOfPoints()
protected java.awt.Polygon getPolygon()
public boolean intersects(java.awt.Rectangle bounds)
bounds - the Rectangular areatrue if the receiver intersects the
given rectangular area;
false otherwise.public void paint(java.awt.Graphics g)
g - the specified Graphics windowpublic void postDuplicate(java.util.Hashtable duplicates)
duplicates - a Hashtable where originals as keys and duplicates as elementsprotected void resetBoundsCache()
protected void resetLocationCache()
protected void resetSizeCache()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||