-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.diagram.synchronization;\r
-\r
-import org.simantics.db.WriteGraph;\r
-\r
-/**\r
- * @author Tuukka Lehtonen\r
- */\r
-public class ModificationAdapter implements IModification {\r
-\r
- public static final Double HIGH_PRIORITY = 1d;\r
-\r
- public static final Double REMOVE_EDGE_PRIORITY = 2d;\r
- public static final Double REMOVE_BRANCH_PRIORITY = 3d;\r
- public static final Double REMOVE_CONNECTION_PRIORITY = 4d;\r
- public static final Double REMOVE_NODE_PRIORITY = 5d;\r
-\r
- public static final Double ADD_NODE_PRIORITY = 6d;\r
- public static final Double ADD_CONNECTION_PRIORITY = 7d;\r
- public static final Double ADD_BRANCH_PRIORITY = 8d;\r
- public static final Double ADD_EDGE_PRIORITY = 9d;\r
- public static final Double SET_CONNECTION_TYPE_PRIORITY = 9.5d;\r
-\r
- public static final Double LOW_PRIORITY = 10d;\r
-\r
- final Double priority;\r
-\r
- Throwable exception;\r
- boolean complete = false;\r
- protected ModificationAdapter(Double priority) {\r
- assert priority != null;\r
- this.priority = priority;\r
- }\r
- @Override\r
- public boolean isComplete() {\r
- return complete;\r
- }\r
- @Override\r
- public void markComplete() {\r
- this.complete = true;\r
- }\r
- @Override\r
- public void perform(WriteGraph g) throws Exception {\r
- }\r
- @Override\r
- public void completed() {\r
- }\r
- @Override\r
- public Throwable getException() {\r
- return exception;\r
- }\r
- @Override\r
- public void setException(Throwable t) {\r
- this.exception = t;\r
- }\r
- //@Override\r
- //public String toString() {\r
- // return getClass().getSimpleName();\r
- //}\r
- @Override\r
- public Double getPriority() {\r
- return priority;\r
- }\r
- @Override\r
- public int compareTo(IModification arg0) {\r
- return priority.compareTo(arg0.getPriority());\r
- }\r
- @Override\r
- public String toString() {\r
- return getClass().getSimpleName() + "$" + System.identityHashCode(this);\r
- }\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.diagram.synchronization;
+
+import org.simantics.db.WriteGraph;
+
+/**
+ * @author Tuukka Lehtonen
+ */
+public class ModificationAdapter implements IModification {
+
+ public static final Double HIGH_PRIORITY = 1d;
+
+ public static final Double REMOVE_EDGE_PRIORITY = 2d;
+ public static final Double REMOVE_BRANCH_PRIORITY = 3d;
+ public static final Double REMOVE_CONNECTION_PRIORITY = 4d;
+ public static final Double REMOVE_NODE_PRIORITY = 5d;
+
+ public static final Double ADD_NODE_PRIORITY = 6d;
+ public static final Double ADD_CONNECTION_PRIORITY = 7d;
+ public static final Double ADD_BRANCH_PRIORITY = 8d;
+ public static final Double ADD_EDGE_PRIORITY = 9d;
+ public static final Double SET_CONNECTION_TYPE_PRIORITY = 9.5d;
+
+ public static final Double LOW_PRIORITY = 10d;
+
+ final Double priority;
+
+ Throwable exception;
+ boolean complete = false;
+ protected ModificationAdapter(Double priority) {
+ assert priority != null;
+ this.priority = priority;
+ }
+ @Override
+ public boolean isComplete() {
+ return complete;
+ }
+ @Override
+ public void markComplete() {
+ this.complete = true;
+ }
+ @Override
+ public void perform(WriteGraph g) throws Exception {
+ }
+ @Override
+ public void completed() {
+ }
+ @Override
+ public Throwable getException() {
+ return exception;
+ }
+ @Override
+ public void setException(Throwable t) {
+ this.exception = t;
+ }
+ //@Override
+ //public String toString() {
+ // return getClass().getSimpleName();
+ //}
+ @Override
+ public Double getPriority() {
+ return priority;
+ }
+ @Override
+ public int compareTo(IModification arg0) {
+ return priority.compareTo(arg0.getPriority());
+ }
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + "$" + System.identityHashCode(this);
+ }
}
\ No newline at end of file