Search this API

y.module
Class LabelingModule

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

public class LabelingModule
extends LayoutModule

This module represents an interactive configurator and launcher for the yFiles labeling algorithms.

 

Field Summary
protected static java.lang.String ITEM_ALLOW_EDGE_OVERLAPS
           
protected static java.lang.String ITEM_ALLOW_NODE_OVERLAPS
           
protected static java.lang.String ITEM_AUTO_ROTATE
           
protected static java.lang.String ITEM_CONSIDER_INVISIBLE_LABELS
           
protected static java.lang.String ITEM_CONSIDER_SELECTED_FEATURES_ONLY
           
protected static java.lang.String ITEM_EDGE_LABEL_MODEL
           
protected static java.lang.String ITEM_OPTIMIZATION_STRATEGY
           
protected static java.lang.String ITEM_PLACE_EDGE_LABELS
           
protected static java.lang.String ITEM_PLACE_NODE_LABELS
           
protected static java.lang.String ITEM_USE_OPTIMIZATION
           
protected static java.lang.String ITEM_USE_POSTPROCESSING
           
protected static java.lang.String LABEL_SELECTION_DP_KEY
           
protected static java.lang.String MODULE_DIVERSE_LABELING
           
protected static java.lang.String SECTION_MODEL
           
protected static java.lang.String SECTION_QUALITY
           
protected static java.lang.String SECTION_SCOPE
           
protected static java.lang.String VALUE_AS_IS
           
protected static java.lang.String VALUE_BEST
           
protected static java.lang.String VALUE_CENTER_SLIDER
           
protected static java.lang.String VALUE_CENTERED
           
protected static java.lang.String VALUE_FREE
           
protected static java.lang.String VALUE_OPTIMIZATION_BALANCED
           
protected static java.lang.String VALUE_OPTIMIZATION_EDGE_OVERLAP
           
protected static java.lang.String VALUE_OPTIMIZATION_LABEL_OVERLAP
           
protected static java.lang.String VALUE_OPTIMIZATION_NODE_OVERLAP
           
protected static java.lang.String VALUE_OPTIMIZATION_NONE
           
protected static java.lang.String VALUE_SIDE_SLIDER
           
protected static java.lang.String VALUE_SIX_POS
           
protected static java.lang.String VALUE_THREE_CENTER
           
protected static java.lang.String VALUE_TWO_POS
           
 
Fields inherited from class y.module.YModule
FAILED, moduleListenerSupport, PRECONDITION_VIOLATED, SUCCESS
 
Constructor Summary
LabelingModule()
          Creates an instance of this module.
 
Method Summary
protected  void configure(MISLabelingAlgorithm al, 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 labeling 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_DIVERSE_LABELING

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

SECTION_SCOPE

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

ITEM_PLACE_NODE_LABELS

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

ITEM_PLACE_EDGE_LABELS

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

ITEM_CONSIDER_SELECTED_FEATURES_ONLY

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

ITEM_CONSIDER_INVISIBLE_LABELS

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

SECTION_QUALITY

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

ITEM_USE_OPTIMIZATION

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

ITEM_OPTIMIZATION_STRATEGY

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

VALUE_OPTIMIZATION_BALANCED

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

VALUE_OPTIMIZATION_NONE

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

VALUE_OPTIMIZATION_EDGE_OVERLAP

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

VALUE_OPTIMIZATION_LABEL_OVERLAP

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

VALUE_OPTIMIZATION_NODE_OVERLAP

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

ITEM_ALLOW_NODE_OVERLAPS

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

ITEM_ALLOW_EDGE_OVERLAPS

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

ITEM_USE_POSTPROCESSING

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

SECTION_MODEL

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

ITEM_EDGE_LABEL_MODEL

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

VALUE_CENTERED

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

VALUE_TWO_POS

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

VALUE_SIX_POS

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

VALUE_THREE_CENTER

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

VALUE_FREE

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

VALUE_CENTER_SLIDER

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

VALUE_SIDE_SLIDER

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

VALUE_AS_IS

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

VALUE_BEST

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

ITEM_AUTO_ROTATE

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

LABEL_SELECTION_DP_KEY

protected static final java.lang.String LABEL_SELECTION_DP_KEY
See Also:
Constant Field Values
Constructor Detail

LabelingModule

public LabelingModule()
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

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 labeling 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 labeling 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 labeling algorithm

configure

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

Parameters:
al - the MISLabelingAlgorithm to be configured
options - the layout options to set

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