Search this API

y.layout
Interface Layouter

All Known Subinterfaces:
LayoutStage
All Known Implementing Classes:
AbstractLabelingAlgorithm, AbstractLayoutStage, ARTreeLayouter, BalloonLayouter, BendConverter, BufferedLayouter, BusRouter, CanonicMultiStageLayouter, ChannelEdgeRouter, ChannelEdgeRouter.OrthogonalShortestPathPathFinder, CircularLayouter, CollinearBendHider, CompactOrthogonalLayouter, ComponentLayouter, CompositeLayouter, CompositeLayoutStage, CurveFittingLayoutStage, DirectedOrthogonalLayouter, EdgeGroupRouterStage, EdgeReversalStage, EdgeRouter, FamilyTreeLayouter, FixedGroupLayoutStage, FixNodeLayoutStage, GenericTreeLayouter, GraphLayoutLineWrapper, GraphTransformer, GraphZoomer, GreedyMISLabeling, GRIP, GroupedShuffleLayouter, GroupNodeHider, GroupNodeRouterStage, HandleNaNCoordinatesStage, HierarchicGroupLayouter, HierarchicLayouter, HierarchicLayouter, HVTreeLayouter, IncrementalHierarchicLayouter, InteractiveOrganicLayouter, IsolatedGroupComponentLayouter, KeepStrongPortConstraintsStage, LabelLayoutDataRefinement, LabelLayoutTranslator, LayoutMultiplexer, MinNodeSizeStage, MISLabelingAlgorithm, MultiPageLayouter, NormalizingGraphElementOrderStage, OrganicEdgeRouter, OrganicLayouter, OrganicPartitionGridLayoutStage, OrganicRemoveOverlapsStage, OrientationLayouter, OrthogonalEdgeRouter, OrthogonalGroupLayouter, OrthogonalLayouter, OrthogonalPatternEdgeRouter, OrthogonalSegmentDistributionStage, ParallelEdgeLayouter, ParentEdgeAugmentationStage, PartialLayouter, PartialLayouter.StraightLineEdgeRouter, PartitionGridLayoutStage, PartitionGridRouterStage, PartitionLayouter, PatchRouterStage, PolylineLayoutStage, PortCalculator, PortCandidateAssignmentStage, PortConstraintEnforcementStage, RadialLayouter, RandomLayouter, RecursiveGroupLayouter, ReducedSphereOfActionStage, RemoveColinearBendsStage, RemoveOverlapsLayoutStage, SALabeling, SelfLoopLayouter, SequentialLayouter, SeriesParallelLayouter, ShuffleLayouter, SingleCycleLayouter, SmartOrganicLayouter, SnapOuterPortsToNodeBorderStage, SplitEdgeLayoutStage, StraightLineEdgeRouter, SubgraphLayouter, TopLevelGroupToSwimlaneStage, TreeComponentLayouter, TreeLayouter, TreeReductionStage

public interface Layouter

Layouter describes the general interface for algorithms that perform a layout process on a LayoutGraph.

The main method for invoking the layout calculation is doLayout(LayoutGraph). Implementing classes will arrange the graph there. To avoid that the layout algorithm crashes if it cannot handle the input graph, canLayout(LayoutGraph) can be called to check whether or not a graph is a valid input for the layout algorithm.

This class also provides keys to register DataProviders with the graph that contain information about the nodes and edges in the graph. DataProviders registered with NODE_ID_DPKEY and EDGE_ID_DPKEY contain unique identifiers for both nodes and edges. These identifiers allow for ensuring consistent results even if the order of nodes and edges was changed between two layout runs.
The selection state of nodes and edges is stored in DataProviders registered with the keys SELECTED_NODES and SELECTED_EDGES. Based on this information, the layout algorithm may reduce its calculations to the selected subset of nodes or edges.

 

Field Summary
static Object EDGE_ID_DPKEY
          A DataProvider key for looking up a unique identifier for each edge in a graph Layout algorithms may use this information to provide consistent layouts for multiple runs.
static Object NODE_ID_DPKEY
          A DataProvider key for looking up a unique identifier for each node in a graph Layout algorithms may use this information to provide consistent layouts for multiple runs.
static Object SELECTED_EDGES
          A DataProvider key for looking up the selected state of the edges in the graph A layout algorithm can retrieve a DataProvider registered with this key to apply a special handling to the selected edges.
static Object SELECTED_NODES
          A DataProvider key for looking up the selected state of the nodes in the graph A layout algorithm can retrieve a DataProvider registered with this key to apply a special handling to the selected nodes.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Checks whether or not the given graph can be arranged by this layout algorithm.
 void doLayout(LayoutGraph graph)
          Main layout routine that assigns new layout information to the given graph.
 

Field Detail

NODE_ID_DPKEY

static final Object NODE_ID_DPKEY
A DataProvider key for looking up a unique identifier for each node in a graph

Layout algorithms may use this information to provide consistent layouts for multiple runs.


EDGE_ID_DPKEY

static final Object EDGE_ID_DPKEY
A DataProvider key for looking up a unique identifier for each edge in a graph

Layout algorithms may use this information to provide consistent layouts for multiple runs.


SELECTED_NODES

static final Object SELECTED_NODES
A DataProvider key for looking up the selected state of the nodes in the graph

A layout algorithm can retrieve a DataProvider registered with this key to apply a special handling to the selected nodes. For example, the layout algorithm may restrict its scope, i.e., it only arranges the selected nodes.

However, it is often more convenient to use a specific DataProvider key for this purpose, e.g., if you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. Thus, these algorithms may provide a method like setSubgraphNodesDpKey(Object) that customizes the DataProvider key allowing to specify different sets of selected nodes for nested layout algorithms.


SELECTED_EDGES

static final Object SELECTED_EDGES
A DataProvider key for looking up the selected state of the edges in the graph

A layout algorithm can retrieve a DataProvider registered with this key to apply a special handling to the selected edges. For example, the layout algorithm may restrict its scope, i.e., it only routes the selected edges.

However, it is often more convenient to use a specific DataProvider key for this purpose, e.g., if you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. Thus, these algorithms may provide a method like setSubgraphEdgesDpKey(Object) that customizes the DataProvider key allowing to specify different sets of selected edges for nested layout algorithms.

Method Detail

canLayout

boolean canLayout(LayoutGraph graph)
Checks whether or not the given graph can be arranged by this layout algorithm. Calling the main layout routine on this graph will only succeed if this method returns true.

Parameters:
graph - the input graph
Returns:
true if this layout algorithm can handle the input graph, false otherwise
See Also:
doLayout(LayoutGraph)

doLayout

void doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. The call to this routine will only succeed if the layout algorithm can handle the input graph.

Parameters:
graph - the input graph
See Also:
canLayout(LayoutGraph)

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