|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.gui.AnchorPoint
public final class AnchorPoint
Used to specify where some item should be anchored relative to
its container if extra width or height is available in the container.
Some anchors also specify whether or not an item's width (or height)
should be flexed (stretched or shrunk) to match the available
width (or height).
See each of the sixteen anchors defined for specifics:
CENTER, NORTH, NORTHEAST, EAST,
SOUTHEAST, SOUTH, SOUTHWEST,
WEST, NORTHWEST,
TOP_FLEX_WIDTH, CENTER_FLEX_WIDTH,
BOTTOM_FLEX_WIDTH, LEFT_FLEX_HEIGHT,
CENTER_FLEX_HEIGHT, RIGHT_FLEX_HEIGHT, and
CENTER_FLEX_BOTH.
| Field Summary | |
|---|---|
static AnchorPoint |
BOTTOM_FLEX_WIDTH
Anchor in the bottom (southern) region, but match the width to the available width of the container. |
static AnchorPoint |
CENTER
Anchor in the CENTER region. |
static AnchorPoint |
CENTER_FLEX_BOTH
Anchor in the CENTER (middle) region, but match the width to the available width of the container and match the height to the available height of the container. |
static AnchorPoint |
CENTER_FLEX_HEIGHT
Anchor in the CENTER (middle) region, but match the height to the available height of the container. |
static AnchorPoint |
CENTER_FLEX_WIDTH
Anchor in the CENTER (middle) region, but match the width to the available width of the container. |
static AnchorPoint |
EAST
Anchor in the EAST (middle right) region. |
static AnchorPoint |
LEFT_FLEX_HEIGHT
Anchor in the left (western) region, but match the height to the available height of the container. |
static AnchorPoint |
NORTH
Anchor in the NORTH (centered, top) region. |
static AnchorPoint |
NORTHEAST
Anchor in the NORTHEAST (top right) region. |
static AnchorPoint |
NORTHWEST
Anchor in the NORTHWEST (top, left) region. |
static AnchorPoint |
RIGHT_FLEX_HEIGHT
Anchor in the right (eastern) region, but match the height to the available height of the container. |
static AnchorPoint |
SOUTH
Anchor in the SOUTH (centered, bottom) region. |
static AnchorPoint |
SOUTHEAST
Anchor in the SOUTHEAST (bottom, right) region. |
static AnchorPoint |
SOUTHWEST
Anchor in the SOUTHWEST (bottom, left) region. |
static AnchorPoint |
TOP_FLEX_WIDTH
Anchor in the top (northern) region, but match the width to the available width of the container. |
static List<AnchorPoint> |
VALUE_LIST
Unmodifiable List of all the instances of AnchorPoint. |
static AnchorPoint |
WEST
Anchor in the WEST (middle, left) region. |
static AnchorPoint[] |
ZERO_LEN_ARRAY
An array with exactly zero slots and a component type of AnchorPoint. |
| Method Summary | |
|---|---|
Rectangle |
calcBounds(int width,
int height,
int availableWidth,
int availableHeight)
Calculates the x and y offsets, width, and height based on the anchor settings always creating a new Rectangle. |
Rectangle |
calcBounds(int width,
int height,
int availableWidth,
int availableHeight,
Rectangle dest)
Calculates the x and y offsets, width, and height based on the anchor settings. |
Point |
calcOffset(int width,
int height,
int availableWidth,
int availableHeight)
Calculates the offsets, always creating a new Point. |
Point |
calcOffset(int width,
int height,
int availableWidth,
int availableHeight,
Point dest)
Calculates the x and y offsets based on the anchor settings. |
int |
compareTo(AnchorPoint other)
|
boolean |
equals(Object obj)
|
String |
getName()
Returns the name of this anchor. |
static AnchorPoint[] |
getValues()
Returns an array of all the legal values. |
int |
hashCode()
|
boolean |
isBottom()
Returns true if the anchoring results in the bottom side of the item being placed as far down as possible in the container when the container has extra height available. |
boolean |
isFlexHeight()
Returns true if the alignment is any of: LEFT_FLEX_HEIGHT, CENTER_FLEX_HEIGHT,
RIGHT_FLEX_HEIGHT, or CENTER_FLEX_BOTH. |
boolean |
isFlexWidth()
Returns true if the alignment is any of: TOP_FLEX_WIDTH, CENTER_FLEX_WIDTH,
BOTTOM_FLEX_WIDTH, or CENTER_FLEX_BOTH. |
boolean |
isHorizontalMiddle()
Returns true if the anchoring results in the extra width being split between the left side and right side of the item when the container has extra width available. |
boolean |
isLeft()
Returns true if the anchoring results in the left side of the item being placed as far left as possible in the container when the container has extra width available. |
boolean |
isRight()
Returns true if the anchoring results in the right side of the item being placed as far right as possible in the container when the container has extra width available. |
boolean |
isTop()
Returns true if the anchoring results in the top side of the item being placed as far up as possible in the container when the container has extra height available. |
boolean |
isVerticalMiddle()
Returns true if the anchoring results in the extra height being split above and below the item when the container has extra height available. |
String |
toString()
|
static AnchorPoint |
valueOf(String name)
Returns the instance whose getName() method returns
a String that matches the name passed in. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final AnchorPoint CENTER
| CENTER: |
|
public static final AnchorPoint NORTH
| NORTH: |
|
public static final AnchorPoint NORTHEAST
| NORTHEAST: |
|
public static final AnchorPoint EAST
| EAST: |
|
public static final AnchorPoint SOUTHEAST
| SOUTHEAST: |
|
public static final AnchorPoint SOUTH
| SOUTH: |
|
public static final AnchorPoint SOUTHWEST
| SOUTHWEST: |
|
public static final AnchorPoint WEST
| WEST: |
|
public static final AnchorPoint NORTHWEST
| NORTHWEST: |
|
public static final AnchorPoint TOP_FLEX_WIDTH
| TOP_FLEX_WIDTH: |
|
public static final AnchorPoint CENTER_FLEX_WIDTH
| CENTER_FLEX_WIDTH: |
|
public static final AnchorPoint BOTTOM_FLEX_WIDTH
| BOTTOM_FLEX_WIDTH: |
|
public static final AnchorPoint LEFT_FLEX_HEIGHT
| LEFT_FLEX_HEIGHT: |
|
public static final AnchorPoint CENTER_FLEX_HEIGHT
| CENTER_FLEX_HEIGHT: |
|
public static final AnchorPoint RIGHT_FLEX_HEIGHT
| RIGHT_FLEX_HEIGHT: |
|
public static final AnchorPoint CENTER_FLEX_BOTH
| CENTER_FLEX_BOTH: |
|
public static final AnchorPoint[] ZERO_LEN_ARRAY
public static final List<AnchorPoint> VALUE_LIST
List of all the instances of AnchorPoint.
| Method Detail |
|---|
public static AnchorPoint[] getValues()
public static AnchorPoint valueOf(String name)
throws IllegalArgumentException
getName() method returns
a String that matches the name passed in.
The matching is done ignoring any case differences and after
trimming any leading or trailing whitespace on the string
passed in.
name - the name to search for.
IllegalArgumentException - if no match is found.public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic int compareTo(AnchorPoint other)
compareTo in interface Comparable<AnchorPoint>public String getName()
public boolean isLeft()
WEST, NORTHWEST, SOUTHWEST,
LEFT_FLEX_HEIGHT,
TOP_FLEX_WIDTH, CENTER_FLEX_WIDTH,
BOTTOM_FLEX_WIDTH, or CENTER_FLEX_BOTH.
public boolean isRight()
EAST, NORTHEAST, SOUTHEAST,
RIGHT_FLEX_HEIGHT,
TOP_FLEX_WIDTH, CENTER_FLEX_WIDTH,
BOTTOM_FLEX_WIDTH, or CENTER_FLEX_BOTH.
public boolean isHorizontalMiddle()
CENTER, NORTH, SOUTH,
CENTER_FLEX_HEIGHT,
TOP_FLEX_WIDTH, CENTER_FLEX_WIDTH,
BOTTOM_FLEX_WIDTH, or CENTER_FLEX_BOTH.
public boolean isTop()
NORTH, NORTHEAST, NORTHWEST,
TOP_FLEX_WIDTH,
LEFT_FLEX_HEIGHT, CENTER_FLEX_HEIGHT,
RIGHT_FLEX_HEIGHT, CENTER_FLEX_BOTH.
public boolean isBottom()
SOUTH, SOUTHEAST, SOUTHWEST,
BOTTOM_FLEX_WIDTH,
LEFT_FLEX_HEIGHT, CENTER_FLEX_HEIGHT,
RIGHT_FLEX_HEIGHT, CENTER_FLEX_BOTH.
public boolean isVerticalMiddle()
CENTER, EAST, WEST,
CENTER_FLEX_WIDTH,
LEFT_FLEX_HEIGHT, CENTER_FLEX_HEIGHT,
RIGHT_FLEX_HEIGHT, CENTER_FLEX_BOTH.
public boolean isFlexWidth()
TOP_FLEX_WIDTH, CENTER_FLEX_WIDTH,
BOTTOM_FLEX_WIDTH, or CENTER_FLEX_BOTH.
public boolean isFlexHeight()
LEFT_FLEX_HEIGHT, CENTER_FLEX_HEIGHT,
RIGHT_FLEX_HEIGHT, or CENTER_FLEX_BOTH.
public Rectangle calcBounds(int width,
int height,
int availableWidth,
int availableHeight,
Rectangle dest)
width - of the item to anchor.height - of the item to anchor.availableWidth - of the space to be anchored within.availableHeight - of the space to be anchored within.dest - Rectangle to load with offsets. If null is
passed, a new Rectangle is allocated.
public Rectangle calcBounds(int width,
int height,
int availableWidth,
int availableHeight)
return calcOffset(width, height, availableWidth, availableHeight, null);
public Point calcOffset(int width,
int height,
int availableWidth,
int availableHeight,
Point dest)
width - of the item to anchor.height - of the item to anchor.availableWidth - of the space to be anchored within.availableHeight - of the space to be anchored within.dest - Point to load with offsets. If null is
passed, a new Point is allocated.
public Point calcOffset(int width,
int height,
int availableWidth,
int availableHeight)
return calcOffset(width, height, availableWidth, availableHeight, null);
|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||