Package adams.gui.visualization.report
Class ReportContainerManager
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainerManager<ReportContainer>
-
- adams.gui.visualization.report.ReportContainerManager
-
- All Implemented Interfaces:
DatabaseConnectionHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,DatabaseContainerManager<ReportContainer>
,NamedContainerManager
,Serializable
public class ReportContainerManager extends AbstractContainerManager<ReportContainer> implements NamedContainerManager, DatabaseContainerManager<ReportContainer>
A container manager for Report objects.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDatabaseConnection
m_DatabaseConnection
the database connection.-
Fields inherited from class adams.gui.visualization.container.AbstractContainerManager
m_AllowRemoval, m_DataChangeListeners, m_FilteredList, m_List, m_SearchRegexp, m_SearchString, m_UpdateList, m_Updating
-
-
Constructor Summary
Constructors Constructor Description ReportContainerManager(AbstractDatabaseConnection dbcon)
Initializes the manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countVisible()
Returns the number of visible containers.List<ReportContainer>
getAllVisible()
Returns (a copy of) all currently stored containers.AbstractDatabaseConnection
getDatabaseConnection()
Returns the currently used database connection object, can be null.ReportContainer
getVisible(int index)
Returns the nth visible container.int[]
getVisibleIndices()
Returns the indices of all visible containers.int
indexOf(String id)
Determines the index of the reports with the specified ID.protected boolean
isMatch(ReportContainer cont, String search, boolean regExp)
Returns whether the container matches the current search.boolean
isVisible(int index)
Returns whether the container at the specified position is visible.ReportContainer
newContainer(Comparable o)
Returns a new container containing the given payload.void
setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.void
setVisible(int index, boolean visible)
Sets the specified container's visibility.-
Methods inherited from class adams.gui.visualization.container.AbstractContainerManager
add, addAll, addDataChangeListener, clear, clearSearch, contains, count, countFiltered, finishUpdate, finishUpdate, get, getAll, getAllowRemoval, getFiltered, getFilteredIndices, indexOf, indexOfFiltered, isFiltered, isFiltered, isUpdating, notifyDataChangeListeners, postAdd, postSet, preAdd, preSet, remove, removeDataChangeListener, search, set, setAllowRemoval, startUpdate, toString, updateSearch, updateSearchOnUpdate
-
-
-
-
Field Detail
-
m_DatabaseConnection
protected AbstractDatabaseConnection m_DatabaseConnection
the database connection.
-
-
Constructor Detail
-
ReportContainerManager
public ReportContainerManager(AbstractDatabaseConnection dbcon)
Initializes the manager.- Parameters:
dbcon
- the database context
-
-
Method Detail
-
getDatabaseConnection
public AbstractDatabaseConnection getDatabaseConnection()
Returns the currently used database connection object, can be null.- Specified by:
getDatabaseConnection
in interfaceDatabaseConnectionProvider
- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnection
in interfaceDatabaseConnectionHandler
- Parameters:
value
- the object to use
-
getVisibleIndices
public int[] getVisibleIndices()
Returns the indices of all visible containers.- Returns:
- all containers
-
getAllVisible
public List<ReportContainer> getAllVisible()
Returns (a copy of) all currently stored containers. Those containers have no manager.- Returns:
- all containers
-
isVisible
public boolean isVisible(int index)
Returns whether the container at the specified position is visible.- Parameters:
index
- the container's position- Returns:
- true if the container is visible
-
setVisible
public void setVisible(int index, boolean visible)
Sets the specified container's visibility. Uses the scripting engine if the owner is derived from SpectrumPanel.- Parameters:
index
- the index of the containervisible
- if true then the container will be made visible- See Also:
SequencePanel
-
getVisible
public ReportContainer getVisible(int index)
Returns the nth visible container.- Parameters:
index
- the index (relates only to the visible containers!)- Returns:
- the container, null if index out of range
-
countVisible
public int countVisible()
Returns the number of visible containers.- Returns:
- the number of visible containers
-
indexOf
public int indexOf(String id)
Determines the index of the reports with the specified ID.- Specified by:
indexOf
in interfaceNamedContainerManager
- Parameters:
id
- the ID of the report- Returns:
- the index of the report or -1 if not found
-
newContainer
public ReportContainer newContainer(Comparable o)
Returns a new container containing the given payload.- Specified by:
newContainer
in classAbstractContainerManager<ReportContainer>
- Parameters:
o
- the payload to encapsulate- Returns:
- the new container
-
isMatch
protected boolean isMatch(ReportContainer cont, String search, boolean regExp)
Returns whether the container matches the current search.- Specified by:
isMatch
in classAbstractContainerManager<ReportContainer>
- Parameters:
cont
- the container to checksearch
- the search stringregExp
- whether to perform regular expression matching
-
-