|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.properties.Position
public class Position
The Position
class is an abstraction of a positional value tuple.
It can be used with percentual values or absolute pixels and can be global or Widget local.
Constructor Summary | |
---|---|
protected |
Position(Widget widget,
boolean isGlobalPosition,
RelativePositioning positioning,
float x,
boolean xPercent,
float y,
boolean yPercent,
AbstractSize size)
|
Method Summary | |
---|---|
void |
bake()
|
boolean |
equalsEffective(int x,
int y)
|
Position |
flipXPercentagePx()
|
Position |
flipYPercentagePx()
|
int |
getEffectiveX()
Gets the effective Widget's x-location using getPositioning() . |
int |
getEffectiveY()
Gets the effective Widget's y-location using getPositioning() . |
RelativePositioning |
getPositioning()
|
Property |
getPositioningProperty(java.lang.String name)
|
Property |
getPositioningProperty(java.lang.String name,
java.lang.String nameForDisplay)
|
Widget |
getWidget()
|
PosSizeProperty |
getXProperty(java.lang.String name)
|
PosSizeProperty |
getXProperty(java.lang.String name,
java.lang.String nameForDisplay)
|
PosSizeProperty |
getYProperty(java.lang.String name)
|
PosSizeProperty |
getYProperty(java.lang.String name,
java.lang.String nameForDisplay)
|
boolean |
isBaked()
|
boolean |
isGlobalPosition()
|
static Position |
newGlobalPosition(Widget widget,
RelativePositioning positioning,
float x,
boolean xPercent,
float y,
boolean yPercent,
AbstractSize size)
Create a new positional property for global positions on the whole screen area. |
static Position |
newLocalPosition(Widget widget,
RelativePositioning positioning,
float x,
boolean xPercent,
float y,
boolean yPercent,
AbstractSize size)
Create a new positional property for positions local to a Widget's area. |
protected void |
onPositioningPropertySet(RelativePositioning positioning)
|
protected void |
onXPropertySet(float x)
|
protected void |
onYPropertySet(float y)
|
static float |
parseValue(java.lang.String value,
boolean defaultPerc)
|
boolean |
setEffectivePosition(int x,
int y)
Sets this Widget's position. |
boolean |
setEffectivePosition(RelativePositioning positioning,
int x,
int y)
Sets this Widget's position. |
void |
setTo(Position position)
Sets the Position to the values of the given Position . |
Position |
setXToPercents()
|
Position |
setXToPixels()
|
Position |
setYToPercents()
|
Position |
setYToPixels()
|
void |
unbake()
|
static java.lang.String |
unparseValue(float value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Position(Widget widget, boolean isGlobalPosition, RelativePositioning positioning, float x, boolean xPercent, float y, boolean yPercent, AbstractSize size)
Method Detail |
---|
public final Widget getWidget()
public final boolean isGlobalPosition()
public final RelativePositioning getPositioning()
public void setTo(Position position)
Position
to the values of the given Position
.
position
- public final boolean setEffectivePosition(RelativePositioning positioning, int x, int y)
positioning
- the used RelativePositioning
x
- the absolute pixel xy
- the absolute pixel y
public final boolean setEffectivePosition(int x, int y)
x
- the absolute pixel xy
- the absolute pixel y
public final int getEffectiveX()
getPositioning()
.
public final int getEffectiveY()
getPositioning()
.
public final boolean equalsEffective(int x, int y)
public void unbake()
public void bake()
public final boolean isBaked()
public Position setXToPercents()
public Position setXToPixels()
public Position flipXPercentagePx()
public Position setYToPercents()
public Position setYToPixels()
public Position flipYPercentagePx()
public static float parseValue(java.lang.String value, boolean defaultPerc)
public static java.lang.String unparseValue(float value)
protected void onPositioningPropertySet(RelativePositioning positioning)
positioning
- the new positioningpublic Property getPositioningProperty(java.lang.String name, java.lang.String nameForDisplay)
public final Property getPositioningProperty(java.lang.String name)
protected void onXPropertySet(float x)
x
- the new xpublic PosSizeProperty getXProperty(java.lang.String name, java.lang.String nameForDisplay)
public final PosSizeProperty getXProperty(java.lang.String name)
protected void onYPropertySet(float y)
y
- the new ypublic PosSizeProperty getYProperty(java.lang.String name, java.lang.String nameForDisplay)
public final PosSizeProperty getYProperty(java.lang.String name)
public static final Position newLocalPosition(Widget widget, RelativePositioning positioning, float x, boolean xPercent, float y, boolean yPercent, AbstractSize size)
widget
- the owning Widget
.positioning
- the used RelativePositioning
x
- the x positionxPercent
- interpret 'x' as percents?y
- the y positionyPercent
- interpret 'y' as percents?size
- the size for the area
public static final Position newGlobalPosition(Widget widget, RelativePositioning positioning, float x, boolean xPercent, float y, boolean yPercent, AbstractSize size)
widget
- the owning Widget
.positioning
- the used RelativePositioning
x
- the x positionxPercent
- interpret 'x' as percents?y
- the y positionyPercent
- interpret 'y' as percents?size
- the size for the area
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |