|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.edu.swin.synergy.plugin.diagram.BDrawable
Field Summary | |
protected BScalarRect |
bounds
|
protected BScalar |
iconOOZ
|
static int |
kBackward
|
protected static String |
kDefaultName
|
protected static String |
kDefaultStatus
|
static int |
kEmptyFlag
|
static int |
kForward
|
static int |
kHighlightFlag
|
static int |
kHitBounds
|
static int |
kHitSizer
|
protected static String |
kKeyName
|
protected static String |
kKeyStatus
|
static int |
kNotHit
|
static int |
kSelectedFlag
|
protected static int |
kSizerCtrlPoint1
|
protected static int |
kSizerCtrlPoint2
|
protected static int |
kSizerEndArc
|
protected static int |
kSizerHalfH
|
protected static int |
kSizerHalfW
|
protected static int |
kSizerNorthEast
|
protected static int |
kSizerNorthWest
|
protected static int |
kSizerSouthEast
|
protected static int |
kSizerSouthWest
|
protected static int |
kSizerStartArc
|
protected int |
lastFrame
|
protected String |
name
|
protected int |
paintCount
|
protected BScalarPoint |
pos
|
protected Color |
sizerColour
|
protected int |
statusFlag
|
protected BScalarRect |
tmpBounds
|
Constructor Summary | |
protected |
BDrawable()
|
Method Summary | |
int |
checkSizerHit(Point pt)
Checks to see if a sizer has been hit by a point Works on xformed values. |
int |
checkXFormBounds(Point pt)
Checks to see if a point has hit the transformed bounds of this object |
int |
checkXFormHit(Point pt)
Checks to see if a point has hit the transformed values of this object |
boolean |
contains(BScalarPoint pt)
Tests to see if a point is contained within the bounds of this drawable object The bounds are assumed to be in model space. |
void |
continueAdd(BScalarPoint pt)
continue adding this drawable... |
void |
copy(BDrawable src)
copies the data from the src BDrawable into this one. |
void |
delete()
called before the drawable is about to be deleted so that it has time to clean itself up if need be. |
void |
doPasted(BDiagram diagram)
Called when a drawable is pasted onto a diagram. |
void |
dragAdd(BScalarPoint deltaXY)
Called as the drawable is being added |
void |
dragMove(BScalarPoint deltaXY)
Called as the drawable is being moved |
void |
dragResize(BScalarPoint deltaXY)
Called as the drawable is being resized |
BasicStroke |
getBasicStroke()
gets the basic stroke of the drawable. |
BScalarRect |
getBounds()
|
Color |
getColour()
gets the outline colour of this drawable. |
int |
getIconHeight()
gets the local height of the drawable |
int |
getIconWidth()
gets the local width of the drawable |
String |
getName()
Returns the name of this drawable object |
BScalarPoint |
getPos()
|
BPropPanel |
getPropertyPanel()
Returns the associated property panel with this drawable. |
void |
incPos(BScalarPoint deltaXY)
increments the position of the object. |
boolean |
intersects(BScalarRect bounds)
Tests to see if the bounds of this drawable object intersect with a given rectangle. |
String |
isDeletable()
|
boolean |
isHighlighted()
|
boolean |
isInside(BScalarRect bounds)
|
boolean |
isSelected()
|
boolean |
isStatusFlag(int flag)
|
boolean |
isTransformed(int frameCounter)
|
boolean |
load(BDataFile file)
Loads the BDrawable from a file |
abstract BDrawable |
newInstance()
Creates and returns a new instance of the BDrawable object |
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
|
abstract void |
render(Graphics2D g2)
Renders the transformed coordinates of the drawable object to a Graphics2D |
boolean |
save(BDataFile file)
Saves the BDrawable to a file |
void |
setFlag(int flag,
boolean on)
sets a flag on or off |
void |
setHighlighted(boolean on)
|
void |
setName(String name)
|
void |
setPos(BScalarPoint pos)
Sets the position of the object. |
void |
setPos(Point pos)
Sets the position of the object. |
void |
setSelected(boolean on)
|
void |
snapToGrid(int spacing)
Snaps the position of a drawable to the grid. |
void |
startAdd()
called when the drawable is about to be added.. |
void |
startMove()
called when the drawable is about to be moved.. |
void |
startResize(int sizerNum)
called when the drawable is about to be resized.. |
void |
stopAdd()
called when the drawable has finished being added.. |
void |
stopMove()
called when the drawable has finished being moved.. |
void |
stopResize()
Called as the drawable is stopped being resized |
String |
toString()
toString - currently just prints the name of the object. |
abstract void |
transform(BView viewport,
BScalarPoint parentPos,
int frameCounter)
Transforms the coordinates of the drawable object to a new coordinate space, as defined by the viewport and parent pos. |
abstract void |
updateBounds()
updates the bounding region of the drawable Called when something requires the bounds of the drawable to be updated. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int kEmptyFlag
public static final int kHighlightFlag
public static final int kSelectedFlag
public static final int kNotHit
public static final int kHitBounds
public static final int kHitSizer
protected Color sizerColour
protected static final int kSizerHalfW
protected static final int kSizerHalfH
protected static final int kSizerNorthWest
protected static final int kSizerNorthEast
protected static final int kSizerSouthEast
protected static final int kSizerSouthWest
protected static final int kSizerStartArc
protected static final int kSizerEndArc
protected static final int kSizerCtrlPoint1
protected static final int kSizerCtrlPoint2
public static final int kForward
public static final int kBackward
protected int paintCount
protected static final String kKeyName
protected static final String kDefaultName
protected static final String kKeyStatus
protected static final String kDefaultStatus
protected BScalarPoint pos
protected String name
protected BScalarRect bounds
protected BScalarRect tmpBounds
protected int statusFlag
protected int lastFrame
protected BScalar iconOOZ
Constructor Detail |
protected BDrawable()
Method Detail |
public final boolean isTransformed(int frameCounter)
public String isDeletable()
public void delete()
public abstract void transform(BView viewport, BScalarPoint parentPos, int frameCounter)
BView
- viewport - the viewport that this object is going to be drawn inPoint
- parentPos - coordinates of any parent objectpublic abstract void render(Graphics2D g2)
Graphics2D
- g2 - the place to render the object to.public BPropPanel getPropertyPanel()
public abstract BDrawable newInstance()
public boolean load(BDataFile file)
BDataFile
- file - the file to load frompublic boolean save(BDataFile file)
BDataFile
- file - the file to save topublic abstract void updateBounds()
public boolean intersects(BScalarRect bounds)
Rectangle
- bounds - the bounds to test againstpublic boolean isInside(BScalarRect bounds)
public boolean contains(BScalarPoint pt)
int
- x - the x coordinate of the pointint
- y - the y coordinate of the pointpublic int checkXFormHit(Point pt)
Point
- pt - the point to check the hit against..public int checkXFormBounds(Point pt)
Point
- pt - the point to check the hit against..public int checkSizerHit(Point pt)
Point
- pt - the point to check the hit againstpublic void startResize(int sizerNum)
int
- sizerNum - a sizerNum returned from checkSizerHitpublic void dragResize(BScalarPoint deltaXY)
public void stopResize()
public void startMove()
public void dragMove(BScalarPoint deltaXY)
public void stopMove()
public void startAdd()
public void dragAdd(BScalarPoint deltaXY)
public void stopAdd()
public void continueAdd(BScalarPoint pt)
public void paintIcon(Component c, Graphics g, int x, int y)
public BScalarRect getBounds()
public int getIconWidth()
public int getIconHeight()
public void setHighlighted(boolean on)
public void setSelected(boolean on)
public void setFlag(int flag, boolean on)
public boolean isStatusFlag(int flag)
public boolean isHighlighted()
public boolean isSelected()
public Color getColour()
public BasicStroke getBasicStroke()
public void setPos(BScalarPoint pos)
public void setPos(Point pos)
public void snapToGrid(int spacing)
int
- spacing - the spacing of the gridpublic void incPos(BScalarPoint deltaXY)
public BScalarPoint getPos()
public String toString()
public void copy(BDrawable src)
BDrawable
- src - the source BDrawable..public String getName()
public void setName(String name)
public void doPasted(BDiagram diagram)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |