public class VisibleLayout
extends javax.swing.JPanel
| Modifier and Type | Class and Description |
|---|---|
protected class |
VisibleLayout.KFLogPanel
Small subclass of LogPanel for use by layouts
|
protected static class |
VisibleLayout.LayoutOperation
Editing operations on the layout
|
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected static int |
LAYOUT_HEIGHT
the flow layout height
|
protected static int |
LAYOUT_WIDTH
the flow layout width
|
protected java.lang.String |
m_editConnection
The name of the user-selected connection if the user has initiated a
connection from a source step (stored in m_editStep)
|
protected StepVisual |
m_editStep
Reference to the step being edited (if any)
|
protected Environment |
m_env
Environment variables to use
|
protected java.io.File |
m_filePath
Current path on disk for this flow
|
protected Flow |
m_flow |
protected FlowExecutor |
m_flowExecutor
The flow executor used to execute the flow
|
protected boolean |
m_hasBeenEdited
True if the flow has been edited, but not yet saved
|
protected boolean |
m_isExecuting
True if this flow is executing
|
protected LayoutPanel |
m_layout
The panel used to render the flow
|
protected VisibleLayout.KFLogPanel |
m_logPanel
The log panel to use for this layout
|
protected MainKFPerspective |
m_mainPerspective
A reference to the main perspective
|
protected java.util.List<StepVisual> |
m_renderGraph
The steps to be rendered on this layout
|
protected java.util.List<StepVisual> |
m_selectedSteps
Keeps track of any highlighted steps on the canvas
|
protected java.util.Stack<java.io.File> |
m_undoBuffer
Keeps track of the undo buffer for this flow
|
protected VisibleLayout.LayoutOperation |
m_userOpp
The current layout operation
|
protected int |
m_zoomSetting
Current zoom setting for this layout
|
protected static int |
SCROLLBAR_INCREMENT
The scrollbar increment of the layout scrollpane
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
VisibleLayout(MainKFPerspective mainPerspective)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<StepVisual> |
addAll(java.util.List<StepManagerImpl> steps)
Add all the supplied steps to the flow managed by this layout
|
protected java.util.List<StepVisual> |
addAll(java.util.List<StepManagerImpl> steps,
boolean revalidate)
Add all the supplied steps to the flow managed by this layout
|
protected void |
addStep(StepManagerImpl manager,
int x,
int y)
Add the supplied step to the flow managed by this layout
|
protected void |
addUndoPoint()
Add an undo point
|
void |
connectSteps(StepManagerImpl source,
StepManagerImpl target,
java.lang.String connectionType)
Connect the supplied source step to the supplied target step using the
specified connection type
|
protected void |
copySelectedStepsToClipboard()
Copies the currently selected list of steps to the global clipboard
|
protected void |
copyStepsToClipboard(java.util.List<StepVisual> steps)
Copies the supplied list of steps to the global clipboard
|
java.lang.String |
environmentSubstitute(java.lang.String source) |
void |
executeFlow(boolean sequential)
Execute the flow managed by this layout
|
protected java.util.Map<java.lang.String,java.util.List<StepManagerImpl[]>> |
findClosestConnections(java.awt.Point point,
int delta)
Find all connections within delta of the supplied point
|
protected StepVisual |
findStep(java.awt.Point p)
Find the first step whose bounds enclose the supplied point
|
protected java.util.List<StepVisual> |
findSteps(java.awt.Rectangle boundingBox)
Find a list of steps that exist within the supplied bounding box
|
protected java.util.List<StepManagerImpl> |
findStepsThatCanAcceptConnection(java.lang.String connectionName)
Find a list of steps in the flow that can accept the supplied connection
type
|
protected java.lang.String |
getEditConnection()
If the user has initiated the connection process, then this method returns
the name of the connection involved
|
boolean |
getEdited()
Get whether this flow has been altered since the last save operation
|
protected StepVisual |
getEditStep()
Get the step currently being "edited".
|
Environment |
getEnvironment()
Get the environment variables being used by this layout
|
java.io.File |
getFilePath()
Get the current path (if any) of the flow being edited in this layout
|
Flow |
getFlow()
Get the flow being edited by this layout
|
FlowExecutor |
getFlowExecutor()
Get the
FlowExecutor being used for execution of this flow |
protected VisibleLayout.LayoutOperation |
getFlowLayoutOperation()
Get the current flow edit operation
|
VisibleLayout.KFLogPanel |
getLogPanel()
Get the log panel in use by this layout
|
protected MainKFPerspective |
getMainPerspective()
Get the main perspective that owns this layout
|
protected java.util.List<StepVisual> |
getRenderGraph()
Get a list of the steps (wrapped in
StepVisual instances) that make
up the flow rendered/edited by this panel |
protected java.util.List<StepVisual> |
getSelectedSteps()
Get the list of selected steps.
|
protected int |
getUndoBufferSize()
Get the number of entries in the undo stack
|
int |
getZoomSetting()
Get the current zoom setting for this layout
|
protected void |
initiateAddNote()
Initiate the process of adding a note to the layout
|
boolean |
isExecuting()
Returns true if the flow managed by this layout is currently executing
|
protected void |
loadLayout(java.io.File fFile,
boolean isUndo)
Load a flow into this layout
|
protected int |
numSteps()
Get the number of steps in the layout
|
protected void |
pasteFromClipboard(int x,
int y)
Pastes the contents (if any) of the global clipboard to this layout
|
protected void |
popAndLoadUndo()
Pop an undo point and load the flow it encapsulates
|
protected boolean |
previousConn(java.util.Map<java.lang.String,java.util.List<StepManager>> outConns,
StepManagerImpl target,
int index)
Returns true if there is a previous (prior to index) connection to the
supplied target step in the supplied map of connections.
|
protected void |
removeSelectedSteps()
Removes the currently selected list of steps from the layout
|
protected void |
removeStep(StepVisual step)
Remove a step from the flow displayed/edited by this layout
|
protected void |
renameStep(java.lang.String oldName,
java.lang.String newName)
Rename a step
|
protected void |
saveLayout(boolean showDialog)
Save the flow managed by this layout
|
static java.lang.String |
serializeStepsToJSON(java.util.List<StepVisual> steps,
java.lang.String name)
Utility method to serialize a list of steps (encapsulated in StepVisuals)
to a JSON flow.
|
protected void |
setEditConnection(java.lang.String connName)
Set the name of the connection involved in a connection operation
|
void |
setEdited(boolean edited)
Set the edited status of this flow
|
protected void |
setEditStep(StepVisual step)
Set the step to "edit"
|
void |
setEnvironment(Environment env)
Set the environment variables to use with this layout
|
void |
setFilePath(java.io.File path)
Set the file path for the flow being edited by this layout
|
void |
setFlow(Flow flow)
Set the flow to edit in this layout
|
void |
setFlowExecutor(FlowExecutor executor)
Set the
FlowExcecutor to use for executing the flow |
protected void |
setFlowLayoutOperation(VisibleLayout.LayoutOperation mode)
Set the current flow edit operation
|
protected void |
setSelectedSteps(java.util.List<StepVisual> selected)
Set a list of steps to be considered "selected".
|
void |
setZoomSetting(int zoom)
Set the current zoom setting for this layout
|
protected void |
snapSelectedToGrid()
Snap the selected steps (if any) to the grid
|
void |
stopFlow()
Stop the flow from executing
|
getAccessibleContext, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected static final int LAYOUT_WIDTH
protected static final int LAYOUT_HEIGHT
protected static final int SCROLLBAR_INCREMENT
protected Flow m_flow
protected VisibleLayout.KFLogPanel m_logPanel
protected int m_zoomSetting
protected java.io.File m_filePath
protected java.util.List<StepVisual> m_selectedSteps
protected java.util.Stack<java.io.File> m_undoBuffer
protected boolean m_hasBeenEdited
protected FlowExecutor m_flowExecutor
protected Environment m_env
protected boolean m_isExecuting
protected MainKFPerspective m_mainPerspective
protected java.util.List<StepVisual> m_renderGraph
protected VisibleLayout.LayoutOperation m_userOpp
protected LayoutPanel m_layout
protected StepVisual m_editStep
protected java.lang.String m_editConnection
public VisibleLayout(MainKFPerspective mainPerspective)
mainPerspective - the main Knowledge Flow perspectiveprotected java.util.List<StepVisual> getRenderGraph()
StepVisual instances) that make
up the flow rendered/edited by this panelprotected MainKFPerspective getMainPerspective()
protected StepVisual getEditStep()
protected void setEditStep(StepVisual step)
step - the step to editprotected java.lang.String getEditConnection()
protected void setEditConnection(java.lang.String connName)
connName - the name of the connectionprotected java.util.List<StepVisual> getSelectedSteps()
protected void setSelectedSteps(java.util.List<StepVisual> selected)
selected - a list of steps to be considered as selectedprotected void removeSelectedSteps()
throws WekaException
WekaException - if a problem occursprotected void copySelectedStepsToClipboard()
throws WekaException
WekaException - if a problem occursprotected void copyStepsToClipboard(java.util.List<StepVisual> steps) throws WekaException
steps - the steps to copy to the clipboardWekaException - if a problem occursprotected void pasteFromClipboard(int x,
int y)
throws WekaException
x - the x coordinate to paste aty - the y cooridinate to paste atWekaException - if a problem occursprotected void addUndoPoint()
protected int getUndoBufferSize()
protected void snapSelectedToGrid()
protected void initiateAddNote()
public Flow getFlow()
public void setFlow(Flow flow)
flow - the flow to edit in this layoutprotected java.util.List<StepVisual> addAll(java.util.List<StepManagerImpl> steps)
steps - the steps to addStepVisual instance.protected java.util.List<StepVisual> addAll(java.util.List<StepManagerImpl> steps, boolean revalidate)
steps - the steps to addrevalidate - true if the GUI should be repaintedStepVisual instance.protected void addStep(StepManagerImpl manager, int x, int y)
manager - the StepManager instance managing the step to be
addedx - the x coordinate to add aty - the y coordinate to add atpublic void connectSteps(StepManagerImpl source, StepManagerImpl target, java.lang.String connectionType)
source - the StepManager instance managing the source steptarget - the StepManager instance managing the target stepconnectionType - the connection type to useprotected void renameStep(java.lang.String oldName,
java.lang.String newName)
oldName - the old name of the step to renamenewName - the new name to give the stepprotected void removeStep(StepVisual step) throws WekaException
step - the StepVisual instance wrapping the step to be removedWekaException - if a problem occursprotected int numSteps()
public Environment getEnvironment()
public void setEnvironment(Environment env)
env - the environment variables to usepublic java.lang.String environmentSubstitute(java.lang.String source)
public FlowExecutor getFlowExecutor()
FlowExecutor being used for execution of this flowFlowExecutor in use by this layoutpublic void setFlowExecutor(FlowExecutor executor)
FlowExcecutor to use for executing the flowexecutor - the FlowExecutor to use for executing the flow in
this layoutpublic java.io.File getFilePath()
public void setFilePath(java.io.File path)
path - the path on disk for the flow being editedpublic VisibleLayout.KFLogPanel getLogPanel()
public int getZoomSetting()
public void setZoomSetting(int zoom)
zoom - the current zoom settingpublic boolean getEdited()
public void setEdited(boolean edited)
edited - true if the flow has been alteredpublic boolean isExecuting()
protected VisibleLayout.LayoutOperation getFlowLayoutOperation()
protected void setFlowLayoutOperation(VisibleLayout.LayoutOperation mode)
mode - the current flow edit operationpublic void executeFlow(boolean sequential)
throws WekaException
sequential - true if the flow's start points are to be launched
sequentially rather than in parallelWekaException - if a problem occurspublic void stopFlow()
protected StepVisual findStep(java.awt.Point p)
p - the pointprotected java.util.List<StepVisual> findSteps(java.awt.Rectangle boundingBox)
boundingBox - the bounding box to checkprotected java.util.List<StepManagerImpl> findStepsThatCanAcceptConnection(java.lang.String connectionName)
connectionName - the type of connection to check forprotected java.util.Map<java.lang.String,java.util.List<StepManagerImpl[]>> findClosestConnections(java.awt.Point point, int delta)
point - the point on the canvas to find steps atdelta - the radius around point for detecting connectionsprotected boolean previousConn(java.util.Map<java.lang.String,java.util.List<StepManager>> outConns, StepManagerImpl target, int index)
outConns - the map of connections to checktarget - the target step to check forindex - connections to the target prior to this index in the map countprotected void saveLayout(boolean showDialog)
showDialog - true if a file dialog should be displayedprotected void popAndLoadUndo()
protected void loadLayout(java.io.File fFile,
boolean isUndo)
fFile - the file containing the flowisUndo - true if this is an "undo" layoutpublic static java.lang.String serializeStepsToJSON(java.util.List<StepVisual> steps, java.lang.String name) throws WekaException
steps - the steps to serializename - the name to set in the encapsulating Flow before serializingWekaException - if a problem occurs