sm
Class SMRectangularShape

java.lang.Object
  extended bysm.SMShape
      extended bysm.SMRectangularShape
All Implemented Interfaces:
java.lang.Cloneable, InteractiveObject
Direct Known Subclasses:
SMEllipse, SMRectangle, SMSegment

public abstract class SMRectangularShape
extends SMShape

An abstract rectangular shape for use with an SMCanvas. SMRectangularShape is the base class for SMEllipse and SMEllipseSMRectangle, it provides methods to manipulate those shapes by their rectangular bounding box.

Author:
Caroline Appert

Field Summary
 
Fields inherited from class sm.SMShape
cptId
 
Constructor Summary
SMRectangularShape(java.awt.Shape s)
          Builds a rectangular shape.
SMRectangularShape(java.awt.Shape s, java.awt.Paint p)
          Builds a rectangular shape.
SMRectangularShape(java.awt.Shape s, java.awt.Paint p, java.awt.Paint o)
          Builds a rectangular shape.
SMRectangularShape(java.awt.Shape s, java.awt.Paint p, java.awt.Paint o, java.awt.Stroke str)
          Builds a rectangular shape.
SMRectangularShape(java.awt.Shape s, java.awt.Paint p, java.awt.Stroke str)
          Builds a rectangular shape.
SMRectangularShape(java.awt.Shape s, java.awt.Stroke str)
          Builds a rectangular shape.
 
Method Summary
 SMRectangularShape setBoundingBox(double minx, double miny, double width, double height)
          Define this rectangular shape by its bounding box.
 SMRectangularShape setBoundingBox(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
          Define this rectangular shape by its bounding box.
 SMRectangularShape setDiagonal(double x1, double y1, double x2, double y2)
          Define this rectangular shape by its diagonal.
 SMRectangularShape setDiagonal(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
          Define this rectangular shape by its diagonal.
 
Methods inherited from class sm.SMShape
above, aboveAll, addChild, addGhost, addTag, addTag, addTag, addTo, asEllipse, asImage, asPolyLine, asRectangle, asRectangularShape, asText, attachSM, below, belowAll, canvasToShape, clone, contains, contains, contains, contains, containsPoint, containsPoint, copyTo, detachSM, duplicate, equals, getAbsShape, getAbsTransform, getBoundingBox, getCanvas, getCenterX, getCenterY, getChildren, getClip, getFillPaint, getHeight, getHierarchy, getID, getMaxX, getMaxY, getMinX, getMinY, getOutlinePaint, getParent, getReferenceX, getReferenceY, getRotation, getScaleX, getScaleY, getShape, getStroke, getTransform, getTranslateX, getTranslateY, getTransparency, getWidth, hasTag, hasTag, intersects, intersects, isAbove, isAntialiased, isBelow, isDrawable, isEmpty, isFilled, isOnOutline, isOutlined, isPickable, paint, remove, removeChild, removeGhost, removeTag, removeTag, rotateBy, rotateTo, scaleBy, scaleBy, scaleTo, scaleTo, setAntialiased, setClip, setDrawable, setFilled, setFillPaint, setOutlined, setOutlinePaint, setParent, setPickable, setReferencePoint, setShape, setStroke, setTransparency, shapeToCanvas, translateBy, translateTo
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMRectangularShape

public SMRectangularShape(java.awt.Shape s)
Builds a rectangular shape.

Parameters:
s - The shape (Rectangle2D or Ellipse2D)

SMRectangularShape

public SMRectangularShape(java.awt.Shape s,
                          java.awt.Paint p,
                          java.awt.Paint o,
                          java.awt.Stroke str)
Builds a rectangular shape.

Parameters:
s - The shape (Rectangle2D or Ellipse2D)
p - The fill paint style
o - The outline paint style
str - The stroke style

SMRectangularShape

public SMRectangularShape(java.awt.Shape s,
                          java.awt.Paint p,
                          java.awt.Stroke str)
Builds a rectangular shape.

Parameters:
s - The shape (Rectangle2D or Ellipse2D)
p - The fill paint style
str - The stroke style

SMRectangularShape

public SMRectangularShape(java.awt.Shape s,
                          java.awt.Paint p,
                          java.awt.Paint o)
Builds a rectangular shape.

Parameters:
s - The shape (Rectangle2D or Ellipse2D)
p - The paint style
o - The outline paint style

SMRectangularShape

public SMRectangularShape(java.awt.Shape s,
                          java.awt.Paint p)
Builds a rectangular shape.

Parameters:
s - The shape (Rectangle2D or Ellipse2D)
p - The paint style

SMRectangularShape

public SMRectangularShape(java.awt.Shape s,
                          java.awt.Stroke str)
Builds a rectangular shape.

Parameters:
s - The shape (Rectangle2D or Ellipse2D)
str - The stroke style
Method Detail

setBoundingBox

public SMRectangularShape setBoundingBox(java.awt.geom.Point2D p1,
                                         java.awt.geom.Point2D p2)
Define this rectangular shape by its bounding box.

Parameters:
p1 - One corner of the diagonal of the bounding box.
p2 - The other corner of the diagonal of the bounding box.
Returns:
this rectangular shape.

setBoundingBox

public SMRectangularShape setBoundingBox(double minx,
                                         double miny,
                                         double width,
                                         double height)
Define this rectangular shape by its bounding box.

Parameters:
minx - The x coordinate of the upper left corner of the bounding box.
miny - The y coordinate of the upper left corner of the bounding box.
width - The width of the bounding box.
height - The height of the bounding box.
Returns:
this rectangular shape.

setDiagonal

public SMRectangularShape setDiagonal(double x1,
                                      double y1,
                                      double x2,
                                      double y2)
Define this rectangular shape by its diagonal.

Parameters:
x1 - The x coordinate of one corner of the diagonal.
y1 - The y coordinate of one corner of the diagonal.
x2 - The x coordinate of the other corner of the diagonal.
y2 - The y coordinate of the other corner of the diagonal.
Returns:
Returns this rectangle

setDiagonal

public SMRectangularShape setDiagonal(java.awt.geom.Point2D p1,
                                      java.awt.geom.Point2D p2)
Define this rectangular shape by its diagonal.

Parameters:
p1 - One corner of the diagonal.
p2 - The other corner of the diagonal.
Returns:
Returns this ellipse