Пример #1
0
  /**
   * Initializes the Event Behaviours that are run when an event occurs. Since this can be complex a
   * helper class is provided to build the complex datastructure of Behaviours.
   *
   * @see EditToolConfigurationHelper
   * @param helper a helper for constructing the complicated structure of EventBehaviours.
   */
  @Override
  protected void initEventBehaviours(EditToolConfigurationHelper helper) {
    helper.add(new DrawCreateVertexSnapAreaBehaviour());
    helper.startMutualExclusiveList();
    helper.add(new AddVertexWhileCreatingBehaviour());
    // override so that editing will not be started if there are no geometries on the
    // blackboard.
    helper.add(new StartEditingBehaviour(ShapeType.LINE));
    helper.stopMutualExclusiveList();

    helper.add(new SetSnapSizeBehaviour());
    helper.add(new AcceptOnDoubleClickBehaviour());
    helper.done();
  }
Пример #2
0
  /**
   * Initializes the Event Behaviours that are run when an event occurs. Since this can be complex a
   * helper class is provided to build the complex datastructure of Behaviours.
   *
   * @see EditToolConfigurationHelper
   * @param helper a helper for constructing the complicated structure of EventBehaviours.
   */
  @Override
  protected void initEventBehaviours(EditToolConfigurationHelper helper) {
    // show the snap area
    helper.add(new DrawCreateVertexSnapAreaBehaviour());

    // run only the first valid behaviour
    helper.startMutualExclusiveList();
    helper.add(new AddVertexWhileCreatingBehaviour());
    // override so that editing will not be started if there are no geometries on the
    // blackboard.
    helper.add(new StartEditingBehaviour(ShapeType.POINT));
    helper.stopMutualExclusiveList();

    // End interaction trigger when the third coordinate is entered
    NumOfPointsRunAcceptBehaviour acceptBehaviour = new NumOfPointsRunAcceptBehaviour(3);
    // acceptBehaviour.setAddPoint(true); FIXME it is not present in rc15

    helper.add(acceptBehaviour);
    helper.add(new SetSnapSizeBehaviour());
    helper.add(new EditToolFeedbackBehaviour(getFeedbackManager()));
    helper.add(new AcceptOnDoubleClickBehaviour());
    helper.done();
  }