Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

phoebe.util
Class PEdgeEndIcon  view PEdgeEndIcon download PEdgeEndIcon.java

java.lang.Object
  extended byPPath
      extended byphoebe.util.PEdgeEndIcon
Direct Known Subclasses:
PArrowIcon, PCircleIcon, PDiamondIcon, PTIcon

public class PEdgeEndIcon
extends PPath

Base class that encapsulates some of the basic functionality needed to draw an icon. This class should be extended by any new icon. If this class is instantiated directly, it will not draw anything and will not appear in any way on the screen.


Field Summary
protected  double lineLen
          The length of the edge.
protected  double newX
          The new X position for the end of the edge.
protected  double newY
          The new X position for the end of the edge.
protected  java.awt.geom.Point2D source
          The source node point.
protected  java.awt.geom.Point2D target
          The target node point.
 
Constructor Summary
PEdgeEndIcon(java.awt.geom.Point2D s, java.awt.geom.Point2D t)
          Constructor.
 
Method Summary
protected  void calcLineLen()
          Calculates the length of the edge using the pythagorean theorem.
 void drawIcon(java.awt.geom.Point2D s, java.awt.geom.Point2D t)
          Draws the icon.
 double getNewX()
          Returns the new X position of the updated end point of the edge.
 double getNewY()
          Returns the new Y position of the updated end point of the edge.
protected  void paint(PPaintContext paintContext)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected java.awt.geom.Point2D source
The source node point.


target

protected java.awt.geom.Point2D target
The target node point. The icon is always drawn at the this point. To draw the icon at the opposite node, instantiate the child class with the nodes swapped.


newX

protected double newX
The new X position for the end of the edge. Since we don't (usually) want the edge as it is currently drawn to be drawn through the icon, we have to adjust the endpoint of the edge to accomodate the icon. This point must be updated (usually by drawIcon) when the icon gets drawn.


newY

protected double newY
The new X position for the end of the edge. Since we don't (usually) want the edge as it is currently drawn to be drawn through the icon, we have to adjust the endpoint of the edge to accomodate the icon. This point must be updated (usually by drawIcon) when the icon gets drawn.


lineLen

protected double lineLen
The length of the edge.

Constructor Detail

PEdgeEndIcon

public PEdgeEndIcon(java.awt.geom.Point2D s,
                    java.awt.geom.Point2D t)
Constructor.

Method Detail

drawIcon

public void drawIcon(java.awt.geom.Point2D s,
                     java.awt.geom.Point2D t)
Draws the icon. This method should be overridden by any child class to actually draw the icon.


calcLineLen

protected void calcLineLen()
Calculates the length of the edge using the pythagorean theorem.


getNewX

public double getNewX()
Returns the new X position of the updated end point of the edge. Since we don't (usually) want the edge as it is currently drawn to be drawn through the icon, we have to adjust the endpoint of the edge to accomodate the icon.


getNewY

public double getNewY()
Returns the new Y position of the updated end point of the edge. Since we don't (usually) want the edge as it is currently drawn to be drawn through the icon, we have to adjust the endpoint of the edge to accomodate the icon.


paint

protected void paint(PPaintContext paintContext)

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).