java.lang.Object
org.jpo.datamodel.GroupInfo
- All Implemented Interfaces:
Serializable
,GroupOrPicture
A GroupInfo object carries a description and its owning node can have zero or
many GroupOrPicture carrying nodes.
This class must implement the Serializable interface or Drag and Drop will not work.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGroupInfoChangeListener
(GroupInfoChangeListener groupInfoChangeListener) Adds a change listenerint
Defines how GroupInfo objects compare themselvesvoid
dumpToXml
(BufferedWriter out, boolean rootNode, boolean protection) this method writes all attributes of the group to the JPO xml data format with the highres locations passed in as parameters.void
endGroupXML
(BufferedWriter out, boolean rootNode) Closes the xml outputgetClone()
Returns a new GroupInfo object which is identical to the current one.Returns the description of the group.Returns the description of the group with the HTML characters safely escaped.Returns the node that owns this objectvoid
removeGroupInfoChangeListener
(GroupInfoChangeListener groupInfoChangeListener) Removes the change listenervoid
Creates a GroupInfoChangedEvent and sends it to inform listening objects that the node was selected.void
Creates a PictureChangedEvent and sends it to inform listening objects that the node was unselected.void
setGroupName
(String name) Set name of the GroupInfovoid
setOwningNode
(SortableDefaultMutableTreeNode sortableDefaultMutableTreeNode) A GroupOrPicture must be able to remember the node that owns it to facilitate traversaltoString()
toString method that returns the description of the group
-
Constructor Details
-
GroupInfo
Constructor to create a new GroupInfo object.- Parameters:
description
- The description of the Group
-
-
Method Details
-
toString
toString method that returns the description of the group -
getGroupName
Returns the description of the group.- Returns:
- The description of the Group.
- See Also:
-
getGroupNameHtml
Returns the description of the group with the HTML characters safely escaped.- Returns:
- The description of the Group.
- See Also:
-
setGroupName
Set name of the GroupInfo- Parameters:
name
- The new description of the GroupInfo- See Also:
-
dumpToXml
this method writes all attributes of the group to the JPO xml data format with the highres locations passed in as parameters.- Parameters:
out
- The BufferedWriter receiving the xml data. I use a BufferedWriter because it has a newLine methodrootNode
- The starting nodeprotection
- Whether the collection is protected or not- Throws:
IOException
- If there was an IO error
-
endGroupXML
Closes the xml output- Parameters:
out
- The output streamrootNode
- true if this si the root node- Throws:
IOException
- if something went wrong
-
sendWasSelectedEvent
public void sendWasSelectedEvent()Creates a GroupInfoChangedEvent and sends it to inform listening objects that the node was selected. Strictly speaking this is not a GroupInfo level event but a node level event. However, because I have the GroupInfoChangeEvent structure in place this is a good place to put this notification. -
sendWasUnselectedEvent
public void sendWasUnselectedEvent()Creates a PictureChangedEvent and sends it to inform listening objects that the node was unselected. Strictly speaking this is not a PictureInfo level event but a node level event. However, because I have the PictureInfoChangeEvent structure in place this is a good place to put this notification. -
addGroupInfoChangeListener
Adds a change listener- Parameters:
groupInfoChangeListener
- The object that will receive notifications.
-
removeGroupInfoChangeListener
Removes the change listener- Parameters:
groupInfoChangeListener
- The listener that doesn't want to receive notifications.
-
getClone
Returns a new GroupInfo object which is identical to the current one.- Returns:
- a clone of the current PictureInfo object.
-
compareTo
Defines how GroupInfo objects compare themselves- Parameters:
otherGroupInfo
- The other GroupInfo object- Returns:
- negative number if this is less than other Zero if same or positive number if other is less than this
-
setOwningNode
Description copied from interface:GroupOrPicture
A GroupOrPicture must be able to remember the node that owns it to facilitate traversal- Specified by:
setOwningNode
in interfaceGroupOrPicture
- Parameters:
sortableDefaultMutableTreeNode
- The owning node
-
getOwningNode
Description copied from interface:GroupOrPicture
Returns the node that owns this object- Specified by:
getOwningNode
in interfaceGroupOrPicture
- Returns:
- the node that owns this object
-