/*******************************************************************************
- * Copyright (c) 2010 Association for Decentralized Information Management in
+ * Copyright (c) 2020 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
*
* Contributors:
* VTT Technical Research Centre of Finland - initial API and implementation
+ * Semantum Oy - simantics/platform#574
*******************************************************************************/
package org.simantics.sysdyn.ui.editor.participant;
import org.simantics.g2d.participant.MouseUtil;
import org.simantics.g2d.participant.MouseUtil.MouseInfo;
import org.simantics.scenegraph.g2d.G2DParentNode;
+import org.simantics.scenegraph.g2d.IG2DNode;
import org.simantics.scenegraph.g2d.events.EventHandlerReflection.EventHandler;
import org.simantics.scenegraph.g2d.events.KeyEvent;
import org.simantics.scenegraph.g2d.events.KeyEvent.KeyPressedEvent;
import org.simantics.scenegraph.g2d.events.KeyEvent.KeyReleasedEvent;
import org.simantics.scenegraph.g2d.events.MouseEvent;
import org.simantics.scenegraph.g2d.events.MouseEvent.MouseMovedEvent;
-import org.simantics.scenegraph.g2d.nodes.ShapeNode;
import org.simantics.sysdyn.SysdynResource;
import org.simantics.sysdyn.ui.elements.AuxiliaryFactory;
import org.simantics.sysdyn.ui.elements.CloudFactory;
@Dependency
ElementPainter diagramPainter;
- ShapeNode node;
+ IG2DNode node;
G2DParentNode parent;
private boolean createVar;
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_A,
SysdynResource.URIs.AuxiliarySymbol,
- (ShapeNode)AuxiliaryFactory.AUX_STATIC_IMAGE.init(parent)
+ (IG2DNode)AuxiliaryFactory.AUX_STATIC_IMAGE.init(parent)
);
} else if (kpe.keyCode == java.awt.event.KeyEvent.VK_S) {
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_S,
SysdynResource.URIs.StockSymbol,
- (ShapeNode)StockFactory.STOCK_IMAGE.init(parent)
+ (IG2DNode)StockFactory.STOCK_IMAGE.init(parent)
);
} else if (kpe.keyCode == java.awt.event.KeyEvent.VK_C) {
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_C,
SysdynResource.URIs.CloudSymbol,
- (ShapeNode)CloudFactory.CLOUD_IMAGE.init(parent)
+ (IG2DNode)CloudFactory.CLOUD_IMAGE.init(parent)
);
} else if (kpe.keyCode == java.awt.event.KeyEvent.VK_V) {
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_V,
SysdynResource.URIs.ValveSymbol,
- (ShapeNode)ValveFactory.VALVE_STATIC_IMAGE.init(parent)
+ (IG2DNode)ValveFactory.VALVE_STATIC_IMAGE.init(parent)
);
} else if (kpe.keyCode == java.awt.event.KeyEvent.VK_I) {
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_I,
SysdynResource.URIs.InputSymbol,
- (ShapeNode)InputFactory.INPUT_IMAGE.init(parent)
+ (IG2DNode)InputFactory.INPUT_IMAGE.init(parent)
);
} else if (kpe.keyCode == java.awt.event.KeyEvent.VK_G) {
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_G,
SysdynResource.URIs.ShadowSymbol,
- (ShapeNode)ShadowFactory.GHOST_IMAGE.init(parent)
+ (IG2DNode)ShadowFactory.GHOST_IMAGE.init(parent)
);
} else if (kpe.keyCode == java.awt.event.KeyEvent.VK_L) {
variableInformation = new VariableInformation(
java.awt.event.KeyEvent.VK_L,
SysdynResource.URIs.LoopSymbol,
- (ShapeNode)LoopFactory.LOOP_STATIC_IMAGE.init(parent)
+ (IG2DNode)LoopFactory.LOOP_STATIC_IMAGE.init(parent)
);
}
private class VariableInformation {
public String symbolURI;
- public ShapeNode node;
+ public IG2DNode node;
public int shortcutKey;
- public VariableInformation(int shortcutKey, String symbolURI, ShapeNode node) {
+ public VariableInformation(int shortcutKey, String symbolURI, IG2DNode node) {
this.symbolURI = symbolURI;
this.node = node;
this.shortcutKey = shortcutKey;