Synergy Home Page

au.edu.swin.synergy.shapes
Class BLine

java.lang.Object
  |
  +--au.edu.swin.synergy.plugin.diagram.BDrawable
        |
        +--au.edu.swin.synergy.shapes.BLine

public class BLine
extends BDrawable
implements BSaveable

See Also:
Serialized Form

Field Summary
protected static String kDefaultLineColour
           
protected static String kDefaultStyle
           
protected static String kDefaultUseLineColour
           
protected static String kKeyLineColour
           
protected static String kKeyStyle
           
protected static String kKeyUseLineColour
           
protected  Color lineColour
           
protected  int lineSize
           
protected  BasicStroke stroke
           
protected  Integer style
           
protected  boolean useLineColour
           
protected  BScalarRect viewCoords
           
 
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
BLine()
           
BLine(BLine line)
           
BLine(int x1, int y1, int x2, int y2)
           
 
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
 void copy(BLine src)
          copies the data from the src BRectShape into this one.
 void dragAdd(BScalarPoint deltaXY)
          called when the user is drag adding the line...
 void dragResize(BScalarPoint deltaXY)
           
 Color getLineColour()
           
 Integer getLineStyle()
           
 String getName()
          Returns the name of this drawable object
 BPropPanel getPropertyPanel()
           
 BasicStroke getStroke()
           
 boolean load(BDataFile file)
          Loads the BDrawable from a file
 BDrawable newInstance()
          Creates and returns a new instance of the BDrawable object
 void paintIcon(Component c, Graphics g, int x, int y)
           
 void render(Graphics2D g2)
          Renders the transformed coordinates of the line to a Graphics2D
 void renderOutlineAndSizers(Graphics2D g2)
           
 boolean save(BDataFile file)
          Saves the BDrawable to a file
 void setLineColour(Color colour)
           
 void setLineStyle(Integer s)
           
 void setStroke(BasicStroke str)
           
 void startAdd()
           
 void startResize(int sizerNum)
           
 void stopAdd()
           
 void stopResize()
           
 void transform(BView viewport, BScalarPoint parentPos, int frameCounter)
          Transforms the coordinates of the rectshape 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, dragMove, getBasicStroke, getBounds, getColour, getIconHeight, getIconWidth, getPos, incPos, intersects, isDeletable, isHighlighted, isInside, isSelected, isStatusFlag, isTransformed, setFlag, setHighlighted, setName, setPos, setPos, setSelected, snapToGrid, startMove, stopMove, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

useLineColour

protected boolean useLineColour

lineColour

protected Color lineColour

stroke

protected BasicStroke stroke

style

protected Integer style

lineSize

protected int lineSize

viewCoords

protected BScalarRect viewCoords

kKeyUseLineColour

protected static final String kKeyUseLineColour

kDefaultUseLineColour

protected static final String kDefaultUseLineColour

kKeyLineColour

protected static final String kKeyLineColour

kDefaultLineColour

protected static final String kDefaultLineColour

kKeyStyle

protected static final String kKeyStyle

kDefaultStyle

protected static final String kDefaultStyle
Constructor Detail

BLine

public BLine(int x1,
             int y1,
             int x2,
             int y2)

BLine

public BLine(BLine line)

BLine

public BLine()
Method Detail

getLineStyle

public Integer getLineStyle()

setLineStyle

public void setLineStyle(Integer s)

getLineColour

public Color getLineColour()

setLineColour

public void setLineColour(Color colour)

getStroke

public BasicStroke getStroke()

setStroke

public void setStroke(BasicStroke str)

getPropertyPanel

public BPropPanel getPropertyPanel()
Overrides:
getPropertyPanel in class BDrawable

render

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

renderOutlineAndSizers

public void renderOutlineAndSizers(Graphics2D g2)

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

startAdd

public void startAdd()
Overrides:
startAdd in class BDrawable

dragAdd

public void dragAdd(BScalarPoint deltaXY)
called when the user is drag adding the line...
Overrides:
dragAdd in class BDrawable

transform

public void transform(BView viewport,
                      BScalarPoint parentPos,
                      int frameCounter)
Transforms the coordinates of the rectshape to a new coordinate space, as defined by the viewport and parent pos.
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 BDrawable

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Overrides:
paintIcon 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

startResize

public void startResize(int sizerNum)
Overrides:
startResize in class BDrawable

dragResize

public void dragResize(BScalarPoint deltaXY)
Overrides:
dragResize in class BDrawable

stopResize

public void stopResize()
Overrides:
stopResize in class BDrawable

stopAdd

public void stopAdd()
Overrides:
stopAdd 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

copy

public void copy(BLine src)
copies the data from the src BRectShape into this one.
Parameters:
BRectShape - src - the sourc BRectShape..

getName

public String getName()
Returns the name of this drawable object
Returns:
String - the name of the object..
Overrides:
getName 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

Synergy Home Page