Zest
1.5.0.201305060205

org.eclipse.zest.layouts.algorithms
Class RadialLayoutAlgorithm

java.lang.Object
  extended by org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm
      extended by org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm
          extended by org.eclipse.zest.layouts.algorithms.RadialLayoutAlgorithm
All Implemented Interfaces:
LayoutAlgorithm, Stoppable

public class RadialLayoutAlgorithm
extends TreeLayoutAlgorithm

This layout will take the given entities, apply a tree layout to them, and then display the tree in a circular fashion with the roots in the center.


Field Summary
 
Fields inherited from class org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm
comparator, filter, internalAsynchronous, internalContinuous, layout_styles, layoutStopped, MIN_ENTITY_SIZE, resizeEntitiesAfterLayout
 
Constructor Summary
RadialLayoutAlgorithm()
          Creates a radial layout with no style.
RadialLayoutAlgorithm(int styles)
           
 
Method Summary
protected  void computeRadialPositions(org.eclipse.zest.layouts.dataStructures.InternalNode[] entities, org.eclipse.zest.layouts.dataStructures.DisplayIndependentRectangle bounds2)
          Take the tree and make it round.
protected  org.eclipse.zest.layouts.dataStructures.DisplayIndependentRectangle getLayoutBounds(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout, boolean includeNodeSize)
          Find the bounds in which the nodes are located.
protected  boolean isValidConfiguration(boolean asynchronous, boolean continueous)
          Determines if the configuration is valid for this layout
protected  void postLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout, org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider)
          Code called after the layout algorithm ends
protected  void preLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout, org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider, double x, double y, double width, double height)
          Executes this TreeLayoutAlgorithm layout algorithm by referencing the data stored in the repository system.
 void setLayoutArea(double x, double y, double width, double height)
           
 void setRangeToLayout(double startDegree, double endDegree)
          Set the range the radial layout will use when applyLayout is called.
 
Methods inherited from class org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm
applyLayoutInternal, getCurrentLayoutStep, getRoots, getTotalNumberOfLayoutSteps
 
Methods inherited from class org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm
addEntity, addProgressListener, addRelationship, applyLayout, defaultFitWithinBounds, defaultFitWithinBounds, fireProgressEnded, fireProgressEvent, fireProgressStarted, getEntityAspectRatio, getLocalLocation, getNumberOfProgressListeners, getStyle, isRunning, removeEntity, removeProgressListener, removeRelationship, removeRelationships, removeRelationships, setComparator, setEntityAspectRatio, setFilter, setStyle, stop, updateBendPoints, updateEntities, updateLayoutLocations, updateRelationships, verifyInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadialLayoutAlgorithm

public RadialLayoutAlgorithm()
Creates a radial layout with no style.


RadialLayoutAlgorithm

public RadialLayoutAlgorithm(int styles)
Method Detail

setLayoutArea

public void setLayoutArea(double x,
                          double y,
                          double width,
                          double height)
Overrides:
setLayoutArea in class TreeLayoutAlgorithm

isValidConfiguration

protected boolean isValidConfiguration(boolean asynchronous,
                                       boolean continueous)
Description copied from class: AbstractLayoutAlgorithm
Determines if the configuration is valid for this layout

Overrides:
isValidConfiguration in class TreeLayoutAlgorithm

preLayoutAlgorithm

protected void preLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
                                  org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider,
                                  double x,
                                  double y,
                                  double width,
                                  double height)
Description copied from class: TreeLayoutAlgorithm
Executes this TreeLayoutAlgorithm layout algorithm by referencing the data stored in the repository system. Once done, the result will be saved to the data repository.

Overrides:
preLayoutAlgorithm in class TreeLayoutAlgorithm
Parameters:
entitiesToLayout - Apply the algorithm to these entities
relationshipsToConsider - Only consider these relationships when applying the algorithm.

postLayoutAlgorithm

protected void postLayoutAlgorithm(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
                                   org.eclipse.zest.layouts.dataStructures.InternalRelationship[] relationshipsToConsider)
Description copied from class: AbstractLayoutAlgorithm
Code called after the layout algorithm ends

Overrides:
postLayoutAlgorithm in class TreeLayoutAlgorithm

setRangeToLayout

public void setRangeToLayout(double startDegree,
                             double endDegree)
Set the range the radial layout will use when applyLayout is called. Both values must be in radians.


computeRadialPositions

protected void computeRadialPositions(org.eclipse.zest.layouts.dataStructures.InternalNode[] entities,
                                      org.eclipse.zest.layouts.dataStructures.DisplayIndependentRectangle bounds2)
Take the tree and make it round. This is done by determining the location of each entity in terms of its percentage in the tree layout. Then apply that percentage to the radius and distance from the center.


getLayoutBounds

protected org.eclipse.zest.layouts.dataStructures.DisplayIndependentRectangle getLayoutBounds(org.eclipse.zest.layouts.dataStructures.InternalNode[] entitiesToLayout,
                                                                                              boolean includeNodeSize)
Find the bounds in which the nodes are located. Using the bounds against the real bounds of the screen, the nodes can proportionally be placed within the real bounds. The bounds can be determined either including the size of the nodes or not. If the size is not included, the bounds will only be guaranteed to include the center of each node.

Overrides:
getLayoutBounds in class AbstractLayoutAlgorithm

Zest
1.5.0.201305060205

Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.