Search in sources :

Example 1 with GraphClipboard

use of com.centurylink.mdw.designer.utils.GraphClipboard 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);
                    }
                }
            }
        }
    }
}
Also used : GraphClipboard(com.centurylink.mdw.designer.utils.GraphClipboard) Node(com.centurylink.mdw.designer.display.Node) GraphFragment(com.centurylink.mdw.designer.display.GraphFragment)

Aggregations

GraphFragment (com.centurylink.mdw.designer.display.GraphFragment)1 Node (com.centurylink.mdw.designer.display.Node)1 GraphClipboard (com.centurylink.mdw.designer.utils.GraphClipboard)1