@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
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| 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
|
protected boolean |
m_allowMultipleTabs
Whether to allow multiple tabs
|
protected javax.swing.JFileChooser |
m_FileChooser
The file chooser for loading layout files
|
protected java.util.List<VisibleLayout> |
m_flowGraphs
List of layouts - one for each tab
|
protected javax.swing.JTabbedPane |
m_flowTabs
Holds the tabs of the perspective
|
protected MainKFPerspectiveToolBar |
m_mainToolBar
Main toolbar
|
protected StepManagerImpl |
m_palleteSelectedStep
The current step selected from the design pallete
|
protected java.lang.String |
m_pasteBuffer
The paste buffer
|
protected javax.swing.JFileChooser |
m_saveFileChooser
The file chooser for saving layout files (only supports saving as json .kf
files
|
protected StepTree |
m_stepTree
The jtree holding steps
|
protected TemplateManager |
m_templateManager
Manages template flows
|
protected int |
m_untitledCount
Count for new "untitled" tabs
|
m_isActive, m_isLoaded, m_log, m_mainApplication, m_perspectiveIcon, m_perspectiveID, m_perspectiveTipText, m_perspectiveTitlelistenerList, TOOL_TIP_TEXT_KEY, ui, 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. the user can click on this perspective at this time in the perspective
toolbar.
|
void |
removeTab(int tabIndex)
Remove/close a tab
|
protected void |
saveLayout(int tabIndex,
boolean showDialog)
Save a particular flow layout
|
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
|
protected void |
setCurrentTabTitle(java.lang.String title)
Set the title of the current (visible) tab
|
void |
setCurrentTabTitleEditedStatus(boolean edited)
Set the edited status for the current (visible) tab
|
void |
setFlowLayoutOperation(VisibleLayout.LayoutOperation opp)
Set the current flow layout operation
|
void |
setInstances(Instances instances)
Set instances (if this perspective can use them)
|
protected void |
setPalleteSelectedStep(StepManagerImpl stepvisual)
Set a reference to the currently selected step in the design palette
|
protected void |
setPasteBuffer(java.lang.String serializedFlow)
Set the contents of the paste buffer
|
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, toStringgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocusUpCyclepublic static final java.lang.String FLOW_PARENT_DIRECTORY_VARIABLE_KEY
public static final java.lang.String FILE_EXTENSION_JSON
protected int m_untitledCount
protected boolean m_allowMultipleTabs
protected StepManagerImpl m_palleteSelectedStep
protected javax.swing.JTabbedPane m_flowTabs
protected java.util.List<VisibleLayout> m_flowGraphs
protected StepTree m_stepTree
protected java.lang.String m_pasteBuffer
protected javax.swing.JFileChooser m_FileChooser
protected javax.swing.JFileChooser m_saveFileChooser
protected TemplateManager m_templateManager
protected MainKFPerspectiveToolBar m_mainToolBar
public StepManagerImpl getPalleteSelectedStep()
protected void setPalleteSelectedStep(StepManagerImpl stepvisual)
stepvisual - the currently selected steppublic 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(VisibleLayout.LayoutOperation opp)
opp - the operation to usepublic boolean getSnapToGrid()
public void clearDesignPaletteSelection()
public java.lang.String getPasteBuffer()
protected void setPasteBuffer(java.lang.String serializedFlow)
serializedFlow - (sub-)flow in JSONpublic 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
WekaExceptionpublic 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()
protected void saveLayout(int tabIndex,
boolean showDialog)
tabIndex - the index of the tab containing the flow to asaveshowDialog - true if a file dialog should be popped uppublic 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 tabprotected void setCurrentTabTitle(java.lang.String title)
title - the tab title to usepublic boolean isMemoryLow()
public boolean showMemoryIsLow()
public boolean getDebug()
public MainKFPerspectiveToolBar getMainToolBar()
public void setActive(boolean active)
setActive in interface PerspectivesetActive in class AbstractPerspectiveactive - true if this perspective is the active onepublic java.util.List<javax.swing.JMenu> getMenus()
getMenus in interface PerspectivegetMenus in class AbstractPerspectivepublic Defaults getDefaultSettings()
getDefaultSettings in interface PerspectivegetDefaultSettings in class AbstractPerspectivepublic boolean okToBeActive()
okToBeActive in interface PerspectiveokToBeActive in class AbstractPerspectivepublic void settingsChanged()
settingsChanged in interface PerspectivesettingsChanged in class AbstractPerspectivepublic boolean acceptsInstances()
acceptsInstances in interface PerspectiveacceptsInstances in class AbstractPerspectivepublic void setInstances(Instances instances)
setInstances in interface PerspectivesetInstances in class AbstractPerspectiveinstances - the instances