|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vlsolutions.swing.docking.RelativeDockablePosition
public class RelativeDockablePosition
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.
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.
Field Summary | |
---|---|
static RelativeDockablePosition |
BOTTOM
convenience field referencing the BOTTOM border of the DockingDesktop |
static RelativeDockablePosition |
BOTTOM_CENTER
convenience field referencing the CENTER part of the BOTTOM border of the DockingDesktop |
static RelativeDockablePosition |
BOTTOM_LEFT
convenience field referencing the TOP-RIGHT corner of the DockingDesktop |
static RelativeDockablePosition |
BOTTOM_RIGHT
convenience field referencing the TOP-RIGHT corner of the DockingDesktop |
static RelativeDockablePosition |
LEFT
convenience field referencing the LEFT border of the DockingDesktop |
static RelativeDockablePosition |
LEFT_CENTER
convenience field referencing the CENTER part of the LEFT border of the DockingDesktop |
static RelativeDockablePosition |
RIGHT
convenience field referencing the RIGHT border of the DockingDesktop |
static RelativeDockablePosition |
RIGHT_CENTER
convenience field referencing the CENTER part of the RIGHT border of the DockingDesktop |
static RelativeDockablePosition |
TOP
convenience field referencing the TOP border of the DockingDesktop |
static RelativeDockablePosition |
TOP_CENTER
convenience field referencing the CENTER part of TOP border of the DockingDesktop |
static RelativeDockablePosition |
TOP_LEFT
convenience field referencing the TOP-LEFT corner of the DockingDesktop |
static RelativeDockablePosition |
TOP_RIGHT
convenience field referencing the TOP-RIGHT corner of the DockingDesktop |
Constructor Summary | |
---|---|
RelativeDockablePosition()
Constructs an empty relative position (all fields are initialized with 0.0 values) |
|
RelativeDockablePosition(java.awt.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. |
Method Summary | |
---|---|
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 |
java.awt.Container |
getRelativeAncestorContainer()
Returns the ancestor container used as a reference for the relative potionning |
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(java.awt.Container relativeAncestorContainer,
Dockable dockable)
Updates the current relative ancestor container and anchor positionning |
java.lang.String |
toString()
Returns a meaningfull string representation of this RelativeDockablePosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RelativeDockablePosition TOP
public static final RelativeDockablePosition TOP_CENTER
public static final RelativeDockablePosition TOP_RIGHT
public static final RelativeDockablePosition TOP_LEFT
public static final RelativeDockablePosition RIGHT
public static final RelativeDockablePosition RIGHT_CENTER
public static final RelativeDockablePosition BOTTOM_RIGHT
public static final RelativeDockablePosition BOTTOM
public static final RelativeDockablePosition BOTTOM_CENTER
public static final RelativeDockablePosition BOTTOM_LEFT
public static final RelativeDockablePosition LEFT
public static final RelativeDockablePosition LEFT_CENTER
Constructor Detail |
---|
public RelativeDockablePosition()
public RelativeDockablePosition(double x, double y, double w, double h)
Please remember that the values must be between 0 and 1, as they designate relative coordinates position/size.
java.lang.IllegalArgumentException
- if values are not in the given boundspublic RelativeDockablePosition(java.awt.Container relativeAncestorContainer, double x, double y, double w, double h)
Method Detail |
---|
public double getX()
public double getY()
public double getWidth()
public double getHeight()
public java.lang.String toString()
toString
in class java.lang.Object
public java.awt.Container getRelativeAncestorContainer()
This can be a DockingPanel (top level ancestor) or CompoundDockingPanel (intermediate ancestor)
public int getAnchors()
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
AnchorConstraints
public void resetRelativePosition(java.awt.Container relativeAncestorContainer, Dockable dockable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |