Class ScrollBarFigureLayout

java.lang.Object
org.eclipse.draw2d.AbstractLayout
org.csstudio.swt.widgets.figures.ScrollBarFigureLayout
All Implemented Interfaces:
org.eclipse.draw2d.LayoutManager

public class ScrollBarFigureLayout extends org.eclipse.draw2d.AbstractLayout
Lays out the Figures that make up a ScrollBar.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Used as a constraint for the down arrow figure.
    static final String
    Used as a constraint for the page down figure.
    static final String
    Used as a constraint for the page up figure.
    static final String
    Used as a constraint for the thumb figure.
    protected final org.eclipse.draw2d.geometry.Transposer
    Transposes values if the ScrollBar is horizontally oriented.
    static final String
    Used as a constraint for the up arrow figure.

    Fields inherited from class org.eclipse.draw2d.AbstractLayout

    isObservingVisibility, preferredSize
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScrollBarFigureLayout(org.eclipse.draw2d.geometry.Transposer t)
    Constructs a ScrollBarLayout.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.eclipse.draw2d.geometry.Dimension
    calculatePreferredSize(org.eclipse.draw2d.IFigure parent, int w, int h)
     
    void
    layout(org.eclipse.draw2d.IFigure parent)
     
    protected org.eclipse.draw2d.geometry.Rectangle
    Places the buttons and returns the Rectangle into which the track should be placed.
    void
    remove(org.eclipse.draw2d.IFigure child)
     
    void
    setConstraint(org.eclipse.draw2d.IFigure figure, Object constraint)
     

    Methods inherited from class org.eclipse.draw2d.AbstractLayout

    calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, invalidate, isObservingVisibility, setObserveVisibility

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UP_ARROW

      public static final String UP_ARROW
      Used as a constraint for the up arrow figure.
      See Also:
    • DOWN_ARROW

      public static final String DOWN_ARROW
      Used as a constraint for the down arrow figure.
      See Also:
    • THUMB

      public static final String THUMB
      Used as a constraint for the thumb figure.
      See Also:
    • PAGE_UP

      public static final String PAGE_UP
      Used as a constraint for the page up figure.
      See Also:
    • PAGE_DOWN

      public static final String PAGE_DOWN
      Used as a constraint for the page down figure.
      See Also:
    • transposer

      protected final org.eclipse.draw2d.geometry.Transposer transposer
      Transposes values if the ScrollBar is horizontally oriented. When used properly, the layout manager just needs to code for one case: vertical orientation.
  • Constructor Details

    • ScrollBarFigureLayout

      public ScrollBarFigureLayout(org.eclipse.draw2d.geometry.Transposer t)
      Constructs a ScrollBarLayout. If the given Transposer is enabled, the Scrollbar will be horizontally oriented. Otherwise, the ScrollBar will be vertically oriented.
  • Method Details

    • setConstraint

      public void setConstraint(org.eclipse.draw2d.IFigure figure, Object constraint)
      Specified by:
      setConstraint in interface org.eclipse.draw2d.LayoutManager
      Overrides:
      setConstraint in class org.eclipse.draw2d.AbstractLayout
    • calculatePreferredSize

      protected org.eclipse.draw2d.geometry.Dimension calculatePreferredSize(org.eclipse.draw2d.IFigure parent, int w, int h)
      Specified by:
      calculatePreferredSize in class org.eclipse.draw2d.AbstractLayout
    • layout

      public void layout(org.eclipse.draw2d.IFigure parent)
    • layoutButtons

      protected org.eclipse.draw2d.geometry.Rectangle layoutButtons(ScrollbarFigure scrollBar)
      Places the buttons and returns the Rectangle into which the track should be placed. The track consists of the pageup, pagedown, and thumb figures. The Rectangle returned should be transposed correctly, that is, it should be vertically oriented. Users of the rectangle will re-transpose it for horizontal use.
      Parameters:
      scrollBar - the scrollbar whose buttons are being layed out
      Returns:
      the Rectangle into which the track should be placed
    • remove

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