Synergy Home Page

au.edu.swin.synergy.plugin.modeller
Class BModelNode

java.lang.Object
  |
  +--au.edu.swin.synergy.plugin.diagram.BDrawable
        |
        +--au.edu.swin.synergy.plugin.modeller.BModelElement
              |
              +--au.edu.swin.synergy.plugin.modeller.BModelNode

public class BModelNode
extends BModelElement
implements BSaveable

See Also:
Serialized Form

Fields inherited from class au.edu.swin.synergy.plugin.modeller.BModelElement
kUnassignedID, metaElement, ruleStatus, uniqueID
 
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
BModelNode()
          Default constructor for BSaveable
BModelNode(BModelNode modelNode)
           
BModelNode(BPackageNode pNode)
           
 
Method Summary
 void addInArc(BModelArc arc)
           
 void addOutArc(BModelArc arc)
           
 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
 boolean circRefExists(String arcType)
           
protected  boolean circularRef(BModelNode startNode, String arcType)
          checks to see if there is a circular reference with this node, for a given arc type.
 void copy(BModelNode src)
           
 void delete()
          When the node is deleted, it needs to tell the connected arcs that they are no longer connected...
 int findChanges(BModelElement oldNode)
           
 int getNumInArcs()
           
 int getNumOutArcs()
           
 BDrawable getPackageNode()
           
 Vector getProperties()
           
 BPropPanel getPropertyPanel()
           
 Rectangle getXFormedBounds()
           
 String isDeletable()
           
 boolean load(BDataFile file)
          Loads the BDrawable from a file
 BDrawable newInstance()
          Creates and returns a new instance of the BDrawable object
 void removeInArc(BModelArc arc)
           
 void removeOutArc(BModelArc arc)
           
 void render(Graphics2D g2)
          Renders the transformed coordinates of the drawable object to a Graphics2D
 void resolveLoadedObject(BModel model)
           
 boolean save(BDataFile file)
          Saves the BDrawable to a file
 void setFlag(int flag, boolean on)
           
 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.modeller.BModelElement
addProperties, checkID, doPasted, doSaveText, getChildAt, getChildCount, getConflict, getID, getIndexOf, getMetaElement, getName, getParent, getPropertyValue, getRuleStatus, getUniqueID, isChangeAllowed, isLeaf, removeAllChildren, resolveText, setConflict, setMetaElement, setParent, setRuleStatus, updateCommon
 
Methods inherited from class au.edu.swin.synergy.plugin.diagram.BDrawable
checkXFormHit, contains, continueAdd, copy, dragAdd, dragMove, dragResize, getBasicStroke, getBounds, getColour, getIconHeight, getIconWidth, getPos, incPos, intersects, isHighlighted, isInside, isSelected, isStatusFlag, isTransformed, paintIcon, setHighlighted, setName, setPos, setPos, setSelected, snapToGrid, startAdd, startMove, startResize, stopAdd, stopMove, stopResize, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BModelNode

public BModelNode(BPackageNode pNode)

BModelNode

public BModelNode(BModelNode modelNode)

BModelNode

public BModelNode()
Default constructor for BSaveable
Method Detail

getPropertyPanel

public BPropPanel getPropertyPanel()
Overrides:
getPropertyPanel in class BDrawable

isDeletable

public String isDeletable()
Returns:
true if this drawable is able to be deleted at this point in time
Overrides:
isDeletable in class BDrawable

getProperties

public Vector getProperties()
Overrides:
getProperties in class BModelElement

addInArc

public void addInArc(BModelArc arc)

removeInArc

public void removeInArc(BModelArc arc)

getPackageNode

public BDrawable getPackageNode()

addOutArc

public void addOutArc(BModelArc arc)

removeOutArc

public void removeOutArc(BModelArc arc)

getNumInArcs

public int getNumInArcs()

getNumOutArcs

public int getNumOutArcs()

copy

public void copy(BModelNode src)

circRefExists

public boolean circRefExists(String arcType)

circularRef

protected boolean circularRef(BModelNode startNode,
                              String arcType)
checks to see if there is a circular reference with this node, for a given arc type.

getXFormedBounds

public final Rectangle getXFormedBounds()

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. Subclasses should follow the following equation for tranforming relevant points etc. xformPt.x = ((localPt.x + parentPos.x + pos.x - viewport.x) * viewport.zoom ) + viewport.halfx;
Parameters:
BView - viewport - the viewport that this object is going to be drawn in
Point - parentPos - coordinates of any parent object
Overrides:
transform in class BModelElement

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 BModelElement

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 BModelElement

setFlag

public void setFlag(int flag,
                    boolean on)
Overrides:
setFlag 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

checkSizerHit

public int checkSizerHit(Point pt)
Checks to see if a sizer has been hit by a point Works on xformed values. Subclasses should determine appropriate places for the sizer..
Parameters:
Point - pt - the point to check the hit against
Returns:
kNotHit - not hit
Overrides:
checkSizerHit 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 BModelElement

resolveLoadedObject

public void resolveLoadedObject(BModel model)
Overrides:
resolveLoadedObject in class BModelElement

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 BModelElement

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 BModelElement

findChanges

public int findChanges(BModelElement oldNode)
Overrides:
findChanges in class BModelElement

delete

public void delete()
When the node is deleted, it needs to tell the connected arcs that they are no longer connected...
Overrides:
delete in class BDrawable

Synergy Home Page