com.realtime.crossfire.jxclient.skin.skin
Class Extent

java.lang.Object
  extended by com.realtime.crossfire.jxclient.skin.skin.Extent

public class Extent
extends java.lang.Object

Encapsulates the extent of a GUI element. It consists of a location and a size.


Field Summary
private  Expression h
          The height.
private  Expression w
          The width.
private  Expression x
          The x coordinate.
private  Expression y
          The y coordinate.
 
Constructor Summary
Extent(Expression x, Expression y, Expression w, Expression h)
          Creates a new instance.
Extent(int x, int y, int w, int h)
          Creates a new instance.
 
Method Summary
 int getConstantH()
          Returns the height.
 int getConstantW()
          Returns the width.
 int getH(int width, int height)
          Returns the height.
 Expression getHExpression()
          Returns the height.
 int getW(int width, int height)
          Returns the width.
 Expression getWExpression()
          Returns the width.
 int getX(int width, int height)
          Returns the x coordinate.
 int getY(int width, int height)
          Returns the y coordinate.
 void setLocation(Expression x, Expression y)
          Sets the location.
 void setSize(Expression w, Expression h)
          Sets the size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

h

@NotNull
private Expression h
The height.


w

@NotNull
private Expression w
The width.


x

@NotNull
private Expression x
The x coordinate.


y

@NotNull
private Expression y
The y coordinate.

Constructor Detail

Extent

public Extent(@NotNull
              Expression x,
              @NotNull
              Expression y,
              @NotNull
              Expression w,
              @NotNull
              Expression h)
Creates a new instance.

Parameters:
x - the x coordinate
y - the y coordinate
w - the width
h - thr height

Extent

public Extent(int x,
              int y,
              int w,
              int h)
Creates a new instance.

Parameters:
x - the x coordinate
y - the y coordinate
w - the width
h - thr height
Method Detail

getConstantH

public int getConstantH()
Returns the height. The width must evaluate to a constant.

Returns:
the height

getConstantW

public int getConstantW()
Returns the width. The width must evaluate to a constant.

Returns:
the width

getH

public int getH(int width,
                int height)
Returns the height.

Parameters:
width - the screen width
height - the screen height
Returns:
the height

getHExpression

@NotNull
public Expression getHExpression()
Returns the height.

Returns:
the height

getW

public int getW(int width,
                int height)
Returns the width.

Parameters:
width - the screen width
height - the screen height
Returns:
the width

getWExpression

@NotNull
public Expression getWExpression()
Returns the width.

Returns:
the width

getX

public int getX(int width,
                int height)
Returns the x coordinate.

Parameters:
width - the screen width
height - the screen height
Returns:
the x coordinate

getY

public int getY(int width,
                int height)
Returns the y coordinate.

Parameters:
width - the screen width
height - the screen height
Returns:
the y coordinate

setLocation

public void setLocation(@NotNull
                        Expression x,
                        @NotNull
                        Expression y)
Sets the location.

Parameters:
x - the x coordinate
y - the y coordinate

setSize

public void setSize(@NotNull
                    Expression w,
                    @NotNull
                    Expression h)
Sets the size.

Parameters:
w - the width
h - the height