pipe.dataLayer
Class ArcPath

java.lang.Object
  extended by pipe.dataLayer.ArcPath
All Implemented Interfaces:
java.awt.Shape, java.lang.Cloneable, Constants

public class ArcPath
extends java.lang.Object
implements java.awt.Shape, java.lang.Cloneable, Constants


Field Summary
 
Fields inherited from interface pipe.gui.Constants
ADDTOKEN, ANIMATE, ANNOTATION, ANNOTATION_DEFAULT_FONT, ANNOTATION_DEFAULT_FONT_SIZE, ANNOTATION_LAYER_OFFSET, ANNOTATION_MIN_WIDTH, ANNOTATION_SIZE_OFFSET, ARC, ARC_CONTROL_POINT_CONSTANT, ARC_LAYER_OFFSET, ARC_PATH_PROXIMITY_WIDTH, ARC_PATH_SELECTION_WIDTH, ARC_POINT_LAYER_OFFSET, CLASS_FILE_DESC, CLASS_FILE_EXTENSION, CREATING, DEFAULT_ELEMENT_TYPE, DELETE, DELTOKEN, DRAG, DRAW, ELEMENT_FILL_COLOUR, ELEMENT_LINE_COLOUR, ENABLED_TRANSITION_COLOUR, FIRE, GRID, IMMTRANS, LOWEST_LAYER_OFFSET, NOTE_DISABLED_COLOUR, NOTE_EDITING_COLOUR, PLACE, PLACE_TRANSITION_HEIGHT, PLACE_TRANSITION_LAYER_OFFSET, PLACE_TRANSITION_PROXIMITY_RADIUS, PROPERTY_FILE_DESC, PROPERTY_FILE_EXTENSION, RANDOM, RESERVED_BORDER, RESIZE_POINT_DOWN_COLOUR, SELECT, SELECTION_FILL_COLOUR, SELECTION_LAYER_OFFSET, SELECTION_LINE_COLOUR, START, STEPBACKWARD, STEPFORWARD, STOP, TIMEDTRANS
 
Constructor Summary
ArcPath(Arc a)
           
 
Method Summary
 void addPoint()
           
 void addPoint(double x, double y, boolean type)
           
 void addPoint(float x, float y, boolean type)
           
 void addPointsToGui(GuiView editWindow)
           
 pipe.dataLayer.Cubic[] calcNaturalCubic(int n, int[] x)
           
 boolean contains(double arg0, double arg1)
           
 boolean contains(double arg0, double arg1, double arg2, double arg3)
           
 boolean contains(java.awt.geom.Point2D p)
           
 boolean contains(java.awt.geom.Rectangle2D arg0)
           
 void createPath()
           
 void delete()
           
 void deletePoint(ArcPathPoint a)
           
 void deselectPoint(int index)
           
 Arc getArc()
           
 java.lang.String[][] getArcPathDetails()
           
 java.awt.geom.GeneralPath getArcSelection()
           
 java.awt.Rectangle getBounds()
           
 java.awt.geom.Rectangle2D getBounds2D()
           
 double getEndAngle()
           
 int getEndIndex()
           
 int getNumPoints()
           
 java.awt.geom.GeneralPath getPath()
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform arg0)
           
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform arg0, double arg1)
           
 ArcPathPoint getPathPoint(int index)
           
 java.awt.geom.Point2D.Float getPoint(int index)
           
 java.awt.geom.GeneralPath getPointSelection()
           
 double getStartAngle()
           
 void hidePoints()
           
 void insertPoint(int index, ArcPathPoint newpoint)
          insertPoint() Inserts a new point into the Array List of path points at the specified index and shifts all the following points along
 boolean intersects(double arg0, double arg1, double arg2, double arg3)
           
 boolean intersects(java.awt.geom.Rectangle2D r)
           
 boolean isPointSelected(int index)
           
 boolean proximityContains(java.awt.geom.Point2D p)
           
 boolean proximityIntersects(java.awt.geom.Rectangle2D r)
           
 void purgePathPoints()
           
 void selectPoint(int index)
           
 void setFinalPointType(boolean type)
           
 void setPointLocation(int index, double x, double y)
           
 void setPointLocation(int index, java.awt.geom.Point2D.Double point)
           
 void setPointType(int index, boolean type)
           
 void setPointVisibilityLock(boolean lock)
           
 void setTransitionAngle(int angle)
           
 void showPoints()
           
 void splitSegment(java.awt.geom.Point2D.Float mouseposition)
          splitSegment() Goes through neighbouring pairs of ArcPathPoints determining the midpoint between them.
 void togglePointType(int index)
           
 void translatePoint(int index, float x, float y)
           
 void updateArc()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcPath

public ArcPath(Arc a)
Method Detail

createPath

public void createPath()

getPath

public java.awt.geom.GeneralPath getPath()

getArcSelection

public java.awt.geom.GeneralPath getArcSelection()

getPointSelection

public java.awt.geom.GeneralPath getPointSelection()

addPoint

public void addPoint(float x,
                     float y,
                     boolean type)

addPoint

public void addPoint(double x,
                     double y,
                     boolean type)

addPoint

public void addPoint()

deletePoint

public void deletePoint(ArcPathPoint a)

updateArc

public void updateArc()

translatePoint

public void translatePoint(int index,
                           float x,
                           float y)

contains

public boolean contains(double arg0,
                        double arg1)
Specified by:
contains in interface java.awt.Shape

getEndIndex

public int getEndIndex()

setPointLocation

public void setPointLocation(int index,
                             double x,
                             double y)

setPointLocation

public void setPointLocation(int index,
                             java.awt.geom.Point2D.Double point)

setPointType

public void setPointType(int index,
                         boolean type)

setFinalPointType

public void setFinalPointType(boolean type)

togglePointType

public void togglePointType(int index)

isPointSelected

public boolean isPointSelected(int index)

selectPoint

public void selectPoint(int index)

deselectPoint

public void deselectPoint(int index)

getNumPoints

public int getNumPoints()

getPoint

public java.awt.geom.Point2D.Float getPoint(int index)

getPathPoint

public ArcPathPoint getPathPoint(int index)

getArc

public Arc getArc()

showPoints

public void showPoints()

hidePoints

public void hidePoints()

setPointVisibilityLock

public void setPointVisibilityLock(boolean lock)

getEndAngle

public double getEndAngle()

getStartAngle

public double getStartAngle()

contains

public boolean contains(double arg0,
                        double arg1,
                        double arg2,
                        double arg3)
Specified by:
contains in interface java.awt.Shape

intersects

public boolean intersects(double arg0,
                          double arg1,
                          double arg2,
                          double arg3)
Specified by:
intersects in interface java.awt.Shape

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Point2D p)
Specified by:
contains in interface java.awt.Shape

proximityContains

public boolean proximityContains(java.awt.geom.Point2D p)

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Specified by:
getBounds2D in interface java.awt.Shape

contains

public boolean contains(java.awt.geom.Rectangle2D arg0)
Specified by:
contains in interface java.awt.Shape

intersects

public boolean intersects(java.awt.geom.Rectangle2D r)
Specified by:
intersects in interface java.awt.Shape

proximityIntersects

public boolean proximityIntersects(java.awt.geom.Rectangle2D r)

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform arg0)
Specified by:
getPathIterator in interface java.awt.Shape

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform arg0,
                                                  double arg1)
Specified by:
getPathIterator in interface java.awt.Shape

calcNaturalCubic

public pipe.dataLayer.Cubic[] calcNaturalCubic(int n,
                                               int[] x)

addPointsToGui

public void addPointsToGui(GuiView editWindow)

delete

public void delete()

getArcPathDetails

public java.lang.String[][] getArcPathDetails()

purgePathPoints

public void purgePathPoints()

setTransitionAngle

public void setTransitionAngle(int angle)

insertPoint

public void insertPoint(int index,
                        ArcPathPoint newpoint)
insertPoint() Inserts a new point into the Array List of path points at the specified index and shifts all the following points along

Parameters:
index -
newpoint -

splitSegment

public void splitSegment(java.awt.geom.Point2D.Float mouseposition)
splitSegment() Goes through neighbouring pairs of ArcPathPoints determining the midpoint between them. Then calculates the distance from midpoint to the point passed as an argument. The pair of ArcPathPoints resulting in the shortest distance then have an extra point added between them at the midpoint effectively splitting that segment into two.

Parameters:
-