com.vlsolutions.swing.docking
Class RelativeDockablePosition
java.lang.Object
com.vlsolutions.swing.docking.RelativeDockablePosition
public class RelativeDockablePosition
extends java.lang.Object
This class is an immutable object used to remember the relative positionning
of docked components.
x, y, w, h
fields are expressed with
double
values
varying from 0 to 1.
- x : 0 = left, 1 = right
- y : 0 = top, 1 = bottom
- w : 0 = no width, 1-x = full remaining width
- h : 0 = no height, 1-y = full remaining height
Objects of this class are used to reposition a Dockable on the desktop, based
on lazy constraints : As the desktop is a mix of horizontal and vertical
split panes (
SplitContainer
) it is not always possible to put a dockable
exactly where you want given a set of x,y, w, and h constraints.
RelativeDockablePosition() - Constructs an empty relative position (all fields are initialized with 0.0 values)
|
RelativeDockablePosition(Container relativeAncestorContainer, double x, double y, double w, double h) - Constructs a relative position with a given location and size, relative to a container
|
RelativeDockablePosition(double x, double y, double w, double h) - Constructs a relative position with given location and size.
|
int | getAnchors() - Returns an integer value representing the anchoring of the dockable relatively to
its ancestor container.
|
double | getHeight() - Returns the relative height of the dockable
|
Container | getRelativeAncestorContainer() - Returns the ancestor container used as a reference for the relative potionning
This can be a DockingPanel (top level ancestor) or CompoundDockingPanel (intermediate ancestor)
|
double | getWidth() - Returns the relative width of the dockable
|
double | getX() - Returns the relative x position of the dockable
|
double | getY() - Returns the relative y position of the dockable
|
void | resetRelativePosition(Container relativeAncestorContainer, Dockable dockable) - Updates the current relative ancestor container and anchor positionning
|
String | toString() - Returns a meaningfull string representation of this RelativeDockablePosition
|
BOTTOM
public static final RelativeDockablePosition BOTTOM
convenience field referencing the BOTTOM border of the DockingDesktop
BOTTOM_CENTER
public static final RelativeDockablePosition BOTTOM_CENTER
convenience field referencing the CENTER part of the BOTTOM border of the DockingDesktop
BOTTOM_LEFT
public static final RelativeDockablePosition BOTTOM_LEFT
convenience field referencing the TOP-RIGHT corner of the DockingDesktop
BOTTOM_RIGHT
public static final RelativeDockablePosition BOTTOM_RIGHT
convenience field referencing the TOP-RIGHT corner of the DockingDesktop
LEFT
public static final RelativeDockablePosition LEFT
convenience field referencing the LEFT border of the DockingDesktop
LEFT_CENTER
public static final RelativeDockablePosition LEFT_CENTER
convenience field referencing the CENTER part of the LEFT border of the DockingDesktop
RIGHT
public static final RelativeDockablePosition RIGHT
convenience field referencing the RIGHT border of the DockingDesktop
RIGHT_CENTER
public static final RelativeDockablePosition RIGHT_CENTER
convenience field referencing the CENTER part of the RIGHT border of the DockingDesktop
TOP_CENTER
public static final RelativeDockablePosition TOP_CENTER
convenience field referencing the CENTER part of TOP border of the DockingDesktop
TOP_LEFT
public static final RelativeDockablePosition TOP_LEFT
convenience field referencing the TOP-LEFT corner of the DockingDesktop
TOP_RIGHT
public static final RelativeDockablePosition TOP_RIGHT
convenience field referencing the TOP-RIGHT corner of the DockingDesktop
RelativeDockablePosition
public RelativeDockablePosition()
Constructs an empty relative position (all fields are initialized with 0.0 values)
RelativeDockablePosition
public RelativeDockablePosition(Container relativeAncestorContainer,
double x,
double y,
double w,
double h)
Constructs a relative position with a given location and size, relative to a container
RelativeDockablePosition
public RelativeDockablePosition(double x,
double y,
double w,
double h)
Constructs a relative position with given location and size.
Please remember that the values must be between 0 and 1, as they designate
relative coordinates position/size.
getAnchors
public int getAnchors()
Returns an integer value representing the anchoring of the dockable relatively to
its ancestor container.
For example a dockable at the top left angle of an ancestor container will have an
"anchors" value or : AnchorConstraints.ANCHOR_TOP|AnchorConstraints.ANCHOR_LEFT
getHeight
public double getHeight()
Returns the relative height of the dockable
getRelativeAncestorContainer
public Container getRelativeAncestorContainer()
Returns the ancestor container used as a reference for the relative potionning
This can be a DockingPanel (top level ancestor) or CompoundDockingPanel (intermediate ancestor)
getWidth
public double getWidth()
Returns the relative width of the dockable
getX
public double getX()
Returns the relative x position of the dockable
getY
public double getY()
Returns the relative y position of the dockable
resetRelativePosition
public void resetRelativePosition(Container relativeAncestorContainer,
Dockable dockable)
Updates the current relative ancestor container and anchor positionning
toString
public String toString()
Returns a meaningfull string representation of this RelativeDockablePosition
© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications