/******************************************************************************* * Copyright (c) 2010-2015 Henshin developers. All rights reserved. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * TU Berlin, University of Luxembourg, SES S.A. *******************************************************************************/ package de.tub.tfs.henshin.tggeditor.editpolicies.graphical; import org.eclipse.draw2d.ChopboxAnchor; import org.eclipse.draw2d.ColorConstants; import org.eclipse.draw2d.Connection; import org.eclipse.draw2d.ConnectionAnchor; import org.eclipse.draw2d.PolylineConnection; import org.eclipse.draw2d.PositionConstants; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.henshin.model.Edge; import org.eclipse.emf.henshin.model.Mapping; import org.eclipse.emf.henshin.model.NestedCondition; import org.eclipse.emf.henshin.model.Node; import org.eclipse.emf.henshin.model.Rule; import org.eclipse.gef.EditPolicy; import org.eclipse.gef.Request; import org.eclipse.gef.commands.Command; import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy; import org.eclipse.gef.requests.AlignmentRequest; import org.eclipse.gef.requests.CreateConnectionRequest; import org.eclipse.gef.requests.ReconnectRequest; import de.tub.tfs.henshin.tgg.TNode; import de.tub.tfs.henshin.tgg.interpreter.impl.NodeTypes; import de.tub.tfs.henshin.tgg.interpreter.util.RuleUtil; import de.tub.tfs.henshin.tggeditor.commands.create.CreateEdgeCommand; import de.tub.tfs.henshin.tggeditor.commands.create.rule.CreateNodeMappingCommand; import de.tub.tfs.henshin.tggeditor.commands.create.rule.CreateRuleEdgeCommand; import de.tub.tfs.henshin.tggeditor.commands.move.MoveNodeObjectCommand; import de.tub.tfs.henshin.tggeditor.commands.move.ReconnectedEdgeCommand; import de.tub.tfs.henshin.tggeditor.editparts.graphical.TNodeObjectEditPart; import de.tub.tfs.henshin.tggeditor.editparts.rule.RuleNodeEditPart; /** * The Class NodeGraphicalEditPartPolicy. */ public class AttributeGraphicalEditPolicy extends GraphicalNodeEditPolicy implements EditPolicy { /* * (non-Javadoc) * * @seeorg.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# * getConnectionCompleteCommand * (org.eclipse.gef.requests.CreateConnectionRequest) */ @Override protected Command getConnectionCompleteCommand( CreateConnectionRequest request) { return null; } /* * (non-Javadoc) * * @seeorg.eclipse.gef.editpolicies.GraphicalNodeEditPolicy# * getConnectionCreateCommand * (org.eclipse.gef.requests.CreateConnectionRequest) */ @Override protected Command getConnectionCreateCommand(CreateConnectionRequest request) { return null; } /* * (non-Javadoc) * * @see * org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy#getCommand(org.eclipse * .gef.Request) */ @Override public Command getCommand(Request request) { if (REQ_ALIGN.equals(request.getType())) { AlignmentRequest a_request = (AlignmentRequest) request; return getAligmentCommand(a_request); } return super.getCommand(request); } /** * @param a_request */ protected Command getAligmentCommand(AlignmentRequest a_request) { return new Command() {}; } @Override protected Command getReconnectTargetCommand(ReconnectRequest request) { return null; } @Override protected Command getReconnectSourceCommand(ReconnectRequest request) { return null; } }