Crossfire JXClient, Trunk
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.gui.Expression Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.gui.gui.Expression:
Collaboration graph

Public Member Functions

int evaluate (final int width, final int height, final int prefWidth, final int prefHeight)
 
int evaluateConstant ()
 
 Expression (@NotNull final Expression expression1, final boolean negative, @NotNull final Expression expression2)
 
 Expression (final int constant, final float widthFactor, final float heightFactor, final float prefWidthFactor, final float prefHeightFactor)
 

Static Private Member Functions

static int applyFactor (final int value, final float factor)
 

Private Attributes

final int constant
 
final float heightFactor
 
final float prefHeightFactor
 
final float prefWidthFactor
 
final float widthFactor
 

Detailed Description

An expression yielding an integer value derived from a screen resolution.

Author
Andreas Kirschbaum

Definition at line 31 of file Expression.java.

Constructor & Destructor Documentation

◆ Expression() [1/2]

com.realtime.crossfire.jxclient.gui.gui.Expression.Expression ( final int  constant,
final float  widthFactor,
final float  heightFactor,
final float  prefWidthFactor,
final float  prefHeightFactor 
)

Creates a new instance.

Parameters
constantthe constant term
widthFactorthe screen width dependent factor
heightFactorthe screen height dependent factor
prefWidthFactorthe preferred width dependent factor
prefHeightFactorthe preferred height dependent factor

Definition at line 66 of file Expression.java.

References com.realtime.crossfire.jxclient.gui.gui.Expression.constant, com.realtime.crossfire.jxclient.gui.gui.Expression.heightFactor, com.realtime.crossfire.jxclient.gui.gui.Expression.prefHeightFactor, com.realtime.crossfire.jxclient.gui.gui.Expression.prefWidthFactor, and com.realtime.crossfire.jxclient.gui.gui.Expression.widthFactor.

◆ Expression() [2/2]

com.realtime.crossfire.jxclient.gui.gui.Expression.Expression ( @NotNull final Expression  expression1,
final boolean  negative,
@NotNull final Expression  expression2 
)

Creates a new instance as the sum or difference of two expressions.

Parameters
expression1the left expression
negativewhether the right expression should be added (
false
) or subtracted (
true
)
expression2the right expression

Definition at line 81 of file Expression.java.

References com.realtime.crossfire.jxclient.gui.gui.Expression.constant, com.realtime.crossfire.jxclient.gui.gui.Expression.heightFactor, com.realtime.crossfire.jxclient.gui.gui.Expression.prefHeightFactor, com.realtime.crossfire.jxclient.gui.gui.Expression.prefWidthFactor, and com.realtime.crossfire.jxclient.gui.gui.Expression.widthFactor.

Member Function Documentation

◆ applyFactor()

static int com.realtime.crossfire.jxclient.gui.gui.Expression.applyFactor ( final int  value,
final float  factor 
)
staticprivate

Applies a factor to a value.

Parameters
valuethe value
factorthe factor
Returns
the result

Definition at line 120 of file Expression.java.

Referenced by com.realtime.crossfire.jxclient.gui.gui.Expression.evaluate().

Here is the caller graph for this function:

◆ evaluate()

int com.realtime.crossfire.jxclient.gui.gui.Expression.evaluate ( final int  width,
final int  height,
final int  prefWidth,
final int  prefHeight 
)

◆ evaluateConstant()

int com.realtime.crossfire.jxclient.gui.gui.Expression.evaluateConstant ( )

Member Data Documentation

◆ constant

final int com.realtime.crossfire.jxclient.gui.gui.Expression.constant
private

◆ heightFactor

final float com.realtime.crossfire.jxclient.gui.gui.Expression.heightFactor
private

◆ prefHeightFactor

final float com.realtime.crossfire.jxclient.gui.gui.Expression.prefHeightFactor
private

◆ prefWidthFactor

final float com.realtime.crossfire.jxclient.gui.gui.Expression.prefWidthFactor
private

◆ widthFactor

final float com.realtime.crossfire.jxclient.gui.gui.Expression.widthFactor
private

The documentation for this class was generated from the following file: