Package adams.gui.event
Class DataChangeEvent
- java.lang.Object
-
- java.util.EventObject
-
- adams.gui.event.DataChangeEvent
-
- All Implemented Interfaces:
Serializable
public class DataChangeEvent extends EventObject
An event indicating that the underlying containers have changed.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataChangeEvent.Type
the type of event.
-
Field Summary
Fields Modifier and Type Field Description protected AbstractContainer[]
m_Containers
the replaced containers.protected int[]
m_Indices
the indices of the modified containers.protected DataChangeEvent.Type
m_Type
the type of event.-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type)
Initializes the event.DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int index)
Initializes the event.DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int[] indices)
Initializes the event.DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int[] indices, AbstractContainer[] cont)
Initializes the event.DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int index, AbstractContainer cont)
Initializes the event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractContainer[]
getContainers()
Returns the old containers, can be null.int[]
getIndices()
Returns the relevant indices, can be null.AbstractContainerManager
getManager()
Returns the manager that triggered the event.DataChangeEvent.Type
getType()
Returns the type of event.String
toString()
Returns a short string representation of the event.-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Field Detail
-
m_Type
protected DataChangeEvent.Type m_Type
the type of event.
-
m_Indices
protected int[] m_Indices
the indices of the modified containers.
-
m_Containers
protected AbstractContainer[] m_Containers
the replaced containers.
-
-
Constructor Detail
-
DataChangeEvent
public DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type)
Initializes the event.- Parameters:
source
- the manager that triggered the eventtype
- the type of event
-
DataChangeEvent
public DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int index)
Initializes the event.- Parameters:
source
- the manager that triggered the eventtype
- the type of eventindex
- the relevant index
-
DataChangeEvent
public DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int index, AbstractContainer cont)
Initializes the event.- Parameters:
source
- the manager that triggered the eventtype
- the type of eventindex
- the relevant indexcont
- the old container, can be null
-
DataChangeEvent
public DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int[] indices)
Initializes the event.- Parameters:
source
- the manager that triggered the eventtype
- the type of eventindices
- the relevant indices, can be null
-
DataChangeEvent
public DataChangeEvent(AbstractContainerManager source, DataChangeEvent.Type type, int[] indices, AbstractContainer[] cont)
Initializes the event.- Parameters:
source
- the manager that triggered the eventtype
- the type of eventindices
- the relevant indices, can be nullcont
- the old containers, can be null
-
-
Method Detail
-
getManager
public AbstractContainerManager getManager()
Returns the manager that triggered the event.- Returns:
- the manager
-
getType
public DataChangeEvent.Type getType()
Returns the type of event.- Returns:
- the type
-
getIndices
public int[] getIndices()
Returns the relevant indices, can be null.- Returns:
- the indices, can be null
-
getContainers
public AbstractContainer[] getContainers()
Returns the old containers, can be null.- Returns:
- the containers, can be null
-
toString
public String toString()
Returns a short string representation of the event.- Overrides:
toString
in classEventObject
- Returns:
- the string representation
-
-