public final class Gravity
extends org.freedesktop.bindings.Constant
move()
. The gravity for a
Window is set by setGravity()
.
It turns out the whole gravity concept is unreliable; luckily you don't
really need it for much. And in any case, if you're trying to move the
Window around; what you probably want is
setPosition()
.
Modifier and Type | Field and Description |
---|---|
static Gravity |
CENTER
Reference point is with respect to the center of the screen.
|
static Gravity |
EAST
Co-ordinates are with respect to the center of the right-hand edge of
the Window.
|
static Gravity |
NORTH
Co-ordinates are with respect to the center of the top edge of the
Window.
|
static Gravity |
NORTH_EAST |
static Gravity |
NORTH_WEST
Orientation to the top left corner of the screen and co-ordinates
running right and down.
|
static Gravity |
SOUTH
Co-ordinates are with respect to the center of the bottom edge of the
Window.
|
static Gravity |
SOUTH_EAST |
static Gravity |
SOUTH_WEST |
static Gravity |
STATIC
This is a weird one: it is in reference to the top-left corner of the
Window itself (like
NORTH_WEST but ignoring whatever
decorations etc have been added outside by the window manager. |
static Gravity |
WEST
Co-ordinates are with respect to the center of the left-hand edge of
the Window.
|
public static final Gravity CENTER
setPosition()
with an argument of
CENTER
or
CENTER_ALWAYS
instead.public static final Gravity EAST
public static final Gravity NORTH
public static final Gravity NORTH_EAST
public static final Gravity NORTH_WEST
x
,y
to mean on an
X display: horizontal and vertical distance from the top-left corner.public static final Gravity SOUTH
public static final Gravity SOUTH_EAST
public static final Gravity SOUTH_WEST
public static final Gravity STATIC
NORTH_WEST
but ignoring whatever
decorations etc have been added outside by the window manager. At first
this would seem brilliantly useful, but since it ignores window
decorations, moving to the co-ordinates returned by
getPosition()
will actually
cause the Window to move slightly on the screen, rather than staying
still as you might have expected. So even when you think you want this,
you really want NORTH_WEST, which is why it's the default.public static final Gravity WEST