|
|||||||||
| 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
This provides basic default functionality for Figures that are assumed to be movable and reshapable with observers that want to know when their locations or shapes change. It provides most of its functionality based on its bounds(), and forces concrete subclasses to define, at a minimum: paint(Graphics); getBounds(); basicTranslate(int,int); basicReshape(int,int,int,int);
| Fields inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure |
listeners,
locationListeners |
| Constructor Summary | |
AbstractShape()
|
|
| Method Summary | |
protected abstract 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. |
Handle[] |
getHandles()
Answer the handles associated with the receiver. |
protected void |
resetBoundsCache()
Flush caches with respect to determining bounds. |
protected void |
resetSizeCache()
Flush caches with respect to determining size. |
static java.awt.Polygon |
reshapedPolygon(java.awt.Polygon polygon,
int x,
int y,
int width,
int height)
Answer a new version of the given polygon reshaped to the specified bounding box. |
static java.awt.Polygon |
reshapedPolygon(java.awt.Polygon polygon,
java.awt.Rectangle bounds)
Answer a new version of the given polygon reshaped to the specified bounding box. |
void |
setBounds(int x,
int y,
int width,
int height)
Reshapes the receiver to the specified bounding box. |
void |
setSize(int width,
int height)
Resizes the receiver to the specified width and height. |
| 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 |
| Constructor Detail |
public AbstractShape()
| Method Detail |
protected abstract 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 new width.height - the new height.basicReshape(int, int, int, int)public Handle[] getHandles()
protected void resetBoundsCache()
protected void resetSizeCache()
public static java.awt.Polygon reshapedPolygon(java.awt.Polygon polygon,
int x,
int y,
int width,
int height)
polygon - the polygonx - the x coordinatey - the y coordinatewidth - the width of the figureheight - the height of the figure
public static java.awt.Polygon reshapedPolygon(java.awt.Polygon polygon,
java.awt.Rectangle bounds)
polygon - the polygonbounds - its new bounding box
public void setBounds(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
public void setSize(int width,
int height)
width - the width of the figureheight - the height of the figure
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||