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
,PropertyChangeListener
,Cloneable
,EventListener
This class simply manages a list of groupings and has some nice convenience methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.addGroupingForKey
(String aKey) Adds a new grouping with the given key.addGroupingForKey
(String aKey, int anIndex) Adds a new grouping with the given key at the given index.void
addGroupings
(List<RMGrouping> aList) Adds a given list of groupings to grouper's list of groupings.clone()
Standard clone implementation.boolean
Standard equals implementation.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.getGrouping
(int anIndex) Returns the grouping at the given index.getGrouping
(String aKey) Returns the grouping with the given key.int
Returns the number of groupings in this grouper.getGroupingKey
(int anIndex) Return the key for the grouping at the given index.Returns the last grouping.Returns the currently selected grouping (while editing only).int
Returns the currently selected grouping's index (for editing, mostly).groupObjects
(List aList) Separates given objects into RMGroups defined by groupings.int
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
(PropertyChangeEvent anEvent) Listen for property changes and forward to grouper's property change listeners.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).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
-
Constructor Details
-
RMGrouper
public RMGrouper()Creates an empty grouper.
-
-
Method Details
-
getGroupingCount
public int getGroupingCount()Returns the number of groupings in this grouper. -
getGrouping
Returns the grouping at the given index. -
addGrouping
Adds a given grouping to grouper's list of groupings. -
addGrouping
Adds a given grouping to grouper's list of groupings. -
removeGrouping
Removes the grouping at the given index. -
getGrouping
Returns the grouping with the given key. -
getGroupingLast
Returns the last grouping. -
getGroupingKey
Return the key for the grouping at the given index. -
indexOf
Returns the index for the grouping with the given key. -
addGroupings
Adds a given list of groupings to grouper's list of groupings. -
addGroupingForKey
Adds a new grouping with the given key. -
addGroupingForKey
Adds a new grouping with the given key at the given index. -
removeGrouping
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
Returns the currently selected grouping (while editing only). -
groupObjects
Separates given objects into RMGroups defined by groupings. -
propertyChange
Listen for property changes and forward to grouper's property change listeners.- Specified by:
propertyChange
in interfacePropertyChangeListener
-
equals
Standard equals implementation. -
clone
Standard clone implementation.- Overrides:
clone
in classRMListenerList
-
toXML
XML archival.- Specified by:
toXML
in interfaceArchivable
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-