Class TimeseriesContainer
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainer
-
- adams.gui.visualization.timeseries.TimeseriesContainer
-
- All Implemented Interfaces:
DatabaseIDHandler
,IDHandler
,MutableIDHandler
,ColorContainer
,DatabaseContainer
,NamedContainer
,VisibilityContainer
,Serializable
,Comparable<AbstractContainer>
public class TimeseriesContainer extends AbstractContainer implements VisibilityContainer, NamedContainer, ColorContainer, DatabaseContainer
A container class for a timeseries and additional information.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Color
m_Color
the associated color.protected boolean
m_Visible
whether the timeseries is visible.-
Fields inherited from class adams.gui.visualization.container.AbstractContainer
m_Manager, m_Payload, m_Updating
-
-
Constructor Summary
Constructors Constructor Description TimeseriesContainer(TimeseriesContainerManager manager, Timeseries data)
Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assign(AbstractContainer c)
Updates itself with the values from given container (the manager is excluded!).Color
getColor()
Returns the current color in use.Timeseries
getData()
Returns the stored timeseries.int
getDatabaseID()
Returns the database ID.String
getDisplayID()
Returns an ID to be used in the GUI (the DB ID with added single quotes to make it unique among the timeseries in the container manager).String
getID()
Returns the ID used for display.int
hashCode()
Returns the hashcode of the ID string.protected void
initialize()
Initializes members.boolean
isVisible()
Returns whether the timeseries is visible.void
setColor(Color value)
Sets the color to use.void
setData(Timeseries value)
Sets the timeseries.void
setID(String value)
Sets the ID to use for display.void
setVisible(boolean value)
Sets the timeseries visibility.String
toString()
Returns a short string representation of the container.-
Methods inherited from class adams.gui.visualization.container.AbstractContainer
compareTo, copy, equals, getManager, getPayload, invalidate, postProcessPayload, setManager, setPayload
-
-
-
-
Field Detail
-
m_Visible
protected boolean m_Visible
whether the timeseries is visible.
-
m_Color
protected Color m_Color
the associated color.
-
-
Constructor Detail
-
TimeseriesContainer
public TimeseriesContainer(TimeseriesContainerManager manager, Timeseries data)
Initializes the container.- Parameters:
manager
- the owning managerdata
- the timeseries to store (visible)
-
-
Method Detail
-
initialize
protected void initialize()
Initializes members.- Overrides:
initialize
in classAbstractContainer
-
setID
public void setID(String value)
Sets the ID to use for display.- Specified by:
setID
in interfaceMutableIDHandler
- Specified by:
setID
in interfaceNamedContainer
- Parameters:
value
- the ID
-
getID
public String getID()
Returns the ID used for display.- Specified by:
getID
in interfaceIDHandler
- Specified by:
getID
in interfaceNamedContainer
- Returns:
- the ID
-
getDisplayID
public String getDisplayID()
Returns an ID to be used in the GUI (the DB ID with added single quotes to make it unique among the timeseries in the container manager).- Specified by:
getDisplayID
in interfaceNamedContainer
- Returns:
- a short ID for the GUI
-
setData
public void setData(Timeseries value)
Sets the timeseries.- Parameters:
value
- the timeseries
-
getData
public Timeseries getData()
Returns the stored timeseries.- Returns:
- the timeseries
-
setVisible
public void setVisible(boolean value)
Sets the timeseries visibility.- Specified by:
setVisible
in interfaceVisibilityContainer
- Parameters:
value
- if true then the timeseries will be visible
-
isVisible
public boolean isVisible()
Returns whether the timeseries is visible.- Specified by:
isVisible
in interfaceVisibilityContainer
- Returns:
- true if the timeseries is visible
-
setColor
public void setColor(Color value)
Sets the color to use.- Specified by:
setColor
in interfaceColorContainer
- Parameters:
value
- the color
-
getColor
public Color getColor()
Returns the current color in use.- Specified by:
getColor
in interfaceColorContainer
- Returns:
- the color
-
getDatabaseID
public int getDatabaseID()
Returns the database ID.- Specified by:
getDatabaseID
in interfaceDatabaseIDHandler
- Returns:
- the database ID
-
assign
public void assign(AbstractContainer c)
Updates itself with the values from given container (the manager is excluded!). Derived classes need to override this method.- Overrides:
assign
in classAbstractContainer
- Parameters:
c
- the container to get the values from
-
hashCode
public int hashCode()
Returns the hashcode of the ID string.
-
toString
public String toString()
Returns a short string representation of the container.- Overrides:
toString
in classAbstractContainer
- Returns:
- a string representation
-
-