public static void notifyMenus(PixelitorEdit edit) { undoableEditSupport.postEdit(edit); }
public UndoSupportImpl() { m_undoManager = new UndoManager(); m_undoSupport = new UndoableEditSupport(); m_undoSupport.addUndoableEditListener( m_undoManager ); }
public static void addUndoableEditListener(UndoableEditListener listener) { undoableEditSupport.addUndoableEditListener(listener); }
/** * Posts the edit to the UndoableEditSupport instance. */ public void postEdit(AbstractCyEdit edit) { if ( edit != null ) m_undoSupport.postEdit( new SwingEditWrapper(edit) ); }
public static void onAllImagesClosed() { numUndoneEdits = 0; undoManager.discardAllEdits(); undoableEditSupport.postEdit(null); }
public void actionPerformed(final ActionEvent e) { final CyNetworkView view = Cytoscape.getCurrentNetworkView(); final List<NodeView> hiddenNodeViews = new ArrayList<NodeView>(); for (Iterator i = view.getSelectedNodes().iterator(); i.hasNext(); /* Empty! */) hiddenNodeViews.add((NodeView)i.next()); CyUndo.getUndoableEditSupport().postEdit(new HideSelectedNodesEdit(view, hiddenNodeViews, this)); GinyUtils.hideSelectedNodes(view); }
/** * Instead of using a listener, just overwrite this method to save time and * write to the temp object */ public void setValueAt(final Object newValue, int rowIdx, int colIdx) { final int keyIndex = getKeyIndex(); if (keyIndex == -1) return; final DataEditAction edit = updateCell(keyIndex, rowIdx, colIdx, newValue); if (edit != null) cytoscape.util.undo.CyUndo.getUndoableEditSupport().postEdit(edit); }
cytoscape.util.undo.CyUndo.getUndoableEditSupport().postEdit(edit);
/** * Updates an entire column. * * @param newValue the new value to be set * @param colIdx the index of the column that will be updated * @param skipRowIdx a row with matching this index will not be updated * */ public void updateColumn(final Object newValue, final int colIdx, final int skipRowIdx) { final int keyIndex = getKeyIndex(); if (keyIndex == -1) return; for (int rowIdx = 0; rowIdx < getRowCount(); ++rowIdx) { if (rowIdx == skipRowIdx) continue; final DataEditAction edit = updateCell(keyIndex, rowIdx, colIdx, newValue); if (edit != null) cytoscape.util.undo.CyUndo.getUndoableEditSupport().postEdit(edit); } }
nodeInd[i++] = ni.intValue(); CyUndo.getUndoableEditSupport().postEdit( new DeleteEdit(cyNet,nodeInd,edgeInd, this) );
public static void addEdit(PixelitorEdit edit) { // Utils.debugCall(edit.getDebugName()); assert edit != null; if (ignoreEdits) { return; } edit.getComp().setDirty(true); if (edit.canUndo()) { undoManager.addEdit(edit); } else { undoManager.discardAllEdits(); } // reset BEFORE posting, so that the fade menu item can become enabled numUndoneEdits = 0; undoableEditSupport.postEdit(edit); if (Build.CURRENT != Build.FINAL) { Events.postAddToHistoryEvent(edit); ConsistencyChecks.checkAll(edit.getComp(), false); } }
CyUndo.getUndoableEditSupport().postEdit(new MergeNetworkEdit(cyNetwork, newNodes, newEdges));