Package org.gvt.editpolicy

Source Code of org.gvt.editpolicy.ChsComponentEditPolicy

package org.gvt.editpolicy;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.requests.GroupRequest;
import org.gvt.command.DeleteCommand;
import org.gvt.model.GraphObject;
import org.gvt.model.NodeModel;
import org.gvt.model.CompoundModel;

/**
* @author Cihan Kucukkececi
*
* Copyright: I-Vis Research Group, Bilkent University, 2007
*/
public class ChsComponentEditPolicy
  extends org.eclipse.gef.editpolicies.ComponentEditPolicy
{
  protected Command createDeleteCommand(GroupRequest request)
  {
    Object parent = getHost().getParent().getModel();
    DeleteCommand deleteCmd = new DeleteCommand();
    deleteCmd.setParent((CompoundModel) parent);
    deleteCmd.setChild((NodeModel) getHost().getModel());
    return deleteCmd;
  }
}
TOP

Related Classes of org.gvt.editpolicy.ChsComponentEditPolicy

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.