Synergy Home Page

au.edu.swin.synergy.plugin.packager
Class BProperty

java.lang.Object
  |
  +--au.edu.swin.synergy.plugin.diagram.BDrawable
        |
        +--au.edu.swin.synergy.plugin.packager.BProperty

public class BProperty
extends BDrawable
implements BTreeNode, BSaveable, BPropertyBagItem

See Also:
Serialized Form

Field Summary
protected static String kKeyItem
           
 
Fields inherited from class au.edu.swin.synergy.plugin.diagram.BDrawable
bounds, iconOOZ, kBackward, kDefaultName, kDefaultStatus, kEmptyFlag, kForward, kHighlightFlag, kHitBounds, kHitSizer, kKeyName, kKeyStatus, kNotHit, kSelectedFlag, kSizerCtrlPoint1, kSizerCtrlPoint2, kSizerEndArc, kSizerHalfH, kSizerHalfW, kSizerNorthEast, kSizerNorthWest, kSizerSouthEast, kSizerSouthWest, kSizerStartArc, lastFrame, name, paintCount, pos, sizerColour, statusFlag, tmpBounds
 
Constructor Summary
  BProperty()
           
protected BProperty(BProperty prop)
           
  BProperty(String name)
           
 
Method Summary
 void addDrawable(BDrawable drawable)
           
 void addString(String item)
           
 int checkSizerHit(Point pt)
           
 int checkXFormBounds(Point pt)
          Checks to see if a point has hit the transformed bounds of this object
 void copy(BProperty src)
           
 void dragMove(BScalarPoint deltaXY)
          Called as the drawable is being moved
 void dragResize(BScalarPoint deltaXY)
          Called as the drawable is being resized
 BScalarRect getBounds()
           
 Object getChildAt(int index)
           
 int getChildCount()
           
 int getIndexOf(Object node)
           
 String getName()
           
 Object getParent()
           
 Object getPropertyValue(String name)
           
 boolean intersects(BScalarRect bounds)
          Overridden from our super class for it's not the property which is drawable rather than the drawables contained to represent the data we hold.
 boolean isChangeAllowed(String name, Object oldValue, Object newValue)
           
 boolean isHighlighted()
           
 boolean isLeaf()
           
 boolean isSelected()
           
 boolean isStatusFlag(int flag)
           
 boolean load(BDataFile file)
          Loads the BDrawable from a file
 BDrawable newInstance()
          Creates and returns a new instance of the BDrawable object
 void removeAllChildren()
           
 void removeString(String item)
           
 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 setColour(Color colour)
           
 void setFlag(int flag, boolean on)
          sets a flag on or off
 void setHighlighted(boolean on)
           
 void setParent(Object parent)
           
 void setSelected(boolean on)
           
 void setTextArea(BTextArea text)
           
 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 stopMove()
          called when the drawable has finished being moved..
 void stopResize()
          called when the drawable has finished being resized..
 String toString()
          Please complete the missing tags for toString
 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.
 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 au.edu.swin.synergy.plugin.diagram.BDrawable
checkXFormHit, contains, continueAdd, copy, delete, doPasted, dragAdd, getBasicStroke, getColour, getIconHeight, getIconWidth, getPos, getPropertyPanel, incPos, isDeletable, isInside, isTransformed, paintIcon, setName, setPos, setPos, snapToGrid, startAdd, stopAdd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kKeyItem

protected static final String kKeyItem
Constructor Detail

BProperty

public BProperty()

BProperty

public BProperty(String name)

BProperty

protected BProperty(BProperty prop)
Method Detail

addString

public void addString(String item)

removeString

public void removeString(String item)

getPropertyValue

public Object getPropertyValue(String name)
Specified by:
getPropertyValue in interface BPropertyBagItem

isChangeAllowed

public boolean isChangeAllowed(String name,
                               Object oldValue,
                               Object newValue)
Specified by:
isChangeAllowed in interface BPropertyBagItem

transform

public 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.
Parameters:
BViewport - viewport - the viewport that this object is going to be drawn in
Point - parentPos - coordinates of any parent object
Overrides:
transform in class BDrawable

render

public void render(Graphics2D g2)
Renders the transformed coordinates of the drawable object to a Graphics2D
Parameters:
Graphics2D - g2 - the place to render the object to.
Overrides:
render in class BDrawable

newInstance

public BDrawable newInstance()
Creates and returns a new instance of the BDrawable object
Returns:
a new instance of this BDrawable object.
Overrides:
newInstance in class BDrawable

load

public boolean load(BDataFile file)
Loads the BDrawable from a file
Specified by:
load in interface BSaveable
Parameters:
BDataFile - file - the file to load from
Returns:
boolean - true on success, false on failure.
Overrides:
load in class BDrawable

save

public boolean save(BDataFile file)
Saves the BDrawable to a file
Specified by:
save in interface BSaveable
Parameters:
BDataFile - file - the file to save to
Returns:
boolean - true on success, false on failure.
Overrides:
save in class BDrawable

updateBounds

public void updateBounds()
updates the bounding region of the drawable Called when something requires the bounds of the drawable to be updated. Subclasses should determine a suitable way to update themselves.
Overrides:
updateBounds in class BDrawable

getBounds

public BScalarRect getBounds()
Overrides:
getBounds in class BDrawable

toString

public String toString()
Please complete the missing tags for toString
Parameters:
-  
Returns:
 
Overrides:
toString in class BDrawable
Pre Condition:
 
Post Condition:
 

setColour

public void setColour(Color colour)

copy

public void copy(BProperty src)

setTextArea

public void setTextArea(BTextArea text)

addDrawable

public void addDrawable(BDrawable drawable)

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface BTreeNode

getChildAt

public Object getChildAt(int index)
Specified by:
getChildAt in interface BTreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface BTreeNode

getParent

public Object getParent()
Specified by:
getParent in interface BTreeNode

getIndexOf

public int getIndexOf(Object node)
Specified by:
getIndexOf in interface BTreeNode

setParent

public void setParent(Object parent)
Specified by:
setParent in interface BTreeNode

removeAllChildren

public void removeAllChildren()
Specified by:
removeAllChildren in interface BTreeNode

getName

public String getName()
Specified by:
getName in interface BTreeNode
Overrides:
getName in class BDrawable

intersects

public boolean intersects(BScalarRect bounds)
Overridden from our super class for it's not the property which is drawable rather than the drawables contained to represent the data we hold. At the moment will only cater for text area until better hacks can be thought of.
Overrides:
intersects in class BDrawable

setHighlighted

public void setHighlighted(boolean on)
Overrides:
setHighlighted in class BDrawable

setSelected

public void setSelected(boolean on)
Overrides:
setSelected in class BDrawable

setFlag

public void setFlag(int flag,
                    boolean on)
sets a flag on or off
Overrides:
setFlag in class BDrawable

isStatusFlag

public boolean isStatusFlag(int flag)
Overrides:
isStatusFlag in class BDrawable

isHighlighted

public boolean isHighlighted()
Overrides:
isHighlighted in class BDrawable

isSelected

public boolean isSelected()
Overrides:
isSelected in class BDrawable

checkSizerHit

public int checkSizerHit(Point pt)
Overrides:
checkSizerHit in class BDrawable

checkXFormBounds

public int checkXFormBounds(Point pt)
Checks to see if a point has hit the transformed bounds of this object
Parameters:
Point - pt - the point to check the hit against..
Returns:
kNotHit - not hit
Overrides:
checkXFormBounds in class BDrawable

startMove

public void startMove()
called when the drawable is about to be moved..
Overrides:
startMove in class BDrawable

dragMove

public void dragMove(BScalarPoint deltaXY)
Called as the drawable is being moved
Overrides:
dragMove in class BDrawable

stopMove

public void stopMove()
called when the drawable has finished being moved..
Overrides:
stopMove in class BDrawable

startResize

public void startResize(int sizerNum)
called when the drawable is about to be resized..
Parameters:
int - sizerNum - a sizerNum returned from checkSizerHit
Overrides:
startResize in class BDrawable

dragResize

public void dragResize(BScalarPoint deltaXY)
Called as the drawable is being resized
Overrides:
dragResize in class BDrawable

stopResize

public void stopResize()
called when the drawable has finished being resized..
Overrides:
stopResize in class BDrawable

Synergy Home Page