psdi.webclient.applet.wfcanvas.diagram

Class Line

  • java.lang.Object
    • psdi.webclient.applet.wfcanvas.diagram.Line
  • All Implemented Interfaces:
    java.lang.Comparable


    public class Line
    extends java.lang.Object
    implements java.lang.Comparable
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected static int CLOSE
      Distance in pixels to be close to the line
      protected static int HORIZONTAL 
      protected static int OTHER 
      protected DiagramWorkflowRelationship rel 
      protected int type 
      protected static int VERTICAL 
      protected int x1 
      protected int x2 
      protected int y1 
      protected int y2 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compareTo(java.lang.Object o)
      Compares 2 relationships for the Comparable interface
      DiagramWorkflowRelationship getRelationship()
      Returns the relationship
      int getType()
      Returns the line type
      java.awt.Point intersect(Line line)
      Returns the intersets point of 2 lines
      boolean isClose(java.awt.Point point)
      Returns true if the point is close to the line
      boolean overlap(Line line)
      Returns whether or not the 2 lines overlap
      java.lang.String toString()
      Returns the string representation of the line
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Line

        public Line(DiagramWorkflowRelationship rel,
                    int x1,
                    int y1,
                    int x2,
                    int y2)
        Constructs a line
        Parameters:
        rel - The workflow realtionship the line belongs to
        x1 - The starting x-ccordinate
        y1 - The starting y-ccordinate
        x2 - The ending x-ccordinate
        y2 - The ending x-ccordinate
    • Method Detail

      • getType

        public int getType()
        Returns the line type
        Returns:
        The line type - HORIZONTAL,VERTICAL or OTHER
      • compareTo

        public int compareTo(java.lang.Object o)
        Compares 2 relationships for the Comparable interface
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        o - The object to compare to
        Returns:
        negative value if less than passed object,zero if equals and positive value if greater
      • isClose

        public boolean isClose(java.awt.Point point)
        Returns true if the point is close to the line
        Parameters:
        point - The point to test
        Returns:
        true if close (within 2 pixels) false otherwise
      • overlap

        public boolean overlap(Line line)
        Returns whether or not the 2 lines overlap
        Parameters:
        line - The line to find overlap with
        Returns:
        True if overlap false otherwise
      • intersect

        public java.awt.Point intersect(Line line)
        Returns the intersets point of 2 lines
        Parameters:
        line - The line to find intersection with
        Returns:
        The intersection point or null if no intersection
      • toString

        public java.lang.String toString()
        Returns the string representation of the line
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation