exe
Class VisEdge

java.lang.Object
  extended by exe.VisEdge
Direct Known Subclasses:
Edge

public class VisEdge
extends java.lang.Object

This class maintains the information for a single edge in the VisualGraph data structure. A VisEdge object contains color, weight, and position information, as well as keeping track of whether it is active in a VisualGraph or should be hidden when the VisualGraph is displayed.

In order to use any of these graph classes in a script-producing program, the script-producing program must import the package exe.

Author:
Jeff Lucas (original author), Richard Teviotdale (GAIGS adaptations and additions), Andrew Jungwirth (more GAIGS adaptations and Javadoc comments)

Constructor Summary
VisEdge()
          Constructs a new VisEdge with default information.
VisEdge(java.lang.String color, double sx, double sy, double ex, double ey)
          Constructs a new VisEdge by specifying its hexadecimal color String and the Cartesian coordinates for its starting and ending points.
 
Method Summary
 void activate()
          Sets this VisEdge to active, meaning that it will be displayed when the VisualGraph to which it belongs is displayed.
 void clearEdge()
          Resets this VisEdge's data members to their default values.
 void deactivate()
          Sets this VisEdge to inactive, meaning that it will not be displayed when the VisualGraph to which it belongs is displayed.
 double getEX()
          Returns the Cartesian x-coordinate in [0,1] space for the ending point of this VisEdge.
 double getEY()
          Returns the Cartesian y-coordinate in [0,1] space for the ending point of this VisEdge.
 java.lang.String getHexColor()
          Gives the hexadecimal String that defines the color for this VisEdge.
 double getSX()
          Gives the Cartesian x-coordinate in [0,1] space of the starting point for this VisEdge.
 double getSY()
          Gives the Cartesian y-coordinate in [0,1] space of the starting point for this VisEdge.
 double getWeight()
          Returns the weight for this VisEdge.
 boolean isActivated()
          Gives the current activation status of this VisEdge in a VisualGraph.
 void setEX(double m_ex)
          Sets the Cartesian x-coordinate in [0,1] space for the ending point of this VisEdge.
 void setEY(double m_ey)
          Sets the Cartesian y-coordinate in [0,1] space for the ending point of this VisEdge.
 void setHexColor(java.lang.String c)
          Sets the color of this VisEdge.
 void setSX(double m_sx)
          Assigns the Cartesian x-coordinate in [0,1] space for the starting point of this VisEdge.
 void setSY(double m_sy)
          Assigns the Cartesian y-coordinate in [0,1] space for the starting point of this VisEdge.
 void setWeight(double my_w)
          Assigns a weight to this VisEdge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisEdge

public VisEdge()
Constructs a new VisEdge with default information.


VisEdge

public VisEdge(java.lang.String color,
               double sx,
               double sy,
               double ex,
               double ey)
Constructs a new VisEdge by specifying its hexadecimal color String and the Cartesian coordinates for its starting and ending points.

All other data members are assigned default values and must be set with the corresponding method calls. This newly constructed VisNode is inactive until the activate method is called.

Parameters:
color - Gives the hexadecimal String of the form #123456 that defines the color for this VisEdge.
sx - Indicates the Cartesian x-coordinate in [0,1] space for the starting point of this VisEdge.
sy - Indicates the Cartesian y-coordinate in [0,1] space for the starting point of this VisEdge.
ex - Specifies the Cartesian x-coordinate in [0,1] space for the ending point of this VisEdge.
ey - Specifies the Cartesian y-coordinate in [0,1] space for the ending point of this VisEdge.
Method Detail

clearEdge

public void clearEdge()
Resets this VisEdge's data members to their default values.


getHexColor

public java.lang.String getHexColor()
Gives the hexadecimal String that defines the color for this VisEdge.

Returns:
Yields a String of the form #123456.

getWeight

public double getWeight()
Returns the weight for this VisEdge.

Returns:
Gives the value stored in weight.

getSX

public double getSX()
Gives the Cartesian x-coordinate in [0,1] space of the starting point for this VisEdge.

Returns:
Yields the x-coordinate for the starting point of this VisEdge.

getSY

public double getSY()
Gives the Cartesian y-coordinate in [0,1] space of the starting point for this VisEdge.

Returns:
Yields the y-coordinate for the starting point of this VisEdge.

getEX

public double getEX()
Returns the Cartesian x-coordinate in [0,1] space for the ending point of this VisEdge.

Returns:
Gives the x-coordinate for the ending point of this VisEdge.

getEY

public double getEY()
Returns the Cartesian y-coordinate in [0,1] space for the ending point of this VisEdge.

Returns:
Gives the y-coordinate for the ending point of this VisEdge.

isActivated

public boolean isActivated()
Gives the current activation status of this VisEdge in a VisualGraph.

Returns:
Yields a value of true if this VisEdge is a part of the VisualGraph and should be displayed or false if it should not be displayed.

setHexColor

public void setHexColor(java.lang.String c)
Sets the color of this VisEdge.

Parameters:
c - Indicates the color of this VisEdge when it is displayed. The value must be a six-digit hexadecimal color String of the form #123456.

setWeight

public void setWeight(double my_w)
Assigns a weight to this VisEdge.

Parameters:
my_w - Indicates the weight for this VisEdge.

setSX

public void setSX(double m_sx)
Assigns the Cartesian x-coordinate in [0,1] space for the starting point of this VisEdge.

Parameters:
m_sx - Indicates the new x-coordinate for the starting point of this VisEdge.

setSY

public void setSY(double m_sy)
Assigns the Cartesian y-coordinate in [0,1] space for the starting point of this VisEdge.

Parameters:
m_sy - Indicates the new y-coordinate for the starting point of this VisEdge.

setEX

public void setEX(double m_ex)
Sets the Cartesian x-coordinate in [0,1] space for the ending point of this VisEdge.

Parameters:
m_ex - Specifies the new x-coordinate for the ending point of this VisEdge.

setEY

public void setEY(double m_ey)
Sets the Cartesian y-coordinate in [0,1] space for the ending point of this VisEdge.

Parameters:
m_ey - Specifies the new y-coordinate for the ending point of this VisEdge.

activate

public void activate()
Sets this VisEdge to active, meaning that it will be displayed when the VisualGraph to which it belongs is displayed.


deactivate

public void deactivate()
Sets this VisEdge to inactive, meaning that it will not be displayed when the VisualGraph to which it belongs is displayed.