Package javax.swing.undo

Examples of javax.swing.undo.CompoundEdit


        throw new RuntimeException("removeSceneGraphObject invalid argument ="+obj.getClass());
    }
   
    public void paste(boolean deepClone){
        ArrayList<SceneGraphTreeNode> v=getTree().getClipBoard().get();
        CompoundEdit compoundEdit = new CompoundEdit();
        for(SceneGraphTreeNode o: v){
            SceneGraphTreeNode cn=o.cloneNode(deepClone, this);
            SceneGraphObject replaced=addSceneGraphObject((SceneGraphObject)cn.getGraphObject());
            compoundEdit.addEdit(new AddEdit(this,
                    (SceneGraphObject)cn.getGraphObject(),
                    replaced));
        }
        compoundEdit.end();
        getTree().getUndoableEditListener().undoableEditHappened(
                new UndoableEditEvent(this, compoundEdit));
    }
View Full Code Here


            if(h.getSceneGraphObject() instanceof AnimatorGroup){
                ang=h;
                break;
            }
        }
        CompoundEdit ce=new CompoundEdit();
        if(ang==null){
            // create one
            AnimatorGroup ag=new AnimatorGroup();
            holder.addSceneGraphObject(ag);
            AddEdit ae=new AddEdit(holder,ag,null);
            ce.addEdit(ae);
        }
        list.clear();
        holder.getChildrenHolders(list);
        for(SceneGraphObjectHolder h : list){
            if(h.getSceneGraphObject() instanceof AnimatorGroup){
                ang=h;
                break;
            }
        }
        if(ang==null){
            throw new RuntimeException("Can not retrieve holder for animator group");
        }
        ang.addSceneGraphObject(an);
        AddEdit ae=new AddEdit(ang,an,null);
        ce.addEdit(ae);
       
        holder.getUndoableEditListener().undoableEditHappened(
                new UndoableEditEvent(source, ce));
       
        ArrayList<SceneGraphObjectHolder> cl=new ArrayList<SceneGraphObjectHolder>();
View Full Code Here

         : Globals.lang("entry"))+"?";
    int answer = JOptionPane.showConfirmDialog(parent, msg, Globals.lang("Delete strings"),
                 JOptionPane.YES_NO_OPTION,
                 JOptionPane.QUESTION_MESSAGE);
    if (answer == JOptionPane.YES_OPTION) {
        CompoundEdit ce = new CompoundEdit();
        for (int i=sel.length-1; i>=0; i--) {
      // Delete the strings backwards to avoid moving indexes.

      BibtexString subject = (BibtexString)strings[sel[i]];

      // Store undo information:
      ce.addEdit(new UndoableRemoveString
           (panel, base,
            subject));

      base.removeString(subject.getId());
        }
        ce.end();
        panel.undoManager.addEdit(ce);

        //table.revalidate();
        refreshTable();
        if (base.getStringCount() > 0)
View Full Code Here

      span  = new Span( Math.min( position, selectionStart ),
                Math.max( position, selectionStart ));
      edit  = TimelineVisualEdit.select( this, doc, span ).perform();
        } else {
      if( altDrag ) {
        edit  = new CompoundEdit();
        edit.addEdit( TimelineVisualEdit.select( this, doc, new Span() ).perform() );
        edit.addEdit( TimelineVisualEdit.position( this, doc, position ).perform() );
        ((CompoundEdit) edit).end();
        altDrag = false;
      } else {
View Full Code Here

    }
   
    private void perform()
    {
      Span      selSpan;
      CompoundEdit  edit;
      long      pos;
   
      selSpan    = getSelectionSpan();
      if( selSpan.isEmpty() ) return;
     
      edit  = new BasicCompoundEdit();
      if( deselect ) edit.addEdit( TimelineVisualEdit.select( this, doc, new Span() ).perform() );
      pos    = (long) (selSpan.getStart() + selSpan.getLength() * weight + 0.5);
      edit.addEdit( TimelineVisualEdit.position( this, doc, pos ).perform() );
      edit.end();
      doc.getUndoManager().addEdit( edit );
    }
View Full Code Here

public class canRedo
  implements Testlet
{
  public void test(TestHarness harness)
  {
    CompoundEdit edit;

    // Check #1.
    edit = new CompoundEdit();
    edit.addEdit(new AbstractUndoableEdit());
    harness.check(!edit.canRedo());

    // Check #2.
    edit.end();
    harness.check(!edit.canRedo());

    // Check #3.
    edit.undo();
    harness.check(edit.canRedo());

    // Check #4.
    edit.redo();
    harness.check(!edit.canRedo());

    // Check #5.
    edit.die();
    harness.check(!edit.canRedo());
  }
View Full Code Here

public class isInProgress
  implements Testlet
{
  public void test(TestHarness harness)
  {
    CompoundEdit edit;

    // Check #1.
    edit = new CompoundEdit();
    harness.check(edit.isInProgress());

    // Check #2.
    edit.end();
    harness.check(!edit.isInProgress());
  }
View Full Code Here

public class canUndo
  implements Testlet
{
  public void test(TestHarness harness)
  {
    CompoundEdit edit;

    // Check #1.
    edit = new CompoundEdit();
    edit.addEdit(new AbstractUndoableEdit());
    harness.check(!edit.canUndo());

    // Check #2.
    edit.end();
    harness.check(edit.canUndo());

    // Check #3.
    edit.undo();
    harness.check(!edit.canUndo());

    // Check #4.
    edit.redo();
    harness.check(edit.canUndo());

    // Check #5.
    edit.die();
    harness.check(!edit.canUndo());
  }
View Full Code Here

      super(realSource);
    }

    public CompoundEdit createCompoundEdit()
    {
      return new CompoundEdit()
      {
        public String toString()
        {
          return "rose";
        }
View Full Code Here

  implements Testlet
{
  public void test(TestHarness harness)
  {
    MyUES ues;
    CompoundEdit c1, c2;

    ues = new MyUES();
    c1 = ues.cce();
    c2 = ues.cce();
View Full Code Here

TOP

Related Classes of javax.swing.undo.CompoundEdit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.