weka.gui

## Interface Perspective

- All Known Implementing Classes:
    AbstractPerspective, AssociationsPanel, AttributeSelectionPanel, AttributeSummaryPerspective, ClassifierPanel, ClustererPanel, Experimenter, MainKFPerspective, PreprocessPanel, ScatterPlotMatrixPerspective, SimpleCLIPanel, SQLViewerPerspective, VisualizePanel

      public interface Perspective

  Interface for GUI elements that can appear as a perspective in a `GUIApplication`. Clients will typically extend `AbstractPerspective`.
  Version:
    $Revision: $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acceptsInstances()` Returns true if this perspective can do something meaningful with a set of instances
    `Defaults` | `getDefaultSettings()` Get the default settings for this perspective (or null if there are none)
    `GUIApplication` | `getMainApplication()` Get the main application that this perspective belongs to
    `java.util.List<javax.swing.JMenu>` | `getMenus()` Get an ordered list of menus to appear in the main menu bar.
    `javax.swing.Icon` | `getPerspectiveIcon()` Get the icon for this perspective
    `java.lang.String` | `getPerspectiveID()` Get the ID of this perspective
    `java.lang.String` | `getPerspectiveTipText()` Get the tool tip text for this perspective
    `java.lang.String` | `getPerspectiveTitle()` Get the title of this perspective
    `void` | `instantiationComplete()` Gets called when startup of the application has completed.
    `boolean` | `okToBeActive()` Returns true if this perspective is OK with being an active perspective - i.e.
    `boolean` | `requiresLog()` Whether this perspective requires a graphical log to write to
    `void` | `setActive(boolean active)` Set active status of this perspective.
    `void` | `setInstances(Instances instances)` Set instances (if this perspective can use them)
    `void` | `setLoaded(boolean loaded)` Set whether this perspective is "loaded" - i.e.
    `void` | `setLog(Logger log)` Set a log to use (if required by the perspective)
    `void` | `setMainApplication(GUIApplication main)` Set the main application.
    `void` | `settingsChanged()` Called when the user alters settings.

- - ### Method Detail

    - #### instantiationComplete

          void instantiationComplete()

      Gets called when startup of the application has completed. At this point, and only at this point, is it guaranteed that a perspective has access to its hosting application and the PerspectiveManager. Implementations can use this method to complete their initialization in this method if this requires access to information from the main application and/or the PerspectiveManager (i.e. knowledge about what other perspectives are available).

    - #### okToBeActive

          boolean okToBeActive()

      Returns true if this perspective is OK with being an active perspective - i.e. the user can click on this perspective at this time in the perspective toolbar. For example, a Perspective might return false from this method if it needs a set of instances to operate but none have been supplied yet.
      Returns:
        true if this perspective can be active at the current time

    - #### setActive

          void setActive(boolean active)

      Set active status of this perspective. True indicates that this perspective is the visible active perspective in the application
      Parameters:
        `active` - true if this perspective is the active one

    - #### setLoaded

          void setLoaded(boolean loaded)

      Set whether this perspective is "loaded" - i.e. whether or not the user has opted to have it available in the perspective toolbar. The perspective can make the decision as to allocating or freeing resources on the basis of this. Note that the main application and perspective manager instances are not available to the perspective until the instantiationComplete() method has been called.
      Parameters:
        `loaded` - true if the perspective is available in the perspective toolbar of the KnowledgeFlow

    - #### setMainApplication

          void setMainApplication(GUIApplication main)

      Set the main application. Gives other perspectives access to information provided by the main application
      Parameters:
        `main` - the main application

    - #### getMainApplication

          GUIApplication getMainApplication()

      Get the main application that this perspective belongs to
      Returns:
        the main application that this perspective belongs to

    - #### getPerspectiveID

          java.lang.String getPerspectiveID()

      Get the ID of this perspective
      Returns:
        the ID of this perspective

    - #### getPerspectiveTitle

          java.lang.String getPerspectiveTitle()

      Get the title of this perspective
      Returns:
        the title of this perspective

    - #### getPerspectiveIcon

          javax.swing.Icon getPerspectiveIcon()

      Get the icon for this perspective
      Returns:
        the icon for this perspective

    - #### getPerspectiveTipText

          java.lang.String getPerspectiveTipText()

      Get the tool tip text for this perspective
      Returns:
        the tool tip text for this perspective

    - #### getMenus

          java.util.List<javax.swing.JMenu> getMenus()

      Get an ordered list of menus to appear in the main menu bar. Return null for no menus
      Returns:
        a list of menus to appear in the main menu bar or null for no menus

    - #### getDefaultSettings

          Defaults getDefaultSettings()

      Get the default settings for this perspective (or null if there are none)
      Returns:
        the default settings for this perspective, or null if the perspective does not have any settings

    - #### settingsChanged

          void settingsChanged()

      Called when the user alters settings. The settings altered by the user are not necessarily ones related to this perspective

    - #### acceptsInstances

          boolean acceptsInstances()

      Returns true if this perspective can do something meaningful with a set of instances
      Returns:
        true if this perspective accepts instances

    - #### setInstances

          void setInstances(Instances instances)

      Set instances (if this perspective can use them)
      Parameters:
        `instances` - the instances

    - #### requiresLog

          boolean requiresLog()

      Whether this perspective requires a graphical log to write to
      Returns:
        true if a log is needed by this perspective

    - #### setLog

          void setLog(Logger log)

      Set a log to use (if required by the perspective)
      Parameters:
        `log` - the graphical log to use