Exemplo n.º 1
0
  @Override
  public void dispose() {
    // store current settings back into preferences
    IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
    String pName = getPartName();
    Integer setting = colourSettings.get(pName);
    if (setting != null)
      preferenceStore.setValue(
          pName + "." + PreferenceConstants.PLOT_VIEW_PLOT2D_COLOURMAP, setting);
    preferenceStore.setValue(
        pName + "." + PreferenceConstants.PLOT_VIEW_PLOT2D_SCALING, (useLog ? 1 : 0));
    deleteIObservers();
    if (histogramPlotter != null) histogramPlotter.cleanUp();
    data = null;
    if (histogramUI != null) {
      histogramUI.deactivate(false);
      histogramUI.dispose();
    }
    if (!cmbAlpha.isDisposed()) cmbAlpha.removeSelectionListener(this);
    if (!cmbRedColour.isDisposed()) cmbRedColour.removeSelectionListener(this);
    if (!cmbGreenColour.isDisposed()) cmbGreenColour.removeSelectionListener(this);
    if (!cmbBlueColour.isDisposed()) cmbBlueColour.removeSelectionListener(this);
    if (!btnGreenInverse.isDisposed()) btnGreenInverse.removeSelectionListener(this);
    if (!btnBlueInverse.isDisposed()) btnBlueInverse.removeSelectionListener(this);
    if (!btnAlphaInverse.isDisposed()) btnAlphaInverse.removeSelectionListener(this);
    if (!btnRedInverse.isDisposed()) btnRedInverse.removeSelectionListener(this);

    super.dispose();
  }
Exemplo n.º 2
0
 protected void buildToolbar() {
   IActionBars toolBar = getViewSite().getActionBars();
   histogramUI = new HistogramUI(this, toolBar, histogramPlotter);
   histogramUI.addIObserver(this);
   histogramPlotter.registerUI(histogramUI);
 }