utils.circuit
Class Segment

java.lang.Object
  extended by utils.circuit.Segment
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
Curve, ObjShapeHandle, ObjShapeTerrain, Straight, XmlObjPits

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

Author:
Patrice Espie , Charalampos Alexopoulos TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Field Summary
protected  int count
           
 double distFromCircuitStart
           
 double endTrackAlpha
           
 java.awt.geom.Point2D.Double endTrackCenter
           
protected  double heightEnd
           
protected  double heightStart
           
protected  SegmentSide left
           
protected  double length
           
protected  java.lang.String name
           
 Segment nextShape
           
 java.awt.geom.Point2D.Double[] points
           
 Segment previousShape
           
protected  double profilStepLength
           
protected  SegmentSide right
           
 double startTrackAlpha
           
 java.awt.geom.Point2D.Double startTrackCenter
           
protected  java.lang.String surface
           
 java.awt.geom.Point2D.Double[] trPoints
           
protected  java.lang.String type
           
 
Constructor Summary
Segment()
           
Segment(java.lang.String type)
           
 
Method Summary
 void addSideListener(SegmentSideListener l)
           
 void calcShape(Segment previousShape)
           
 java.lang.Object clone()
           
 boolean contains(double x, double y)
           
 Segment copyTo(Segment shape)
           
 void drag(java.awt.geom.Point2D.Double dragDelta)
           
 void draw(java.awt.Graphics g, java.awt.geom.AffineTransform affineTransform)
           
 java.awt.geom.Rectangle2D.Double getBounds()
           
 int getCount()
           
 double getDx()
           
 double getDy()
           
 double getHeightEnd()
           
 double getHeightStart()
           
 SegmentSide getLeft()
           
 double getLength()
           
 java.lang.String getName()
           
 java.awt.geom.Point2D.Double[] getPoints()
           
 Segment getPreviousShape()
           
 double getProfilStepLength()
           
 SegmentSide getRight()
           
 java.lang.String getSurface()
           
 java.lang.String getType()
           
 void removeSideListener(java.awt.event.ActionListener l)
           
 void setCount(int count)
           
 void setHeightEnd(double heightEnd)
           
 void setHeightStart(double heightStart)
           
 void setLeft(SegmentSide left)
           
 void setLength(double length)
           
 void setName(java.lang.String name)
           
 void setPoints(java.awt.geom.Point2D.Double[] points)
           
 void setPreviousShape(Segment prev)
           
 void setProfilStepLength(double profilStepLength)
           
 void setRight(SegmentSide right)
           
 void setSurface(java.lang.String surface)
           
 void setType(java.lang.String type)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousShape

public Segment previousShape

nextShape

public Segment nextShape

name

protected java.lang.String name

left

protected SegmentSide left

right

protected SegmentSide right

type

protected java.lang.String type

count

protected int count

startTrackAlpha

public double startTrackAlpha

endTrackAlpha

public double endTrackAlpha

startTrackCenter

public java.awt.geom.Point2D.Double startTrackCenter

endTrackCenter

public java.awt.geom.Point2D.Double endTrackCenter

distFromCircuitStart

public double distFromCircuitStart

profilStepLength

protected double profilStepLength

length

protected double length

surface

protected java.lang.String surface

heightStart

protected double heightStart

heightEnd

protected double heightEnd

points

public java.awt.geom.Point2D.Double[] points

trPoints

public java.awt.geom.Point2D.Double[] trPoints
Constructor Detail

Segment

public Segment()

Segment

public Segment(java.lang.String type)
Method Detail

getLeft

public SegmentSide getLeft()
Returns:
Returns the left.

setLeft

public void setLeft(SegmentSide left)
Parameters:
left - The left to set.

getRight

public SegmentSide getRight()
Returns:
Returns the right.

setRight

public void setRight(SegmentSide right)
Parameters:
right - The right to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

getSurface

public java.lang.String getSurface()
Returns:
Returns the surface.

setSurface

public void setSurface(java.lang.String surface)
Parameters:
surface - The surface to set.

copyTo

public Segment copyTo(Segment shape)
               throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

contains

public boolean contains(double x,
                        double y)

getBounds

public java.awt.geom.Rectangle2D.Double getBounds()

calcShape

public void calcShape(Segment previousShape)
               throws java.lang.Exception
Throws:
java.lang.Exception

draw

public void draw(java.awt.Graphics g,
                 java.awt.geom.AffineTransform affineTransform)

drag

public void drag(java.awt.geom.Point2D.Double dragDelta)

getHeightEnd

public double getHeightEnd()
Returns:
Returns the heightEnd.

setHeightEnd

public void setHeightEnd(double heightEnd)
Parameters:
heightEnd - The heightEnd to set.

getHeightStart

public double getHeightStart()
Returns:
Returns the heightStart.

setHeightStart

public void setHeightStart(double heightStart)
Parameters:
heightStart - The heightStart to set.

getLength

public double getLength()
Returns:
Returns the length.

setLength

public void setLength(double length)
Parameters:
length - The length to set.

getType

public java.lang.String getType()
Returns:
Returns the type.

setType

public void setType(java.lang.String type)
Parameters:
type - The type to set.

getProfilStepLength

public double getProfilStepLength()
Returns:
Returns the profilStepLength.

setProfilStepLength

public void setProfilStepLength(double profilStepLength)
Parameters:
profilStepLength - The profilStepLength to set.

getCount

public int getCount()
Returns:
Returns the count.

setCount

public void setCount(int count)
Parameters:
count - The count to set.

getPreviousShape

public Segment getPreviousShape()
Returns:
Returns the previousShape.

setPreviousShape

public void setPreviousShape(Segment prev)
Parameters:
previousShape - The previousShape to set.

removeSideListener

public void removeSideListener(java.awt.event.ActionListener l)

addSideListener

public void addSideListener(SegmentSideListener l)

clone

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

getPoints

public java.awt.geom.Point2D.Double[] getPoints()
Returns:
Returns the points.

setPoints

public void setPoints(java.awt.geom.Point2D.Double[] points)
Parameters:
points - The points to set.

getDx

public double getDx()
Returns:
Returns the dx.

getDy

public double getDy()
Returns:
Returns the dy.