public final class ProjectTree extends DNDTree implements MouseListener, ActionListener
Modifier and Type | Class and Description |
---|---|
protected class |
ProjectTree.ProjectThingNodeRenderer |
DNDTree.NodeRenderer
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected static Color |
ACTIVE_DISPL_COLOR |
background, dispatcher, project
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ProjectTree(Project project,
ProjectThing project_thing) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent ae) |
DefaultMutableTreeNode |
addChild(ProjectThing parent,
String childType,
Displayable d)
|
DefaultMutableTreeNode |
addSibling(Displayable elder,
Displayable sibling)
Finds the node for the elder and adds the sibling next to it, under the same parent.
|
protected DNDTree.NodeRenderer |
createNodeRenderer()
Subclasses should override this method to return a subclass of DNDTree.NodeRenderer
|
void |
destroy() |
Profile |
duplicateChild(Profile original,
int position,
Layer layer)
Implements the "Duplicate, link and send to next/previous layer" functionality.
|
protected Thing |
getRootThing() |
void |
insertSegmentations(Collection<? extends Displayable> al)
Creates a new node of basic type for each AreaList, Ball, Pipe or Polyline present in the ArrayList.
|
void |
keyPressed(KeyEvent ke) |
void |
mouseClicked(MouseEvent me) |
void |
mouseDragged(MouseEvent me) |
void |
mouseEntered(MouseEvent me) |
void |
mouseExited(MouseEvent me) |
void |
mousePressed(MouseEvent me) |
void |
mouseReleased(MouseEvent me) |
boolean |
rawSendToSiblingProject(ProjectThing source_pt,
int transfer_mode,
Project target_project,
ProjectThing landing_parent)
Assumes that both projects have the same TemplateThing structure,
and assumes that the parent of the (
source_pt and the landing_parent
instances are of the same type. |
boolean |
remove(boolean check,
ProjectThing thing,
DefaultMutableTreeNode node)
If the given node is null, it will be searched for.
|
void |
remove(DefaultMutableTreeNode node,
boolean check,
boolean remove_empty_parents,
int levels)
Remove the node, its Thing and the object hold by the thing from the database.
|
Set<Displayable> |
remove(Set<? extends Displayable> displayables,
DefaultMutableTreeNode top)
Remove the Thing and DefaultMutableTreeNode that wrap each of the Displayable;
calls softRemove on each Displayable, and does NOT call remove on the Displayable.
|
void |
removeProjectThingLadder(ProjectThing lowest,
int levels)
Recursive as long as levels is above zero.
|
void |
rename(ProjectThing thing) |
void |
selectInDisplay(ProjectThing thing,
boolean shift_down) |
boolean |
sendToSiblingProject(DefaultMutableTreeNode node)
When two or more people work on the same XML file, images may be the same but segmentations and the transformations of the images may diverge.
|
Bureaucrat |
sendToSiblingProjectTask(DefaultMutableTreeNode node) |
void |
showInfo(ProjectThing thing) |
Connector |
tryAddNewConnector(Displayable d,
boolean selectNode)
|
addChild, addLeafs, autoscroll, duplicate, expandAllNodes, expandAllNodes, expandNode, findNode, findNode2, getAutoscrollInsets, getExpandedStates, getExpandedStates, getInfo, getRoot, getRootNode, isExpanded, isExpanded, keyReleased, keyTyped, makeNode, makeNode, processKeyBinding, processKeyEvent, rebuild, rebuild, rebuild, removeNode, reset, selectNode, set, setExpandedSilently, setExpandedSilently, treeCollapsed, treeExpanded, updateList, updateList, updateUILater
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI
addAncestorListener, 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, 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, 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, update
add, 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, validateTree
action, 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, transferFocusUpCycle
protected static final Color ACTIVE_DISPL_COLOR
public ProjectTree(Project project, ProjectThing project_thing)
public void mousePressed(MouseEvent me)
mousePressed
in interface MouseListener
public void rename(ProjectThing thing)
public void mouseDragged(MouseEvent me)
public void mouseReleased(MouseEvent me)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent me)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent me)
mouseExited
in interface MouseListener
public void mouseClicked(MouseEvent me)
mouseClicked
in interface MouseListener
public void actionPerformed(ActionEvent ae)
actionPerformed
in interface ActionListener
public void remove(DefaultMutableTreeNode node, boolean check, boolean remove_empty_parents, int levels)
public void removeProjectThingLadder(ProjectThing lowest, int levels)
public Profile duplicateChild(Profile original, int position, Layer layer)
public void insertSegmentations(Collection<? extends Displayable> al)
public void keyPressed(KeyEvent ke)
keyPressed
in interface KeyListener
keyPressed
in class DNDTree
public boolean remove(boolean check, ProjectThing thing, DefaultMutableTreeNode node)
public final Set<Displayable> remove(Set<? extends Displayable> displayables, DefaultMutableTreeNode top)
public void showInfo(ProjectThing thing)
public void selectInDisplay(ProjectThing thing, boolean shift_down)
public DefaultMutableTreeNode addSibling(Displayable elder, Displayable sibling)
public DefaultMutableTreeNode addChild(ProjectThing parent, String childType, Displayable d)
d
as a ProjectThing
child of type childType
to the parent ProjectThing
parent
. A new DefaultMutableTreeNode
will be added to the DefaultMutableTreeNode
that encapsulates the parent
.
Will fail by returning null if:
1. The parent
ProjectThing
cannot have a child of type childType
.
2. The ProjectThing
constructor throws an Exception, for example if d
is null.
3. The parent
ProjectThing.addChild(Thing)
returns false.DefaultMutableTreeNode
.protected DNDTree.NodeRenderer createNodeRenderer()
DNDTree
createNodeRenderer
in class DNDTree
public Bureaucrat sendToSiblingProjectTask(DefaultMutableTreeNode node)
public boolean sendToSiblingProject(DefaultMutableTreeNode node)
public boolean rawSendToSiblingProject(ProjectThing source_pt, int transfer_mode, Project target_project, ProjectThing landing_parent)
source_pt
and the landing_parent
instances are of the same type.source_pt
- The ProjectThing
to be cloned.transfer_mode
- Either 0 ("As is") or 1 ("Transformed with the images").target_project
- The sibling project into which insert a clone of the source_pt
.landing_parent
- The ProjectThing in the sibling project that receives the cloned source_pt
.protected Thing getRootThing()
getRootThing
in class DNDTree
public Connector tryAddNewConnector(Displayable d, boolean selectNode)
active
can accept a Connector or has a direct child
node that can accept a Connector
, add a new Connector
and return it.d
- The Displayable
that serves as reference, to decide which node to add the new Connector
.selectNode
- Whether to select the new node containing the Connector
in the ProjectTree.Connector
.Copyright © 2015–2021 Fiji. All rights reserved.