suvi.alg.policies
Class LinearComponentLayoutPolicy

java.lang.Object
  |
  +--javautils.collections.Algs
        |
        +--suvi.alg.policies.LinearComponentLayoutPolicy
All Implemented Interfaces:
ComponentLayoutPolicy, GraphLayoutAttrConsumer

public class LinearComponentLayoutPolicy
extends javautils.collections.Algs
implements ComponentLayoutPolicy

Generalized linear (side-by-side) component layout policy.

The components are placed linearly side-by-side in the order determined by the specified LinearComponentLayoutPolicy.Orderer and the components are aligned vertically based on the specified vertical alignment factor.

The vertical alignment factor must be in the range [0,1] and determines the relative vertical alignment of the layouts. An alignment of 0 aligns the tops of the layouts, 0.5 aligns the centers, and 1 aligns the bottoms of the layouts.


Nested Class Summary
static class LinearComponentLayoutPolicy.LeftRightAlternatingOrdererDecorator
          Produces a new permutation by alternatingly putting the next index to the left or to the right of the resulting permutation.
static interface LinearComponentLayoutPolicy.Orderer
          Determines the order of component graph layouts.
static class LinearComponentLayoutPolicy.SortingOrderer
          Produces a sorted permutation of the indices based on an ordering predicate on Dimensions.
 
Field Summary
static double ALIGN_BOTTOMS
           
static double ALIGN_CENTERS
           
static double ALIGN_DEFAULT
           
static double ALIGN_TOPS
           
static LinearComponentLayoutPolicy.Orderer ORDER_ASCENDING_HEIGHT
           
static LinearComponentLayoutPolicy.Orderer ORDER_DEFAULT
           
static LinearComponentLayoutPolicy.Orderer ORDER_DESCENDING_HEIGHT
           
static LinearComponentLayoutPolicy.Orderer ORDER_GAUSSIAN
           
 
Fields inherited from class javautils.collections.Algs
EMPTY_ARRAY, EMPTY_LIST, EMPTY_MAP, EMPTY_SEQUENCE, EMPTY_SET
 
Constructor Summary
LinearComponentLayoutPolicy()
           
LinearComponentLayoutPolicy(double verticalAlignment)
           
LinearComponentLayoutPolicy(double verticalAlignment, LinearComponentLayoutPolicy.Orderer orderer)
           
LinearComponentLayoutPolicy(LinearComponentLayoutPolicy.Orderer orderer)
           
 
Method Summary
 GraphLayoutAttr[] defaultAttrs()
          This policy uses the following attributes: NodeGapAttr
 java.awt.Point[] locations(javautils.graph.adt.AugmentedGraph original, GraphLayoutAttrMap attrMap, GraphLayout[] layouts)
          Locations for the specified layouts.
 
Methods inherited from class javautils.collections.Algs
addAll, allSuperInterfaces, asArray, asArray, asComparator, asUnmodifiableList, collect, collectMap, collectSet, collectUnmodifiable, concat, concat, concat, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOfArray, ensureLength, exists, exists, exists, filter, filter, filter, find, find, find, flatten, flatten, flatten, fold, fold, fold, foldRight, foldRight, foldRight, forAll, forAll, forAll, forEach, forEach, forEach, forEach, forEach, forEach, forEachInProduct, forEachInProduct, forEachInProduct, forEachInProduct, genAddAll, genConcat, genConcat, genForEach, genForEach, getOrIfNull, integersInRange, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iterator, iteratorOverArray, map, map, map, map, map, map, mapMorphism, mapMorphismTo, mapTransform, max, max, max, max, max, max, max, min, min, min, min, min, min, min, newMap, newShapedArray, newUnmodifiableList, putAll, putAll, reverseIterator, reverseIterator, select, select, select, sign, singletonIterator, sort, sort, sorted, sorted, transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_TOPS

public static final double ALIGN_TOPS
See Also:
Constant Field Values

ALIGN_CENTERS

public static final double ALIGN_CENTERS
See Also:
Constant Field Values

ALIGN_BOTTOMS

public static final double ALIGN_BOTTOMS
See Also:
Constant Field Values

ALIGN_DEFAULT

public static final double ALIGN_DEFAULT
See Also:
Constant Field Values

ORDER_DEFAULT

public static final LinearComponentLayoutPolicy.Orderer ORDER_DEFAULT

ORDER_DESCENDING_HEIGHT

public static final LinearComponentLayoutPolicy.Orderer ORDER_DESCENDING_HEIGHT

ORDER_ASCENDING_HEIGHT

public static final LinearComponentLayoutPolicy.Orderer ORDER_ASCENDING_HEIGHT

ORDER_GAUSSIAN

public static final LinearComponentLayoutPolicy.Orderer ORDER_GAUSSIAN
Constructor Detail

LinearComponentLayoutPolicy

public LinearComponentLayoutPolicy()

LinearComponentLayoutPolicy

public LinearComponentLayoutPolicy(double verticalAlignment)

LinearComponentLayoutPolicy

public LinearComponentLayoutPolicy(LinearComponentLayoutPolicy.Orderer orderer)

LinearComponentLayoutPolicy

public LinearComponentLayoutPolicy(double verticalAlignment,
                                   LinearComponentLayoutPolicy.Orderer orderer)
Method Detail

defaultAttrs

public final GraphLayoutAttr[] defaultAttrs()

This policy uses the following attributes:

Specified by:
defaultAttrs in interface GraphLayoutAttrConsumer

locations

public final java.awt.Point[] locations(javautils.graph.adt.AugmentedGraph original,
                                        GraphLayoutAttrMap attrMap,
                                        GraphLayout[] layouts)
Description copied from interface: ComponentLayoutPolicy

Locations for the specified layouts.

Specified by:
locations in interface ComponentLayoutPolicy