Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.jboogie.layout

Class LayoutStrategy

com.gentleware.jboogie.layout.LayoutStrategy
All known Subclassifier:
ConcavePentagonLayout , ConvexPentagonLayout , DiagramLayout , EdgeLayout , EllipseFillLayout , EllipseVerticalLayout , FillLayout , FixedSizeLayout , GraphicPrimitiveLayout , HorizontalLayout , TextElementLayout , VerticalLayout


public class LayoutStrategy


A LayoutStrategy changes the positions and dimensions of its contained elements in some fashion. Also, it returns a preferred size that is also based on the same layout fashion and on the sizes of the contained elements.


 Inner Classifier Summary
public static   LayoutStrategy.EdgeComparator
Sorts a list of LayoutableElements, so that the edges are at the end. 
arrow_up
 

 Attribute Summary
private boolean  _includeElementsWithShape
 
arrow_up
 

 Association Summary
public Insets2D  DIAGRAM_INSETS
 
private Project  _project
 
arrow_up
 

 Constructor Summary
public   LayoutStrategy(Project project)
 
protected   LayoutStrategy(Project project, boolean includeElementsWithShape)
 
arrow_up
 

 Method Summary
protected void   adjustChildren(LayoutableNode node, double oldX, double oldY, double oldWidth, double oldHeight, double newX, double newY, double newWidth, double newHeight, DiMacroMemento memento)
This is a hook for layouts where the child positions depend on both the old and the new bounds of the container. 
private List   filterVisibleElements(List elements)
 
public List   getDependentElementsToInvalidate(LayoutableElement invalidatedElement)
If an elements layout depends on other elements, this method can be overwritten to invalidate these elements when the given element is invalidated. 
public LayoutStrategy   getLayout(LayoutableElement layoutableElement)
 
public final PDimension   getMinimumSize(LayoutableElement container)
 
protected PDimension   getMinimumSizeImpl(LayoutableElement container, List layoutableElements)
 
public final PBounds   getPreferredBounds(LayoutableElement diagramElement)
When a container lays out its contained elements it needs to know which size the elements should (preferably) get. 
protected PBounds   getPreferredBoundsImpl(LayoutableElement container, List layoutableElements)
 
public Project   getProject()
 
private boolean   isCurrentlyMovingShape(LayoutableElement element)
Returns true if the given element is a shape and is moved by the user. 
protected boolean   isFrozen(LayoutableElement element)
helper method that just asks the validator  
private void   layoutCollection(List containedNodes, DiMacroMemento memento)
 
public final void   layoutContainer(LayoutableElement container, DiMacroMemento memento)
 
public final void   layoutContainer(LayoutableElement container, DiMacroMemento memento, boolean allowHack)
 
public void   reshapeElements(LayoutableElement container, List layoutableElements, DiMacroMemento memento)
Subclasses must reposition and resize each layoutable element. 
public final void   setNodeShape(LayoutableNode node, PBounds bounds, DiMacroMemento memento)
Sets new bounds for the nodeToBeLayouted and its PNode. 
public final void   setNodeShape(LayoutableNode node, double x, double y, double width, double height, DiMacroMemento memento)
Sets new bounds for the nodeToBeLayouted and its PNode. 
private void   sortContainedElements(LayoutableElement container, List elementsToBeLayoutedByContainer, List elementsWhichWantToLayoutThemselves, List frozenElements)
 
public void   updateSelfEdges(LayoutableNode node, double newX, double newY, double newWidth, double newHeight, double oldX, double oldY, double oldWidth, double oldHeight, DiMacroMemento memento)
A node is about to be resized. 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 28
gentleware-imported-package-statement-line-number 5
 

 Inner Classifier Detail

LayoutStrategy.EdgeComparator

public static  LayoutStrategy.EdgeComparator

Sorts a list of LayoutableElements, so that the edges are at the end.  
arrow_up
 Attribute Detail

_includeElementsWithShape

private boolean _includeElementsWithShape

arrow_up
 Association Detail

DIAGRAM_INSETS

public Insets2D DIAGRAM_INSETS

arrow_up


_project

private Project _project

arrow_up
 Constructor Detail

LayoutStrategy

public com.gentleware.jboogie.layout.LayoutStrategy LayoutStrategy(Project project)

Parameters:
project -
Returns:
arrow_up


LayoutStrategy

protected com.gentleware.jboogie.layout.LayoutStrategy LayoutStrategy(Project project, boolean includeElementsWithShape)

Parameters:
project -
includeElementsWithShape -
Returns:
arrow_up
 Method Detail

adjustChildren

protected void adjustChildren(LayoutableNode node, double oldX, double oldY, double oldWidth, double oldHeight, double newX, double newY, double newWidth, double newHeight, DiMacroMemento memento)


This is a hook for layouts where the child positions depend on both the old and the new bounds of the container.  
Parameters:
node -
oldX -
oldY -
oldWidth -
oldHeight -
newX -
newY -
newWidth -
newHeight -
memento -
arrow_up


filterVisibleElements

private List filterVisibleElements(List elements)

Parameters:
elements -
Returns:
arrow_up


getDependentElementsToInvalidate

public List getDependentElementsToInvalidate(LayoutableElement invalidatedElement)


If an elements layout depends on other elements, this method can be overwritten to invalidate these elements when the given element is invalidated.  
Parameters:
invalidatedElement -
Returns:
arrow_up


getLayout

public LayoutStrategy getLayout(LayoutableElement layoutableElement)

Parameters:
layoutableElement -
Returns:
arrow_up


getMinimumSize

public final PDimension getMinimumSize(LayoutableElement container)

Parameters:
container -
Returns:
arrow_up


getMinimumSizeImpl

protected PDimension getMinimumSizeImpl(LayoutableElement container, List layoutableElements)

Parameters:
container -
layoutableElements -
Returns:
arrow_up


getPreferredBounds

public final PBounds getPreferredBounds(LayoutableElement diagramElement)


When a container lays out its contained elements it needs to know which size the elements should (preferably) get.  
Parameters:
diagramElement -
Returns:
arrow_up


getPreferredBoundsImpl

protected PBounds getPreferredBoundsImpl(LayoutableElement container, List layoutableElements)

Parameters:
container -
layoutableElements -
Returns:
arrow_up


getProject

public Project getProject()

Returns:
arrow_up


isCurrentlyMovingShape

private boolean isCurrentlyMovingShape(LayoutableElement element)


Returns true if the given element is a shape and is moved by the user.  
Parameters:
element - element to check
Returns:
true iff. element is a shape and is moved by the user
arrow_up


isFrozen

protected boolean isFrozen(LayoutableElement element)


helper method that just asks the validator  
Parameters:
element -
Returns:
arrow_up


layoutCollection

private void layoutCollection(List containedNodes, DiMacroMemento memento)

Parameters:
containedNodes -
memento -
arrow_up


layoutContainer

public final void layoutContainer(LayoutableElement container, DiMacroMemento memento)

Parameters:
container -
memento -
arrow_up


layoutContainer

public final void layoutContainer(LayoutableElement container, DiMacroMemento memento, boolean allowHack)

Parameters:
container -
memento -
allowHack -
arrow_up


reshapeElements

public void reshapeElements(LayoutableElement container, List layoutableElements, DiMacroMemento memento)


Subclasses must reposition and resize each layoutable element. Any contained elements that are either invisible or have a layout that wants to reshape the container itself are already removed from the list of layoutable elements before this method is called.  
Parameters:
container -
layoutableElements -
memento -
arrow_up


setNodeShape

public final void setNodeShape(LayoutableNode node, PBounds bounds, DiMacroMemento memento)


Sets new bounds for the nodeToBeLayouted and its PNode. Final since it is a helper method.  
Parameters:
node - The DI node that receives the new bounds.
bounds - new bounds
memento - If not null, the memento is extended by the memento of the nodeToBeLayouted (if necessary).
arrow_up


setNodeShape

public final void setNodeShape(LayoutableNode node, double x, double y, double width, double height, DiMacroMemento memento)


Sets new bounds for the nodeToBeLayouted and its PNode. Final since it is a helper method.  
Parameters:
node - The DI node that receives the new bounds.
x - new value or Double.NaN if this should not be changed
y - new value or Double.NaN if this should not be changed
width - new value or Double.NaN if this should not be changed
height - new value or Double.NaN if this should not be changed
memento - If not null, the memento is extended by the memento of the nodeToBeLayouted (if necessary).
arrow_up


sortContainedElements

private void sortContainedElements(LayoutableElement container, List elementsToBeLayoutedByContainer, List elementsWhichWantToLayoutThemselves, List frozenElements)

Parameters:
container -
elementsToBeLayoutedByContainer -
elementsWhichWantToLayoutThemselves -
frozenElements -
arrow_up


updateSelfEdges

public void updateSelfEdges(LayoutableNode node, double newX, double newY, double newWidth, double newHeight, double oldX, double oldY, double oldWidth, double oldHeight, DiMacroMemento memento)


A node is about to be resized. Reposition the node's connectors so that they are on the new borders. This method is called _before_ the node is actually resized, so that a connector's new position can be dependent on the old position relative to the old bounds.  
Parameters:
node -
newX -
newY -
newWidth -
newHeight -
oldX -
oldY -
oldWidth -
oldHeight -
memento -
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.