use of com.centurylink.mdw.designer.display.Node in project mdw-designer by CenturyLinkCloud.
the class CanvasCommon method keyReleased.
protected void keyReleased(KeyEvent arg0, Graph main_graph, boolean recordchange) {
if (useLabelEditor && arg0.getSource() == labelEditor) {
if (main_graph.isReadonly())
return;
if (updateLabelWhileTyping)
editing_obj.setText(labelEditor.getText());
if (labelEditor.adjustSize())
repaint();
} else {
int keycode = arg0.getKeyCode();
if (keycode != KeyEvent.VK_CONTROL) {
if (arg0.isControlDown()) {
if (keycode == KeyEvent.VK_C) {
if (selected_obj != null) {
GraphClipboard cb = GraphClipboard.getInstance();
cb.put(selected_obj);
}
} else if (keycode == KeyEvent.VK_V || keycode == KeyEvent.VK_X) {
if (main_graph.isReadonly())
return;
GraphClipboard cb = GraphClipboard.getInstance();
GraphFragment frag = cb.get();
if (frag != null) {
performPaste(frag, main_graph, recordchange);
}
} else {
if (selected_obj instanceof Node) {
handleActivityMenuShortCut((Node) selected_obj, keycode);
}
}
}
}
}
}
use of com.centurylink.mdw.designer.display.Node in project mdw-designer by CenturyLinkCloud.
the class GraphClipboard method put.
public void put(Object obj) {
ProcessTransferVO transfer;
GraphFragment fragment;
if (obj instanceof Node) {
fragment = new GraphFragment(((Node) obj).graph.getProcessVO().getProcessId());
fragment.nodes.add((Node) obj);
} else if (obj instanceof SubGraph) {
fragment = new GraphFragment(((SubGraph) obj).getGraph().getId());
fragment.subgraphs.add((SubGraph) obj);
} else if (obj instanceof GraphFragment) {
fragment = (GraphFragment) obj;
} else
return;
transfer = new ProcessTransferVO(fragment);
clipboard.setContents(transfer, this);
}
Aggregations