Search this API

y.module
Class BusRouterModule

java.lang.Object
  extended by y.module.YModule
      extended by y.module.LayoutModule
          extended by y.module.BusRouterModule

public class BusRouterModule
extends LayoutModule

Module for the BusRouter.

There are more scopes in this module than in BusRouter. Each additional scope is mapped to an appropriate combinations of scope and fixed edges in BusRouter.

ALL
Maps to BusRouter.SCOPE_ALL. All edges are in scope, and all of them are movable.
SUBSET
Maps to BusRouter.SCOPE_SUBSET. Selected edges are in scope, and all of them are movable.
SUBSET_BUS
Each bus with at least one selected edge is in scope, and all of their edges are movable.
PARTIAL
Each bus with at least one selected node is in scope, and only the adjacent edges of the selected nodes are movable.
EDGES_AT_SELECTED_NODES
Maps to BusRouter.SCOPE_SUBSET. Edges connected to selected nodes are in scope, and all of them are movable.

See Also:
Section Orthogonal Bus-style Edge Routing in the yFiles for Java Developer's Guide
 

Field Summary
protected static java.lang.String ITEM_BUSES
           
protected static java.lang.String ITEM_CROSSING_COST
           
protected static java.lang.String ITEM_CROSSING_REROUTING
           
protected static java.lang.String ITEM_GRID_ENABLED
           
protected static java.lang.String ITEM_GRID_SPACING
           
protected static java.lang.String ITEM_MIN_DISTANCE_TO_EDGES
           
protected static java.lang.String ITEM_MIN_DISTANCE_TO_NODES
           
protected static java.lang.String ITEM_MINIMUM_BACKBONE_LENGTH
           
protected static java.lang.String ITEM_MINIMUM_CONNECTIONS_COUNT
           
protected static java.lang.String ITEM_POLICY
           
protected static java.lang.String ITEM_PREFERRED_BACKBONE_COUNT
           
protected static java.lang.String ITEM_SCOPE
           
protected static java.lang.String MODULE_BUS_ROUTER
           
protected  boolean optionsLayout
          Specifies whether the options of group layout are used.
protected  boolean optionsRouting
          Specifies whether the options for routing and recombination are used.
protected  boolean optionsSelection
          Specifies whether the options for initial backbone selection are used.
protected static java.lang.String TITLE_LAYOUT
           
protected static java.lang.String TITLE_ROUTING
           
protected static java.lang.String TITLE_SELECTION
           
protected static java.lang.String VALUE_COLOR
           
protected static java.lang.String VALUE_CONNECTED_COMPONENT
           
protected static java.lang.String VALUE_POLICY_ALWAYS
           
protected static java.lang.String VALUE_POLICY_PATH_AS_NEEDED
           
protected static java.lang.String VALUE_SCOPE_ALL
           
protected static java.lang.String VALUE_SCOPE_EDGES_AT_SELECTED_NODES
           
protected static java.lang.String VALUE_SCOPE_PARTIAL
           
protected static java.lang.String VALUE_SCOPE_SUBSET
           
protected static java.lang.String VALUE_SCOPE_SUBSET_BUS
           
protected static java.lang.String VALUE_SINGLE
           
 
Fields inherited from class y.module.YModule
FAILED, moduleListenerSupport, PRECONDITION_VIOLATED, SUCCESS
 
Constructor Summary
BusRouterModule()
          Creates an instance of this module.
 
Method Summary
protected  void addOptionItems(BusRouter defaults, OptionHandler options)
          Adds the option items used by this module to the given OptionHandler.
protected  void configure(BusRouter bus, OptionHandler options)
          Configures the module's layout algorithm according to the given options.
protected  OptionHandler createOptionHandler()
          Creates an OptionHandler and adds the option items used by this module.
protected  void mainrun()
          Main module execution routine.
protected  void prepareGraph(Graph2D graph, OptionHandler options)
          Prepares a graph depending on the given options for the module's layout algorithm.
protected  void restoreGraph(Graph2D graph, OptionHandler options)
          Restores the given graph by freeing up resources created by prepareGraph(y.view.Graph2D, y.option.OptionHandler).
 
Methods inherited from class y.module.LayoutModule
backupDataProvider, createAnimationPlayer, createLayoutExecutor, createLayoutMorpher, getBufferedMode, getLayoutExecutor, isAbortable, isMorphingEnabled, isPortIntersectionCalculatorEnabled, launchLayouter, launchLayouter, restoreDataProvider, setBufferedMode, setLayoutExecutor, setMorphingEnabled, setPortIntersectionCalculatorEnabled, useEventDispatchThread
 
Methods inherited from class y.module.YModule
addModuleListener, createThread, dispose, exceptionHappened, fitGraph2DView, getAuthor, getDescription, getExitStatus, getGraph2D, getGraph2DView, getModuleListeners, getModuleName, getOptionHandler, getTimer, getView, init, initGuiFactory, isBackupRealizersEnabled, removeModuleListener, run, setBackupRealizersEnabled, setExitStatus, setGraph2D, setModuleName, setOptionHandler, start, startAsThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE_BUS_ROUTER

protected static final java.lang.String MODULE_BUS_ROUTER
See Also:
Constant Field Values

TITLE_LAYOUT

protected static final java.lang.String TITLE_LAYOUT
See Also:
Constant Field Values

ITEM_SCOPE

protected static final java.lang.String ITEM_SCOPE
See Also:
Constant Field Values

VALUE_SCOPE_ALL

protected static final java.lang.String VALUE_SCOPE_ALL
See Also:
Constant Field Values

VALUE_SCOPE_SUBSET

protected static final java.lang.String VALUE_SCOPE_SUBSET
See Also:
Constant Field Values

VALUE_SCOPE_EDGES_AT_SELECTED_NODES

protected static final java.lang.String VALUE_SCOPE_EDGES_AT_SELECTED_NODES
See Also:
Constant Field Values

VALUE_SCOPE_SUBSET_BUS

protected static final java.lang.String VALUE_SCOPE_SUBSET_BUS
See Also:
Constant Field Values

VALUE_SCOPE_PARTIAL

protected static final java.lang.String VALUE_SCOPE_PARTIAL
See Also:
Constant Field Values

ITEM_BUSES

protected static final java.lang.String ITEM_BUSES
See Also:
Constant Field Values

VALUE_SINGLE

protected static final java.lang.String VALUE_SINGLE
See Also:
Constant Field Values

VALUE_COLOR

protected static final java.lang.String VALUE_COLOR
See Also:
Constant Field Values

VALUE_CONNECTED_COMPONENT

protected static final java.lang.String VALUE_CONNECTED_COMPONENT
See Also:
Constant Field Values

ITEM_POLICY

protected static final java.lang.String ITEM_POLICY
See Also:
Constant Field Values

VALUE_POLICY_ALWAYS

protected static final java.lang.String VALUE_POLICY_ALWAYS
See Also:
Constant Field Values

VALUE_POLICY_PATH_AS_NEEDED

protected static final java.lang.String VALUE_POLICY_PATH_AS_NEEDED
See Also:
Constant Field Values

ITEM_GRID_ENABLED

protected static final java.lang.String ITEM_GRID_ENABLED
See Also:
Constant Field Values

ITEM_GRID_SPACING

protected static final java.lang.String ITEM_GRID_SPACING
See Also:
Constant Field Values

ITEM_MIN_DISTANCE_TO_NODES

protected static final java.lang.String ITEM_MIN_DISTANCE_TO_NODES
See Also:
Constant Field Values

ITEM_MIN_DISTANCE_TO_EDGES

protected static final java.lang.String ITEM_MIN_DISTANCE_TO_EDGES
See Also:
Constant Field Values

TITLE_SELECTION

protected static final java.lang.String TITLE_SELECTION
See Also:
Constant Field Values

ITEM_PREFERRED_BACKBONE_COUNT

protected static final java.lang.String ITEM_PREFERRED_BACKBONE_COUNT
See Also:
Constant Field Values

ITEM_MINIMUM_BACKBONE_LENGTH

protected static final java.lang.String ITEM_MINIMUM_BACKBONE_LENGTH
See Also:
Constant Field Values

TITLE_ROUTING

protected static final java.lang.String TITLE_ROUTING
See Also:
Constant Field Values

ITEM_CROSSING_COST

protected static final java.lang.String ITEM_CROSSING_COST
See Also:
Constant Field Values

ITEM_CROSSING_REROUTING

protected static final java.lang.String ITEM_CROSSING_REROUTING
See Also:
Constant Field Values

ITEM_MINIMUM_CONNECTIONS_COUNT

protected static final java.lang.String ITEM_MINIMUM_CONNECTIONS_COUNT
See Also:
Constant Field Values

optionsLayout

protected boolean optionsLayout
Specifies whether the options of group layout are used.


optionsSelection

protected boolean optionsSelection
Specifies whether the options for initial backbone selection are used.


optionsRouting

protected boolean optionsRouting
Specifies whether the options for routing and recombination are used.

Constructor Detail

BusRouterModule

public BusRouterModule()
Creates an instance of this module.

Method Detail

createOptionHandler

protected OptionHandler createOptionHandler()
Creates an OptionHandler and adds the option items used by this module.

Overrides:
createOptionHandler in class YModule
Returns:
the created OptionHandler providing module related options

addOptionItems

protected void addOptionItems(BusRouter defaults,
                              OptionHandler options)
Adds the option items used by this module to the given OptionHandler.

Parameters:
defaults - a BusRouter instance that provides default option values.
options - the OptionHandler to add the items to

mainrun

protected void mainrun()
Main module execution routine. Launches the module's underlying algorithm on the module's graph based on user options.

Specified by:
mainrun in class YModule

prepareGraph

protected void prepareGraph(Graph2D graph,
                            OptionHandler options)
Prepares a graph depending on the given options for the module's layout algorithm.
Additional resources created by this method have to be freed up by calling restoreGraph(y.view.Graph2D, y.option.OptionHandler) after layout calculation.

Parameters:
graph - the graph to be prepared
options - the options for the module's layout algorithm

restoreGraph

protected void restoreGraph(Graph2D graph,
                            OptionHandler options)
Restores the given graph by freeing up resources created by prepareGraph(y.view.Graph2D, y.option.OptionHandler).

Parameters:
graph - the graph for which prepareGraph has been called
options - the options for the module's layout algorithm

configure

protected void configure(BusRouter bus,
                         OptionHandler options)
Configures the module's layout algorithm according to the given options.

Parameters:
bus - the BusRouter to be configured
options - the layout options to set

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.