SimJava 2.0.1

eduni.simanim
Class Anim_param

Object
  extended by Anim_param

public class Anim_param
extends Object

An animation parameter, parameters are used to display data relating to its parent entity during an animation.

Version:
1.0, 4 September, 1.2, fwh, 19 June 1997 - added Param_type
Author:
Ross McNab, Fred Howell

Field Summary
static String[] enum_type
           
static int HIDDEN
          Display type: Don't display.
static int NAME
          Display type: Show parameter's name only.
static int NAME_VALUE
          Display type: Show both the parameter's name and its value.
static int STATE
          Display type: Show as the entity's bitmap.
static int VALUE
          Display type: Show value only.
 
Constructor Summary
Anim_param(String name, int type, Param_type ptype)
          Constructor, with co-ordinates defaulting to (0, 0).
Anim_param(String name, int type, Param_type ptype, int x, int y)
          Constructor, with Param_type object and (x, y) co-ordinate.
Anim_param(String name, int type, String value)
          Constructor, with co-ordinates defaulting to (0, 0).
Anim_param(String name, int type, String value, int x, int y)
          Constructor, with (x, y) co-ordinate.
 
Method Summary
(package private)  void draw(Graphics g)
           
 int get_intval()
          Get integer value of parameter.
(package private)  String get_name()
           
(package private)  Param_type get_ptype()
           
(package private)  int get_type()
           
 String get_value()
          Get string value of parameter.
(package private) static int parseType(String type)
           
(package private)  void set_parent(Anim_entity ent)
           
(package private)  void set_position(int x, int y)
           
(package private)  void set_type(int type)
           
 void set_value(int val)
          Set value of parameter to integer.
 void set_value(String val)
          Set value of parameter to string.
(package private)  void update_position()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIDDEN

public static final int HIDDEN
Display type: Don't display.

See Also:
Constant Field Values

STATE

public static final int STATE
Display type: Show as the entity's bitmap.

See Also:
Constant Field Values

VALUE

public static final int VALUE
Display type: Show value only.

See Also:
Constant Field Values

NAME

public static final int NAME
Display type: Show parameter's name only.

See Also:
Constant Field Values

NAME_VALUE

public static final int NAME_VALUE
Display type: Show both the parameter's name and its value.

See Also:
Constant Field Values

enum_type

public static final String[] enum_type
Constructor Detail

Anim_param

public Anim_param(String name,
                  int type,
                  String value,
                  int x,
                  int y)
Constructor, with (x, y) co-ordinate.

Parameters:
name - The parameter's name
type - One of the display types above
value - The initial value of the parameter
x - The X co-ordinate of the parameter relative to the left of its parent entity.
y - The Y co-ordinate of the parameter relative to the top of its parent entity.

Anim_param

public Anim_param(String name,
                  int type,
                  String value)
Constructor, with co-ordinates defaulting to (0, 0).

Parameters:
name - The parameter's name
type - One of the display types above
value - The initial value of the parameter

Anim_param

public Anim_param(String name,
                  int type,
                  Param_type ptype,
                  int x,
                  int y)
Constructor, with Param_type object and (x, y) co-ordinate.

Parameters:
name - The parameter's name
type - One of the display types above
ptype - The parameter type object
x - The X co-ordinate of the parameter relative to the left of its parent entity.
y - The Y co-ordinate of the parameter relative to the top of its parent entity.

Anim_param

public Anim_param(String name,
                  int type,
                  Param_type ptype)
Constructor, with co-ordinates defaulting to (0, 0).

Parameters:
name - The parameter's name
type - One of the display types above
value - The initial value of the parameter
Method Detail

set_value

public void set_value(String val)
Set value of parameter to string.

Parameters:
val - The value of the parameter

set_value

public void set_value(int val)
Set value of parameter to integer. Note that it sets the value to the ith string value.

Parameters:
val - The value of the parameter

get_value

public String get_value()
Get string value of parameter.


get_intval

public int get_intval()
Get integer value of parameter.


set_type

void set_type(int type)

set_position

void set_position(int x,
                  int y)

set_parent

void set_parent(Anim_entity ent)

get_type

int get_type()

get_ptype

Param_type get_ptype()

get_name

String get_name()

parseType

static int parseType(String type)

update_position

void update_position()

draw

void draw(Graphics g)

SimJava 2.0.1

The University of Edinburgh, 2009