@PerspectiveInfo(ID="knowledgeflow.main", title="Data mining processes", toolTipText="Data mining processes", iconPath="weka/gui/weka_icon_new_small.png") public class MainKFPerspective extends AbstractPerspective
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FILE_EXTENSION_JSON
File extension for undo point files
|
static java.lang.String |
FLOW_PARENT_DIRECTORY_VARIABLE_KEY
Key for the environment variable that holds the parent directory of a
loaded flow
|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MainKFPerspective()
Construct a new MainKFPerspective
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsInstances()
Returns true if this perspective can do something meaningful with a set of
instances
|
void |
addTab(java.lang.String tabTitle)
Add a new titled tab to the UI
|
void |
addUntitledTab()
Add a new untitled tab to the UI
|
void |
clearDesignPaletteSelection()
Clear the current selection in the design palette
|
void |
closeAllTabs()
Close all the open tabs
|
void |
copyFlowToClipboard(Flow flow) |
void |
copyStepsToClipboard(java.util.List<StepVisual> steps)
Copy the supplied steps to the clipboard
|
boolean |
getAllowMultipleTabs()
Returns true if the perspective is allowing multiple tabs to be open
|
VisibleLayout |
getCurrentLayout()
Get the flow layout for the current (visible) tab
|
int |
getCurrentTabIndex()
Get the index of the current (visible) tab
|
boolean |
getDebug() |
Defaults |
getDefaultSettings()
Get the default settings for this perspective (or null if there are none)
|
VisibleLayout |
getLayoutAt(int index)
Get the flow layout at the supplied index
|
MainKFPerspectiveToolBar |
getMainToolBar()
Get the main toolbar
|
java.util.List<javax.swing.JMenu> |
getMenus()
Get an ordered list of menus to appear in the main menu bar.
|
int |
getNumTabs()
Get the number of open tabs
|
StepManagerImpl |
getPalleteSelectedStep()
Return the currently selected step in the design palette
|
java.lang.String |
getPasteBuffer()
Get the contents of the paste buffer
|
<T> T |
getSetting(Settings.SettingKey propKey,
T defaultVal)
Get the value of a setting for the main perspective
|
boolean |
getSnapToGrid()
Return true if the snap-to-grid button is selected
|
java.lang.String |
getTabTitle(int index)
Get the title of the tab at the supplied index
|
TemplateManager |
getTemplateManager()
Get the template manager
|
boolean |
isMemoryLow()
Return true if memory is running low
|
void |
loadLayout()
Load a flow layout.
|
void |
loadLayout(java.io.File fFile,
boolean newTab)
Load a flow layout.
|
void |
notifyIsDirty() |
boolean |
okToBeActive()
Returns true if this perspective is OK with being an active perspective -
i.e.
|
void |
removeTab(int tabIndex)
Remove/close a tab
|
void |
setActive(boolean active)
Set active status of this perspective.
|
void |
setActiveTab(int tabIndex)
Set the active (visible) tab
|
void |
setAllowMultipleTabs(boolean allow)
Set whether multiple tabs are allowed
|
void |
setCurrentTabTitleEditedStatus(boolean edited)
Set the edited status for the current (visible) tab
|
void |
setFlowLayoutOperation(weka.gui.knowledgeflow.VisibleLayout.LayoutOperation opp)
Set the current flow layout operation
|
void |
setInstances(Instances instances)
Set instances (if this perspective can use them)
|
void |
settingsChanged()
Called when the user alters settings.
|
void |
showErrorDialog(java.lang.Exception cause)
Popup an error dialog
|
void |
showInfoDialog(java.lang.Object information,
java.lang.String title,
boolean isWarning)
Popup an information dialog
|
boolean |
showMemoryIsLow()
Print a warning if memory is low (and show a GUI dialog if running in a
graphical environment)
|
getMainApplication, getPerspectiveIcon, getPerspectiveID, getPerspectiveTipText, getPerspectiveTitle, instantiationComplete, requiresLog, setLoaded, setLog, setMainApplication, terminate, toString
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, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String FLOW_PARENT_DIRECTORY_VARIABLE_KEY
public static final java.lang.String FILE_EXTENSION_JSON
public StepManagerImpl getPalleteSelectedStep()
public void showErrorDialog(java.lang.Exception cause)
cause
- the exception associated with the errorpublic void showInfoDialog(java.lang.Object information, java.lang.String title, boolean isWarning)
information
- the information to displaytitle
- the title for the dialogisWarning
- true if the dialog should be a warning dialogpublic void setFlowLayoutOperation(weka.gui.knowledgeflow.VisibleLayout.LayoutOperation opp)
opp
- the operation to usepublic boolean getSnapToGrid()
public void clearDesignPaletteSelection()
public java.lang.String getPasteBuffer()
public void copyStepsToClipboard(java.util.List<StepVisual> steps) throws WekaException
steps
- a list of steps to copyWekaException
- if a problem occurspublic void copyFlowToClipboard(Flow flow) throws WekaException
WekaException
public TemplateManager getTemplateManager()
public void addUntitledTab()
public void addTab(java.lang.String tabTitle)
tabTitle
- the title for the tabpublic void setCurrentTabTitleEditedStatus(boolean edited)
edited
- true if the flow in the tab has been edited (but not saved)public int getCurrentTabIndex()
public int getNumTabs()
public java.lang.String getTabTitle(int index)
index
- the index of the tab to get the title forjava.lang.IndexOutOfBoundsException
- if the index is out of rangepublic void setActiveTab(int tabIndex)
tabIndex
- the index of the tab to make activepublic void closeAllTabs()
public void removeTab(int tabIndex)
tabIndex
- the index of the tab to closepublic VisibleLayout getCurrentLayout()
public VisibleLayout getLayoutAt(int index)
index
- the index of the flow layout to getjava.lang.IndexOutOfBoundsException
- if the index is out of rangepublic boolean getAllowMultipleTabs()
public void setAllowMultipleTabs(boolean allow)
allow
- true if multiple tabs are allowedpublic <T> T getSetting(Settings.SettingKey propKey, T defaultVal)
T
- the type of the settingpropKey
- the key of the setting to getdefaultVal
- the default value to use if nothing is set yetpublic void notifyIsDirty()
public void loadLayout()
public void loadLayout(java.io.File fFile, boolean newTab)
fFile
- the file to loadnewTab
- true if the flow should be loaded into a new tabpublic boolean isMemoryLow()
public boolean showMemoryIsLow()
public boolean getDebug()
public MainKFPerspectiveToolBar getMainToolBar()
public void setActive(boolean active)
setActive
in interface Perspective
setActive
in class AbstractPerspective
active
- true if this perspective is the active onepublic java.util.List<javax.swing.JMenu> getMenus()
getMenus
in interface Perspective
getMenus
in class AbstractPerspective
public Defaults getDefaultSettings()
getDefaultSettings
in interface Perspective
getDefaultSettings
in class AbstractPerspective
public boolean okToBeActive()
okToBeActive
in interface Perspective
okToBeActive
in class AbstractPerspective
public void settingsChanged()
settingsChanged
in interface Perspective
settingsChanged
in class AbstractPerspective
public boolean acceptsInstances()
acceptsInstances
in interface Perspective
acceptsInstances
in class AbstractPerspective
public void setInstances(Instances instances)
setInstances
in interface Perspective
setInstances
in class AbstractPerspective
instances
- the instances