com.rolemodelsoft.drawlet.shapes.rectangles
Class RectangleShape

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
                                |
                                +--com.rolemodelsoft.drawlet.shapes.rectangles.RectangleShape
Direct Known Subclasses:
GraphNode

public class RectangleShape
extends AbstractRectangleShape

This provides a basic concrete implementation of BoundedFigures in the form of "rectilinear" boxes 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.

See Also:
Serialized Form

Fields inherited from class com.rolemodelsoft.drawlet.shapes.AbstractRectangleShape
height, width, x, y
 
Fields inherited from class com.rolemodelsoft.drawlet.shapes.FilledShape
fillColor, lineColor
 
Fields inherited from class com.rolemodelsoft.drawlet.basics.AbstractFigure
listeners, locationListeners
 
Constructor Summary
RectangleShape()
          Constructs a new, default instance of the receiver.
RectangleShape(int x, int y, int width, int height)
          Constructs a new instance of the receiver initialized with the given values for x, y, width and height.
RectangleShape(java.awt.Rectangle rectangle)
          Constructs a new instance of the receiver initialized with the given Rectangle.
 
Method Summary
 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.
 
Methods inherited from class com.rolemodelsoft.drawlet.shapes.AbstractRectangleShape
basicMove, basicReshape, basicResize, basicTranslate, changedShape, defaultHeight, defaultWidth, defaultX, defaultY, getBounds, getSize
 
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
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
 

Constructor Detail

RectangleShape

public RectangleShape()
Constructs a new, default instance of the receiver.

RectangleShape

public RectangleShape(int x,
                      int y,
                      int width,
                      int height)
Constructs a new instance of the receiver initialized with the given values for x, y, width and height.
Parameters:
x - an integer representing the x coordinate.
y - an integer representing the y coordinate.
width - an integer representing the width.
height - an integer representing the height.

RectangleShape

public RectangleShape(java.awt.Rectangle rectangle)
Constructs a new instance of the receiver initialized with the given Rectangle.
Parameters:
rectangle - a Rectangle representing the bounding box.
Method Detail

paintFilled

public void paintFilled(java.awt.Graphics g)
Paint the shape, filling all contained area.
Overrides:
paintFilled in class FilledShape
Parameters:
g - the specified Graphics window.

paintStrokes

public void paintStrokes(java.awt.Graphics g)
Paint the outline of the shape.
Overrides:
paintStrokes in class FilledShape
Parameters:
g - the specified Graphics window