Package adams.gui.visualization.sequence
Class XYSequenceContainerManager
- java.lang.Object
-
- adams.gui.visualization.container.AbstractContainerManager<XYSequenceContainer>
-
- adams.gui.visualization.sequence.XYSequenceContainerManager
-
- All Implemented Interfaces:
ColorContainerManager<XYSequenceContainer>,NamedContainerManager,VisibilityContainerManager<XYSequenceContainer>,Serializable
- Direct Known Subclasses:
SequencePlotContainerManager
public class XYSequenceContainerManager extends AbstractContainerManager<XYSequenceContainer> implements VisibilityContainerManager<XYSequenceContainer>, NamedContainerManager, ColorContainerManager<XYSequenceContainer>
A handler for the XY sequence containers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorProviderm_ColorProviderthe color provider for managing the colors.protected ContainerListManagerm_Ownerthe 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 XYSequenceContainerManager(ContainerListManager owner)Initializes the manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(XYSequenceContainer c)Adds the given container to the list.voidclear()Clears the container list.intcountVisible()Returns the number of visible containers.List<XYSequenceContainer>getAllVisible()Returns (a copy of) all currently stored containers.ColorgetColor(XYSequenceContainer cont)Returns the color for the container.ColorProvidergetColorProvider()Returns the color provider to use.ContainerListManagergetOwner()Returns the owning panel.XYSequenceContainergetVisible(int index)Returns the nth visible container.int[]getVisibleIndices()Returns the indices of all visible containers.intindexOf(String id)Determines the index of the sequence with the specified ID.protected booleanisMatch(XYSequenceContainer 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.XYSequenceContainernewContainer(Comparable o)Returns a new container containing the given payload.XYSequenceContainerremove(int index)Removes the container at the specified position.voidsetColorProvider(ColorProvider value)Sets the color provider to use.voidsetVisible(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, set, setAllowRemoval, startUpdate, toString, updateSearch, updateSearchOnUpdate
-
-
-
-
Field Detail
-
m_Owner
protected ContainerListManager m_Owner
the owning panel.
-
m_ColorProvider
protected ColorProvider m_ColorProvider
the color provider for managing the colors.
-
-
Constructor Detail
-
XYSequenceContainerManager
public XYSequenceContainerManager(ContainerListManager 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:
setColorProviderin interfaceColorContainerManager<XYSequenceContainer>- Parameters:
value- the color provider
-
getColorProvider
public ColorProvider getColorProvider()
Returns the color provider to use.- Specified by:
getColorProviderin interfaceColorContainerManager<XYSequenceContainer>- Returns:
- the color provider in use
-
getColor
public Color getColor(XYSequenceContainer cont)
Returns the color for the container.- Specified by:
getColorin interfaceColorContainerManager<XYSequenceContainer>- Parameters:
cont- the container to get the color for- Returns:
- the color
-
clear
public void clear()
Clears the container list.- Overrides:
clearin classAbstractContainerManager<XYSequenceContainer>
-
newContainer
public XYSequenceContainer newContainer(Comparable o)
Returns a new container containing the given payload.- Specified by:
newContainerin classAbstractContainerManager<XYSequenceContainer>- Parameters:
o- the payload to encapsulate- Returns:
- the new container
-
add
public void add(XYSequenceContainer c)
Adds the given container to the list. Duplicates are ignored.- Overrides:
addin classAbstractContainerManager<XYSequenceContainer>- Parameters:
c- the container to add
-
remove
public XYSequenceContainer remove(int index)
Removes the container at the specified position.- Overrides:
removein classAbstractContainerManager<XYSequenceContainer>- 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:
indexOfin 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:
getVisibleIndicesin interfaceVisibilityContainerManager<XYSequenceContainer>- Returns:
- all containers
-
getAllVisible
public List<XYSequenceContainer> getAllVisible()
Returns (a copy of) all currently stored containers. Those containers have no manager.- Specified by:
getAllVisiblein interfaceVisibilityContainerManager<XYSequenceContainer>- Returns:
- all containers
-
isVisible
public boolean isVisible(int index)
Returns whether the container at the specified position is visible.- Specified by:
isVisiblein interfaceVisibilityContainerManager<XYSequenceContainer>- 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:
setVisiblein interfaceVisibilityContainerManager<XYSequenceContainer>- Parameters:
index- the index of the containervisible- if true then the container will be made visible
-
getVisible
public XYSequenceContainer getVisible(int index)
Returns the nth visible container.- Specified by:
getVisiblein interfaceVisibilityContainerManager<XYSequenceContainer>- 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:
countVisiblein interfaceVisibilityContainerManager<XYSequenceContainer>- Returns:
- the number of visible containers
-
isMatch
protected boolean isMatch(XYSequenceContainer cont, String search, boolean regExp)
Returns whether the container matches the current search.- Specified by:
isMatchin classAbstractContainerManager<XYSequenceContainer>- Parameters:
cont- the container to checksearch- the search stringregExp- whether to perform regular expression matching
-
-