public void applyChanges() {
    annotation.setName(nameText.getText());
    if (snapToTrace.getSelection())
      annotation.setTrace(
          xyGraph.getPlotArea().getTraceList().get(xAxisOrTraceCombo.getSelectionIndex()));
    else
      annotation.setFree(
          xyGraph.getXAxisList().get(xAxisOrTraceCombo.getSelectionIndex()),
          xyGraph.getYAxisList().get(yAxisCombo.getSelectionIndex()));

    if (!useDefaultColorButton.getSelection())
      annotation.setAnnotationColor(
          XYGraphMediaFactory.getInstance().getColor(colorSelector.getColorValue()));
    else annotation.setAnnotationColor(null);
    annotation.setFont(font);
    annotation.setCursorLineStyle(CursorLineStyle.values()[cursorLineCombo.getSelectionIndex()]);
    annotation.setShowName(showNameButton.getSelection());
    annotation.setShowSampleInfo(showSampleInfoButton.getSelection());
    annotation.setShowPosition(showPositionButton.getSelection());
  }