Crossfire JXClient, Trunk
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation Class Referenceabstract
Inheritance diagram for com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation:
Collaboration graph

Public Member Functions

int getCur ()
 
int getH ()
 
int getHeight ()
 
int getMax ()
 
int getMin ()
 
int getW ()
 
int getWidth ()
 
int getX ()
 
int getY ()
 
boolean isLowImage ()
 
boolean isNegativeImage ()
 
boolean isValid ()
 
boolean setExtends (final int width, final int height)
 
void setHasNegativeImage (final boolean hasNegativeImage)
 
boolean setValues (final int cur, final int min, final int max)
 

Protected Member Functions

 AbstractOrientation ()
 
abstract void reCalculate ()
 
void setExtent (final int x, final int y, final int w, final int h)
 

Static Protected Member Functions

static int calculate (final int val, final int max, final int size)
 

Private Attributes

int cur
 
int h
 
boolean hasNegativeImage
 
int height
 
int max
 
int min
 
int w
 
int width
 
int x
 
int y
 

Detailed Description

Abstract base class for implementing Orientation instances.

Author
Andreas Kirschbaum

Definition at line 29 of file AbstractOrientation.java.

Constructor & Destructor Documentation

◆ AbstractOrientation()

com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.AbstractOrientation ( )
protected

Creates a new instance.

Definition at line 85 of file AbstractOrientation.java.

Member Function Documentation

◆ calculate()

static int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.calculate ( final int  val,
final int  max,
final int  size 
)
staticprotected

Returns the fraction

val/max

rounded to [

0..size

].

Parameters
valthe value
maxthe range size
sizethe size of the result
Returns
the fraction in pixels

Definition at line 170 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.max.

Referenced by com.realtime.crossfire.jxclient.gui.gauge.OrientationEW.reCalculate(), com.realtime.crossfire.jxclient.gui.gauge.OrientationWE.reCalculate(), com.realtime.crossfire.jxclient.gui.gauge.OrientationSN.reCalculate(), and com.realtime.crossfire.jxclient.gui.gauge.OrientationNS.reCalculate().

Here is the caller graph for this function:

◆ getCur()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getCur ( )

◆ getH()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getH ( )

Returns the height of the highlighted part of the image.

Returns
the height

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 139 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.h.

◆ getHeight()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getHeight ( )

◆ getMax()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getMax ( )

◆ getMin()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getMin ( )

◆ getW()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getW ( )

Returns the width of the highlighted part of the image.

Returns
the width

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 134 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.w.

◆ getWidth()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getWidth ( )

◆ getX()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getX ( )

Returns the x-coordinate of the highlighted part of the image.

Returns
the x-coordinate

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 124 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.x.

◆ getY()

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.getY ( )

Returns the y-coordinate of the highlighted part of the image.

Returns
the y-coordinate

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 129 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.y.

◆ isLowImage()

boolean com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.isLowImage ( )

◆ isNegativeImage()

boolean com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.isNegativeImage ( )

◆ isValid()

boolean com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.isValid ( )

Returns whether the gauge's values are valid.

Returns
whether the values are valid

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 154 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.max, and com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.min.

◆ reCalculate()

abstract void com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.reCalculate ( )
abstractprotected

◆ setExtends()

boolean com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.setExtends ( final int  width,
final int  height 
)

Sets the extends of the image.

Parameters
widththe width
heightthe height
Returns
true if the size changed, false else

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 112 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.height, com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.reCalculate(), and com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.width.

Here is the call graph for this function:

◆ setExtent()

void com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.setExtent ( final int  x,
final int  y,
final int  w,
final int  h 
)
protected

◆ setHasNegativeImage()

void com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.setHasNegativeImage ( final boolean  hasNegativeImage)

Sets whether the gauge can display negative images. By default, negative images are not supported.

Parameters
hasNegativeImagewhether the gauge can display negative images

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 89 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.hasNegativeImage, and com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.reCalculate().

Here is the call graph for this function:

◆ setValues()

boolean com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.setValues ( final int  cur,
final int  min,
final int  max 
)

Sets the gauge's values.

Parameters
curthe current value
minthe minimum value
maxthe maximum value
Returns
whether the values have been updated

Implements com.realtime.crossfire.jxclient.gui.gauge.Orientation.

Definition at line 99 of file AbstractOrientation.java.

References com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.cur, com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.max, com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.min, and com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.reCalculate().

Here is the call graph for this function:

Member Data Documentation

◆ cur

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.cur
private

◆ h

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.h
private

◆ hasNegativeImage

boolean com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.hasNegativeImage
private

◆ height

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.height
private

◆ max

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.max
private

◆ min

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.min
private

◆ w

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.w
private

◆ width

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.width
private

◆ x

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.x
private

◆ y

int com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.y
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.min
int min
Definition: AbstractOrientation.java:50
com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.max
int max
Definition: AbstractOrientation.java:55
com.realtime.crossfire.jxclient.gui.gauge.AbstractOrientation.cur
int cur
Definition: AbstractOrientation.java:44