org.openjump.core.ui.plugin.tools
Class PlanarGraphPlugIn

java.lang.Object
  extended by com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
      extended by com.vividsolutions.jump.workbench.plugin.ThreadedBasePlugIn
          extended by org.openjump.core.ui.plugin.tools.PlanarGraphPlugIn
All Implemented Interfaces:
PlugIn, ThreadedPlugIn

public class PlanarGraphPlugIn
extends ThreadedBasePlugIn

PlanarGraphPlugIn computes a planar graph from a set of features. The user can choose to produce the nodes, the edges and the faces, or only some of those features. The following relations are kept as edge attributes :
Initial node identifier
Final node identifier
Right face
Left face

Author:
Michael Michaud and Erwan Bocher (2005-06) Comments added by Michael Michaud on 2006-05-01

Field Summary
static java.lang.String CALCULATE_FACES
           
static java.lang.String CALCULATE_NODES
           
static java.lang.String CALCULATE_RELATIONS
           
static java.lang.String CATEGORY
           
static java.lang.String EDGE
           
 java.util.Collection edges
           
static java.lang.String FACE
           
static java.lang.String KEEP_ATTRIBUTES
           
static java.lang.String MAPPING
           
static java.lang.Integer MINUS_ONE
           
static java.lang.String NODE
           
static java.lang.String SELECT_LAYER
           
static java.lang.String TITLE
           
 
Constructor Summary
PlanarGraphPlugIn()
           
 
Method Summary
 FeatureCollection createEdgeLayer(FeatureCollection fc, boolean nodeb, boolean faceb, boolean relations, PlugInContext context)
           
 FeatureCollection createFaceLayer(FeatureCollection fcEdge, PlugInContext context, boolean relations)
           
 FeatureCollection createNodeLayer(FeatureCollection fcEdge, PlugInContext context, boolean relations)
           
 boolean execute(PlugInContext context)
          Performs the action for this plugin.
 java.util.List getLines(FeatureCollection fc)
           
 java.lang.String getName()
          Returns a very brief description of this PlugIn e.g. for display as a menu item
 void initialize(PlugInContext context)
          Called when Workbench starts up to allow plugins to initialize themselves.
 void run(TaskMonitor monitor, PlugInContext context)
          Calculations take place here
 
Methods inherited from class com.vividsolutions.jump.workbench.plugin.ThreadedBasePlugIn
main
 
Methods inherited from class com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
createName, execute, execute, isRollingBackInvalidEdits, reportNothingToUndoYet, toActionListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EDGE

public static final java.lang.String EDGE

FACE

public static final java.lang.String FACE

NODE

public static final java.lang.String NODE

CATEGORY

public static final java.lang.String CATEGORY

MAPPING

public static final java.lang.String MAPPING

TITLE

public static final java.lang.String TITLE

SELECT_LAYER

public static final java.lang.String SELECT_LAYER

CALCULATE_NODES

public static final java.lang.String CALCULATE_NODES

CALCULATE_FACES

public static final java.lang.String CALCULATE_FACES

CALCULATE_RELATIONS

public static final java.lang.String CALCULATE_RELATIONS

KEEP_ATTRIBUTES

public static final java.lang.String KEEP_ATTRIBUTES

MINUS_ONE

public static final java.lang.Integer MINUS_ONE

edges

public java.util.Collection edges
Constructor Detail

PlanarGraphPlugIn

public PlanarGraphPlugIn()
Method Detail

run

public void run(TaskMonitor monitor,
                PlugInContext context)
         throws java.lang.Exception
Calculations take place here

Parameters:
monitor - context to which this task can report its progress and check whether a party has requested its cancellation
Throws:
java.lang.Exception

initialize

public void initialize(PlugInContext context)
                throws java.lang.Exception
Description copied from interface: PlugIn
Called when Workbench starts up to allow plugins to initialize themselves.

Specified by:
initialize in interface PlugIn
Overrides:
initialize in class AbstractPlugIn
Parameters:
context -
Throws:
java.lang.Exception

execute

public boolean execute(PlugInContext context)
                throws java.lang.Exception
Description copied from interface: PlugIn
Performs the action for this plugin. For threaded plugins with dialogs, this method contains the code to invoke the dialog. If the user cancels the dialog, this method should return false to prevent the run method from being called.

Specified by:
execute in interface PlugIn
Overrides:
execute in class AbstractPlugIn
Returns:
true if the action completed, false if it was aborted. Used by ThreadedPlugIns to indicate that their #run method needn't be called next.
Throws:
java.lang.Exception - if a problem occurs during plug-in execution
See Also:
ThreadedPlugIn

getName

public java.lang.String getName()
Description copied from interface: PlugIn
Returns a very brief description of this PlugIn e.g. for display as a menu item

Specified by:
getName in interface PlugIn
Overrides:
getName in class AbstractPlugIn
Returns:
the class name, minus "PlugIn", with spaces inserted at the appropriate point before each uppercase+lowercase and lowercase+uppercase combination.

getLines

public java.util.List getLines(FeatureCollection fc)

createEdgeLayer

public FeatureCollection createEdgeLayer(FeatureCollection fc,
                                         boolean nodeb,
                                         boolean faceb,
                                         boolean relations,
                                         PlugInContext context)

createNodeLayer

public FeatureCollection createNodeLayer(FeatureCollection fcEdge,
                                         PlugInContext context,
                                         boolean relations)

createFaceLayer

public FeatureCollection createFaceLayer(FeatureCollection fcEdge,
                                         PlugInContext context,
                                         boolean relations)