Exemplo n.º 1
0
  public AbstractSelectionRegion<?> getEditingRegion() {

    final String txt = nameText.getText();
    try {
      xyGraph.renameRegion(editingRegion, txt);
    } catch (Exception e) {
      MessageDialog.openError(
          Display.getDefault().getActiveShell(),
          "Region Exists",
          "The region '"
              + txt
              + "' already exists.\n\n"
              + "Please choose a unique name for regions.");
    }
    final AspectAxis x = getAxis(xyGraph.getXAxisList(), xCombo.getSelectionIndex());
    final AspectAxis y = getAxis(xyGraph.getYAxisList(), yCombo.getSelectionIndex());
    RegionCoordinateSystem sys = new RegionCoordinateSystem(getImageTrace(), x, y);
    editingRegion.setCoordinateSystem(sys);
    editingRegion.setShowPosition(showPoints.getSelection());
    editingRegion.setRegionColor(new Color(getDisplay(), colorSelector.getColorValue()));
    editingRegion.setAlpha(alpha.getSelection());
    editingRegion.setMobile(mobile.getSelection());
    editingRegion.setVisible(visible.getSelection());
    editingRegion.setShowLabel(showLabel.getSelection());
    editingRegion.setFill(fillRegion.getSelection());

    return editingRegion;
  }
  protected void onSave() {
    try {
      int channelInt = Integer.parseInt(channelName.getText());
      if (channelInt < 0 || channelInt > 256) {
        throw new Exception();
      }
      String key = getKey(String.valueOf(channelInt));
      raptorPreferenceStore.setValue(key, colorSelector.getColorValue());

      boolean channelsHasSelection = false;
      for (int i = 0; i < channels.getItemCount(); i++) {
        if (channels.getItem(i).equals(String.valueOf(channelInt))) {
          channelsHasSelection = true;
          break;
        }
      }

      if (!channelsHasSelection) {
        channels.add(String.valueOf(channelInt));
      }
    } catch (Throwable t) {
      MessageDialog.openInformation(
          Raptor.getInstance().getWindow().getShell(),
          local.getString("alert"),
          local.getString("chatConColP3"));
    }
  }
Exemplo n.º 3
0
  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());
  }
 private void applyColor() {
   if (fBlockNotification) return;
   RGB rgb = fColorSelector.getColorValue();
   getSplashInfo().setForegroundColor(rgbToHEX(rgb), false);
 }
Exemplo n.º 5
0
 @Override
 public void widgetSelected(SelectionEvent e) {
   ColorSelector editor = (ColorSelector) e.widget.getData();
   PreferenceConverter.setValue(
       fOverlayStore, fColorButtons.get(editor), editor.getColorValue());
 }