bibliothek.gui.dock.station.stack.tab.layouting
Interface LayoutBlock

All Known Implementing Classes:
ComponentLayoutBlock, EclipseTabInfo, LineTabsLayoutBlock, MenuLayoutBlock, TabsLayoutBlock

public interface LayoutBlock

Represents one or many components that have some unknown layout and are used by an AbstractTabLayoutManager to layout the contents of a TabPane.

Author:
Benjamin Sigg

Method Summary
 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 setLayout(Size size)
          Sets the layout of this block, the exact meaning of size depends on this block.
 

Method Detail

getSizes

Size[] getSizes()
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...

Returns:
the map of sizes, may be empty or null

setLayout

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

Parameters:
size - the new layout
Throws:
IllegalArgumentException - if key is null or cannot be read

setBounds

void setBounds(int x,
               int y,
               int width,
               int height)
Sets the boundaries of this block. The component(s) represented by this block must somehow fit into the rectangle.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width in pixel
height - the height in pixel