|
|||||||||
| 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.FilledShape
|
+--com.rolemodelsoft.drawlet.shapes.polygons.PolygonShape
This provides a basic concrete implementation of PolygonFigures that are assumed to be movable and reshapable with observers that want to know when their locations or shapes change. Although this is a concrete class, it is acknowledged that there are probably other implementations (e.g. one that uses Locators) which are more flexible.
| Field Summary | |
protected java.awt.Polygon |
polygon
The underlying, defining polygon. |
| Fields inherited from class com.rolemodelsoft.drawlet.shapes.FilledShape |
fillColor,
lineColor |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
listeners,
locationListeners |
| Fields inherited from interface com.rolemodelsoft.drawlet.Figure |
FILL_COLOR_PROPERTY,
LINE_COLOR_PROPERTY,
LOCATION_PROPERTY,
RELATION_PROPERTY,
SHAPE_PROPERTY,
SIZE_PROPERTY,
STRING_PROPERTY,
STYLE_PROPERTY,
TEXT_COLOR_PROPERTY |
| Constructor Summary | |
PolygonShape()
Constructs a new instance of the receiver. |
|
PolygonShape(java.awt.Polygon polygon)
Constructs and initializes a new instance of the receiver based on a defining polygon. |
|
| Method Summary | |
protected void |
basicReshape(int x,
int y,
int width,
int height)
Reshapes the Figure to the specified bounding box. |
protected void |
basicSetPolygon(java.awt.Polygon polygon)
Set the Polygon associated with the Figure. |
protected void |
basicTranslate(int x,
int y)
Moves the Figure 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. |
protected java.awt.Polygon |
defaultPolygon()
Answer the default/initial value for polygon |
java.lang.Object |
duplicateIn(java.util.Hashtable duplicates)
Duplicates the receiver into a Hashtable. |
java.awt.Rectangle |
getBounds()
Returns the current bounds of the receiver. |
Handle[] |
getHandles()
Answer the handles associated with the receiver. |
java.awt.Polygon |
getPolygon()
Answer a Polygon associated with the receiver. |
boolean |
intersects(int x1,
int y1,
int x2,
int y2)
Answers whether the receiver intersects a Rectangular area. |
boolean |
intersects(java.awt.Rectangle Box)
Answers whether the receiver intersects a Rectangular area. |
void |
paintFilled(java.awt.Graphics g)
Paint the shape, filling all contained area. |
void |
paintStrokes(java.awt.Graphics g)
Paint the outline of the shape. |
void |
setPolygon(java.awt.Polygon polygon)
Set the Polygon associated with the figure. |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.FilledShape |
defaultFillColor,
defaultLineColor,
getFillColor,
getLineColor,
getStyle,
isOpaque,
isStroked,
paint,
setFillColor,
setLineColor,
setStyle |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.AbstractShape |
basicResize,
resetBoundsCache,
resetSizeCache,
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,
estimatedDuplicateSize,
figureFromLocator,
fireLocationChange,
firePropertyChange,
firePropertyChange,
fireRelationChange,
fireShapeChange,
fireSizeChange,
getLocation,
getLocator,
intersects,
isObsolete,
isWithin,
isWithin,
locatorAt,
move,
move,
postDuplicate,
relatedLocationListeners,
removePropertyChangeListener,
removeRelatedLocationListener,
requestConnection,
resetLocationCache,
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 java.awt.Polygon polygon
| Constructor Detail |
public PolygonShape()
public PolygonShape(java.awt.Polygon polygon)
polygon - the polygon which defines the basic shape of the receiver.| Method Detail |
protected void basicReshape(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the width of the figureheight - the height of the figureprotected void basicSetPolygon(java.awt.Polygon polygon)
polygon - the Polygon.
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 coordinateprotected java.awt.Polygon defaultPolygon()
public java.lang.Object duplicateIn(java.util.Hashtable duplicates)
duplicates - the Hashtable to place the duplicate in.public java.awt.Rectangle getBounds()
public Handle[] getHandles()
public java.awt.Polygon getPolygon()
public boolean intersects(int x1,
int y1,
int x2,
int y2)
box - the Rectangular areatrue if the receiver intersects the
specified Rectangular area;
false otherwise.#boundspublic boolean intersects(java.awt.Rectangle Box)
Box - the Rectangular areatrue if the receiver intersects the
specified Rectangular area;
false otherwise.#boundspublic void paintFilled(java.awt.Graphics g)
g - the specified Graphics windowpublic void paintStrokes(java.awt.Graphics g)
g - the specified Graphics windowpublic void setPolygon(java.awt.Polygon polygon)
polygon - the Polygon
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||