Package javax.swing.undo

Examples of javax.swing.undo.UndoableEditSupport.beginUpdate()


   * Deletes items and post a cut operation to undo support.
   */
  public void cut(List<? extends Selectable> items) {
    // Start a compound edit that deletes items and changes presentation name
    UndoableEditSupport undoSupport = getUndoableEditSupport();
    undoSupport.beginUpdate();
    getPlanController().deleteItems(items);
    // Add a undoable edit to change presentation name
    undoSupport.postEdit(new AbstractUndoableEdit() {
        @Override
        public String getPresentationName() {
View Full Code Here


            && !(items.get(0) instanceof Compass))) {
      // Always use selection mode after a drop or a paste operation
      getPlanController().setMode(PlanController.Mode.SELECTION);
      // Start a compound edit that adds walls, furniture, rooms, dimension lines and labels to home
      UndoableEditSupport undoSupport = getUndoableEditSupport();
      undoSupport.beginUpdate();
      List<HomePieceOfFurniture> addedFurniture = Home.getFurnitureSubList(items);
      // If magnetism is enabled, adjust furniture size and elevation
      if (this.preferences.isMagnetismEnabled()) {
        for (HomePieceOfFurniture piece : addedFurniture) {
          if (piece.isResizable()) {
View Full Code Here

        };
    this.home.addFurnitureListener(addedFurnitureListener);
   
    // Start a compound edit that adds furniture to home
    UndoableEditSupport undoSupport = getUndoableEditSupport();
    undoSupport.beginUpdate();
    // Import furniture
    for (String model : importableModels) {
      getFurnitureController().importFurniture(model);
    }
    this.home.removeFurnitureListener(addedFurnitureListener);
View Full Code Here

                  + Integer.toHexString(u.hashCode())
                  + " updateLevel: 0 listeners: []"
                  + " compoundEdit: null");

    // Check #2.
    u.beginUpdate();
    u.beginUpdate();
    u.addUndoableEditListener(new MyListener());
    u.addUndoableEditListener(new MyListener());
    harness.check(u.toString(),
                  u.getClass().getName() + "@"
View Full Code Here

                  + " updateLevel: 0 listeners: []"
                  + " compoundEdit: null");

    // Check #2.
    u.beginUpdate();
    u.beginUpdate();
    u.addUndoableEditListener(new MyListener());
    u.addUndoableEditListener(new MyListener());
    harness.check(u.toString(),
                  u.getClass().getName() + "@"
                  + Integer.toHexString(u.hashCode())
View Full Code Here

    // Check #1.
    ues = new UndoableEditSupport();
    harness.check(ues.getUpdateLevel(), 0);

    // Check #2.
    ues.beginUpdate();
    harness.check(ues.getUpdateLevel(), 1);

    // Check #3.
    ues.beginUpdate();
    harness.check(ues.getUpdateLevel(), 2);
View Full Code Here

    // Check #2.
    ues.beginUpdate();
    harness.check(ues.getUpdateLevel(), 1);

    // Check #3.
    ues.beginUpdate();
    harness.check(ues.getUpdateLevel(), 2);

    // Check #4.
    ues.endUpdate();
    harness.check(ues.getUpdateLevel(), 1);
View Full Code Here

    // Check #4.
    ues.endUpdate();
    harness.check(ues.getUpdateLevel(), 1);

    // Check #5.
    ues.beginUpdate();
    harness.check(ues.getUpdateLevel(), 2);

    // Check #6.
    ues.endUpdate();
    harness.check(ues.getUpdateLevel(), 1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.