Runtime

org.eclipse.gmf.runtime.draw2d.ui.figures
Class ConstrainedToolbarLayout

java.lang.Object
  extended by org.eclipse.draw2d.AbstractLayout
      extended by org.eclipse.draw2d.AbstractHintLayout
          extended by org.eclipse.draw2d.ToolbarLayout
              extended by org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout
All Implemented Interfaces:
LayoutManager
Direct Known Subclasses:
GravityConstrainedFlowLayout

public class ConstrainedToolbarLayout
extends ToolbarLayout

An extended toolbar layout that supports the following additional features: 1- The ability to stretch the major axis 2- The ability to reverse the children in layout 3- The ability to ignore invisible children 4- The ability to set ratio constraints on children (in major axis)


Field Summary
 
Fields inherited from class org.eclipse.draw2d.ToolbarLayout
ALIGN_BOTTOMRIGHT, ALIGN_CENTER, ALIGN_TOPLEFT, horizontal, HORIZONTAL, matchWidth, minorAlignment, spacing, transposer, VERTICAL
 
Fields inherited from class org.eclipse.draw2d.AbstractLayout
isObservingVisibility, preferredSize
 
Constructor Summary
ConstrainedToolbarLayout()
          Creates a new vertical ConstrainedToolbarLayout
ConstrainedToolbarLayout(boolean isHorizontal)
          Creates a new ConstrainedToolbarLayout with a given orientation
 
Method Summary
 Dimension calculateMinimumSize(IFigure container, int wHint, int hHint)
           
protected  Dimension calculatePreferredSize(IFigure container, int wHint, int hHint)
           
 java.lang.Object getConstraint(IFigure child)
           
 boolean getIgnoreInvisibleChildren()
           
 boolean getStretchMajorAxis()
           
 boolean isReversed()
           
 void layout(IFigure parent)
           
 void remove(IFigure child)
           
 void setConstraint(IFigure child, java.lang.Object constraint)
           
 void setIgnoreInvisibleChildren(boolean ignoreInvisibleChildren)
          Sets whether to ignore invisible children or not
 void setReversed(boolean reversed)
          Sets whether to reverse children or not
 void setStretchMajorAxis(boolean stretch)
          Sets whether to stretch the major axis or not
 
Methods inherited from class org.eclipse.draw2d.ToolbarLayout
getChildMinimumSize, getChildPreferredSize, getMinorAlignment, getSpacing, getStretchMinorAxis, isHorizontal, isSensitiveHorizontally, isSensitiveVertically, setMatchWidth, setMinorAlignment, setSpacing, setStretchMinorAxis, setVertical
 
Methods inherited from class org.eclipse.draw2d.AbstractHintLayout
getMinimumSize, getPreferredSize, invalidate
 
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getMinimumSize, getPreferredSize, invalidate, isObservingVisibility, setObserveVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstrainedToolbarLayout

public ConstrainedToolbarLayout()
Creates a new vertical ConstrainedToolbarLayout


ConstrainedToolbarLayout

public ConstrainedToolbarLayout(boolean isHorizontal)
Creates a new ConstrainedToolbarLayout with a given orientation

Parameters:
isHorizontal - Whether the layout is horizontal
Method Detail

calculatePreferredSize

protected Dimension calculatePreferredSize(IFigure container,
                                           int wHint,
                                           int hHint)
Overrides:
calculatePreferredSize in class ToolbarLayout
See Also:
AbstractLayout.calculatePreferredSize(org.eclipse.draw2d.IFigure, int, int)

calculateMinimumSize

public Dimension calculateMinimumSize(IFigure container,
                                      int wHint,
                                      int hHint)
Overrides:
calculateMinimumSize in class ToolbarLayout
See Also:
AbstractHintLayout.calculateMinimumSize(org.eclipse.draw2d.IFigure, int, int)

layout

public void layout(IFigure parent)
Specified by:
layout in interface LayoutManager
Overrides:
layout in class ToolbarLayout
See Also:
LayoutManager.layout(IFigure)

getConstraint

public java.lang.Object getConstraint(IFigure child)
Specified by:
getConstraint in interface LayoutManager
Overrides:
getConstraint in class AbstractLayout
See Also:
LayoutManager.getConstraint(org.eclipse.draw2d.IFigure)

setConstraint

public void setConstraint(IFigure child,
                          java.lang.Object constraint)
Specified by:
setConstraint in interface LayoutManager
Overrides:
setConstraint in class AbstractLayout
See Also:
LayoutManager.setConstraint(org.eclipse.draw2d.IFigure, java.lang.Object)

remove

public void remove(IFigure child)
Specified by:
remove in interface LayoutManager
Overrides:
remove in class AbstractLayout
See Also:
LayoutManager.remove(org.eclipse.draw2d.IFigure)

setStretchMajorAxis

public void setStretchMajorAxis(boolean stretch)
Sets whether to stretch the major axis or not

Parameters:
stretch - Whether to stretch the major axis or not

getStretchMajorAxis

public boolean getStretchMajorAxis()
Returns:
Whether the stretch major axis is on

setReversed

public void setReversed(boolean reversed)
Sets whether to reverse children or not

Parameters:
reversed - Whether to reverse children or not

isReversed

public boolean isReversed()
Returns:
Whether the reverse children or not

setIgnoreInvisibleChildren

public void setIgnoreInvisibleChildren(boolean ignoreInvisibleChildren)
Sets whether to ignore invisible children or not

Parameters:
ignoreInvisibleChildren - Whether to ignore invisible children or not

getIgnoreInvisibleChildren

public boolean getIgnoreInvisibleChildren()
Returns:
Whether to ignore invisible children or not

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.