Drawable, Interactive, Measurable, SelectableBoundedImage, InteractiveArrow, InteractiveCenteredArrowpublic class BoundedShape extends InteractiveShape implements Selectable
| Modifier and Type | Class | Description |
|---|---|---|
protected static class |
BoundedShape.BoundedShapeLoader |
A class to save and load BoundedShape in an XMLControl.
|
InteractiveShape.InteractiveShapeLoadercolor, x, yedgeColor, height, pixelSized, shape, shapeClass, theta, width, xoff, yoff| Constructor | Description |
|---|---|
BoundedShape(java.awt.Shape s,
double x,
double y) |
Constructs a BoundedShape object for the given shape.
|
| Modifier and Type | Method | Description |
|---|---|---|
static BoundedShape |
createBoundedArrow(double x,
double y,
double w,
double h) |
Creates a bounded arrow.
|
static BoundedShape |
createBoundedCenteredArrow(double x,
double y,
double w,
double h) |
Creates a bounded arrow.
|
static BoundedShape |
createBoundedCircle(double x,
double y,
double d) |
Creates a bounded circle.
|
static BoundedShape |
createBoundedEllipse(double x,
double y,
double w,
double h) |
Creates a bounded ellipse.
|
static BoundedShape |
createBoundedImage(java.awt.Image image,
double x,
double y) |
Creates a bounded image.
|
static BoundedShape |
createBoundedRectangle(double x,
double y,
double w,
double h) |
Creates a bounded rectangle.
|
static BoundedShape |
createBoundedTriangle(double x,
double y,
double b,
double h) |
Creates a bounded rectangle.
|
void |
draw(DrawingPanel panel,
java.awt.Graphics g) |
Draws the shape.
|
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix) |
Finds the interactive object that will respond to mouse actions.
|
static XML.ObjectLoader |
getLoader() |
Gets the XML object loader for this class.
|
java.awt.Cursor |
getPreferredCursor() |
|
boolean |
isHeightDrag() |
Gets the height drag option.
|
boolean |
isInside(DrawingPanel panel,
int xpix,
int ypix) |
Determines if the shape is enabled and if the given pixel coordinates are within the shape.
|
boolean |
isRotateDrag() |
Gets the rotate drag option.
|
boolean |
isSelected() |
|
boolean |
isWidthDrag() |
Gets the width width drag option.
|
boolean |
isXYDrag() |
Gets the xy drag boolean.
|
void |
setHeightDrag(boolean enable) |
Sets the height drag option.
|
void |
setRotateDrag(boolean enable) |
Sets the rotate drag option.
|
void |
setSelected(boolean selected) |
|
void |
setWidthDrag(boolean enable) |
Sets the width drag option.
|
void |
setXYDrag(boolean enable) |
Sets the xy drag option.
|
void |
toggleSelected() |
|
java.lang.String |
toString() |
Gets a description of this object.
|
getX, getY, isEnabled, setEnabledgetX, getY, isEnabled, setEnabled, setX, setXY, setYcontains, createArrow, createCenteredArrow, createCircle, createEllipse, createImage, createRectangle, createSquare, createTextLine, createTriangle, getHeight, getShape, getWidth, getXMax, getXMin, getYMax, getYMin, isMeasured, setHeight, setMarkerColor, setMeasured, setOffset, setPixelSized, setTheta, setWidth, setX, setXY, setY, tranform, transformgetXMax, getXMin, getYMax, getYMin, isMeasuredpublic BoundedShape(java.awt.Shape s,
double x,
double y)
s - Shapex - doubley - doublepublic static BoundedShape createBoundedRectangle(double x, double y, double w, double h)
x - y - w - h - public static BoundedShape createBoundedTriangle(double x, double y, double b, double h)
x - y - b - baseh - heightpublic static BoundedShape createBoundedArrow(double x, double y, double w, double h)
x - y - w - baseh - heightpublic static BoundedShape createBoundedCenteredArrow(double x, double y, double w, double h)
x - y - w - baseh - heightpublic static BoundedShape createBoundedImage(java.awt.Image image, double x, double y)
x - y - image - public static BoundedShape createBoundedEllipse(double x, double y, double w, double h)
x - y - w - h - public static BoundedShape createBoundedCircle(double x, double y, double d)
x - y - d - the diameterpublic void setSelected(boolean selected)
setSelected in interface Selectablepublic boolean isSelected()
isSelected in interface Selectablepublic void setXYDrag(boolean enable)
enable - booleanpublic boolean isXYDrag()
public void setRotateDrag(boolean enable)
enable - booleanpublic boolean isRotateDrag()
public void setWidthDrag(boolean enable)
enable - booleanpublic boolean isWidthDrag()
public void setHeightDrag(boolean enable)
enable - booleanpublic boolean isHeightDrag()
public java.awt.Cursor getPreferredCursor()
getPreferredCursor in interface Selectablepublic void toggleSelected()
toggleSelected in interface Selectablepublic Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
AbstractInteractivefindInteractive in interface InteractivefindInteractive in class AbstractInteractivepanel - DrawingPanelxpix - intypix - intpublic boolean isInside(DrawingPanel panel, int xpix, int ypix)
isInside in class InteractiveShapepanel - DrawingPanelxpix - intypix - intpublic void draw(DrawingPanel panel, java.awt.Graphics g)
draw in interface Drawabledraw in class InteractiveShapepanel - the drawing panelg - the graphics contextpublic java.lang.String toString()
toString in class InteractiveShapepublic static XML.ObjectLoader getLoader()