|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.miginfocom.util.gfx.geometry.numbers.AtFraction
public final class AtFraction
A value that is a aligned somewhere between start and end. Basically returns start + (end - start) * f.
E.g. 0.3f is 30% from start.
| Field Summary | |
|---|---|
static AtFraction |
CENTER
Same as new AtFraction(0.5f) but can be used to avoid creating new objects. |
static AtFraction |
END
Same as new AtFraction(1f) but can be used to avoid creating new objects. |
static AtFraction |
START
Same as new AtFraction(0f) but can be used to avoid creating new objects. |
| Constructor Summary | |
|---|---|
AtFraction(float p)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
float |
getFraction()
Returns the percent value sent into the constructor. |
int |
getIntValue(float ref)
Returns a value rounded to an int, possibly depending on the ref. |
int |
getIntValue(float start,
float end)
Returns start + (end - start) * d rounded to the closest int. |
float |
getValue(float ref)
Returns a value, possibly depending on the ref. |
float |
getValue(float start,
float end)
Returns start + (end - start) * d. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final AtFraction START
new AtFraction(0f) but can be used to avoid creating new objects. Could also been namnd ZERO or NONE.
public static final AtFraction CENTER
new AtFraction(0.5f) but can be used to avoid creating new objects. Could also been namnd MIDDLE or HALF.
public static final AtFraction END
new AtFraction(1f) but can be used to avoid creating new objects. Could also been namnd FULL or ONE.
| Constructor Detail |
|---|
public AtFraction(float p)
p - The alignment somewhere between start and end. 0.0 is at start and 1.0 is at end.| Method Detail |
|---|
public float getValue(float ref)
AtRefNumberref.
getValue in interface AtRefNumberref - Some reference value. Might be used or disregarded depending on implementation.
public int getIntValue(float ref)
AtRefNumberint, possibly depending on the ref.
getIntValue in interface AtRefNumberref - Some reference value. Might be used or disregarded depending on implementation.
int.
public final float getValue(float start,
float end)
start + (end - start) * d.
getValue in interface AtRefRangeNumberstart - The start value.end - The end value.
start + (end - start) * d
public final int getIntValue(float start,
float end)
start + (end - start) * d rounded to the closest int.
getIntValue in interface AtRefRangeNumberstart - The start value.end - The end value.
start + (end - start) * d rounded to the closest int.public final float getFraction()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||