/**
   * Method that should be called when a new AnnotationComponent is selected by the user The
   * associated object will be stored locally as currentAnnotation Then all of it's properties will
   * be applied to the UI pane For example if the border was red, the color of the background button
   * will be changed to red
   *
   * @param newAnnotation to set and apply to this UI
   */
  public void setAnnotationComponent(AnnotationComponent newAnnotation) {

    if (newAnnotation == null || newAnnotation.getAnnotation() == null) {
      setEnabled(false);
      return;
    }
    // assign the new action instance.
    this.currentAnnotationComponent = newAnnotation;

    // For convenience grab the Annotation object wrapped by the component
    annotation = (InkAnnotation) currentAnnotationComponent.getAnnotation();

    applySelectedValue(lineThicknessBox, annotation.getLineThickness());
    applySelectedValue(lineStyleBox, annotation.getLineStyle());
    colorBorderButton.setBackground(annotation.getColor());

    // disable appearance input if we have a invisible rectangle
    safeEnable(lineThicknessBox, true);
    safeEnable(lineStyleBox, true);
    safeEnable(colorBorderButton, true);
  }