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 AbstractDatabaseConnectionm_DatabaseConnectionthe 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 intcountVisible()Returns the number of visible containers.List<ReportContainer>getAllVisible()Returns (a copy of) all currently stored containers.AbstractDatabaseConnectiongetDatabaseConnection()Returns the currently used database connection object, can be null.ReportContainergetVisible(int index)Returns the nth visible container.int[]getVisibleIndices()Returns the indices of all visible containers.intindexOf(String id)Determines the index of the reports with the specified ID.protected booleanisMatch(ReportContainer cont, String search, boolean regExp)Returns whether the container matches the current search.booleanisVisible(int index)Returns whether the container at the specified position is visible.ReportContainernewContainer(Comparable o)Returns a new container containing the given payload.voidsetDatabaseConnection(AbstractDatabaseConnection value)Sets the database connection object to use.voidsetVisible(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:
getDatabaseConnectionin interfaceDatabaseConnectionProvider- Returns:
- the current object
-
setDatabaseConnection
public void setDatabaseConnection(AbstractDatabaseConnection value)
Sets the database connection object to use.- Specified by:
setDatabaseConnectionin 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:
indexOfin 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:
newContainerin 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:
isMatchin classAbstractContainerManager<ReportContainer>- Parameters:
cont- the container to checksearch- the search stringregExp- whether to perform regular expression matching
-
-