public enum Anchor extends Enum<Anchor>
Enum Constant and Description |
---|
BottomCenter |
BottomLeft |
BottomRight |
CenterCenter |
CenterLeft |
CenterRight |
TopCenter |
TopLeft |
TopRight |
Modifier and Type | Method and Description |
---|---|
Rectangle |
getRectangle(Point location,
int width,
int height)
Reconstructs the rectangle from a location anchored inside
|
Point |
getRectangleCoordinates(Rectangle rectangle)
Gets the coordinate inside given rectangle
|
double |
getRelativeX() |
double |
getRelativeY() |
int |
getRelevantParameters() |
Rectangle |
placeInside(Rectangle inner,
Rectangle outer)
Places the inner rectangle into the outer rectangle according to the anchor
|
static Anchor |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Anchor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Anchor TopLeft
public static final Anchor TopCenter
public static final Anchor TopRight
public static final Anchor BottomLeft
public static final Anchor BottomCenter
public static final Anchor BottomRight
public static final Anchor CenterLeft
public static final Anchor CenterRight
public static final Anchor CenterCenter
public static Anchor[] values()
for (Anchor c : Anchor.values()) System.out.println(c);
public static Anchor valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getRelevantParameters()
public Rectangle getRectangle(Point location, int width, int height)
width
- the widthheight
- the heightpublic Point getRectangleCoordinates(Rectangle rectangle)
rectangle
- the rectanglepublic Rectangle placeInside(Rectangle inner, Rectangle outer)
inner
- the inner (x and y are used to shift the rectangle; ignored on center-center); relative x and youter
- the outer rectangle; absolute x and ypublic double getRelativeX()
public double getRelativeY()
Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.