Package com.inductiveautomation.rm.base
Class RMGrouper
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.base.RMGrouper
-
- All Implemented Interfaces:
Archivable
,RMPropertyChanger
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.util.EventListener
public class RMGrouper extends RMObject implements java.beans.PropertyChangeListener, Archivable
This class simply manages a list of groupings and has some nice convenience methods.
-
-
Constructor Summary
Constructors Constructor Description RMGrouper()
Creates an empty grouper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGrouping(RMGrouping aGrouping)
Adds a given grouping to grouper's list of groupings.void
addGrouping(RMGrouping aGrouping, int anIndex)
Adds a given grouping to grouper's list of groupings.RMGrouping
addGroupingForKey(java.lang.String aKey)
Adds a new grouping with the given key.RMGrouping
addGroupingForKey(java.lang.String aKey, int anIndex)
Adds a new grouping with the given key at the given index.void
addGroupings(java.util.List<RMGrouping> aList)
Adds a given list of groupings to grouper's list of groupings.RMGrouper
clone()
Standard clone implementation.boolean
equals(java.lang.Object anObj)
Standard equals implementation.java.lang.Object
fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.RMGrouping
getGrouping(int anIndex)
Returns the grouping at the given index.RMGrouping
getGrouping(java.lang.String aKey)
Returns the grouping with the given key.int
getGroupingCount()
Returns the number of groupings in this grouper.java.lang.String
getGroupingKey(int anIndex)
Return the key for the grouping at the given index.RMGrouping
getGroupingLast()
Returns the last grouping.RMGrouping
getSelectedGrouping()
Returns the currently selected grouping (while editing only).int
getSelectedGroupingIndex()
Returns the currently selected grouping's index (for editing, mostly).RMGroup
groupObjects(java.util.List aList)
Separates given objects into RMGroups defined by groupings.int
indexOf(java.lang.String aKey)
Returns the index for the grouping with the given key.void
moveGrouping(int fromIndex, int toIndex)
Moves a grouping from given fromIndex to given toIndex.void
propertyChange(java.beans.PropertyChangeEvent anEvent)
Listen for property changes and forward to grouper's property change listeners.RMGrouping
removeGrouping(int anIndex)
Removes the grouping at the given index.boolean
removeGrouping(RMGrouping aGrouping)
Removes the given grouping.void
setSelectedGroupingIndex(int anIndex)
Sets the currently selected grouping by index (for editing, mostly).RXElement
toXML(RXArchiver anArchiver)
XML archival.-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toString
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Method Detail
-
getGroupingCount
public int getGroupingCount()
Returns the number of groupings in this grouper.
-
getGrouping
public RMGrouping getGrouping(int anIndex)
Returns the grouping at the given index.
-
addGrouping
public void addGrouping(RMGrouping aGrouping)
Adds a given grouping to grouper's list of groupings.
-
addGrouping
public void addGrouping(RMGrouping aGrouping, int anIndex)
Adds a given grouping to grouper's list of groupings.
-
removeGrouping
public RMGrouping removeGrouping(int anIndex)
Removes the grouping at the given index.
-
getGrouping
public RMGrouping getGrouping(java.lang.String aKey)
Returns the grouping with the given key.
-
getGroupingLast
public RMGrouping getGroupingLast()
Returns the last grouping.
-
getGroupingKey
public java.lang.String getGroupingKey(int anIndex)
Return the key for the grouping at the given index.
-
indexOf
public int indexOf(java.lang.String aKey)
Returns the index for the grouping with the given key.
-
addGroupings
public void addGroupings(java.util.List<RMGrouping> aList)
Adds a given list of groupings to grouper's list of groupings.
-
addGroupingForKey
public RMGrouping addGroupingForKey(java.lang.String aKey)
Adds a new grouping with the given key.
-
addGroupingForKey
public RMGrouping addGroupingForKey(java.lang.String aKey, int anIndex)
Adds a new grouping with the given key at the given index.
-
removeGrouping
public boolean removeGrouping(RMGrouping aGrouping)
Removes the given grouping.
-
moveGrouping
public void moveGrouping(int fromIndex, int toIndex)
Moves a grouping from given fromIndex to given toIndex.
-
getSelectedGroupingIndex
public int getSelectedGroupingIndex()
Returns the currently selected grouping's index (for editing, mostly).
-
setSelectedGroupingIndex
public void setSelectedGroupingIndex(int anIndex)
Sets the currently selected grouping by index (for editing, mostly).
-
getSelectedGrouping
public RMGrouping getSelectedGrouping()
Returns the currently selected grouping (while editing only).
-
groupObjects
public RMGroup groupObjects(java.util.List aList)
Separates given objects into RMGroups defined by groupings.
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
Listen for property changes and forward to grouper's property change listeners.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equals
in classjava.lang.Object
-
clone
public RMGrouper clone()
Standard clone implementation.- Overrides:
clone
in classRMListenerList
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Specified by:
toXML
in interfaceArchivable
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-
-