view 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
line wrap: on
line source
/*  
 CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool
  
 Copyright (C) 2011  Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/)

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package uk.ac.qmul.eecs.ccmi.gui;

import java.awt.geom.Point2D;
import java.util.Set;

import uk.ac.qmul.eecs.ccmi.diagrammodel.DiagramElement;
import uk.ac.qmul.eecs.ccmi.diagrammodel.DiagramModelTreeNode;
import uk.ac.qmul.eecs.ccmi.diagrammodel.NodeProperties;

/**
 * 
 * The DiagramModelUpdater class is used to make changes to the diagram model. The reason why 
 * changes are not made directly to the model is allowing the network-local diagram interchangeability. 
 * A NetDiagram differs from a local 
 * diagram only by its DiagramModelUpdater implementation. The rest of the operations are 
 * performed through the delegate local diagram which is passed as argument to the constructor.    
 * In this way a local diagram can be easily turned into a network diagram and vice versa.
 *
 * @see NetDiagram
 */
public interface DiagramModelUpdater {
	
	public boolean getLock(DiagramModelTreeNode treeNode, Lock lock);
	
	public void yieldLock(DiagramModelTreeNode treeNode, Lock lock);
	
	public void insertInCollection(DiagramElement element);
	
	public void insertInTree(DiagramElement element);
	
	public void takeOutFromCollection(DiagramElement element);
	
	public void takeOutFromTree(DiagramElement element);
		
	public void setName(DiagramElement element, String name);
	
	public void setProperty(Node node, String type, int index, String value);
	
	public void setProperties(Node node, NodeProperties properties);
	
	public void clearProperties(Node node);
	
	public void setNotes(DiagramModelTreeNode treeNode, String notes);
	
	public void addProperty(Node node, String type, String value);
	
	public void removeProperty(Node node, String type, int index);
	
	public void setModifiers(Node node, String type, int index, Set<Integer> modifiers);
	
	public void setEndLabel(Edge edge, Node node, String label);
	
	public void setEndDescription(Edge edge, Node node, int i);// String description);
	
	public void translate(GraphElement ge, Point2D p, double x, double y);
	
	public void startMove(GraphElement ge, Point2D p);
	
	public void bend(Edge edge, Point2D p);
	
	public void stopMove(GraphElement ge);
}