Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class Junction

    java.lang.Object
      |
      +--Junction

All Implemented Interfaces:
  XMLSerializable

public class Junction
extends java.lang.Object
implements XMLSerializable

Field Summary
`static int` | `junctionID`
`int` | `thisJunctionID`

Constructor Summary
`Junction(float nx, float ny, int gridSize, RoadDesigner parent)`

Method Summary
`void` | `attachRoad(int roadID, int side, boolean isStart)`
`void` | `changeLocation(float newX, float newY)`
`void` | `changeType()`
`boolean` | `contains(java.awt.geom.Point2D p)`
`void` | `dettachRoad(int roadID)`
`void` | `drawHandledJunction(java.awt.Graphics2D g2d)`
`void` | `drawSimpleJunction(java.awt.Graphics2D g2d)`
`void` | `drawSimpleJunction(java.awt.Graphics2D g2d, float[] x, float[] y, java.awt.Shape s)`
`int` | `getClosestNotEmptySide(java.awt.geom.Point2D closestPoint)`
`java.awt.geom.Line2D` | `getEastSide()`
`int` | `getFirstDir(java.awt.geom.GeneralPath path, int index)`
`int` | `getFirstIndex(java.awt.geom.GeneralPath p)`
`java.awt.geom.Point2D` | `getFirstIntersection(java.awt.geom.GeneralPath path, int index)`
`int` | `getFirstNonEmptyDir(java.awt.geom.GeneralPath path, int index)`
`int` | `getID()`
`int` | `getJunctionSide(java.awt.geom.Point2D p)`
`int` | `getLastDir(java.awt.geom.GeneralPath path, int index1, int index2)`
`int` | `getLastIndex(java.awt.geom.GeneralPath p, int pos)`
`java.awt.geom.Point2D` | `getLastIntersection(java.awt.geom.GeneralPath path, int index1, int index2)`
`int` | `getLastNonEmptyDir(java.awt.geom.GeneralPath path, int index1, int index2)`
`java.awt.geom.Point2D` | `getMidPointsCenter()`
`static java.lang.String` | `getName(int type)`
`java.awt.geom.Line2D` | `getNorthSide()`
`int` | `getPriority(int index)`
`java.awt.Shape` | `getShape()`
`java.awt.image.BufferedImage` | `getSignalledJunctionTexture()`
`java.awt.geom.Line2D` | `getSouthSide()`
`int` | `getType()`
`java.awt.geom.Line2D` | `getWestSide()`
`java.lang.String` | `getXMLName()`
`boolean` | `intersects(java.awt.geom.Point2D p)`
`void` | `loadChilds(XMLLoader loader)`
`void` | `loadSelf(XMLElement element)`
`void` | `rePositionAttachedRoads()`
`void` | `rotate(double newAngle)`
`void` | `rotateToMatchOnlyRoad()`
`void` | `saveChilds(XMLSaver saver)`
`XMLElement` | `saveSelf()`
`void` | `setShape()`
`void` | `snapAttachedRoadsToGrid()`
`boolean` | `testToAttach(java.awt.geom.Point2D roadStart, java.awt.geom.Point2D roadEnd, int roadID)`
`void` | `updateAttachedRoadShapes()`
`void` | `updateJunctionLook()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### junctionID

    public static int junctionID

### thisJunctionID

    public int thisJunctionID

Constructor Detail

### Junction

    public Junction(float nx,
                    float ny,
                    int gridSize,
                    RoadDesigner parent)

Method Detail

### getName

    public static java.lang.String getName(int type)

### drawHandledJunction

    public void drawHandledJunction(java.awt.Graphics2D g2d)

### drawSimpleJunction

    public void drawSimpleJunction(java.awt.Graphics2D g2d)

### drawSimpleJunction

    public void drawSimpleJunction(java.awt.Graphics2D g2d,
                                   float[] x,
                                   float[] y,
                                   java.awt.Shape s)

### getID

    public int getID()

### getShape

    public java.awt.Shape getShape()

### getType

    public int getType()

### getPriority

    public int getPriority(int index)

### getNorthSide

    public java.awt.geom.Line2D getNorthSide()

### getEastSide

    public java.awt.geom.Line2D getEastSide()

### getSouthSide

    public java.awt.geom.Line2D getSouthSide()

### getWestSide

    public java.awt.geom.Line2D getWestSide()

### getJunctionSide

    public int getJunctionSide(java.awt.geom.Point2D p)

### getMidPointsCenter

    public java.awt.geom.Point2D getMidPointsCenter()

### getClosestNotEmptySide

    public int getClosestNotEmptySide(java.awt.geom.Point2D closestPoint)

### contains

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

### intersects

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

### testToAttach

    public boolean testToAttach(java.awt.geom.Point2D roadStart,
                                java.awt.geom.Point2D roadEnd,
                                int roadID)

### attachRoad

    public void attachRoad(int roadID,
                           int side,
                           boolean isStart)

### dettachRoad

    public void dettachRoad(int roadID)

### updateJunctionLook

    public void updateJunctionLook()

### snapAttachedRoadsToGrid

    public void snapAttachedRoadsToGrid()

### rePositionAttachedRoads

    public void rePositionAttachedRoads()

### updateAttachedRoadShapes

    public void updateAttachedRoadShapes()

### setShape

    public void setShape()

### rotate

    public void rotate(double newAngle)

### rotateToMatchOnlyRoad

    public void rotateToMatchOnlyRoad()

### changeLocation

    public void changeLocation(float newX,
                               float newY)

### changeType

    public void changeType()

### getSignalledJunctionTexture

    public java.awt.image.BufferedImage getSignalledJunctionTexture()

### getXMLName

    public java.lang.String getXMLName()

  Specified by:
    `getXMLName` in interface `XMLSerializable`

### saveSelf

    public XMLElement saveSelf()

  Specified by:
    `saveSelf` in interface `XMLSerializable`

### saveChilds

    public void saveChilds(XMLSaver saver)

  Specified by:
    `saveChilds` in interface `XMLSerializable`

### loadSelf

    public void loadSelf(XMLElement element)

  Specified by:
    `loadSelf` in interface `XMLSerializable`

### loadChilds

    public void loadChilds(XMLLoader loader)

  Specified by:
    `loadChilds` in interface `XMLSerializable`

### getFirstIndex

    public int getFirstIndex(java.awt.geom.GeneralPath p)

### getFirstDir

    public int getFirstDir(java.awt.geom.GeneralPath path,
                           int index)

### getFirstIntersection

    public java.awt.geom.Point2D getFirstIntersection(java.awt.geom.GeneralPath path,
                                                      int index)

### getFirstNonEmptyDir

    public int getFirstNonEmptyDir(java.awt.geom.GeneralPath path,
                                   int index)

### getLastIndex

    public int getLastIndex(java.awt.geom.GeneralPath p,
                            int pos)

### getLastDir

    public int getLastDir(java.awt.geom.GeneralPath path,
                          int index1,
                          int index2)

### getLastIntersection

    public java.awt.geom.Point2D getLastIntersection(java.awt.geom.GeneralPath path,
                                                     int index1,
                                                     int index2)

### getLastNonEmptyDir

    public int getLastNonEmptyDir(java.awt.geom.GeneralPath path,
                                  int index1,
                                  int index2)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD