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
-
NotBoundedShape()
- Constructs a not bounded shape without an arrowhead
-
adjust(int, int)
- Adjusts the shape's position according to drawing direction and global
current coordinates
-
atPositionAsString()
- Returns the shape's position as a pic text
-
center(int[])
- Returns the most left and most rigth points for this shape.
-
contains(int, int)
- Returns true iff this shape contains the given point
-
drawArrowHead(Graphics, float, float, float, float)
- Draws the arrowhead for this shape.
-
getArrowHead1()
- Returns true iff this shape has an arrowhead at start point
-
getArrowHead2()
- Returns true iff this shape has an arrowhead at finish point
-
getCenter()
- Returns the shape center point
-
getCurrentPoint()
- Gets the current point
-
getHeight()
- Returns the shape height
-
getHigh()
- Returns the shape's high drag points
-
getLeft()
- Returns the shape's left drag points
-
getLow()
- Returns the shape's low drag points
-
getPoints()
- Returns the end points array of this shape
-
getResizeDirection(int)
- Returns the drag direction according to point
-
getRight()
- Returns the shape's right drag points
-
getWidth()
- Returns the shape width
-
inverse()
- Inverses the Y coordinate of the shape.
-
isSelected(int, int, int, int)
- Returns true if the shape is included into the given rectangular frame
-
setArrowHead(int)
- Sets an arrowhead at the start or end of the shape
-
setCurrentPoint(int)
- Sets current drag point
-
setCurrentPoint(Point)
- Sets the current end point to the given point
-
setHeight(int)
- Sets new height for this shape (in pixels)
-
setInsertionPoint()
- Sets the current drawing position
-
setPoints(int[])
- Sets the new endpoints array
-
setWidth(int)
- Sets new width for this shape (in pixels)
NotBoundedShape
protected NotBoundedShape()
- Constructs a not bounded shape without an arrowhead
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
getArrowHead1
public boolean getArrowHead1()
- Returns true iff this shape has an arrowhead at start point
getArrowHead2
public boolean getArrowHead2()
- Returns true iff this shape has an arrowhead at finish point
getPoints
public int[] getPoints()
- Returns the end points array of this shape
inverse
public void inverse()
- Inverses the Y coordinate of the shape.
- Overrides:
- inverse in class GenericShape
getHeight
public int getHeight()
- Returns the shape height
- Overrides:
- getHeight in class GenericShape
getWidth
public int getWidth()
- Returns the shape width
- Overrides:
- getWidth in class GenericShape
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
setHeight
public void setHeight(int newHeight)
- Sets new height for this shape (in pixels)
- Overrides:
- setHeight in class GenericShape
setWidth
public void setWidth(int newWidth)
- Sets new width for this shape (in pixels)
- Overrides:
- setWidth in class GenericShape
setInsertionPoint
public void setInsertionPoint()
- Sets the current drawing position
- Overrides:
- setInsertionPoint in class GenericShape
center
public int[] center(int borders[])
- Returns the most left and most rigth points for this shape.
- Overrides:
- center in class GenericShape
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
atPositionAsString
public String atPositionAsString()
- Returns the shape's position as a pic text
- Overrides:
- atPositionAsString in class GenericShape
contains
public boolean contains(int x,
int y)
- Returns true iff this shape contains the given point
- Overrides:
- contains in class GenericShape
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
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
getResizeDirection
public Point getResizeDirection(int point)
- Returns the drag direction according to point
- Overrides:
- getResizeDirection in class GenericShape
setCurrentPoint
public void setCurrentPoint(int point)
- Sets current drag point
- Overrides:
- setCurrentPoint in class GenericShape
getCenter
protected Point getCenter()
- Returns the shape center point
- Overrides:
- getCenter in class GenericShape
getLeft
protected Point getLeft()
- Returns the shape's left drag points
- Overrides:
- getLeft in class GenericShape
getRight
protected Point getRight()
- Returns the shape's right drag points
- Overrides:
- getRight in class GenericShape
getLow
protected Point getLow()
- Returns the shape's low drag points
- Overrides:
- getLow in class GenericShape
getHigh
protected Point getHigh()
- Returns the shape's high drag points
- Overrides:
- getHigh in class GenericShape
setCurrentPoint
public void setCurrentPoint(Point currPoint)
- Sets the current end point to the given point
getCurrentPoint
public int getCurrentPoint()
- Gets the current point
All Packages Class Hierarchy This Package Previous Next Index