org.latdraw.diagram
Class Vertex

java.lang.Object
  extended by org.latdraw.diagram.Vertex
All Implemented Interfaces:
java.lang.Cloneable

public class Vertex
extends java.lang.Object
implements java.lang.Cloneable

This holds the position of an element in 3 formats: 3d raw, 3d normalized, and a 2d projection. In the 3d normalized form the z coordinate lies in [0, 1] and the projection to the x-y plane lies in the circle of radius 1/2. Also various force imformation is stored here.


Field Summary
static int AUTOMATIC
          Label positionsr.
static int BOTTOM
           
static int CENTER
           
static int LEFT
           
static int RIGHT
           
static int TOP
           
 
Constructor Summary
Vertex(POElem e)
           
 
Method Summary
 void adjustForce(double dx, double dy)
           
 java.lang.Object clone()
           
static double correlation(java.awt.geom.Point2D pt1, java.awt.geom.Point2D pt2)
           
 java.awt.Color getColor()
           
 java.lang.String getLabel()
           
 java.awt.Color getLabelBackgroundColor()
           
 java.awt.Font getLabelFont()
          May return null in which case the default should be used.
 java.awt.Color getLabelForegroundColor()
           
 int getLabelPosition()
          Get the label position which is one of the constants AUTOMATIC, LEFT, RIGHT, TOP, BOTTOM, or CENTER.
 double getNormalizedX()
           
 double getNormalizedY()
           
 double getNormalizedZ()
           
 double getProjectedX()
           
 double getProjectedY()
           
 java.awt.geom.Point2D getProjection()
           
 POElem getUnderlyingElem()
           
 java.lang.Object getUnderlyingObject()
          Get the underlyingObject (the label) of the underlying POElem.
 java.lang.String getUnderlyingObjectlabel()
           
 double getX()
           
 double getY()
           
 double getZ()
           
 int index()
          The index in the linear extension of the ordered set.
 boolean isFilled()
           
 boolean isHighlighted()
           
 boolean isJoinIrreducible()
           
 boolean isLabelPainted()
           
 boolean isMeetIrreducible()
           
 void project2d(double angle)
           
 void project2d(double cos, double sin)
           
 void reset()
           
 void setColor(java.awt.Color c)
           
 void setFilled(boolean v)
           
 void setHighlighted(boolean v)
           
 void setHorizontalLocationFromDrag(double delta, double angle)
          This is for horizontal movements only.
 void setLabel(java.lang.String v)
           
 void setLabelBackgroundColor(java.awt.Color c)
           
 void setLabelFont(java.awt.Font v)
           
 void setLabelForgeroundColor(java.awt.Color c)
           
 void setLabelPainted(boolean v)
           
 void setLabelPosition(int v)
          Set the label position to be one of the constants AUTOMATIC, LEFT, RIGHT, TOP, BOTTOM, or CENTER.
 void setLocationFromDrag(double deltaH, double deltaV, double angle)
           
protected  void setNormalizedCoords()
           
protected  void setNormalizedCoords(double scaleFactor)
           
 void setUseOrderForLabel(boolean v)
           
 void setX(double v)
           
 void setY(double v)
           
 void setZ(double v)
           
 java.lang.String toString()
           
 void update()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AUTOMATIC

public static final int AUTOMATIC
Label positionsr.

See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values
Constructor Detail

Vertex

public Vertex(POElem e)
Method Detail

getUnderlyingElem

public POElem getUnderlyingElem()

index

public int index()
The index in the linear extension of the ordered set.


setUseOrderForLabel

public void setUseOrderForLabel(boolean v)

isJoinIrreducible

public boolean isJoinIrreducible()

isMeetIrreducible

public boolean isMeetIrreducible()

getLabel

public java.lang.String getLabel()

getUnderlyingObjectlabel

public java.lang.String getUnderlyingObjectlabel()

setLabel

public void setLabel(java.lang.String v)

getLabelPosition

public int getLabelPosition()
Get the label position which is one of the constants AUTOMATIC, LEFT, RIGHT, TOP, BOTTOM, or CENTER.


setLabelPosition

public void setLabelPosition(int v)
Set the label position to be one of the constants AUTOMATIC, LEFT, RIGHT, TOP, BOTTOM, or CENTER.


getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color c)

isFilled

public boolean isFilled()

setFilled

public void setFilled(boolean v)

isHighlighted

public boolean isHighlighted()

setHighlighted

public void setHighlighted(boolean v)

isLabelPainted

public boolean isLabelPainted()

setLabelPainted

public void setLabelPainted(boolean v)

getLabelFont

public java.awt.Font getLabelFont()
May return null in which case the default should be used.


setLabelFont

public void setLabelFont(java.awt.Font v)

getLabelForegroundColor

public java.awt.Color getLabelForegroundColor()

setLabelForgeroundColor

public void setLabelForgeroundColor(java.awt.Color c)

getLabelBackgroundColor

public java.awt.Color getLabelBackgroundColor()

setLabelBackgroundColor

public void setLabelBackgroundColor(java.awt.Color c)

getX

public double getX()

setX

public void setX(double v)

getY

public double getY()

setY

public void setY(double v)

getZ

public double getZ()

setZ

public void setZ(double v)

getNormalizedX

public double getNormalizedX()

getNormalizedY

public double getNormalizedY()

getNormalizedZ

public double getNormalizedZ()

getUnderlyingObject

public java.lang.Object getUnderlyingObject()
Get the underlyingObject (the label) of the underlying POElem.


getProjection

public java.awt.geom.Point2D getProjection()

getProjectedX

public double getProjectedX()

getProjectedY

public double getProjectedY()

reset

public void reset()

update

public void update()

correlation

public static double correlation(java.awt.geom.Point2D pt1,
                                 java.awt.geom.Point2D pt2)

adjustForce

public void adjustForce(double dx,
                        double dy)

setNormalizedCoords

protected void setNormalizedCoords()

setNormalizedCoords

protected void setNormalizedCoords(double scaleFactor)

project2d

public void project2d(double angle)

project2d

public void project2d(double cos,
                      double sin)

setLocationFromDrag

public void setLocationFromDrag(double deltaH,
                                double deltaV,
                                double angle)

setHorizontalLocationFromDrag

public void setHorizontalLocationFromDrag(double delta,
                                          double angle)
This is for horizontal movements only.

Parameters:
delta - the horizontal movement in lat coordiantes in the 2d projection.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 2003 Ralph Freese. All Rights Reserved.