Search in sources :

Example 26 with Node

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

Example 27 with Node

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

Aggregations

Node (com.centurylink.mdw.designer.display.Node)27 SubGraph (com.centurylink.mdw.designer.display.SubGraph)18 Link (com.centurylink.mdw.designer.display.Link)14 GraphFragment (com.centurylink.mdw.designer.display.GraphFragment)10 Graph (com.centurylink.mdw.designer.display.Graph)9 TextNote (com.centurylink.mdw.designer.display.TextNote)8 Rectangle (java.awt.Rectangle)5 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)3 ActivityInstanceVO (com.centurylink.mdw.model.value.work.ActivityInstanceVO)3 Activity (com.centurylink.mdw.plugin.designer.model.Activity)2 ActivityImpl (com.centurylink.mdw.plugin.designer.model.ActivityImpl)2 Graphics2D (java.awt.Graphics2D)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 AuthenticationException (com.centurylink.mdw.auth.AuthenticationException)1 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)1 TranslationException (com.centurylink.mdw.common.exception.TranslationException)1 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)1 DesignerDataAccess (com.centurylink.mdw.designer.DesignerDataAccess)1