fiore@3: /* fiore@3: CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool fiore@3: fiore@3: Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/) fiore@3: fiore@3: This program is free software: you can redistribute it and/or modify fiore@3: it under the terms of the GNU General Public License as published by fiore@3: the Free Software Foundation, either version 3 of the License, or fiore@3: (at your option) any later version. fiore@3: fiore@3: This program is distributed in the hope that it will be useful, fiore@3: but WITHOUT ANY WARRANTY; without even the implied warranty of fiore@3: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fiore@3: GNU General Public License for more details. fiore@3: fiore@3: You should have received a copy of the GNU General Public License fiore@3: along with this program. If not, see . fiore@3: */ fiore@3: package uk.ac.qmul.eecs.ccmi.diagrammodel; fiore@3: fiore@3: import java.util.EventObject; fiore@3: fiore@3: /** fiore@3: * An event that is triggered in the {@code DiagramModel} when an action fiore@3: * happens that can involve all the tree nodes of the model's {@code DiagramTree} fiore@3: * rather than only nodes or edges. fiore@3: * fiore@3: * Particularly such actions happens when the user set the notes for a tree node or when fiore@3: * they bookmark a tree node. fiore@3: * fiore@3: */ fiore@3: @SuppressWarnings("serial") fiore@3: public class DiagramTreeNodeEvent extends EventObject { fiore@3: /** fiore@3: * Creates a new event related to a change in a tree node on either notes or bookmarks. fiore@3: * In order to get the status of the tree node before the change the old value is passed as fiore@3: * parameter to this constructor. fiore@3: * For {@code setNotes} this value is the notes before the change. For {@code removeBookmark} it fiore@3: * will be the bookmark that has just been removed. Finally for {@code putBookmark()} the value is the fiore@3: * new bookmark. fiore@3: * fiore@3: * @see uk.ac.qmul.eecs.ccmi.diagrammodel.TreeModel uk.ac.qmul.eecs.ccmi.diagrammodel.TreeModel fiore@3: * fiore@3: * @param treeNode the tree node where the action happened fiore@3: * @param value the value that the tree node had before this action. fiore@3: * @param source the source of the action fiore@3: */ fiore@3: public DiagramTreeNodeEvent(DiagramTreeNode treeNode, String value, Object source){ fiore@3: super(source); fiore@3: this.treeNode = treeNode; fiore@3: this.value = value; fiore@3: } fiore@3: fiore@3: /** fiore@3: * Returns the tree node on which a new note has been set or a bookmark has been added/removed. fiore@3: * fiore@3: * @return the tree node this event refers to. fiore@3: */ fiore@3: public DiagramTreeNode getTreeNode() { fiore@3: return treeNode; fiore@3: } fiore@3: fiore@3: /** fiore@3: * Returns the old value before the action (the old notes for {@code setNotes()}, fiore@3: * and the bookmark key for {@code putBookmark() and removeBookmark()}. fiore@3: * fiore@3: * @return the old value before the action fiore@3: */ fiore@3: public String getValue() { fiore@3: return value; fiore@3: } fiore@3: fiore@3: private DiagramTreeNode treeNode; fiore@3: private String value; fiore@3: }