org.jscience.architecture.traffic.tools
Class EdgeNodeTool

java.lang.Object
  extended by org.jscience.architecture.traffic.tools.EdgeNodeTool
All Implemented Interfaces:
Overlay, Tool

public class EdgeNodeTool
extends java.lang.Object
implements Tool

Tool to set spawning and destination frequencies. A little HOW-TO: - Open infrastructure in GLDsim. - Select 'Edge configuration' tool. - Click on an EdgeNode to select it. - Right-click anywhere on the view to deselect. - Select a roaduser type from the dropdown box in the toolbar if you like. - To change spawning frequency (for currently selected roaduser type): - Left-click on currently selected EdgeNode (with the magenta rectangle around it). - Hold the mousebutton and drag left to decrease, right to increase the spawning frequency. - To change destination frequencies (for currently selected roaduser type): - When an EdgeNode is selected, you can change the chance for each other EdgeNode that a newly spawned Roaduser will go there. - Left-click on the EdgeNode you want to change the frequency for. - Hold the mousebutton and drag left to decrease, right to increase the destination frequency. // This really works a lot easier than any dialog I could think of. :) //


Nested Class Summary
protected  class EdgeNodeTool.RoaduserPanel
          Panel containing a dropdown box for all concrete Roaduser types.
 
Nested classes/interfaces inherited from interface org.jscience.architecture.traffic.tools.Tool
Tool.Mask
 
Constructor Summary
EdgeNodeTool(Controller c)
          Creates a new EdgeNodeTool.
 
Method Summary
protected  EdgeNode findEdgeNode(java.awt.Point p)
          Returns the EdgeNode at given Point.
protected  Node findNode(java.awt.Point p)
          Returns the EdgeNode at given Point.
 java.awt.Panel getPanel()
          DOCUMENT ME!
 void mouseMoved(View view, java.awt.Point p, Tool.Mask mask)
          DOCUMENT ME!
 void mousePressed(View view, java.awt.Point p, Tool.Mask mask)
          DOCUMENT ME!
 void mouseReleased(View view, java.awt.Point p, Tool.Mask mask)
          DOCUMENT ME!
 int overlayType()
          DOCUMENT ME!
 void paint(java.awt.Graphics g)
          DOCUMENT ME!
 void setEdgeNodes(EdgeNode[] _edges)
          Sets the current set of EdgeNodes.
protected  void setRuType(java.lang.String sel)
          Sets the current roaduser type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeNodeTool

public EdgeNodeTool(Controller c)
Creates a new EdgeNodeTool.

Parameters:
c - The SimController this tool is used in.
Method Detail

setEdgeNodes

public void setEdgeNodes(EdgeNode[] _edges)
Sets the current set of EdgeNodes.

Parameters:
_edges - DOCUMENT ME!

setRuType

protected void setRuType(java.lang.String sel)
Sets the current roaduser type.

Parameters:
sel - Description of the roaduser type to set as current.

mousePressed

public void mousePressed(View view,
                         java.awt.Point p,
                         Tool.Mask mask)
DOCUMENT ME!

Specified by:
mousePressed in interface Tool
Parameters:
view - DOCUMENT ME!
p - DOCUMENT ME!
mask - DOCUMENT ME!

findEdgeNode

protected EdgeNode findEdgeNode(java.awt.Point p)
Returns the EdgeNode at given Point.

Parameters:
p - DOCUMENT ME!
Returns:
DOCUMENT ME!

findNode

protected Node findNode(java.awt.Point p)
Returns the EdgeNode at given Point.

Parameters:
p - DOCUMENT ME!
Returns:
DOCUMENT ME!

mouseReleased

public void mouseReleased(View view,
                          java.awt.Point p,
                          Tool.Mask mask)
DOCUMENT ME!

Specified by:
mouseReleased in interface Tool
Parameters:
view - DOCUMENT ME!
p - DOCUMENT ME!
mask - DOCUMENT ME!

mouseMoved

public void mouseMoved(View view,
                       java.awt.Point p,
                       Tool.Mask mask)
DOCUMENT ME!

Specified by:
mouseMoved in interface Tool
Parameters:
view - DOCUMENT ME!
p - DOCUMENT ME!
mask - DOCUMENT ME!

overlayType

public int overlayType()
DOCUMENT ME!

Specified by:
overlayType in interface Overlay
Returns:
DOCUMENT ME!

paint

public void paint(java.awt.Graphics g)
           throws TrafficException
DOCUMENT ME!

Specified by:
paint in interface Overlay
Parameters:
g - DOCUMENT ME!
Throws:
TrafficException - DOCUMENT ME!

getPanel

public java.awt.Panel getPanel()
DOCUMENT ME!

Specified by:
getPanel in interface Tool
Returns:
DOCUMENT ME!