src/main/java/chalmers/pimp/controller/components/PimpEditorPane.java
private void initiateInfoPane(InfoPane infoPane, IController controller, IModel model) {
    Objects.requireNonNull(infoPane);
    Objects.requireNonNull(controller);
    Objects.requireNonNull(model);
    Objects.requireNonNull(canvasPane);

    infoPane.setCanvasWidthLabel(model.getWidth());
    infoPane.setCanvasHeightLabel(model.getHeight());

    canvasPane.setOnMouseDragged(e -> {
      infoPane.updateMouseCoordinates((int) e.getX(), (int) e.getY(), model.getViewport());
      controller.selectedToolDragged(e);
      if (model.hasActiveLayer()) {
        infoPane.setLayerRotationLabel(model.getActiveLayer().getRotation());
      }
    });

    canvasPane.setOnMouseMoved(e -> {
      infoPane.updateMouseCoordinates((int) e.getX(), (int) e.getY(), model.getViewport());
    });
    canvasPane.setOnMouseExited(event -> infoPane.disableMouseCoordinates());

    model.addLayerUpdateListener(event -> {
      if (model.hasActiveLayer()) {
        IReadOnlyLayer layer = model.getActiveLayer();
        infoPane.setLayerWidthLabel(layer.getWidth());
        infoPane.setLayerHeightLabel(layer.getHeight());
        infoPane.setLayerRotationLabel(model.getActiveLayer().getRotation());
      } else {
        infoPane.disableMouseCoordinates();
      }
    });

    model.addModelSizeListener(infoPane);
  }
/**
   * Prepares the supplied info pane for usage.
   *
   * @param infoPane   the info pane that will be prepared.
   * @param controller the associated controller instance.
   * @param model      the associated model instance.
   * @throws NullPointerException if any references are {@code null}.
   */
Prepares the supplied info pane for usage.
@param infoPane   the info pane that will be prepared.
@param controller the associated controller instance.
@param model      the associated model instance.
@throws NullPointerException if any references are  null.
Prepares the supplied info pane for usage . @param infoPane the info pane that will be prepared . @param controller the associated controller instance . @param model the associated model instance . @throws NullPointerException if any references are null .
private void initiateInfoPane(InfoPane infoPane, IController controller, IModel model) {
    Objects.requireNonNull(infoPane);
    Objects.requireNonNull(controller);
    Objects.requireNonNull(model);
    Objects.requireNonNull(canvasPane);
    infoPane.setCanvasWidthLabel(model.getWidth());
    infoPane.setCanvasHeightLabel(model.getHeight());
    canvasPane.setOnMouseDragged(e -> {
      infoPane.updateMouseCoordinates((int) e.getX(), (int) e.getY(), model.getViewport());
      controller.selectedToolDragged(e);
      if (model.hasActiveLayer()) {
        infoPane.setLayerRotationLabel(model.getActiveLayer().getRotation());
      }
    });
    canvasPane.setOnMouseMoved(e -> {
      infoPane.updateMouseCoordinates((int) e.getX(), (int) e.getY(), model.getViewport());
    });
    canvasPane.setOnMouseExited(event -> infoPane.disableMouseCoordinates());
    model.addLayerUpdateListener(event -> {
      if (model.hasActiveLayer()) {
        IReadOnlyLayer layer = model.getActiveLayer();
        infoPane.setLayerWidthLabel(layer.getWidth());
        infoPane.setLayerHeightLabel(layer.getHeight());
        infoPane.setLayerRotationLabel(model.getActiveLayer().getRotation());
      } else {
        infoPane.disableMouseCoordinates();
      }
    });
    model.addModelSizeListener(infoPane);
  }
private void initiateInfoPane ( InfoPane infoPane , IController controller , IModel model ) { Objects . requireNonNull ( infoPane ) ; Objects . requireNonNull ( controller ) ; Objects . requireNonNull ( model ) ; Objects . requireNonNull ( canvasPane ) ; infoPane . setCanvasWidthLabel ( model . getWidth ( ) ) ; infoPane . setCanvasHeightLabel ( model . getHeight ( ) ) ; canvasPane . setOnMouseDragged ( e -> { infoPane . updateMouseCoordinates ( ( int ) e . getX ( ) , ( int ) e . getY ( ) , model . getViewport ( ) ) ; controller . selectedToolDragged ( e ) ; if ( model . hasActiveLayer ( ) ) { infoPane . setLayerRotationLabel ( model . getActiveLayer ( ) . getRotation ( ) ) ; } } ) ; canvasPane . setOnMouseMoved ( e -> { infoPane . updateMouseCoordinates ( ( int ) e . getX ( ) , ( int ) e . getY ( ) , model . getViewport ( ) ) ; } ) ; canvasPane . setOnMouseExited ( event -> infoPane . disableMouseCoordinates ( ) ) ; model . addLayerUpdateListener ( event -> { if ( model . hasActiveLayer ( ) ) { IReadOnlyLayer layer = model . getActiveLayer ( ) ; infoPane . setLayerWidthLabel ( layer . getWidth ( ) ) ; infoPane . setLayerHeightLabel ( layer . getHeight ( ) ) ; infoPane . setLayerRotationLabel ( model . getActiveLayer ( ) . getRotation ( ) ) ; } else { infoPane . disableMouseCoordinates ( ) ; } } ) ; model . addModelSizeListener ( infoPane ) ; }
Prepares the supplied info pane for usage.
Prepares the supplied info pane for usage .