comparison java/src/uk/ac/qmul/eecs/ccmi/gui/DiagramModelUpdater.java @ 0:9418ab7b7f3f

Initial import
author Fiore Martin <fiore@eecs.qmul.ac.uk>
date Fri, 16 Dec 2011 17:35:51 +0000
parents
children 9e67171477bc
comparison
equal deleted inserted replaced
-1:000000000000 0:9418ab7b7f3f
1 /*
2 CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool
3
4 Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/)
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 package uk.ac.qmul.eecs.ccmi.gui;
20
21 import java.awt.geom.Point2D;
22 import java.util.Set;
23
24 import uk.ac.qmul.eecs.ccmi.diagrammodel.DiagramElement;
25 import uk.ac.qmul.eecs.ccmi.diagrammodel.DiagramModelTreeNode;
26 import uk.ac.qmul.eecs.ccmi.diagrammodel.NodeProperties;
27
28 /**
29 *
30 * The DiagramModelUpdater class is used to make changes to the diagram model. The reason why
31 * changes are not made directly to the model is allowing the network-local diagram interchangeability.
32 * A NetDiagram differs from a local
33 * diagram only by its DiagramModelUpdater implementation. The rest of the operations are
34 * performed through the delegate local diagram which is passed as argument to the constructor.
35 * In this way a local diagram can be easily turned into a network diagram and vice versa.
36 *
37 * @see NetDiagram
38 */
39 public interface DiagramModelUpdater {
40
41 public boolean getLock(DiagramModelTreeNode treeNode, Lock lock);
42
43 public void yieldLock(DiagramModelTreeNode treeNode, Lock lock);
44
45 public void insertInCollection(DiagramElement element);
46
47 public void insertInTree(DiagramElement element);
48
49 public void takeOutFromCollection(DiagramElement element);
50
51 public void takeOutFromTree(DiagramElement element);
52
53 public void setName(DiagramElement element, String name);
54
55 public void setProperty(Node node, String type, int index, String value);
56
57 public void setProperties(Node node, NodeProperties properties);
58
59 public void clearProperties(Node node);
60
61 public void setNotes(DiagramModelTreeNode treeNode, String notes);
62
63 public void addProperty(Node node, String type, String value);
64
65 public void removeProperty(Node node, String type, int index);
66
67 public void setModifiers(Node node, String type, int index, Set<Integer> modifiers);
68
69 public void setEndLabel(Edge edge, Node node, String label);
70
71 public void setEndDescription(Edge edge, Node node, int i);// String description);
72
73 public void translate(GraphElement ge, Point2D p, double x, double y);
74
75 public void startMove(GraphElement ge, Point2D p);
76
77 public void bend(Edge edge, Point2D p);
78
79 public void stopMove(GraphElement ge);
80 }