org.globus.cog.gui.grapheditor.util.swing
Class Arrow

java.lang.Object
  extended byorg.globus.cog.gui.grapheditor.util.swing.Arrow
Direct Known Subclasses:
TextArrow

public class Arrow
extends Object

Draws an arrow composed of three lines


Field Summary
protected  short arrowLength
           
protected  short arrowWidth
           
protected  short lineWidth
           
protected  int[] ppx
           
protected  int[] ppy
           
protected  boolean valid
           
protected  int x1
          Stores the bounding polygon for the edge with an arrow.
protected  int x2
          Stores the bounding polygon for the edge with an arrow.
protected  int y1
          Stores the bounding polygon for the edge with an arrow.
protected  int y2
          Stores the bounding polygon for the edge with an arrow.
 
Constructor Summary
Arrow()
           
Arrow(int x1, int y1, int x2, int y2, short lwidth, short awidth, short alen)
           
 
Method Summary
 boolean contains(int x, int y)
          This method checks whether the given point with coordinates x and y lies on the edge or outside the edge.
 void paint(Graphics g)
           
 void setArrowSize(short awidth, short alen)
           
 void setCoords(int x1, int y1, int x2, int y2)
           
 void setLineWidth(short lwidth)
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x1

protected int x1
Stores the bounding polygon for the edge with an arrow.


x2

protected int x2
Stores the bounding polygon for the edge with an arrow.


y1

protected int y1
Stores the bounding polygon for the edge with an arrow.


y2

protected int y2
Stores the bounding polygon for the edge with an arrow.


lineWidth

protected short lineWidth

arrowWidth

protected short arrowWidth

arrowLength

protected short arrowLength

valid

protected boolean valid

ppx

protected int[] ppx

ppy

protected int[] ppy
Constructor Detail

Arrow

public Arrow()

Arrow

public Arrow(int x1,
             int y1,
             int x2,
             int y2,
             short lwidth,
             short awidth,
             short alen)
Method Detail

setCoords

public void setCoords(int x1,
                      int y1,
                      int x2,
                      int y2)

setLineWidth

public void setLineWidth(short lwidth)

setArrowSize

public void setArrowSize(short awidth,
                         short alen)

update

public void update()

paint

public void paint(Graphics g)

contains

public boolean contains(int x,
                        int y)
This method checks whether the given point with coordinates x and y lies on the edge or outside the edge.

Parameters:
x - - x co-ordinate of the point.
y - - y co-ordinate of the point.