ilog.tgo.model
Class IltStateSystem

java.lang.Object
  extended by ilog.tgo.model.internal.IltBaseSystem
      extended by ilog.tgo.model.IltStateSystem
All Implemented Interfaces:
ilog.tgo.model.internal.IltStateCollection, IlvBatchable, Cloneable

public class IltStateSystem
extends ilog.tgo.model.internal.IltBaseSystem
implements ilog.tgo.model.internal.IltStateCollection

This class defines the model of states which will be used by a telecom object.


Field Summary
protected  Collection _primaryStates
           
 
Fields inherited from class ilog.tgo.model.internal.IltBaseSystem
_batchNestingCount, _listenerSupport, _mapper, _name
 
Method Summary
 boolean add(IltState state)
          Adds a new state to the collection.
 boolean add(ilog.tgo.model.internal.IltStatePath parentPath, IltState state)
          Adds a new state in the collection in the position given by the parentPath.
 ilog.tgo.model.internal.IltStatePath addPrimary(IltState state)
          Adds the given state as a primary state, inserting it in the model and creating a state mapper responsible for mapping this state into a change of base style.
 ilog.tgo.model.internal.IltStatePath addPrimary(ilog.tgo.model.internal.IltStatePath parent, IltState state)
          Adds the given state as a primary state, inserting it in the model and creating a state mapper responsible for mapping this state into a change of base style.
 void addPrimaryStatePath(ilog.tgo.model.internal.IltStatePath path)
           
 ilog.tgo.model.internal.IltStatePath addSecondary(IltState state)
          Adds the given state as a secondary state, inserting it in the model and creating a state mapper responsible for mapping this state into a new decoration icon, which is positioned in the secondary state position.
 ilog.tgo.model.internal.IltStatePath addSecondary(ilog.tgo.model.internal.IltStatePath parent, IltState state)
          Adds the given state as a secondary state, inserting it in the model and creating a state mapper responsible for mapping this state into a new decoration, which is positioned in the secondary state position.
 Object clone()
          Returns a copy of this model
protected  ilog.tgo.mapper.IltMapper createMapper()
          Creates and sets the mapper to the state system.
 void fireStateAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
          Notify all listeners that a certain state was added to the state system.
 void fireStateRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
          Notify all listeners that a certain state was removed from the state system.
 void fireStateSystemAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
          Notify all listeners that a certain state system is being used by this one.
 void fireStateSystemRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
          Notify all listeners that a certain state system is no longer being used by this one.
 void fixDependencies()
          This method establishes the relationship between dependent state systems after deserialization.
 ilog.tgo.model.internal.IltStatePath[] getAllPaths(IlpFilter filter)
          Returns all the paths found which corresponds to the criteria given by the filter.
 ilog.tgo.model.internal.IltStatePath[] getAllPaths(IltState state)
          Returns all the paths found which corresponds to the given state.
 ilog.tgo.model.internal.IltStatePath getPath(String name)
          Returns the state from the model that corresponds the given name.
 Collection getPrimaryStates()
          Returns an unmodifiable collection of primary states.
 boolean has(IltState state)
          Returns true if the given state is part of the collection.
 boolean has(IltState state, boolean all)
          Returns true if the given state is part of the collection.
 boolean has(ilog.tgo.model.internal.IltStatePath path)
          Returns true if the given state is part of the collection.
 boolean has(ilog.tgo.model.internal.IltStatePath path, boolean all)
          Returns true if the given state is part of the collection.
 boolean hasLocal(IltState state)
          Verifies if the given state is present in the state table.
 boolean hasLocal(ilog.tgo.model.internal.IltStatePath path)
          Verifies if the given state path is present in this state system.
 boolean hasRecursivelly(IltState state)
          Verifies if the given state is part of the whole subtree.
protected  void initialize()
           
 void map(IltObject object, IltCompositeGraphic graphic)
          Maps an entire IltObjectState.
 void mapState(IltObject object, IltCompositeGraphic graphic, ilog.tgo.model.internal.IltStatePath path, Object value)
          Maps a specific state in the system
 void merge(IltStateSystem other)
          Adds all the states which are in the other state system and are not in this state system.
static IltStateSystem New(String name)
          Factory method responsible for creating a new state model instance, and registering this new instance in the controller.
static IltStateSystem New(String name, ilog.tgo.mapper.state.IltStateSystemMapper mapper)
           
 Enumeration otherStateSystems()
          Returns all the state systems used by this one.
 boolean remove(IltState state)
          Removes a state from the collection.
 boolean remove(ilog.tgo.model.internal.IltStatePath parentPath, IltState state)
          Removes a state from the collection from the position given by the parent path.
 Enumeration states()
          Returns an enumeration of the states in this dictionary.
 String toString()
          Returns the String representation of this IltStateSystem's values.
 void unUseStateSystem(IltStateSystem other)
          Removes the dependency between this state system and the given one.
 void useStateSystem(IltStateSystem other)
          Indicates that this state system uses state information from another state system.
protected  boolean validateListener(EventListener listener)
          This method should be overwritten by the subclasses to define which are the listeners which are allowed.
protected  boolean validateMapper(ilog.tgo.mapper.IltMapper mapper)
          Verifies if the given mapper can be set or not.
 
Methods inherited from class ilog.tgo.model.internal.IltBaseSystem
addListener, createListenerSupport, endBatch, getMapper, getName, hasListeners, notify, notifyEndChangingSystem, removeListener, resetMapper, setMapper, startBatch
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_primaryStates

protected Collection _primaryStates
Internal method or field: do not use!
Method Detail

New

public static IltStateSystem New(String name)
Factory method responsible for creating a new state model instance, and registering this new instance in the controller.

Internal method or field: do not use!

New

public static IltStateSystem New(String name,
                                 ilog.tgo.mapper.state.IltStateSystemMapper mapper)
Parameters:
name - State system name
mapper - State system mapper
Returns:
New State System
Internal method or field: do not use!

initialize

protected void initialize()
Internal method or field: do not use!

add

public boolean add(IltState state)
Adds a new state to the collection. The given state is added in the first level in the model.

Specified by:
add in interface ilog.tgo.model.internal.IltStateCollection
Parameters:
state - State to be added to the model
Internal method or field: do not use!

remove

public boolean remove(IltState state)
Removes a state from the collection. The given state is removed from the first level in the model.

Specified by:
remove in interface ilog.tgo.model.internal.IltStateCollection
Parameters:
state - state to be removed from the model
Internal method or field: do not use!

has

public boolean has(IltState state)
Returns true if the given state is part of the collection. This method not only verifies in the states that are in the collection table, but also searches recursively in the model to see if the state is in any of the sub-states.

Specified by:
has in interface ilog.tgo.model.internal.IltStateCollection
Parameters:
state - state being tested
Returns:
true when the state is part of the collection.
Internal method or field: do not use!

has

public boolean has(IltState state,
                   boolean all)
Returns true if the given state is part of the collection. This method not only verifies in the states that are in the collection table, but also searches recursively in the model to see if the state is in any of the sub-states.

Parameters:
state - state being verified
all - flag indicating if the state will be looked in this system and all the other used systems or just locally.
Internal method or field: do not use!

states

public Enumeration states()
Returns an enumeration of the states in this dictionary.

Specified by:
states in interface ilog.tgo.model.internal.IltStateCollection
Internal method or field: do not use!

add

public boolean add(ilog.tgo.model.internal.IltStatePath parentPath,
                   IltState state)
Adds a new state in the collection in the position given by the parentPath. If parentPath is null, the given state is added in the model's first level of states.

Parameters:
parentPath - Path indicating the state where the given state will be added. The parent state must be an IltAggregateState
state - State to be added in the model
Internal method or field: do not use!

remove

public boolean remove(ilog.tgo.model.internal.IltStatePath parentPath,
                      IltState state)
Removes a state from the collection from the position given by the parent path. If parentPath is null, the given state is removed from the model's first level of states.

Parameters:
parentPath - path indicating which is the state from where the given state will be removed. The parent state must be an IltAggregateState
state - state to be removed from the model
Internal method or field: do not use!

has

public boolean has(ilog.tgo.model.internal.IltStatePath path)
Returns true if the given state is part of the collection. If state is not valid or does not contain any state, this method will return false. This method also verifies if the given path is present in the state systems being currently used by this one.

Parameters:
path - path which indicates the state being searched
Internal method or field: do not use!

has

public boolean has(ilog.tgo.model.internal.IltStatePath path,
                   boolean all)
Returns true if the given state is part of the collection. If state is not valid or does not contain any state, this method will return false. This method also verifies if the given path is present in the state systems being currently used by this one.

Parameters:
path - path which indicates the state being searched
all - flag which indicates if the state will be searched in the other state systems too.
Internal method or field: do not use!

hasRecursivelly

public boolean hasRecursivelly(IltState state)
Verifies if the given state is part of the whole subtree.

Internal method or field: do not use!

hasLocal

public boolean hasLocal(IltState state)
Verifies if the given state is present in the state table. NOTE: The state must be present in the first level of the table. States inside aggregate states are not verified.

Internal method or field: do not use!

hasLocal

public boolean hasLocal(ilog.tgo.model.internal.IltStatePath path)
Verifies if the given state path is present in this state system.

Internal method or field: do not use!

getAllPaths

public ilog.tgo.model.internal.IltStatePath[] getAllPaths(IlpFilter filter)
Returns all the paths found which corresponds to the criteria given by the filter.

Parameters:
filter - criteria to match the state instances.
Internal method or field: do not use!

getAllPaths

public ilog.tgo.model.internal.IltStatePath[] getAllPaths(IltState state)
Returns all the paths found which corresponds to the given state.

Parameters:
state - state being queried
Internal method or field: do not use!

getPath

public ilog.tgo.model.internal.IltStatePath getPath(String name)
Returns the state from the model that corresponds the given name. The name can be a compound string separated by '.', like "Availability.LogFull".

Parameters:
name - complete state name, formed by the concatenation of the states which compose the path inside the model, separated by the character '.'
Internal method or field: do not use!

toString

public String toString()
Returns the String representation of this IltStateSystem's values.

Overrides:
toString in class Object

addPrimaryStatePath

public void addPrimaryStatePath(ilog.tgo.model.internal.IltStatePath path)
Internal method or field: do not use!

getPrimaryStates

public Collection getPrimaryStates()
Returns an unmodifiable collection of primary states.

Returns:
Collection of IltStatePath representing each primary state.
Internal method or field: do not use!

addPrimary

public ilog.tgo.model.internal.IltStatePath addPrimary(IltState state)
Adds the given state as a primary state, inserting it in the model and creating a state mapper responsible for mapping this state into a change of base style. The mapper is created automatically using the default state mapper factory. This default factory creates instances of the class IltPrimaryStateMapper.

Returns:
the state path which allows the user to identify the state inside the state system. If the state could not be added, this method returns null.
Internal method or field: do not use!

addPrimary

public ilog.tgo.model.internal.IltStatePath addPrimary(ilog.tgo.model.internal.IltStatePath parent,
                                                       IltState state)
Adds the given state as a primary state, inserting it in the model and creating a state mapper responsible for mapping this state into a change of base style. The mapper is created automatically using the default state mapper factory. By default an instance of the class IltPrimaryStateMapper is created, which contains a mapping that changes the base style of the object's graphical representation depending on a IltBaseStyleValueGetter instance. To configure the base style used to represent this state, the user must retrieve the state mapper instance and set the appropriate base style value getter, or any new graphic updates if desired.

Returns:
the state path which allows the user to identify the state inside the state system. If the state could not be added, this method returns null.
See Also:
IltPrimaryStateMapper, IltStateSystemMapper.get(ilog.tgo.model.internal.IltStatePath)
Internal method or field: do not use!

addSecondary

public ilog.tgo.model.internal.IltStatePath addSecondary(IltState state)
Adds the given state as a secondary state, inserting it in the model and creating a state mapper responsible for mapping this state into a new decoration icon, which is positioned in the secondary state position. The state is inserted in the state system first level of states.

See Also:
(IltStatePath parent, IltState state), IltStateSystemMapper.get(ilog.tgo.model.internal.IltStatePath)
Internal method or field: do not use!

addSecondary

public ilog.tgo.model.internal.IltStatePath addSecondary(ilog.tgo.model.internal.IltStatePath parent,
                                                         IltState state)
Adds the given state as a secondary state, inserting it in the model and creating a state mapper responsible for mapping this state into a new decoration, which is positioned in the secondary state position. The state is inserted in the state system below the given parent state, which must be an IltAggregateState.

The state mapper is created automatically using the default state mapper factory. By default, an instance of the class IltSecondaryStateMapper is created, which contains a mapping that adds a secondary state icon to the object's graphical representation depending on a IltImageMappingValueGetter instance.

To configure the image used to create the icon decoration, the user must retrieve the state mapper instance and set the appropriate image value getter, or any new graphic updates, if desired.

Using this secondary state mapper, the user can also define different types of decorations, according to the state type. The possible decoration types are Icon, Gauge, Chart or Counter.

The user must define an IltDecorationTypeValueGetter instance, which is responsible for defining the decoration type that will be used. For each possible decoration type, the user can register a decoration configuration, which is used to create the decoration during the mapping operation.

Returns:
the state path which allows the user to identify the state inside the state system. If the state could not be added, this method returns null.
See Also:
IltSecondaryStateMapper, IltStateSystemMapper.get(ilog.tgo.model.internal.IltStatePath)
Internal method or field: do not use!

map

public void map(IltObject object,
                IltCompositeGraphic graphic)
Maps an entire IltObjectState. This method is used by the default map strategy.

Parameters:
object - the telecom object containing this semantic state
graphic - a graphic object representing the telecom object
Internal method or field: do not use!

mapState

public void mapState(IltObject object,
                     IltCompositeGraphic graphic,
                     ilog.tgo.model.internal.IltStatePath path,
                     Object value)
Maps a specific state in the system

Parameters:
object - the telecom object containing this semantic state
graphic - a graphic object representing the telecom object
path - the path
value - the value
Internal method or field: do not use!

validateListener

protected boolean validateListener(EventListener listener)
This method should be overwritten by the subclasses to define which are the listeners which are allowed.

Specified by:
validateListener in class ilog.tgo.model.internal.IltBaseSystem
Internal method or field: do not use!

fireStateAdded

public void fireStateAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
Notify all listeners that a certain state was added to the state system.

Internal method or field: do not use!

fireStateRemoved

public void fireStateRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
Notify all listeners that a certain state was removed from the state system.

Internal method or field: do not use!

fireStateSystemAdded

public void fireStateSystemAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
Notify all listeners that a certain state system is being used by this one.

Internal method or field: do not use!

fireStateSystemRemoved

public void fireStateSystemRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
Notify all listeners that a certain state system is no longer being used by this one.

Internal method or field: do not use!

validateMapper

protected boolean validateMapper(ilog.tgo.mapper.IltMapper mapper)
Verifies if the given mapper can be set or not.

Specified by:
validateMapper in class ilog.tgo.model.internal.IltBaseSystem
Internal method or field: do not use!

createMapper

protected ilog.tgo.mapper.IltMapper createMapper()
Creates and sets the mapper to the state system.

Specified by:
createMapper in class ilog.tgo.model.internal.IltBaseSystem
Internal method or field: do not use!

useStateSystem

public void useStateSystem(IltStateSystem other)
Indicates that this state system uses state information from another state system. Using this property avoids the replication of state information between the systems.

Internal method or field: do not use!

unUseStateSystem

public void unUseStateSystem(IltStateSystem other)
Removes the dependency between this state system and the given one.

Internal method or field: do not use!

otherStateSystems

public Enumeration otherStateSystems()
Returns all the state systems used by this one.

Internal method or field: do not use!

clone

public Object clone()
Returns a copy of this model

Overrides:
clone in class ilog.tgo.model.internal.IltBaseSystem
Internal method or field: do not use!

fixDependencies

public void fixDependencies()
This method establishes the relationship between dependent state systems after deserialization.

Internal method or field: do not use!

merge

public void merge(IltStateSystem other)
Adds all the states which are in the other state system and are not in this state system.

Internal method or field: do not use!


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.