fi.helsinki.dacopan.settings
Class GeneralSettings

java.lang.Object
  extended by fi.helsinki.dacopan.settings.GeneralSettings
All Implemented Interfaces:
Saveable

public class GeneralSettings
extends java.lang.Object
implements Saveable

Class containing general settings for the animation.

The settings stored in this class are basically related to the performance of the animation. These settings are the only ones that are common to all the layers shown in the different animations.

Apart from these performance setting, this class has a list that stores the settings specific to layer containing values to configure scale, speed, selected variables and fields to show in the animations...

Version:
$Id: GeneralSettings.java,v 1.31 2005/05/05 20:32:34 tituomin Exp $

Field Summary
protected  boolean antiAliasing
          true if the antialiasing option is selected
static int DEFAULT_REFRESH_DELAY
           
protected  Layer defaultLayer
           
static int MAX_REFRESH_DELAY
           
static int MAX_REFRESH_RATE
           
static int MIN_REFRESH_DELAY
           
static int MIN_REFRESH_RATE
           
protected  int refreshDelay
          number of miliseconds between two updates of the animation.
protected  java.util.List settingsLayersMSC
          List containing the settings specific to layer (SettingsMSC)
protected  SettingsTSC settingsTSC
          Settings for the Time Sequence Chart
 
Constructor Summary
GeneralSettings()
          constructor that assign to the attributes default values
GeneralSettings(GeneralSettings generalSettings)
          creates a new copy instance of GeneralSettings
 
Method Summary
 boolean addSettingsMSC(SettingsMSC newSettings)
          Adds or replaces a SettingsMSC object in the settingsLayersMSC list.
 void clearSettingsMSC()
          Clears the SettingsMSC objects.
 boolean getAntiAliasing()
          Returns the anti-aliasing setting
 java.lang.Object getData()
          Returns the data that should be saved in the scenario file.
 Layer getDefaultLayer()
          Gets the default layer for the MSC animation
 java.util.List getListSettingsMSC()
          Return the list of settings per layer
 int getRefreshDelay()
          returns the number of miliseconds between two updates in the animation panels high values imply slower animation
 int getRefreshRate()
          returns the number of times the animation panel is updated in a second
 SettingsMSC getSettingsMSC(Layer layer)
          returns the settings for the MSC animation in a provided layer.
 SettingsTSC getSettingsTSC()
           
 void setAntiAliasing(boolean antiAliasing)
          Sets the anti-aliasing setting
 void setData(java.lang.Object o)
          Sets the data loaded from the scenario file.
 void setDefaultLayer(Layer layer)
          Sets the default layer for the MSC animation
 void setRefreshDelay(int refreshDelay)
          sets the number of miliseconds between two updates in the animation panels high values imply slower animation
 void setSettingsMSC(java.util.List listSettingsMSC)
          Sets the list of SettingsMSC objects.
 void setSettingsTSC(SettingsTSC settingsTSC)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_REFRESH_DELAY

public static final int DEFAULT_REFRESH_DELAY
See Also:
Constant Field Values

MIN_REFRESH_DELAY

public static final int MIN_REFRESH_DELAY
See Also:
Constant Field Values

MAX_REFRESH_DELAY

public static final int MAX_REFRESH_DELAY
See Also:
Constant Field Values

MIN_REFRESH_RATE

public static final int MIN_REFRESH_RATE
See Also:
Constant Field Values

MAX_REFRESH_RATE

public static final int MAX_REFRESH_RATE
See Also:
Constant Field Values

refreshDelay

protected int refreshDelay
number of miliseconds between two updates of the animation. This means that for a large values, the animation will be slower and for small values it will be faster (TimeStampTime)


settingsLayersMSC

protected java.util.List settingsLayersMSC
List containing the settings specific to layer (SettingsMSC)


defaultLayer

protected Layer defaultLayer

settingsTSC

protected SettingsTSC settingsTSC
Settings for the Time Sequence Chart


antiAliasing

protected boolean antiAliasing
true if the antialiasing option is selected

Constructor Detail

GeneralSettings

public GeneralSettings()
constructor that assign to the attributes default values


GeneralSettings

public GeneralSettings(GeneralSettings generalSettings)
creates a new copy instance of GeneralSettings

Method Detail

getRefreshDelay

public int getRefreshDelay()
returns the number of miliseconds between two updates in the animation panels high values imply slower animation

Returns:
number of miliseconds between two updates in the animation

setRefreshDelay

public void setRefreshDelay(int refreshDelay)
sets the number of miliseconds between two updates in the animation panels high values imply slower animation

Parameters:
refreshDelay - number of miliseconds between two updates in the animation

getRefreshRate

public int getRefreshRate()
returns the number of times the animation panel is updated in a second

Returns:
number of times that the animation is updated in a second

setDefaultLayer

public void setDefaultLayer(Layer layer)
Sets the default layer for the MSC animation

Parameters:
layer - Layer to set as default

getDefaultLayer

public Layer getDefaultLayer()
Gets the default layer for the MSC animation

Returns:
Layer default for the animation

addSettingsMSC

public boolean addSettingsMSC(SettingsMSC newSettings)
Adds or replaces a SettingsMSC object in the settingsLayersMSC list. Replace will happen if there already is a SettingsMSC object that has the same layer as the newSettings object.

If the default layer for this GeneralSettings object is null, it will be set to newSettings.

Parameters:
newSettings - SettingsMSC instance to add to the list of layer settings
Returns:
True if existing settings for the layer were found and replaced, false if new settings for a layer were added.

setSettingsMSC

public void setSettingsMSC(java.util.List listSettingsMSC)
Sets the list of SettingsMSC objects. This method is used when applying global settings.

Parameters:
listSettingsMSC -

clearSettingsMSC

public void clearSettingsMSC()
Clears the SettingsMSC objects. Needed for global settings.


getSettingsMSC

public SettingsMSC getSettingsMSC(Layer layer)
returns the settings for the MSC animation in a provided layer.

Parameters:
layer - Layer to get the settings from
Returns:
SettingsMSC instance with the settings for the layer specified as parameter

getListSettingsMSC

public java.util.List getListSettingsMSC()
Return the list of settings per layer

Returns:
List with the list of settings for the different layers in the animation

getAntiAliasing

public boolean getAntiAliasing()
Returns the anti-aliasing setting

Returns:
boolean

setAntiAliasing

public void setAntiAliasing(boolean antiAliasing)
Sets the anti-aliasing setting

Parameters:
antiAliasing - boolean

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getData

public java.lang.Object getData()
Description copied from interface: Saveable
Returns the data that should be saved in the scenario file.

Specified by:
getData in interface Saveable
Returns:
arbitrary data (might be null)

setData

public void setData(java.lang.Object o)
Description copied from interface: Saveable
Sets the data loaded from the scenario file.

Specified by:
setData in interface Saveable
Parameters:
o - loaded object

getSettingsTSC

public SettingsTSC getSettingsTSC()
Returns:
Returns the settingsTSC.

setSettingsTSC

public void setSettingsTSC(SettingsTSC settingsTSC)
Parameters:
settingsTSC - The settingsTSC to set.


© Dacopan2 team, 2005-