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

## Class RoadDesigner

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--javax.swing.JComponent
                        |
                        +--javax.swing.JPanel
                              |
                              +--RoadDesigner

All Implemented Interfaces:
  javax.accessibility.Accessible, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, XMLSerializable

public class RoadDesigner
extends javax.swing.JPanel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ComponentListener, XMLSerializable

See Also:
  Serialized Form

Nested classes inherited from class javax.swing.JPanel
`javax.swing.JPanel.AccessibleJPanel`

Nested classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`java.awt.Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary
`static int` | `APPEND_TO_END_OF_ROAD`
`static int` | `APPEND_TO_START_OF_ROAD`
`static int` | `CLICKED_ON_HANDLE`
`static int` | `CLICKED_ON_JUNCTION`
`static int` | `DELETE`
`static int` | `DONT_DRAW`
`static int` | `DRAG_JUNCTION`
`static int` | `DRAG_LEFT_ROAD_EDGE`
`static int` | `DRAG_RIGHT_ROAD_EDGE`
`static int` | `DRAG_ROAD_HANDLE`
`static int` | `DRAG_ROAD_MIDDLE`
`static int` | `DRAW_INITIAL_ROAD`
`static int` | `DRAW_JUNCTION`
`static int` | `DRAW_ROAD`
`static int` | `gridSize`
`static int` | `NO_MODE`
`protected java.awt.BasicStroke` | `normal`
`static int` | `ORIENTATION`
`protected Main` | `parent`
`static int` | `SELECT`

Fields inherited from class javax.swing.JComponent
`accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`RoadDesigner(Main parent)`

Method Summary
`void` | `clear()`
`java.util.Vector` | `clipAllRoads()`
`void` | `componentHidden(java.awt.event.ComponentEvent e)`
`void` | `componentMoved(java.awt.event.ComponentEvent e)`
`void` | `componentResized(java.awt.event.ComponentEvent e)`
`void` | `componentShown(java.awt.event.ComponentEvent e)`
`void` | `drawAllNeatenedRoads(java.awt.Graphics2D offgraphics)`
`java.util.Vector` | `getAllJunctions()`
`java.awt.Image` | `getbackdrop()`
`int` | `getjunctionID(java.awt.geom.Point2D p)`
`int` | `getjunctionSide(java.awt.geom.Point2D p)`
`java.awt.Dimension` | `getPreferredSize()`
`Road` | `getRoad(int roadIndex)`
`java.awt.image.BufferedImage` | `getUnknownJunctionTexture()`
`java.lang.String` | `getXMLName()`
`void` | `loadChilds(XMLLoader loader)`
`void` | `loadSelf(XMLElement element)`
`void` | `mouseClicked(java.awt.event.MouseEvent e)`
`void` | `mouseDragged(java.awt.event.MouseEvent e)`
`void` | `mouseEntered(java.awt.event.MouseEvent e)`
`void` | `mouseExited(java.awt.event.MouseEvent e)`
`void` | `mouseMoved(java.awt.event.MouseEvent e)`
`void` | `mousePressed(java.awt.event.MouseEvent e)`
`void` | `mouseReleased(java.awt.event.MouseEvent e)`
`void` | `paint(java.awt.Graphics g)` Uses doublebuffering to repaint the Drawpanel.
`void` | `refreshCanvass()`
`void` | `resetSelectedStuff()`
`void` | `saveChilds(XMLSaver saver)`
`XMLElement` | `saveSelf()`
`void` | `setBackBuffer(java.awt.Graphics2D g2d)` The backbuffer contains all roads except the current one.
`void` | `setBackDrop()`
`void` | `setDeleteMode()`
`void` | `setDrawJunctionMode()`
`void` | `setDrawRoadMode()`
`void` | `setOrientationMode()`
`void` | `setSelectMode()`
`boolean` | `testWheatherPointInDrawingArea(java.awt.geom.Point2D p)`
`boolean` | `testWheatherPointInJunction(java.awt.geom.Point2D p)`

Methods inherited from class javax.swing.JPanel
`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setLocale, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle`

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

Field Detail

### APPEND_TO_START_OF_ROAD

    public static final int APPEND_TO_START_OF_ROAD

### APPEND_TO_END_OF_ROAD

    public static final int APPEND_TO_END_OF_ROAD

### CLICKED_ON_HANDLE

    public static final int CLICKED_ON_HANDLE

### DRAG_ROAD_HANDLE

    public static final int DRAG_ROAD_HANDLE

### CLICKED_ON_JUNCTION

    public static final int CLICKED_ON_JUNCTION

### DRAG_JUNCTION

    public static final int DRAG_JUNCTION

### DONT_DRAW

    public static final int DONT_DRAW

### NO_MODE

    public static final int NO_MODE

### DRAW_INITIAL_ROAD

    public static final int DRAW_INITIAL_ROAD

### DRAG_LEFT_ROAD_EDGE

    public static final int DRAG_LEFT_ROAD_EDGE

### DRAG_RIGHT_ROAD_EDGE

    public static final int DRAG_RIGHT_ROAD_EDGE

### DRAG_ROAD_MIDDLE

    public static final int DRAG_ROAD_MIDDLE

### SELECT

    public static final int SELECT

### DRAW_ROAD

    public static final int DRAW_ROAD

### DELETE

    public static final int DELETE

### DRAW_JUNCTION

    public static final int DRAW_JUNCTION

### ORIENTATION

    public static final int ORIENTATION

### normal

    protected java.awt.BasicStroke normal

### gridSize

    public static final int gridSize

### parent

    protected Main parent

Constructor Detail

### RoadDesigner

    public RoadDesigner(Main parent)

Method Detail

### setBackDrop

    public void setBackDrop()

### getPreferredSize

    public java.awt.Dimension getPreferredSize()

  Overrides:
    `getPreferredSize` in class `javax.swing.JComponent`

### mousePressed

    public void mousePressed(java.awt.event.MouseEvent e)

  Specified by:
    `mousePressed` in interface `java.awt.event.MouseListener`

### mouseReleased

    public void mouseReleased(java.awt.event.MouseEvent e)

  Specified by:
    `mouseReleased` in interface `java.awt.event.MouseListener`

### mouseDragged

    public void mouseDragged(java.awt.event.MouseEvent e)

  Specified by:
    `mouseDragged` in interface `java.awt.event.MouseMotionListener`

### mouseMoved

    public void mouseMoved(java.awt.event.MouseEvent e)

  Specified by:
    `mouseMoved` in interface `java.awt.event.MouseMotionListener`

### mouseClicked

    public void mouseClicked(java.awt.event.MouseEvent e)

  Specified by:
    `mouseClicked` in interface `java.awt.event.MouseListener`

### mouseEntered

    public void mouseEntered(java.awt.event.MouseEvent e)

  Specified by:
    `mouseEntered` in interface `java.awt.event.MouseListener`

### mouseExited

    public void mouseExited(java.awt.event.MouseEvent e)

  Specified by:
    `mouseExited` in interface `java.awt.event.MouseListener`

### componentHidden

    public void componentHidden(java.awt.event.ComponentEvent e)

  Specified by:
    `componentHidden` in interface `java.awt.event.ComponentListener`

### componentMoved

    public void componentMoved(java.awt.event.ComponentEvent e)

  Specified by:
    `componentMoved` in interface `java.awt.event.ComponentListener`

### componentResized

    public void componentResized(java.awt.event.ComponentEvent e)

  Specified by:
    `componentResized` in interface `java.awt.event.ComponentListener`

### componentShown

    public void componentShown(java.awt.event.ComponentEvent e)

  Specified by:
    `componentShown` in interface `java.awt.event.ComponentListener`

### paint

    public void paint(java.awt.Graphics g)

  Uses doublebuffering to repaint the Drawpanel.
  Overrides:
    `paint` in class `javax.swing.JComponent`

### setBackBuffer

    public void setBackBuffer(java.awt.Graphics2D g2d)

  The backbuffer contains all roads except the current one.

### testWheatherPointInDrawingArea

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

### testWheatherPointInJunction

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

### getUnknownJunctionTexture

    public java.awt.image.BufferedImage getUnknownJunctionTexture()

### getRoad

    public Road getRoad(int roadIndex)

### getjunctionSide

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

### clipAllRoads

    public java.util.Vector clipAllRoads()

### drawAllNeatenedRoads

    public void drawAllNeatenedRoads(java.awt.Graphics2D offgraphics)

### getAllJunctions

    public java.util.Vector getAllJunctions()

### resetSelectedStuff

    public void resetSelectedStuff()

### setSelectMode

    public void setSelectMode()

### clear

    public void clear()

### setDrawRoadMode

    public void setDrawRoadMode()

### setDrawJunctionMode

    public void setDrawJunctionMode()

### setDeleteMode

    public void setDeleteMode()

### setOrientationMode

    public void setOrientationMode()

### getjunctionID

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

### getbackdrop

    public java.awt.Image getbackdrop()

### 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`

### refreshCanvass

    public void refreshCanvass()

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