com.leafdigital.ui.api
Interface BorderPanel

All Superinterfaces:
Panel, Widget, WidgetParent

public interface BorderPanel
extends Panel

A Panel with nine component slots - all the compass points, plus a central component. The central component stretches to take up all available space. Other components are scaled to fit their desired sizes, similar to a Java BorderLayout.

There are three possible ways to handle corners.


Field Summary
static int CENTRAL
          BorderPanel slot: middle
static int CORNERS_HORIZONTALFILL
          Fill corners horizontally - if the NE corner is empty, then the N component will stretch horizontally to fill it.
static int CORNERS_LEAVEBLANK
          Leave corners blank - if the NE corner is empty, then it will remain empty; the panel will have a blank space there.
static int CORNERS_VERTICALFILL
          Fill corners vertically - if the NE corner is empty, then the E component will stretch vertically to fill it.
static int EAST
          BorderPanel slot: right
static int NORTH
          BorderPanel slot: top
static int NORTHEAST
          BorderPanel slot: top right
static int NORTHWEST
          BorderPanel slot: top left
static int SOUTH
          BorderPanel slot: bottom
static int SOUTHEAST
          BorderPanel slot: bottom right
static int SOUTHWEST
          BorderPanel slot: bottom left
static int WEST
          BorderPanel slot: left
 
Method Summary
 Widget get(int slot)
          Retrieves the widget in one slot of the BorderPanel
 void set(int slot, Widget w)
          Sets the component in one slot of the BorderPanel.
 void setCornerHandling(int corners)
          Control the way corners are handled, if a component isn't placed in those slots.
 void setSpacing(int spacing)
          Sets the margin between grid rows/columns.
 
Methods inherited from interface com.leafdigital.ui.api.Panel
remove, removeAll, setBorder
 
Methods inherited from interface com.leafdigital.ui.api.Widget
getID, getOwner, informClosed, isVisible, setOwner, setVisible
 
Methods inherited from interface com.leafdigital.ui.api.WidgetParent
getWidgets
 

Field Detail

NORTH

static final int NORTH
BorderPanel slot: top

See Also:
Constant Field Values

NORTHEAST

static final int NORTHEAST
BorderPanel slot: top right

See Also:
Constant Field Values

EAST

static final int EAST
BorderPanel slot: right

See Also:
Constant Field Values

SOUTHEAST

static final int SOUTHEAST
BorderPanel slot: bottom right

See Also:
Constant Field Values

SOUTH

static final int SOUTH
BorderPanel slot: bottom

See Also:
Constant Field Values

SOUTHWEST

static final int SOUTHWEST
BorderPanel slot: bottom left

See Also:
Constant Field Values

WEST

static final int WEST
BorderPanel slot: left

See Also:
Constant Field Values

NORTHWEST

static final int NORTHWEST
BorderPanel slot: top left

See Also:
Constant Field Values

CENTRAL

static final int CENTRAL
BorderPanel slot: middle

See Also:
Constant Field Values

CORNERS_HORIZONTALFILL

static final int CORNERS_HORIZONTALFILL
Fill corners horizontally - if the NE corner is empty, then the N component will stretch horizontally to fill it. C stretches to fill W/E.

See Also:
Constant Field Values

CORNERS_VERTICALFILL

static final int CORNERS_VERTICALFILL
Fill corners vertically - if the NE corner is empty, then the E component will stretch vertically to fill it. C stretches to fill N/S.

See Also:
Constant Field Values

CORNERS_LEAVEBLANK

static final int CORNERS_LEAVEBLANK
Leave corners blank - if the NE corner is empty, then it will remain empty; the panel will have a blank space there.

See Also:
Constant Field Values
Method Detail

set

void set(int slot,
         Widget w)
Sets the component in one slot of the BorderPanel.

Parameters:
slot - Slot ID (BorderPanel.NORTH, etc.)
w - New component for slot (may be null to remove existing component)

get

Widget get(int slot)
Retrieves the widget in one slot of the BorderPanel

Parameters:
slot - Slot ID (BorderPanel.NORTH, etc.)
Returns:
Widget in that slot or null if none

setSpacing

void setSpacing(int spacing)
Sets the margin between grid rows/columns. The default is for no margin.

Parameters:
spacing - Spacing in pixels (if in doubt, use 4)

setCornerHandling

void setCornerHandling(int corners)
Control the way corners are handled, if a component isn't placed in those slots. The default is CORNERS_HORIZONTALFILL.

Parameters:
corners - A CORNER_xxx constant


Copyright © 2011 Samuel Marshall. All rights reserved.