Class SetLabelsOffsetCommand

  • All Implemented Interfaces:
    IUndoableOperation, org.eclipse.gmf.runtime.common.core.command.ICommand, org.eclipse.gmf.runtime.common.core.internal.command.ICommandWithSettableResult

    public class SetLabelsOffsetCommand
    extends org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand
    This class allows to update edge label Node position.
    • Constructor Summary

      Constructors 
      Constructor Description
      SetLabelsOffsetCommand​(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
      Default constructor.
    • Constructor Detail

      • SetLabelsOffsetCommand

        public SetLabelsOffsetCommand​(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain)
        Default constructor.
        Parameters:
        editingDomain - the editing domain through which model changes are made
    • Method Detail

      • setNewPointList

        public void setNewPointList​(org.eclipse.draw2d.geometry.PointList newPointList)
        Method to set the newPointList.
        Parameters:
        newPointList - The new points list
      • doExecuteWithResult

        protected org.eclipse.gmf.runtime.common.core.command.CommandResult doExecuteWithResult​(IProgressMonitor monitor,
                                                                                                IAdaptable info)
                                                                                         throws ExecutionException
        Specified by:
        doExecuteWithResult in class org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand
        Throws:
        ExecutionException
      • setLabelsToUpdate

        public void setLabelsToUpdate​(org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connectionEditPart)
        Set labels to update according to a connectionEditPart (all labels of this connection will be update).
        This method must be called after having called the setNewPointList(PointList) method.
        Parameters:
        connectionEditPart - The connection from which to get the potential three labels to update
      • setLabelsToUpdate

        public void setLabelsToUpdate​(org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connectionEditPart,
                                      org.eclipse.draw2d.geometry.PointList originalPoints)
        Set labels to update according to a connectionEditPart (all labels of this connection will be update). This method must be used if the edge figure is updated (through feedback) during the move. Indeed, in this case, we can not use the figure to retrieve the old points.
        This method must be called after having called the setNewPointList(PointList) method.
        Parameters:
        connectionEditPart - The connection from which to get the potential three labels to update
        originalPoints - The points of the edge before the move.