00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.gui.gui;
00023
00024 import org.jetbrains.annotations.NotNull;
00025
00031 public class Extent {
00032
00036 @NotNull
00037 private final Expression x;
00038
00042 @NotNull
00043 private final Expression y;
00044
00048 @NotNull
00049 private final Expression w;
00050
00054 @NotNull
00055 private final Expression h;
00056
00064 public Extent(@NotNull final Expression x, @NotNull final Expression y, @NotNull final Expression w, @NotNull final Expression h) {
00065 this.x = x;
00066 this.y = y;
00067 this.w = w;
00068 this.h = h;
00069 }
00070
00079 public int getX(final int width, final int height, final int prefWidth, final int prefHeight) {
00080 return x.evaluate(width, height, prefWidth, prefHeight);
00081 }
00082
00091 public int getY(final int width, final int height, final int prefWidth, final int prefHeight) {
00092 return y.evaluate(width, height, prefWidth, prefHeight);
00093 }
00094
00103 public int getW(final int width, final int height, final int prefWidth, final int prefHeight) {
00104 return w.evaluate(width, height, prefWidth, prefHeight);
00105 }
00106
00115 public int getH(final int width, final int height, final int prefWidth, final int prefHeight) {
00116 return h.evaluate(width, height, prefWidth, prefHeight);
00117 }
00118
00119 }