|
|||||||||
| 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.AbstractRectangleShape
This provides a basic abstract implementation of rectangular bounded Figures. Although this is an abstract class, it is acknowledged that there are other implementations (e.g. ones that uses Locators) which are more flexible. Therefore, one may wish to consider subclassing the superclass instead. This provides most of its functionality based on a simple x, y, width, height attributes, and forces concrete subclasses to define, at a minimum: paintStrokes(Graphics); paintFilled(Graphics);
| Field Summary | |
protected int |
height
The height of the shape |
protected int |
width
The width of the shape |
protected int |
x
The x coordinate for the shape |
protected int |
y
The y coordinate for the shape |
| Fields inherited from class com.rolemodelsoft.drawlet.shapes.FilledShape |
fillColor,
lineColor |
| Fields inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
listeners,
locationListeners |
| Constructor Summary | |
AbstractRectangleShape()
Creates a new, default AbstractRectangleShape. |
|
AbstractRectangleShape(int x,
int y,
int width,
int height)
Creates a new AbstractRectangeShape initialized with the given values for x, y, width and height. |
|
AbstractRectangleShape(java.awt.Rectangle rectangle)
Creates a new AbstractRectangeShape initialized with the given Rectangle. |
|
| Method Summary | |
protected void |
basicMove(int x,
int y)
Moves the receiver to a new location. |
protected void |
basicReshape(int x,
int y,
int width,
int height)
Reshapes the receiver to the specified bounding box. |
protected void |
basicResize(int width,
int height)
Resizes the receiver to the specified width and height. |
protected void |
basicTranslate(int x,
int y)
Moves the receiver in the x and y direction. |
protected void |
changedShape(java.awt.Rectangle oldBounds)
Denote that the receiver has changed. |
protected int |
defaultHeight()
Answer the default/initial value for height. |
protected int |
defaultWidth()
Answer the default/initial value for width. |
protected int |
defaultX()
Answer the default/initial value for x. |
protected int |
defaultY()
Answer the default/initial value for y. |
java.awt.Rectangle |
getBounds()
Returns the current bounds of the receiver. |
java.awt.Dimension |
getSize()
Returns the current size of the receiver. |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.FilledShape |
defaultFillColor,
defaultLineColor,
getFillColor,
getLineColor,
getStyle,
isOpaque,
isStroked,
paint,
paintFilled,
paintStrokes,
setFillColor,
setLineColor,
setStyle |
| Methods inherited from class com.rolemodelsoft.drawlet.shapes.AbstractShape |
getHandles,
resetBoundsCache,
resetSizeCache,
reshapedPolygon,
reshapedPolygon,
setBounds,
setSize |
| Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
addPropertyChangeListener,
addRelatedLocationListener,
changedLocation,
changedSize,
contains,
contains,
contains,
deleteLocationListeners,
disconnect,
duplicate,
duplicateIn,
editTool,
estimatedDuplicateSize,
figureFromLocator,
fireLocationChange,
firePropertyChange,
firePropertyChange,
fireRelationChange,
fireShapeChange,
fireSizeChange,
getLocation,
getLocator,
intersects,
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,
getTop,
getWidth |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected int x
protected int y
protected int width
protected int height
| Constructor Detail |
public AbstractRectangleShape()
public AbstractRectangleShape(int x,
int y,
int width,
int height)
x - an integer representing the x for this AbstractRectangeShape.y - an integer representing the y for this AbstractRectangeShape.width - an integer representing the width for this AbstractRectangeShape.height - an integer representing the height for this AbstractRectangeShape.public AbstractRectangleShape(java.awt.Rectangle rectangle)
rectangle - a Rectangle representing the bounds to be used for initialization.| Method Detail |
protected void basicMove(int x,
int y)
x - the x coordinatey - the y coordinate
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 figure
protected void basicResize(int width,
int height)
width - the width of the figureheight - the height of the figure
protected void basicTranslate(int x,
int y)
x - amount to move in the x directiony - amount to move in the y directionprotected void changedShape(java.awt.Rectangle oldBounds)
oldBounds - the old bounds.protected int defaultHeight()
protected int defaultWidth()
protected int defaultX()
protected int defaultY()
public java.awt.Rectangle getBounds()
public java.awt.Dimension getSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||