org.omegahat.Graphics.Primitives
Class UDoubleExpression
java.lang.Object
|
+--org.omegahat.Graphics.Primitives.UDouble
|
+--org.omegahat.Graphics.Primitives.UDoubleExpression
- public class UDoubleExpression
- extends UDouble
An initial version of a symbolic UDouble
which supports addition and subtraction and which can be used
with nested elemetns to provide multiplication and division.
|
Method Summary |
void |
add(UDouble term)
|
void |
add(UDouble term,
int op)
|
int |
getNumEntries()
Accessor for numEntries field |
int[] |
getOperators()
Accessor for operators field |
UDouble[] |
getTerms()
Accessor for terms field |
int |
setNumEntries(int value)
Accessor for setting numEntries field |
int[] |
setOperators(int[] value)
Accessor for setting operators field |
UDouble[] |
setTerms(UDouble[] value)
Accessor for setting terms field |
protected int |
size(int n)
|
java.lang.String |
toString()
|
protected double |
transform(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize,
int dim)
|
double |
transformHeight(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
Maps the value of this object to NPC
and adjusts for the position of the origin and the potentially
different directions for the drawing coordinates. |
double |
transformWidth(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
|
double |
transformX(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
Map the value to parent coordinates
and adjust for the location of the origin
in the horizontal dimension. |
double |
transformY(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
Map the value to parent coordinates
and adjust for the location of the origin
in the vertical dimension. |
| Methods inherited from class org.omegahat.Graphics.Primitives.UDouble |
addValue, addValue, addValue, createInstance, subtractValue, transformDimension, transformLocation, unit, unit, value, value |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PLUS
public static final int PLUS
MINUS
public static final int MINUS
TIMES
public static final int TIMES
DIV
public static final int DIV
X
public static final int X
Y
public static final int Y
WIDTH
public static final int WIDTH
HEIGHT
public static final int HEIGHT
operators
protected int[] operators
terms
protected UDouble[] terms
numEntries
protected int numEntries
UDoubleExpression
public UDoubleExpression()
UDoubleExpression
public UDoubleExpression(int n)
UDoubleExpression
public UDoubleExpression(double val)
UDoubleExpression
public UDoubleExpression(UDouble val)
UDoubleExpression
public UDoubleExpression(UDouble val,
int op)
transformX
public double transformX(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
- Description copied from class:
UDouble
- Map the value to parent coordinates
and adjust for the location of the
origin
in the horizontal dimension.
- Overrides:
transformX in class UDouble
- Following copied from class:
org.omegahat.Graphics.Primitives.UDouble
- Parameters:
s - the components's scale on which this value should be transformed.thisCM - the absolute size of the appropriate dimensions (i.e. width or height)
component in centimeters.otherCM - the absolute size of the other dimension for use in square coordinates (SNPC).fontSize - the size of the component's fonts, in absolute points.- See Also:
#transformLocation(ScaleInt, double, double, double)
transformY
public double transformY(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
- Description copied from class:
UDouble
- Map the value to parent coordinates
and adjust for the location of the
origin
in the vertical dimension.
- Overrides:
transformY in class UDouble
- Following copied from class:
org.omegahat.Graphics.Primitives.UDouble
- Parameters:
s - the components's scale on which this value should be transformed.thisCM - the absolute size of the appropriate dimensions (i.e. width or height)
component in centimeters.otherCM - the absolute size of the other dimension for use in square coordinates (SNPC).fontSize - the size of the component's fonts, in absolute points.- See Also:
#transformLocation(ScaleInt, double, double, double)
transformWidth
public double transformWidth(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
- Overrides:
transformWidth in class UDouble
- Following copied from class:
org.omegahat.Graphics.Primitives.UDouble
- Parameters:
s - the components's scale on which this value should be transformed.thisCM - the absolute size of the appropriate dimensions (i.e. width or height)
component in centimeters.otherCM - the absolute size of the other dimension for use in square coordinates (SNPC).fontSize - the size of the component's fonts, in absolute points.
transformHeight
public double transformHeight(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize)
- Description copied from class:
UDouble
- Maps the value of this object to NPC
and adjusts for the position of the origin and the potentially
different directions for the drawing coordinates.
- Overrides:
transformHeight in class UDouble
- Following copied from class:
org.omegahat.Graphics.Primitives.UDouble
- Parameters:
s - the components's scale on which this value should be transformed.thisCM - the absolute size of the appropriate dimensions (i.e. width or height)
component in centimeters.otherCM - the absolute size of the other dimension for use in square coordinates (SNPC).fontSize - the size of the component's fonts, in absolute points.
transform
protected double transform(ScaleInt sx,
int origin,
double widthCM,
double heightCM,
int fontSize,
int dim)
add
public void add(UDouble term)
add
public void add(UDouble term,
int op)
size
protected int size(int n)
getOperators
public int[] getOperators()
- Accessor for
operators field
setOperators
public int[] setOperators(int[] value)
- Accessor for setting
operators field
getTerms
public UDouble[] getTerms()
- Accessor for
terms field
setTerms
public UDouble[] setTerms(UDouble[] value)
- Accessor for setting
terms field
getNumEntries
public int getNumEntries()
- Accessor for
numEntries field
setNumEntries
public int setNumEntries(int value)
- Accessor for setting
numEntries field
toString
public java.lang.String toString()
- Overrides:
toString in class UDouble