All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class element.NotBoundedShape

java.lang.Object
   |
   +----java.awt.Component
           |
           +----element.GenericShape
                   |
                   +----element.NotBoundedShape

public abstract class NotBoundedShape
extends GenericShape
This class implements the functionality of not bounded shapes that is lines, arrows, arcs and splines


Constructor Index

 o NotBoundedShape()
Constructs a not bounded shape without an arrowhead

Method Index

 o adjust(int, int)
Adjusts the shape's position according to drawing direction and global current coordinates
 o atPositionAsString()
Returns the shape's position as a pic text
 o center(int[])
Returns the most left and most rigth points for this shape.
 o contains(int, int)
Returns true iff this shape contains the given point
 o drawArrowHead(Graphics, float, float, float, float)
Draws the arrowhead for this shape.
 o getArrowHead1()
Returns true iff this shape has an arrowhead at start point
 o getArrowHead2()
Returns true iff this shape has an arrowhead at finish point
 o getCenter()
Returns the shape center point
 o getCurrentPoint()
Gets the current point
 o getHeight()
Returns the shape height
 o getHigh()
Returns the shape's high drag points
 o getLeft()
Returns the shape's left drag points
 o getLow()
Returns the shape's low drag points
 o getPoints()
Returns the end points array of this shape
 o getResizeDirection(int)
Returns the drag direction according to point
 o getRight()
Returns the shape's right drag points
 o getWidth()
Returns the shape width
 o inverse()
Inverses the Y coordinate of the shape.
 o isSelected(int, int, int, int)
Returns true if the shape is included into the given rectangular frame
 o setArrowHead(int)
Sets an arrowhead at the start or end of the shape
 o setCurrentPoint(int)
Sets current drag point
 o setCurrentPoint(Point)
Sets the current end point to the given point
 o setHeight(int)
Sets new height for this shape (in pixels)
 o setInsertionPoint()
Sets the current drawing position
 o setPoints(int[])
Sets the new endpoints array
 o setWidth(int)
Sets new width for this shape (in pixels)

Constructors

 o NotBoundedShape
 protected NotBoundedShape()
Constructs a not bounded shape without an arrowhead

Methods

 o setArrowHead
 public void setArrowHead(int side)
Sets an arrowhead at the start or end of the shape

Parameters:
side - 1 for start and 2 for finish. All other values are discarded
 o getArrowHead1
 public boolean getArrowHead1()
Returns true iff this shape has an arrowhead at start point

 o getArrowHead2
 public boolean getArrowHead2()
Returns true iff this shape has an arrowhead at finish point

 o getPoints
 public int[] getPoints()
Returns the end points array of this shape

 o inverse
 public void inverse()
Inverses the Y coordinate of the shape.

Overrides:
inverse in class GenericShape
 o getHeight
 public int getHeight()
Returns the shape height

Overrides:
getHeight in class GenericShape
 o getWidth
 public int getWidth()
Returns the shape width

Overrides:
getWidth in class GenericShape
 o setPoints
 public void setPoints(int points[])
Sets the new endpoints array

Parameters:
points - points[2i], points[2i+1] represent the i-th endpoint of the shape
 o setHeight
 public void setHeight(int newHeight)
Sets new height for this shape (in pixels)

Overrides:
setHeight in class GenericShape
 o setWidth
 public void setWidth(int newWidth)
Sets new width for this shape (in pixels)

Overrides:
setWidth in class GenericShape
 o setInsertionPoint
 public void setInsertionPoint()
Sets the current drawing position

Overrides:
setInsertionPoint in class GenericShape
 o center
 public int[] center(int borders[])
Returns the most left and most rigth points for this shape.

Overrides:
center in class GenericShape
 o adjust
 protected void adjust(int width,
                       int height)
Adjusts the shape's position according to drawing direction and global current coordinates

Parameters:
width - X adjustment
height - Y adjustment
 o atPositionAsString
 public String atPositionAsString()
Returns the shape's position as a pic text

Overrides:
atPositionAsString in class GenericShape
 o contains
 public boolean contains(int x,
                         int y)
Returns true iff this shape contains the given point

Overrides:
contains in class GenericShape
 o isSelected
 public boolean isSelected(int x,
                           int y,
                           int width,
                           int height)
Returns true if the shape is included into the given rectangular frame

Overrides:
isSelected in class GenericShape
 o drawArrowHead
 protected void drawArrowHead(Graphics g,
                              float x1,
                              float y1,
                              float x2,
                              float y2)
Draws the arrowhead for this shape. The arrow is drawn as for line (x1, y1),(x2, y2)

Parameters:
g - current Graphics object
x1 - the X coordinate of arrowhead tail
y1 - the Y coordinate of arrowhead tail
x2 - the X coordinate of arrowhead head
g - the Y coordinate of arrowhead head
 o getResizeDirection
 public Point getResizeDirection(int point)
Returns the drag direction according to point

Overrides:
getResizeDirection in class GenericShape
 o setCurrentPoint
 public void setCurrentPoint(int point)
Sets current drag point

Overrides:
setCurrentPoint in class GenericShape
 o getCenter
 protected Point getCenter()
Returns the shape center point

Overrides:
getCenter in class GenericShape
 o getLeft
 protected Point getLeft()
Returns the shape's left drag points

Overrides:
getLeft in class GenericShape
 o getRight
 protected Point getRight()
Returns the shape's right drag points

Overrides:
getRight in class GenericShape
 o getLow
 protected Point getLow()
Returns the shape's low drag points

Overrides:
getLow in class GenericShape
 o getHigh
 protected Point getHigh()
Returns the shape's high drag points

Overrides:
getHigh in class GenericShape
 o setCurrentPoint
 public void setCurrentPoint(Point currPoint)
Sets the current end point to the given point

 o getCurrentPoint
 public int getCurrentPoint()
Gets the current point


All Packages  Class Hierarchy  This Package  Previous  Next  Index