Package org.springframework.ide.eclipse.config.graph.model

Examples of org.springframework.ide.eclipse.config.graph.model.Activity


public class StateNodeEditPolicy extends ActivityNodeEditPolicy {

  @Override
  protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
    int style = ((Integer) request.getNewObjectType()).intValue();
    Activity source = getActivity();
    if (!(source instanceof DecisionStateModelElement)) {
      StateConnectionCreateCommand cmd = new StateConnectionCreateCommand(source.getDiagram().getTextEditor(),
          style);
      cmd.setSource(source);
      request.setStartCommand(cmd);
      return cmd;
    }
View Full Code Here


*/
public class StateDirectEditPolicy extends ActivityDirectEditPolicy {

  @Override
  protected Command getDirectEditCommand(DirectEditRequest request) {
    Activity source = (Activity) getHost().getModel();
    RenameStateCommand cmd = new RenameStateCommand(source.getDiagram().getTextEditor());
    cmd.setSource(source);
    cmd.setOldName(((Activity) getHost().getModel()).getName());
    cmd.setName((String) request.getCellEditor().getValue());
    return cmd;
  }
View Full Code Here

  @Override
  protected Command getOrphanChildrenCommand(GroupRequest request) {
    List parts = request.getEditParts();
    CompoundCommand result = new CompoundCommand();
    for (int i = 0; i < parts.size(); i++) {
      Activity child = (Activity) ((EditPart) parts.get(i)).getModel();
      OrphanChildCommand orphan = new OrphanChildCommand(child.getDiagram().getTextEditor());
      orphan.setChild(child);
      orphan.setParent((StructuredActivity) getHost().getModel());
      result.add(orphan);
    }
    return result.unwrap();
View Full Code Here

   * @see ConnectionEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
   */
  @Override
  protected Command getDeleteCommand(GroupRequest request) {
    Transition transition = (Transition) getHost().getModel();
    Activity source = transition.source;
    DeleteConnectionCommand cmd = new DeleteConnectionCommand(source.getDiagram().getTextEditor());
    cmd.setTransition(transition);
    cmd.setSource(source);
    cmd.setTarget(transition.target);
    return cmd;
  }
View Full Code Here

  /**
   * @see DirectEditPolicy#getDirectEditCommand(org.eclipse.gef.requests.DirectEditRequest)
   */
  @Override
  protected Command getDirectEditCommand(DirectEditRequest request) {
    Activity source = (Activity) getHost().getModel();
    RenameActivityCommand cmd = new RenameActivityCommand(source.getDiagram().getTextEditor());
    cmd.setSource(source);
    cmd.setOldName(((Activity) getHost().getModel()).getName());
    cmd.setName((String) request.getCellEditor().getValue());
    return cmd;
  }
View Full Code Here

* @author Christian Dupuis
*/
public class StructuredActivityLayoutEditPolicy extends LayoutEditPolicy {

  protected Command createAddCommand(EditPart child) {
    Activity activity = (Activity) child.getModel();
    EditPartViewer viewer = getHost().getViewer();
    AddCommand add = new AddCommand(activity.getDiagram().getTextEditor(), viewer);
    add.setParent((StructuredActivity) getHost().getModel());
    add.setChild(activity);
    return add;
  }
View Full Code Here

  }

  @Override
  protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
    int style = ((Integer) request.getNewObjectType()).intValue();
    Activity source = getActivity();
    FixedConnectionCreateCommand cmd = getConnectionCreateCommand(source.getDiagram().getTextEditor(), style);
    if (cmd != null) {
      ConnectionAnchor anchor = getActivityPart().getSourceConnectionAnchor(request);
      if (anchor instanceof FixedConnectionAnchor) {
        FixedConnectionAnchor fixedAnchor = (FixedConnectionAnchor) anchor;
        cmd.setSourceAnchor(fixedAnchor);
View Full Code Here

  protected abstract FixedConnectionCreateCommand getConnectionCreateCommand(ITextEditor textEditor, int style);

  @Override
  protected Command getReconnectSourceCommand(ReconnectRequest request) {
    Activity source = getActivity();
    ReconnectFixedSourceCommand cmd = new ReconnectFixedSourceCommand(source.getDiagram().getTextEditor());
    ConnectionAnchor anchor = getActivityPart().getSourceConnectionAnchor(request);
    if (anchor instanceof FixedConnectionAnchor) {
      FixedConnectionAnchor fixedAnchor = (FixedConnectionAnchor) anchor;
      cmd.setSourceAnchor(fixedAnchor);
    }
View Full Code Here

    return cmd;
  }

  @Override
  protected Command getReconnectTargetCommand(ReconnectRequest request) {
    Activity target = getActivity();
    ReconnectFixedTargetCommand cmd = new ReconnectFixedTargetCommand(target.getDiagram().getTextEditor());
    ConnectionAnchor anchor = getActivityPart().getTargetConnectionAnchor(request);
    if (anchor instanceof FixedConnectionAnchor) {
      FixedConnectionAnchor fixedAnchor = (FixedConnectionAnchor) anchor;
      cmd.setTargetAnchor(fixedAnchor);
    }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.config.graph.model.Activity

Copyright © 2018 www.massapicom. 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.