Class BaseInteractiveViewer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, StepInteractiveViewer
Direct Known Subclasses:
AttributeSummarizerInteractiveView, BoundaryPlotterInteractiveView, CostBenefitAnalysisInteractiveView, DataVisualizerInteractiveView, GraphViewerInteractiveView, ImageViewerInteractiveView, ModelPerformanceChartInteractiveView, ScatterPlotMatrixInteractiveView, StripChartInteractiveView, TextViewerInteractiveView

public abstract class BaseInteractiveViewer extends JPanel implements StepInteractiveViewer
Base class than clients can extend when implementing StepInteractiveViewer. Provides a BorderLayout with a close button in the south position. Also provides a addButton() method that subclasses can call to add additional buttons to the bottom of the window. If the subclass returns a default settings object from the getDefaultSettings() method, then a settings button will also appear at the bottom of the window - this will pop up a settings editor. In this case, the subclass should also override the no-op applySettings() method in order to apply any settings changes that the user might have made in the settings editor. There is also a closePressed() method that is called when the close button is pressed. Subclasses can override this method as necessary.
Version:
$Revision: $
Author:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
See Also:
  • Constructor Details

    • BaseInteractiveViewer

      public BaseInteractiveViewer()
      Constructor
  • Method Details

    • getSettings

      public Settings getSettings()
      Get the settings object for the application
      Specified by:
      getSettings in interface StepInteractiveViewer
      Returns:
      the settings object the settings object
    • applySettings

      public void applySettings(Settings settings)
      No-op implementation. Subcasses should override to be notified about, and apply, any changed settings
      Parameters:
      settings - the settings object that might (or might not) have been altered by the user
    • setMainKFPerspective

      public void setMainKFPerspective(MainKFPerspective perspective)
      Set the main knowledge flow perspective. Implementations can then access application settings if necessary
      Specified by:
      setMainKFPerspective in interface StepInteractiveViewer
      Parameters:
      perspective - the main knowledge flow perspective
    • getMainKFPerspective

      public MainKFPerspective getMainKFPerspective()
      Get the main knowledge flow perspective. Implementations can the access application settings if necessary
      Specified by:
      getMainKFPerspective in interface StepInteractiveViewer
      Returns:
    • setStep

      public void setStep(Step step)
      Set the step that owns this viewer. Implementations may want to access data that has been computed by the step in question.
      Specified by:
      setStep in interface StepInteractiveViewer
      Parameters:
      step - the step that owns this viewer
    • getStep

      public Step getStep()
      Get the step that owns this viewer.
      Returns:
      the Step that owns this viewer
    • nowVisible

      public void nowVisible()
      Called by the KnowledgeFlow application once the enclosing JFrame is visible
      Specified by:
      nowVisible in interface StepInteractiveViewer
    • setParentWindow

      public void setParentWindow(Window parent)
      Set the parent window for this viewer
      Specified by:
      setParentWindow in interface StepInteractiveViewer
      Parameters:
      parent - the parent window
    • addButton

      public void addButton(JButton button)
      Adds a button to the bottom of the window.
      Parameters:
      button - the button to add.
    • closePressed

      public void closePressed()
      Called when the close button is pressed. This default implementation sets all references stored in this viewer to null so that garbage collection is facilitated. Subclasses should override if they need to do something before the window is closed.
    • getDefaultSettings

      public Defaults getDefaultSettings()
      Get default settings for the viewer. Default implementation returns null, i.e. no default settings. Subclasses can override if they have settings (with default values) that the user can edit.
      Returns:
      the default settings for this viewer, or null if there are no user-editable settings