 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.gui;
25 import org.jetbrains.annotations.NotNull;
82 final int factor = negative ? -1 : 1;
83 constant = expression1.constant+expression2.constant*factor;
84 widthFactor = expression1.widthFactor+expression2.widthFactor*factor;
85 heightFactor = expression1.heightFactor+expression2.heightFactor*factor;
86 prefWidthFactor = expression1.prefWidthFactor+expression2.prefWidthFactor*factor;
87 prefHeightFactor = expression1.prefHeightFactor+expression2.prefHeightFactor*factor;
98 public int evaluate(
final int width,
final int height,
final int prefWidth,
final int prefHeight) {
120 private static int applyFactor(
final int value,
final float factor) {
121 return Math.round(value*factor);
final float prefHeightFactor
The preferred height dependent factor.
static int applyFactor(final int value, final float factor)
Applies a factor to a value.
final float heightFactor
The screen height dependent factor.
Expression(@NotNull final Expression expression1, final boolean negative, @NotNull final Expression expression2)
Creates a new instance as the sum or difference of two expressions.
An expression yielding an integer value derived from a screen resolution.
final int constant
The constant term.
Expression(final int constant, final float widthFactor, final float heightFactor, final float prefWidthFactor, final float prefHeightFactor)
Creates a new instance.
final float prefWidthFactor
The preferred width dependent factor.
int evaluate(final int width, final int height, final int prefWidth, final int prefHeight)
Evaluates the expression into a constant.
final float widthFactor
The screen width dependent factor.
int evaluateConstant()
Evaluates the expression into a constant.