public class PerspectiveManager
extends javax.swing.JPanel
Modifier and Type | Class and Description |
---|---|
static class |
PerspectiveManager.SelectedPerspectivePreferences
Class to manage user preferences with respect to visible perspectives and
whether the perspectives toolbar is always hidden or is visible on
application startup
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PERSPECTIVE_INTERFACE
Interface name of perspectives
|
static Settings.SettingKey |
VISIBLE_PERSPECTIVES_KEY
Settings key for visible perspectives in an application
|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PerspectiveManager(GUIApplication mainApp,
java.lang.String... perspectivePrefixesToAllow)
Constructor
|
PerspectiveManager(GUIApplication mainApp,
java.lang.String[] perspectivePrefixesToAllow,
java.lang.String[] perspectivePrefixesToDisallow)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSettingsMenuItemToProgramMenu(Settings settings)
Applications can call this to allow access to the settings editor from the
program menu (in addition to the toolbar widget that pops up the settings
editor)
|
void |
disableAllPerspectiveTabs()
Disable the tab/button for each visible perspective
|
void |
enableAllPerspectiveTabs()
Enable the tab/button for each visible perspective
|
java.util.List<Perspective> |
getLoadedPerspectives()
Get a list of all loaded perspectives.
|
Perspective |
getMainPerspective()
Get the main application perspective.
|
Perspective |
getPerspective(java.lang.String ID)
Get the perspective with the given ID
|
javax.swing.JPanel |
getPerspectiveToolBar()
Get the panel that contains the perspectives toolbar
|
java.util.List<Perspective> |
getVisiblePerspectives()
Get a list of visible perspectives.
|
boolean |
perspectiveToolBarIsVisible()
Returns true if the perspective toolbar is visible
|
void |
setActivePerspective(int theIndex)
Set the active perspective
|
void |
setActivePerspective(java.lang.String perspectiveID)
Set the active perspective
|
void |
setEnablePerspectiveTab(java.lang.String perspectiveID,
boolean enabled)
Enable/disable a perspective's button/tab
|
void |
setEnablePerspectiveTabs(java.util.List<java.lang.String> perspectiveIDs,
boolean enabled)
Enable/disable the tab/button for each perspective in the supplied list of
perspective IDs
|
void |
setMainApplicationForAllPerspectives()
Set the main application on all perspectives managed by this manager
|
void |
setPerspectiveToolbarAlwaysHidden(Settings settings)
Set whether the perspectives toolbar should always be hidden.
|
void |
setPerspectiveToolBarIsVisible(boolean v) |
void |
showMenuBar(javax.swing.JFrame topLevelAncestor)
Tell the perspective manager to show the menu bar
|
void |
terminate()
Method to be called when GUI application is no longer needed, to free up resources so that they
can be garbage collected.
|
boolean |
userRequestedPerspectiveToolbarVisibleOnStartup(Settings settings)
Returns true if the user has requested that the perspective toolbar is
visible when the application starts up
|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String PERSPECTIVE_INTERFACE
public static final Settings.SettingKey VISIBLE_PERSPECTIVES_KEY
public PerspectiveManager(GUIApplication mainApp, java.lang.String... perspectivePrefixesToAllow)
mainApp
- the application that owns this perspective managerperspectivePrefixesToAllow
- a list of perspective class name prefixes
that are to be allowed in this perspective manager. Any
perspectives not covered by this list are ignored. An empty list
means allow all.public PerspectiveManager(GUIApplication mainApp, java.lang.String[] perspectivePrefixesToAllow, java.lang.String[] perspectivePrefixesToDisallow)
mainApp
- the application that owns this perspective managerperspectivePrefixesToAllow
- a list of perspective class name prefixes
that are to be allowed in this perspective manager. Any
perspectives not covered by this list are ignored. An empty list
means allow all.perspectivePrefixesToDisallow
- a list of perspective class name
prefixes that are disallowed in this perspective manager. Any
matches in this list are prevented from appearing in this
perspective manager. Overrides a successful match in the allowed
list. This enables fine-grained exclusion of perspectives (e.g.
allowed might specify all perspectives in weka.gui.funky, while
disallowed vetoes just weka.gui.funky.NonFunkyPerspective.)public void terminate()
public void setMainApplicationForAllPerspectives()
public void setPerspectiveToolbarAlwaysHidden(Settings settings)
settings
- the settings object to set this property onpublic void addSettingsMenuItemToProgramMenu(Settings settings)
settings
- the settings object for the applicationpublic void setActivePerspective(int theIndex)
theIndex
- the index of the perspective to make the active onepublic void setActivePerspective(java.lang.String perspectiveID)
perspectiveID
- the ID of the perspective to make the active onepublic java.util.List<Perspective> getLoadedPerspectives()
public java.util.List<Perspective> getVisiblePerspectives()
public javax.swing.JPanel getPerspectiveToolBar()
public void disableAllPerspectiveTabs()
public void enableAllPerspectiveTabs()
public void setEnablePerspectiveTabs(java.util.List<java.lang.String> perspectiveIDs, boolean enabled)
perspectiveIDs
- the list of perspective IDsenabled
- true or false to enable or disable the perspective buttonspublic void setEnablePerspectiveTab(java.lang.String perspectiveID, boolean enabled)
perspectiveID
- the ID of the perspective to enable/disableenabled
- true or false to enable or disablepublic boolean perspectiveToolBarIsVisible()
public void setPerspectiveToolBarIsVisible(boolean v)
public Perspective getMainPerspective()
public Perspective getPerspective(java.lang.String ID)
ID
- the ID of the perspective to getpublic void showMenuBar(javax.swing.JFrame topLevelAncestor)
topLevelAncestor
- the owning application's Framepublic boolean userRequestedPerspectiveToolbarVisibleOnStartup(Settings settings)
settings
- the settings object for the application