cage.viewer
Class TwoView

java.lang.Object
  extended by cage.viewer.TwoView
All Implemented Interfaces:
CaGeOutlet, CaGeViewer, TwoViewDevice, java.awt.event.ActionListener, java.util.EventListener

public class TwoView
extends java.lang.Object
implements java.awt.event.ActionListener, CaGeViewer, TwoViewDevice


Field Summary
static boolean debug
           
 
Constructor Summary
TwoView()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void beginEdges()
           
 void beginGraph()
           
 void beginVertices()
           
 int getDimension()
          Returns the dimension which is needed for this outlet.
 float getEdgeBrightness()
           
static void main(java.lang.String[] argv)
           
 void outputResult(CaGeResult result)
          Does the actual output of a result.
 void paintEdge(double x1, double y1, double x2, double y2, int v1, int v2)
           
 void paintVertex(double x, double y, int number)
           
 void savePostScript()
           
 void savePSButtonPressed()
           
 void setDimension(int dimension)
          Sets the dimension for which this outlet will be used.
 void setEdgeBrightness(float edgeBrightness)
           
 void setGeneratorInfo(GeneratorInfo generatorInfo)
          Sets the generator info provided for this outlet.
 void setResultPanel(ResultPanel resultPanel)
          Sets the ResultPanel connected with this viewer.
 void setVisible(boolean isVisible)
           
 void stop()
          Called when this outlet is no longer needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Constructor Detail

TwoView

public TwoView()
Method Detail

actionPerformed

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

savePSButtonPressed

public void savePSButtonPressed()

setEdgeBrightness

public void setEdgeBrightness(float edgeBrightness)

getEdgeBrightness

public float getEdgeBrightness()

setDimension

public void setDimension(int dimension)
Description copied from interface: CaGeOutlet
Sets the dimension for which this outlet will be used. This method may throw a RunTimeException when d is an unsupported dimension.

Specified by:
setDimension in interface CaGeOutlet
Parameters:
dimension - The dimension for which this outlet will be used

getDimension

public int getDimension()
Description copied from interface: CaGeOutlet
Returns the dimension which is needed for this outlet.

Specified by:
getDimension in interface CaGeOutlet
Returns:
the dimension which is needed for this outlet.

setResultPanel

public void setResultPanel(ResultPanel resultPanel)
Description copied from interface: CaGeViewer
Sets the ResultPanel connected with this viewer. Some viewer need this to reembed the shown graph.

Specified by:
setResultPanel in interface CaGeViewer

setGeneratorInfo

public void setGeneratorInfo(GeneratorInfo generatorInfo)
Description copied from interface: CaGeOutlet
Sets the generator info provided for this outlet. This info can contain hints for the output such as GeneratorInfo.isReembed2DEnabled().

Specified by:
setGeneratorInfo in interface CaGeOutlet
Parameters:
generatorInfo - the generator info provided for this outlet

setVisible

public void setVisible(boolean isVisible)
Specified by:
setVisible in interface CaGeViewer

outputResult

public void outputResult(CaGeResult result)
Description copied from interface: CaGeOutlet
Does the actual output of a result. This method takes the graph, wrapped in a CaGeResult object, as input and performs the method of output specific to this outlet.

Specified by:
outputResult in interface CaGeOutlet
Parameters:
result - a CaGeResult object that needs to be outputted.

stop

public void stop()
Description copied from interface: CaGeOutlet
Called when this outlet is no longer needed. The outlet can then perform any necessary clean up tasks such as closing streams.

Specified by:
stop in interface CaGeOutlet

savePostScript

public void savePostScript()

beginGraph

public void beginGraph()
Specified by:
beginGraph in interface TwoViewDevice

beginEdges

public void beginEdges()
Specified by:
beginEdges in interface TwoViewDevice

paintEdge

public void paintEdge(double x1,
                      double y1,
                      double x2,
                      double y2,
                      int v1,
                      int v2)
Specified by:
paintEdge in interface TwoViewDevice

beginVertices

public void beginVertices()
Specified by:
beginVertices in interface TwoViewDevice

paintVertex

public void paintVertex(double x,
                        double y,
                        int number)
Specified by:
paintVertex in interface TwoViewDevice

main

public static void main(java.lang.String[] argv)
                 throws java.lang.Exception
Throws:
java.lang.Exception