Package sc.fiji.snt
Class PathManagerUI
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
sc.fiji.snt.PathManagerUI
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,EventListener,Accessible,TreeSelectionListener,RootPaneContainer,WindowConstants
Implements the Path Manager Dialog.
- Author:
- Tiago Ferreira
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDefaultTags(String... defaultTags) Applies a default (built-in) tag to selected Path(s).voidapplySelectionFilter(String query) Selects paths matching a text-based criteria, or a list of SWC type flagsvoidapplySelectionFilter(String property, Number criteria) Selects paths matching a morphometric criteria.voidapplySelectionFilter(String property, Number min, Number max) Selects paths matching a morphometric criteria.voidApplies a custom tag/ color to selected Path(s).protected voidcancelFit(boolean updateUIState) voidClears the current path selection.voiddispose()static StringextractTagsFromPaths(Collection<Path> paths) Gets the collection of paths listed in the Path Manager as aTreeobject.getJTree()Gets the JTree component used to display paths.protected Collection<Tree> Gets the PathAndFillManager instance.com.jidesoft.swing.SearchableGets the Searchable interface for the JTree.getSelectedPaths(boolean ifNoneSelectedGetAll) Gets the paths currently selected in the Manager'sJTreelist.getSelectedPathsOrganizedByTrees(boolean ifNoneSelectedGetAll) protected TreegetSNT()Gets the SNT instance associated with this Path Manager.protected SNTTablegetTable()static voidprotected voidprotected booleanprotected voidquickMeasurementsCmdError(GuiUtils guiUtils) voidrefreshForPaths(Collection<Path> paths) Repaints the Path Manager view for the given paths.voidreload()Reloads the contents ofPathAndFillManagervoidrunCommand(String cmd) Runs a menu command.voidrunCommand(String cmd, String... args) Runs a menu command with options.protected booleanrunCustomCommand(String cmd) voidSelects a specific path in the Path Manager.voidSelects all paths.protected booleanvoidsetCombinedSelectionFilters(boolean enable) Sets whether selection filters should be combined.voidsetFillList(List<Fill> fillList) voidsetPathList(List<Path> pathList, Path justAdded, boolean expandAll) voidsetSelectedPaths(Collection<Path> selectedPaths, Object source) voidupdate()Refreshes (Repaints) the Path Manager JTree.voidupdate(boolean selectedPathsOnly) Refreshes (Repaints) the Path Manager JTree.protected voidvoidMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
TABLE_TITLE
- See Also:
-
guiUtils
-
-
Constructor Details
-
Method Details
-
getSelectedPathsOrganizedByTrees
- Parameters:
ifNoneSelectedGetAll- if true and no paths are currently selected, all Paths in the list are considered- Returns:
- the map of selected paths (
as keys - See Also:
-
getSelectedPaths
Gets the paths currently selected in the Manager'sJTreelist.- Parameters:
ifNoneSelectedGetAll- if true and no paths are currently selected, all Paths in the list will be returned- Returns:
- the selected paths. Note that children of a Path are not returned if unselected.
-
selectionExists
protected boolean selectionExists() -
cancelFit
protected void cancelFit(boolean updateUIState) -
dispose
public void dispose() -
valueChanged
- Specified by:
valueChangedin interfaceTreeSelectionListener
-
setSelectedPaths
-
setPathList
-
getSingleTree
-
getMultipleTrees
-
quickMeasurementsCmdError
-
setFillList
-
getProofReadingToolBar
-
refreshForPaths
Repaints the Path Manager view for the given paths. Public hook used by external mutators (e.g. the Curation Assistant's review-tag actions inCurationManager) that change path names directly and need the table to pick the change up; bypasses the heavier viewer-update pass because path mutations like tag-suffix edits don't affect 3D viewers.- Parameters:
paths- the paths whose representation in the manager needs to refresh;nullor empty repaints the current selection.
-
update
public void update()Refreshes (Repaints) the Path Manager JTree. Gets called bySNT.isOnlySelectedPathsVisible()to reflect changes in path colors, etc. -
update
public void update(boolean selectedPathsOnly) Refreshes (Repaints) the Path Manager JTree.- Parameters:
selectedPathsOnly- Whether only selected nodes in the JTree should be updated (repainted). Iffalseall nodes are updated.
-
reload
public void reload()Reloads the contents ofPathAndFillManager -
updateTable
protected void updateTable() -
getTable
-
getSNT
Gets the SNT instance associated with this Path Manager.- Returns:
- the SNT instance
-
getPathAndFillManager
Gets the PathAndFillManager instance.- Returns:
- the PathAndFillManager instance
-
getJTree
Gets the JTree component used to display paths.- Returns:
- the JTree component
-
getSearchable
public com.jidesoft.swing.Searchable getSearchable()Gets the Searchable interface for the JTree.- Returns:
- the Searchable interface
-
applySelectionFilter
public void applySelectionFilter(String property, Number min, Number max) throws IllegalArgumentException Selects paths matching a morphometric criteria.- Parameters:
property- The morphometric property ("Length", "Path order", etc.) as listed in the "Morphology filter" menu (case-sensitive).min- the lowest value (exclusive) in the filtermax- the highest value (exclusive) in the filter- Throws:
IllegalArgumentException- ifpropertywas not recognized. Note that some filtering options listed in the GUI may not be supported.
-
setCombinedSelectionFilters
public void setCombinedSelectionFilters(boolean enable) Sets whether selection filters should be combined. This is equivalent to toggling the 'filter' button in Path Manager's UI- Parameters:
enable- if true, selection filters are combined
-
applyTag
Applies a custom tag/ color to selected Path(s).- Parameters:
customTagOrColor- The tag (or color) to be applied to selected Paths. Specifying "null color" will remove color tags from selected paths.- Throws:
IllegalArgumentException
-
applyDefaultTags
Applies a default (built-in) tag to selected Path(s).- Parameters:
defaultTags- The tags to be applied to selected Paths, as listed in the "Tag" menu, e.g., "Traced Channel", "Traced Frame", "No. of Spine/Varicosity Markers", etc.- Throws:
IllegalArgumentException
-
applySelectionFilter
Selects paths matching a text-based criteria, or a list of SWC type flags- Parameters:
query- The matching text, as it would have been typed in the "Text filtering" box. If query encodes an integer list (e.g., "[1,3,5]"), paths are selected based on their SWC type flag- Throws:
IllegalArgumentException
-
applySelectionFilter
Selects paths matching a morphometric criteria.- Parameters:
property- The morphometric property ("Length", "Path order", etc.) as listed in the "Morphology filter" menu (case-sensitive).criteria- the filtering criteria.- Throws:
IllegalArgumentException- ifpropertywas not recognized. Note that some filtering options listed in the GUI may not be supported.
-
geSelectedPathsAsTree
Gets the collection of paths listed in the Path Manager as aTreeobject. All paths are retrieved if none are currently selected.- Returns:
- the Tree holding the Path collection
-
clearSelection
public void clearSelection()Clears the current path selection. -
selectAll
public void selectAll()Selects all paths. -
select
Selects a specific path in the Path Manager.- Parameters:
path- the path to be selected. If the path is not found in the manager, the selection remains unchanged. If null active selection (if any) is cleared.
-
runCommand
Runs a menu command.- Parameters:
cmd- The command to be run, exactly as listed in the PathManagerUI's menu bar or Right-click contextual menu- Throws:
IllegalArgumentException- ifcmdwas not found.
-
runCustomCommand
-
runCommand
Runs a menu command with options.- Parameters:
cmd- The command to be run, exactly as listed in the PathManagerUI's menu bar or Right-click contextual menuargs- the option(s) that would fill the command's prompt. e.g., 'runCommand("Branch-based Color Mapping...", "X coordinates", "Cyan Hot.lut")'- Throws:
IllegalArgumentException- ifcmdwas not found, or if it is not supported.IOException
-
measurementsUnsaved
protected boolean measurementsUnsaved() -
measureCells
protected void measureCells() -
extractTagsFromPath
-
extractTagsFromPaths
-
main
-