endrov.typeNetwork
Class NetworkImageTool

java.lang.Object
  extended by endrov.typeNetwork.NetworkImageTool
All Implemented Interfaces:
GeneralTool, Viewer2DTool, java.awt.event.ActionListener, java.util.EventListener

public class NetworkImageTool
extends java.lang.Object
implements Viewer2DTool, java.awt.event.ActionListener

Make and edit networks


Field Summary
static java.util.Vector<NetworkTracerFactory> tracers
           
 boolean useAuto
           
 
Constructor Summary
NetworkImageTool(Viewer2DWindow w, NetworkImageRenderer r)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void deselected()
          Called when the tool has been deselected
 java.lang.Integer getClosestPointID(Network.NetworkFrame nf, javax.vecmath.Vector3d curPos)
           
 javax.swing.JMenuItem getMenuItem()
          Get the menu item to be placed in the tools menu
 NetworkTracerInterface getTracer(EvStack stack, Network.NetworkFrame nf)
          Get the automatic tracer and ensure it is up to date.
 boolean hasTracer()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e, java.awt.Component invoker)
           
 void mouseClickedManual(java.awt.event.MouseEvent e, java.awt.Component invoker)
           
 void mouseClickedTrace(java.awt.event.MouseEvent e, java.awt.Component invoker)
           
 void mouseDragged(java.awt.event.MouseEvent e, int dx, int dy)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e, int dx, int dy)
           
 void mouseMovedManual(java.awt.event.MouseEvent e, int dx, int dy)
           
 void mouseMovedTrace(java.awt.event.MouseEvent e, int dx, int dy)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mousePressedManual(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paintComponent(java.awt.Graphics g)
           
 void recalcTrace(java.awt.event.MouseEvent e)
          Calculate preview points.
 void removeTracer()
          Remove tracer and associated memory
 void setForcedStartingPointXYZ(Maybe<javax.vecmath.Vector3d> v)
           
 boolean storeEditingPoint()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useAuto

public boolean useAuto

tracers

public static java.util.Vector<NetworkTracerFactory> tracers
Constructor Detail

NetworkImageTool

public NetworkImageTool(Viewer2DWindow w,
                        NetworkImageRenderer r)
Method Detail

hasTracer

public boolean hasTracer()

setForcedStartingPointXYZ

public void setForcedStartingPointXYZ(Maybe<javax.vecmath.Vector3d> v)

getTracer

public NetworkTracerInterface getTracer(EvStack stack,
                                        Network.NetworkFrame nf)
Get the automatic tracer and ensure it is up to date. If no tracer is enabled then returns null


removeTracer

public void removeTracer()
Remove tracer and associated memory


recalcTrace

public void recalcTrace(java.awt.event.MouseEvent e)
Calculate preview points. This should only be done when the mouse moves as the window might be redrawn for other reasons

Parameters:
e -

getMenuItem

public javax.swing.JMenuItem getMenuItem()
Description copied from interface: Viewer2DTool
Get the menu item to be placed in the tools menu

Specified by:
getMenuItem in interface Viewer2DTool

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

deselected

public void deselected()
Description copied from interface: Viewer2DTool
Called when the tool has been deselected

Specified by:
deselected in interface Viewer2DTool

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e,
                         java.awt.Component invoker)
Specified by:
mouseClicked in interface GeneralTool

mouseClickedManual

public void mouseClickedManual(java.awt.event.MouseEvent e,
                               java.awt.Component invoker)

mouseClickedTrace

public void mouseClickedTrace(java.awt.event.MouseEvent e,
                              java.awt.Component invoker)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e,
                         int dx,
                         int dy)
Specified by:
mouseDragged in interface GeneralTool

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface GeneralTool

mousePressedManual

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

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface GeneralTool

storeEditingPoint

public boolean storeEditingPoint()

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e,
                       int dx,
                       int dy)
Specified by:
mouseMoved in interface GeneralTool

getClosestPointID

public java.lang.Integer getClosestPointID(Network.NetworkFrame nf,
                                           javax.vecmath.Vector3d curPos)

mouseMovedManual

public void mouseMovedManual(java.awt.event.MouseEvent e,
                             int dx,
                             int dy)

mouseMovedTrace

public void mouseMovedTrace(java.awt.event.MouseEvent e,
                            int dx,
                            int dy)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface GeneralTool

paintComponent

public void paintComponent(java.awt.Graphics g)
Specified by:
paintComponent in interface GeneralTool

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface GeneralTool

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface GeneralTool