ants.move.core.models.bars
Class BarsModel

java.lang.Object
  |
  +--ants.core.Thing
        |
        +--ants.move.core.models.bars.BarsModel
All Implemented Interfaces:
ants.core.Model, ants.core.PropertyChangeListener, ants.comm.RemoteEventListener, java.io.Serializable

public class BarsModel
extends ants.core.Thing
implements ants.core.PropertyChangeListener

Implementation of Bars Model.

Version:
1.30 Build 2000
Author:
Carles Pairot (cpairot@tinet.org), Oriol Montalà (omontala@tinet.org)
See Also:
Serialized Form

Constructor Summary
BarsModel()
          Sole & void constructor.
 
Method Summary
 void addBarsListener(BarsListener bList)
           
 void barsBell(java.lang.String name)
          Remotely sends Bell or Bell- values.
 void barsRampRand(java.lang.String name)
          Remotely sends Ramp or Random values.
 void destroy()
          Finalization method for CSCW components in the ANTS container.
 float getCurrentValue(int i, int j)
          Gets current value of (i, j) bar.
 java.lang.String getType()
          Facility method for obtaining extra information about a specific bean.
 void init()
          Initialization method for CSCW components in the ANTS container.
 void propertyChange(ants.core.PropertyChangeEvent evt)
          Method triggered in response to a property change.
 void readFile(java.lang.String file)
          Read data from a file.
 void removeBarsListener(BarsListener bList)
           
 void setCurrentValue(int i, int j, float value)
           
 void setValue(java.lang.String values)
          Remotely sends bars values.
 float to2d(float n)
          Trims a float to two decimal digits.
 
Methods inherited from class ants.core.Thing
addPropertyChangeListener, addTokenToProperty, eventArrived, getContext, getDescription, getIndexedProperty, getIndexedProperty, getIndexedPropertyNames, getIndexedPropertySize, getName, getPlace, getProperty, getPropertyNames, getThingGateway, getThingId, incrementProperty, init, removePropertyChangeListener, setProperty, triggerEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarsModel

public BarsModel()
Sole & void constructor.
Parameters:
params - None
Throws:
exceptions - No exceptions thrown
Method Detail

init

public void init()
Description copied from class: ants.core.Thing
Initialization method for CSCW components in the ANTS container.
Overrides:
init in class ants.core.Thing

addBarsListener

public void addBarsListener(BarsListener bList)

removeBarsListener

public void removeBarsListener(BarsListener bList)

setValue

public void setValue(java.lang.String values)
Remotely sends bars values.
Parameters:
values - Bars values
Returns:
No return value
Throws:
exceptions - No exceptions thrown

barsRampRand

public void barsRampRand(java.lang.String name)
Remotely sends Ramp or Random values.
Parameters:
name - "Ramp" or "Random"
Returns:
No return value
Throws:
exceptions - No exceptions thrown

to2d

public float to2d(float n)
Trims a float to two decimal digits.
Parameters:
n - Number to trim
Returns:
Number trimmed
Throws:
exceptions - No exceptions thrown

barsBell

public void barsBell(java.lang.String name)
Remotely sends Bell or Bell- values.
Parameters:
name - "Bell" or "Bell-"
Returns:
No return value
Throws:
exceptions - No exceptions thrown

readFile

public void readFile(java.lang.String file)
Read data from a file.
Parameters:
file - File containing bars data
Returns:
No return value
Throws:
exceptions - No exceptions thrown

propertyChange

public void propertyChange(ants.core.PropertyChangeEvent evt)
Description copied from interface: ants.core.PropertyChangeListener
Method triggered in response to a property change.
Specified by:
propertyChange in interface ants.core.PropertyChangeListener
Following copied from interface: ants.core.PropertyChangeListener
Returns:
ants.core.PropertyChangeEvent A PropertyChangeEvent with property change information.

setCurrentValue

public void setCurrentValue(int i,
                            int j,
                            float value)

getCurrentValue

public float getCurrentValue(int i,
                             int j)
Gets current value of (i, j) bar.
Parameters:
i - Column
j - Row
Returns:
Value
Throws:
exceptions - No exceptions thrown

getType

public java.lang.String getType()
Description copied from interface: ants.core.Model
Facility method for obtaining extra information about a specific bean.
Overrides:
getType in class ants.core.Thing
Following copied from interface: ants.core.Model
Returns:
String keyword describing component type

destroy

public void destroy()
Description copied from class: ants.core.Thing
Finalization method for CSCW components in the ANTS container.
Overrides:
destroy in class ants.core.Thing


Developers: Oriol Montala, Carles Pairot, Francesc Pinas2000 - 2002
Departament d'Enginyeria Informatica i Matematiques
Escola Tecnica Superior d'Enginyeria
Universitat Rovira i Virgili