Package org.locationtech.udig.printing.ui.internal.editor

Source Code of org.locationtech.udig.printing.ui.internal.editor.BringToBackAction

/*
* JGrass - Free Open Source Java GIS http://www.jgrass.org
* (C) HydroloGIS - www.hydrologis.com
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the HydroloGIS BSD
* License v1.0 (http://udig.refractions.net/files/hsd3-v10.html).
*/
package org.locationtech.udig.printing.ui.internal.editor;

import org.eclipse.emf.common.util.EList;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.commands.Command;

import org.locationtech.udig.printing.model.Box;
import org.locationtech.udig.printing.model.impl.PageImpl;
import org.locationtech.udig.printing.ui.IBoxEditAction;
import org.locationtech.udig.printing.ui.internal.editor.parts.BoxPart;

/**
* Moves a box of the printing editor below all the others.
*
* @author Andrea Antonello (www.hydrologis.com)
*
*/
public class BringToBackAction implements IBoxEditAction {

    public Command getCommand() {
        return null;
    }

    @SuppressWarnings("unchecked")
    public void init( BoxPart owner ) {
        EditPart parentPart = owner.getParent();
        PageImpl pageImpl = (PageImpl) parentPart.getModel();
        EList<Box> boxes = (EList<Box>) pageImpl.getBoxes();
        Box box = owner.getBoxPrinter().getBox();
        boxes.move(0, box);
    }

    public boolean isDone() {
        return true;
    }

    public void perform() {
    }

}
TOP

Related Classes of org.locationtech.udig.printing.ui.internal.editor.BringToBackAction

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.