bibliothek.gui.dock.station.stack.tab.layouting
Class ComponentLayoutBlock<C extends TabPaneComponent>

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.layouting.ComponentLayoutBlock<C>
All Implemented Interfaces:
LayoutBlock
Direct Known Subclasses:
MenuLayoutBlock

public class ComponentLayoutBlock<C extends TabPaneComponent>
extends Object
implements LayoutBlock

This LayoutBlock handles exactly one TabPaneComponent.

Author:
Benjamin Sigg

Constructor Summary
ComponentLayoutBlock()
           
 
Method Summary
 C getComponent()
          Gets the component which is managed by this block.
 Size[] getSizes()
          Creates a map of all sizes for which this block knows how to make an optimal layout.
 void setBounds(int x, int y, int width, int height)
          Sets the boundaries of this block.
 void setComponent(C component)
          Sets the component which should be managed by this block.
 void setLayout(Size size)
          Sets the layout of this block, the exact meaning of size depends on this block.
 void setOrientation(TabPlacement placement)
          Tells this LayoutBlock at which side of the tabs it is shown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentLayoutBlock

public ComponentLayoutBlock()
Method Detail

setComponent

public void setComponent(C component)
Sets the component which should be managed by this block.

Parameters:
component - the new component, may be null

getComponent

public C getComponent()
Gets the component which is managed by this block.

Returns:
the component, may be null

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: LayoutBlock
Sets the boundaries of this block. The component(s) represented by this block must somehow fit into the rectangle.

Specified by:
setBounds in interface LayoutBlock
Parameters:
x - the x coordinate
y - the y coordinate
width - the width in pixel
height - the height in pixel

getSizes

public Size[] getSizes()
Description copied from interface: LayoutBlock
Creates a map of all sizes for which this block knows how to make an optimal layout. If for example this block consists of 12 buttons, then different sizes might lead to a row of 12 blocks, to 2 rows of 6 blocks, to 3 rows of 4 blocks, etc...

Specified by:
getSizes in interface LayoutBlock
Returns:
the map of sizes, may be empty or null

setLayout

public void setLayout(Size size)
Description copied from interface: LayoutBlock
Sets the layout of this block, the exact meaning of size depends on this block. In general keys returned by the last call of LayoutBlock.getSizes() must be accepted, for any other key the behavior is unspecified.

Specified by:
setLayout in interface LayoutBlock
Parameters:
size - the new layout

setOrientation

public void setOrientation(TabPlacement placement)
Description copied from interface: LayoutBlock
Tells this LayoutBlock at which side of the tabs it is shown.

Specified by:
setOrientation in interface LayoutBlock
Parameters:
placement - the placement, not null