private void setupActions() { // Mac weirdness... VK_MINUS/VK_PLUS seems to map to english key map always... bindAction(new ZoomAction("Zoom in", 2), ZOOM_IN, KeyStroke.getKeyStroke('+'), KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0)); bindAction(new ZoomAction("Zoom out", .5), ZOOM_OUT, KeyStroke.getKeyStroke('-'), KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0)); bindAction(new ZoomAction("Zoom actual"), ZOOM_ACTUAL, KeyStroke.getKeyStroke('0'), KeyStroke.getKeyStroke(KeyEvent.VK_0, 0)); bindAction(TransferHandler.getCopyAction(), (String) TransferHandler.getCopyAction().getValue(Action.NAME), KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); bindAction(TransferHandler.getPasteAction(), (String) TransferHandler.getPasteAction().getValue(Action.NAME), KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); }
map.put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction()); map.put(TransferHandler.getPasteAction().getValue(Action.NAME), TransferHandler.getPasteAction());
); listActionMap.put( TransferHandler.getPasteAction().getValue(Action.NAME), TransferHandler.getPasteAction() );
Action action = this.dndList.getActionMap().get(TransferHandler.getPasteAction().getValue(Action.NAME)); if (action != null) { action.actionPerformed(
public void actionPerformed(ActionEvent e) { JTable table = getSelectedJTable(); Action pasteAction = TransferHandler.getPasteAction(); ActionEvent actionEvent = new ActionEvent(table, ActionEvent.ACTION_PERFORMED, "paste"); pasteAction.actionPerformed(actionEvent); } });
@Override public void actionPerformed(ActionEvent e) { TransferHandler.getPasteAction().actionPerformed(new ActionEvent(list, ActionEvent.ACTION_PERFORMED, "paste")); } }
public void actionPerformed(ActionEvent e) { TransferHandler.getPasteAction().actionPerformed(new ActionEvent(labelPanel, ActionEvent.ACTION_PERFORMED, "paste")); //$NON-NLS-1$ } }
private void setupActions() { // Mac weirdness... VK_MINUS/VK_PLUS seems to map to english key map always... bindAction(new ZoomAction("Zoom in", 2), ZOOM_IN, KeyStroke.getKeyStroke('+'), KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0)); bindAction(new ZoomAction("Zoom out", .5), ZOOM_OUT, KeyStroke.getKeyStroke('-'), KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0)); bindAction(new ZoomAction("Zoom actual"), ZOOM_ACTUAL, KeyStroke.getKeyStroke('0'), KeyStroke.getKeyStroke(KeyEvent.VK_0, 0)); bindAction(TransferHandler.getCopyAction(), (String) TransferHandler.getCopyAction().getValue(Action.NAME), KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); bindAction(TransferHandler.getPasteAction(), (String) TransferHandler.getPasteAction().getValue(Action.NAME), KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); }
public void setUpDndCCP() { setDragEnabled(true); setDropMode(DropMode.INSERT_ROWS); setTransferHandler(new PlaylistTransferHandler(this)); ActionMap map = getActionMap(); Action cutAction = TransferHandler.getCutAction(); map.put(cutAction.getValue(Action.NAME), cutAction); Action copyAction = TransferHandler.getCopyAction(); map.put(copyAction.getValue(Action.NAME), copyAction); Action pasteAction = TransferHandler.getPasteAction(); map.put(pasteAction.getValue(Action.NAME), pasteAction); }
public void paste_actionPerformed(ActionEvent e) { ActionEvent e1 = new ActionEvent(this.ids.editor.getGraph(), e.getID(), e.getActionCommand(), e.getModifiers()); if (ids.editor.getGraph()!=null) { (this.ids.editor.getGraph().getTransferHandler().getPasteAction()). actionPerformed(e1); ids.otherChange(); } } }
public void updateActions(ModelJGraph graph){ copy.updateAction(graph.getTransferHandler().getCopyAction(),graph); paste.updateAction(graph.getTransferHandler().getPasteAction(),graph); }
public synchronized JGraph cloneJGraph(IDEState ids){ UseCaseDiagramModelJGraph jg=new UseCaseDiagramModelJGraph( (UseCaseDiagramDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ ComponentDiagramModelJGraph jg=new ComponentDiagramModelJGraph( (ComponentDiagramDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ OrganizationModelModelJGraph jg=new OrganizationModelModelJGraph( (OrganizationModelDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ ActivityDiagramModelJGraph jg=new ActivityDiagramModelJGraph( (ActivityDiagramDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ TasksAndGoalsModelModelJGraph jg=new TasksAndGoalsModelModelJGraph( (TasksAndGoalsModelDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ DeployDiagramModelJGraph jg=new DeployDiagramModelJGraph( (DeployDiagramDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ EnvironmentModelModelJGraph jg=new EnvironmentModelModelJGraph( (EnvironmentModelDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ InteractionModelModelJGraph jg=new InteractionModelModelJGraph( (InteractionModelDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }
public synchronized JGraph cloneJGraph(IDEState ids){ AgentModelModelJGraph jg=new AgentModelModelJGraph( (AgentModelDataEntity) this.mde,name, ids.om, new Model(ids),new BasicMarqueeHandler(),ids.prefs); this.setSelectionCells(getGraphLayoutCache().getCells(false,true,false,false)); Action copyaction =new EventRedirectorForGraphCopy(this,this.getTransferHandler().getCopyAction(),null ); Action pasteaction =new EventRedirectorPasteForGraphCopy(jg,jg.getTransferHandler().getPasteAction(),null ); copyaction.actionPerformed(new ActionEvent(this,0,"hello")); pasteaction.actionPerformed(new ActionEvent(this,0,"hello")); jg.invalidate(); jg.doLayout(); return jg; }