Class SpreadSheetRowContainerManager
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainerManager<SpreadSheetRowContainer>
-
- adams.gui.visualization.spreadsheet.SpreadSheetRowContainerManager
-
- All Implemented Interfaces:
ColorContainerManager<SpreadSheetRowContainer>
,NamedContainerManager
,VisibilityContainerManager<SpreadSheetRowContainer>
,Serializable
public class SpreadSheetRowContainerManager extends AbstractContainerManager<SpreadSheetRowContainer> implements VisibilityContainerManager<SpreadSheetRowContainer>, NamedContainerManager, ColorContainerManager<SpreadSheetRowContainer>
A handler for the Instance containers.- Version:
- $Revision: 12196 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorProvider
m_ColorProvider
the color provider for managing the colors.protected ContainerListManager<SpreadSheetRowContainerManager>
m_Owner
the owning panel.-
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 SpreadSheetRowContainerManager(ContainerListManager<SpreadSheetRowContainerManager> owner)
Initializes the manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SpreadSheetRowContainer c)
Adds the given container to the list.void
clear()
Clears the container list.int
countVisible()
Returns the number of visible containers.List<SpreadSheetRowContainer>
getAllVisible()
Returns (a copy of) all currently stored containers.Color
getColor(SpreadSheetRowContainer cont)
Returns the color for the container.ColorProvider
getColorProvider()
Returns the color provider to use.ContainerListManager
getOwner()
Returns the owning panel.SpreadSheetRowContainer
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 sequence with the specified ID.protected boolean
isMatch(SpreadSheetRowContainer 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.SpreadSheetRowContainer
newContainer(Comparable o)
Returns a new container containing the given payload.SpreadSheetRowContainer
remove(int index)
Removes the container at the specified position.SpreadSheetRowContainer
set(int index, SpreadSheetRowContainer c)
Replaces the container at the given position.void
setColorProvider(ColorProvider value)
Sets the color provider to use.void
setVisible(int index, boolean visible)
Sets the specified container's visibility.-
Methods inherited from class adams.gui.visualization.container.AbstractContainerManager
addAll, addDataChangeListener, clearSearch, contains, count, countFiltered, finishUpdate, finishUpdate, get, getAll, getAllowRemoval, getFiltered, getFilteredIndices, indexOf, indexOfFiltered, isFiltered, isFiltered, isUpdating, notifyDataChangeListeners, postAdd, postSet, preAdd, preSet, removeDataChangeListener, search, setAllowRemoval, startUpdate, toString, updateSearch, updateSearchOnUpdate
-
-
-
-
Field Detail
-
m_Owner
protected ContainerListManager<SpreadSheetRowContainerManager> m_Owner
the owning panel.
-
m_ColorProvider
protected ColorProvider m_ColorProvider
the color provider for managing the colors.
-
-
Constructor Detail
-
SpreadSheetRowContainerManager
public SpreadSheetRowContainerManager(ContainerListManager<SpreadSheetRowContainerManager> owner)
Initializes the manager.- Parameters:
owner
- the owning panel
-
-
Method Detail
-
getOwner
public ContainerListManager getOwner()
Returns the owning panel.- Returns:
- the owner
-
setColorProvider
public void setColorProvider(ColorProvider value)
Sets the color provider to use.- Specified by:
setColorProvider
in interfaceColorContainerManager<SpreadSheetRowContainer>
- Parameters:
value
- the color provider
-
getColorProvider
public ColorProvider getColorProvider()
Returns the color provider to use.- Specified by:
getColorProvider
in interfaceColorContainerManager<SpreadSheetRowContainer>
- Returns:
- the color provider in use
-
getColor
public Color getColor(SpreadSheetRowContainer cont)
Returns the color for the container.- Specified by:
getColor
in interfaceColorContainerManager<SpreadSheetRowContainer>
- Parameters:
cont
- the container to get the color for- Returns:
- the color
-
clear
public void clear()
Clears the container list.- Overrides:
clear
in classAbstractContainerManager<SpreadSheetRowContainer>
-
newContainer
public SpreadSheetRowContainer newContainer(Comparable o)
Returns a new container containing the given payload.- Specified by:
newContainer
in classAbstractContainerManager<SpreadSheetRowContainer>
- Parameters:
o
- the payload to encapsulate- Returns:
- the new container
-
add
public void add(SpreadSheetRowContainer c)
Adds the given container to the list. Duplicates are ignored.- Overrides:
add
in classAbstractContainerManager<SpreadSheetRowContainer>
- Parameters:
c
- the container to add
-
set
public SpreadSheetRowContainer set(int index, SpreadSheetRowContainer c)
Replaces the container at the given position.- Overrides:
set
in classAbstractContainerManager<SpreadSheetRowContainer>
- Parameters:
index
- the position to replacec
- the replacement- Returns:
- the old container
-
remove
public SpreadSheetRowContainer remove(int index)
Removes the container at the specified position.- Overrides:
remove
in classAbstractContainerManager<SpreadSheetRowContainer>
- Parameters:
index
- the index of the container to remove- Returns:
- the container that got removed
-
indexOf
public int indexOf(String id)
Determines the index of the sequence with the specified ID.- Specified by:
indexOf
in interfaceNamedContainerManager
- Parameters:
id
- the ID of the sequence- Returns:
- the index of the sequence or -1 if not found
-
getVisibleIndices
public int[] getVisibleIndices()
Returns the indices of all visible containers.- Specified by:
getVisibleIndices
in interfaceVisibilityContainerManager<SpreadSheetRowContainer>
- Returns:
- all containers
-
getAllVisible
public List<SpreadSheetRowContainer> getAllVisible()
Returns (a copy of) all currently stored containers. Those containers have no manager.- Specified by:
getAllVisible
in interfaceVisibilityContainerManager<SpreadSheetRowContainer>
- Returns:
- all containers
-
isVisible
public boolean isVisible(int index)
Returns whether the container at the specified position is visible.- Specified by:
isVisible
in interfaceVisibilityContainerManager<SpreadSheetRowContainer>
- 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.- Specified by:
setVisible
in interfaceVisibilityContainerManager<SpreadSheetRowContainer>
- Parameters:
index
- the index of the containervisible
- if true then the container will be made visible
-
getVisible
public SpreadSheetRowContainer getVisible(int index)
Returns the nth visible container.- Specified by:
getVisible
in interfaceVisibilityContainerManager<SpreadSheetRowContainer>
- 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.- Specified by:
countVisible
in interfaceVisibilityContainerManager<SpreadSheetRowContainer>
- Returns:
- the number of visible containers
-
isMatch
protected boolean isMatch(SpreadSheetRowContainer cont, String search, boolean regExp)
Returns whether the container matches the current search.- Specified by:
isMatch
in classAbstractContainerManager<SpreadSheetRowContainer>
- Parameters:
cont
- the container to checksearch
- the search stringregExp
- whether to perform regular expression matching
-
-