]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/TextColorSynchronizer.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / synchronization / graph / TextColorSynchronizer.java
index 4a6f92f3212dde8a1735b53a53181d661d85fb3e..72925ce5af9e310ceff7e4e1f24ab74764df65aa 100644 (file)
@@ -1,51 +1,51 @@
-/*******************************************************************************\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.graph;\r
-\r
-import java.awt.Color;\r
-\r
-import org.simantics.databoard.Bindings;\r
-import org.simantics.db.Resource;\r
-import org.simantics.diagram.synchronization.IModificationQueue;\r
-import org.simantics.diagram.synchronization.ISynchronizationContext;\r
-import org.simantics.g2d.element.ElementHints;\r
-import org.simantics.utils.datastructures.hints.IHintObservable;\r
-import org.simantics.utils.datastructures.hints.IHintContext.Key;\r
-\r
-/**\r
- * @author Marko Luukkainen <marko.luukkainen@vtt.fi>\r
- */\r
-public class TextColorSynchronizer extends ResourceSynchronizer {\r
-\r
-    public static final TextColorSynchronizer INSTANCE = new TextColorSynchronizer();\r
-\r
-    private static final Key[] SYNCHRONIZED_HINTS = {\r
-        ElementHints.KEY_TEXT_COLOR\r
-    };\r
-\r
-    @Override\r
-    public Key[] getSynchronizedHints() {\r
-        return SYNCHRONIZED_HINTS;\r
-    }\r
-\r
-    @Override\r
-    public boolean hintChanged(ISynchronizationContext context, IModificationQueue queue, Resource object, IHintObservable sender, Key key, Object oldValue, Object newValue) {\r
-        if (ElementHints.KEY_TEXT_COLOR.equals(key)) {\r
-            BasicResources br = context.get(GraphSynchronizationHints.BASIC_RESOURCES);\r
-            Color color = (Color)newValue;\r
-            float array[] = color.getRGBComponents(null);\r
-            return queue.offer(new PropertyModification(object, br.G2D.HasColor, br.G2D.Color, array, Bindings.FLOAT_ARRAY), null);\r
-        }\r
-        return false;\r
-    }\r
-\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.graph;
+
+import java.awt.Color;
+
+import org.simantics.databoard.Bindings;
+import org.simantics.db.Resource;
+import org.simantics.diagram.synchronization.IModificationQueue;
+import org.simantics.diagram.synchronization.ISynchronizationContext;
+import org.simantics.g2d.element.ElementHints;
+import org.simantics.utils.datastructures.hints.IHintObservable;
+import org.simantics.utils.datastructures.hints.IHintContext.Key;
+
+/**
+ * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
+ */
+public class TextColorSynchronizer extends ResourceSynchronizer {
+
+    public static final TextColorSynchronizer INSTANCE = new TextColorSynchronizer();
+
+    private static final Key[] SYNCHRONIZED_HINTS = {
+        ElementHints.KEY_TEXT_COLOR
+    };
+
+    @Override
+    public Key[] getSynchronizedHints() {
+        return SYNCHRONIZED_HINTS;
+    }
+
+    @Override
+    public boolean hintChanged(ISynchronizationContext context, IModificationQueue queue, Resource object, IHintObservable sender, Key key, Object oldValue, Object newValue) {
+        if (ElementHints.KEY_TEXT_COLOR.equals(key)) {
+            BasicResources br = context.get(GraphSynchronizationHints.BASIC_RESOURCES);
+            Color color = (Color)newValue;
+            float array[] = color.getRGBComponents(null);
+            return queue.offer(new PropertyModification(object, br.G2D.HasColor, br.G2D.Color, array, Bindings.FLOAT_ARRAY), null);
+        }
+        return false;
+    }
+
+}