private void initialize() { nameText.setText(annotation.getName()); nameText.setSelection(0, nameText.getText().length()); snapToTrace.setSelection(!annotation.isFree()); xAxisLabel.setText( snapToTrace.getSelection() ? Messages.Annotation_Trace : Messages.Annotation_XAxis); xAxisOrTraceCombo.removeAll(); if (!annotation.isFree()) { for (Trace trace : xyGraph.getPlotArea().getTraceList()) xAxisOrTraceCombo.add(trace.getName()); xAxisOrTraceCombo.select(xyGraph.getPlotArea().getTraceList().indexOf(annotation.getTrace())); } else { for (Axis axis : xyGraph.getXAxisList()) xAxisOrTraceCombo.add(axis.getTitle()); xAxisOrTraceCombo.select(xyGraph.getXAxisList().indexOf(annotation.getXAxis())); } for (Axis axis : xyGraph.getYAxisList()) yAxisCombo.add(axis.getTitle()); yAxisCombo.select(xyGraph.getYAxisList().indexOf(annotation.getYAxis())); yAxisLabel.setVisible(!snapToTrace.getSelection()); yAxisCombo.setVisible(!snapToTrace.getSelection()); useDefaultColorButton.setSelection(annotation.getAnnotationColor() == null); colorLabel.setVisible(!useDefaultColorButton.getSelection()); colorSelector.getButton().setVisible(annotation.getAnnotationColor() != null); colorSelector.setColorValue( annotation.getAnnotationColor() == null ? annotation.getYAxis().getForegroundColor().getRGB() : annotation.getAnnotationColor().getRGB()); fontLabel.setText( Messages.Annotation_Font + (font == null ? Messages.Annotation_SystemDefault : font.getFontData()[0].getName())); fontLabel.setFont(font); cursorLineCombo.select(annotation.getCursorLineStyle().getIndex()); showNameButton.setSelection(annotation.isShowName()); showSampleInfoButton.setSelection(annotation.isShowSampleInfo()); showPositionButton.setSelection(annotation.isShowPosition()); }