public abstract class TreeBodyGuiImpl extends AbstractWidget<GuiOutputManager> implements TreeViewDelegate, Scrollable2D, Viewport
| Modifier and Type | Field and Description |
|---|---|
protected ColorRgb |
disabledFore
Disabled state text color
|
protected GuiColorResolver |
gc
Color resolver
|
protected GuiDriver<?,?> |
gd
Screen driver
|
protected GuiFontResolver |
gf
Font resolver
|
private WidgetId |
id
The widget Id.
|
protected ColorRgb |
selectionBack
Selected item box color
|
protected ColorRgb |
selectionFore
Selected item text color
|
protected ClassicTheme |
theme
The theme used for drawing
|
private TreeGuiImpl.TreeNode |
tooltipNode
The node with active tooltip
|
TreeGuiImpl |
tree
The owning tree view
|
private double |
viewportHeight
Viewport height
|
private double |
viewportWidth
Viewport width
|
insets, listeners, location, LOG, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
TreeBodyGuiImpl(TreeGuiImpl tree)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
calcNodeWidth(TreeGuiImpl.TreeNode node,
int level)
Calculates width of a single node.
|
protected void |
deactivateTooltip()
Deactivates an active tooltip.
|
Dimension |
dimension()
Get widget dimension.
|
abstract void |
draw()
Draws this component.
|
private void |
fireChangeTopVisibleNode(int prevNodeId,
int scrollNodeCount)
Triggers CHANGE-TOP-VISIBLE-NODE.
|
private boolean |
fireNodeClickEvent(TreeGuiImpl.TreeNode node)
Fires the node click event.
|
protected TreeGuiImpl.TreeNode |
getCheckBoxNode(NativePoint loc)
Returns the node owning the checkbox at the supplied location.
|
WidgetId |
getId()
Widget Id is required to dispatch mouse events.
|
private TreeGuiImpl.TreeNode |
getNodeAtLocation(NativePoint loc)
Returns a tree node at the specified location or
null if no node exists at the location. |
protected int |
getNodeHeight()
Calculates the node height.
|
protected TreeGuiImpl.TreeNode |
getNodeInView(int rowIndex)
Returns the node at the specified in-view row index.
|
protected int |
getNodesColumnWidth()
The method returns the first nodes colum width.
|
protected double |
getViewportWidth()
Gets the current viewport width.
|
double |
height()
Get widget height.
|
java.lang.Integer |
hitTest(int x,
int y)
Get the TreeView node under mouse cursor.
|
protected TreeGuiImpl.TreeNode |
isExpandIconAtLocation(NativePoint location)
The method returns the node at the specified location.
|
protected TreeGuiImpl.TreeNode |
isNodeContentAtLocation(NativePoint loc)
The method returns the node at the specified location.
|
Dimension |
minimumSize()
Get widget minimum size.
|
void |
modelChanged(Model model)
This procedure is called by the model after it was changed.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Notification of a mouse dragged event occurred for this widget.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Notification of a mouse exited event occurred for this widget.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Notification of a mouse entered event occurred for this widget.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Notification of a mouse pressed event occurred for this widget.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Notification of a mouse released event occurred for this widget.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Notification of a mouse wheel moved event occurred for this widget.
|
protected void |
move(TreeGuiImpl.TreeNode from,
int key)
Process keyboard commands, which change the selection.
|
protected java.lang.Iterable<TreeGuiImpl.TreeNode> |
nodesInView()
Get iterable for all nodes visible on screen.
|
protected void |
oleDoDrop(java.awt.event.MouseEvent e)
Called when an automatic Drop operation is ended.
|
protected void |
oleDragging(java.awt.event.MouseEvent e)
Called on OLE Dragging.
|
protected boolean |
oleStartDragging(java.awt.event.MouseEvent e)
Called when an automatic OLE Drag operation is started.
|
void |
processKeyEvent(KeyInput event)
Process key event.
|
private void |
setMouseCursor(MousePointer cursor)
Set mouse cursor.
|
void |
setViewportHeight(double height)
Set viewport height.
|
void |
setViewportWidth(double width)
Set viewport width.
|
private void |
triggerDefaultAction(TreeGuiImpl.TreeNode node)
Triggers DEFAULT-ACTION.
|
void |
updateColors(TreeConfig c)
Updates tree colors.
|
protected boolean |
updateHScrollModel(int width)
Helper method suitable for both tree view and tree list
|
boolean |
updateVScrollModel()
Update the vertical scrolling model based on this object geometry and contents.
|
double |
width()
Get widget width.
|
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseEntered, moveToBottom, moveToTop, name, navigable, oleDrag, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChanged, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalDimensionInt, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unrealize, unregisterWidgetListener, updateSizeWorker, updateSystemParent, widgetRealized, widgetStateChanged, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitupdateHScrollModelsetViewportDimensionsacceptsEscAsAnyKey, acceptTrigger, canMovetoTop, completeTrigger, defaultMousePtr, enforceDefaultMousePtr, getIdForTrigger, getLegacyWidget, getTriggerWidget, getTriggerWidget, hasFocus, ignoreEnable, isCurrent, isDirectManipulable, isDroppable, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, maySwitchFocus, parent, refreshWidget, requestFocus, requestFocus, startTrigger, systemFocusGrabbed, validateDisplayValuepublic TreeGuiImpl tree
protected ColorRgb disabledFore
protected GuiColorResolver gc
protected GuiDriver<?,?> gd
protected GuiFontResolver gf
protected ColorRgb selectionBack
protected ColorRgb selectionFore
protected final ClassicTheme theme
private TreeGuiImpl.TreeNode tooltipNode
private double viewportHeight
private double viewportWidth
public TreeBodyGuiImpl(TreeGuiImpl tree)
tree - The owning tree view.public Dimension dimension()
dimension in interface Widget<GuiOutputManager>dimension in class AbstractWidget<GuiOutputManager>public abstract void draw()
draw in interface Widget<GuiOutputManager>draw in class AbstractWidget<GuiOutputManager>public final WidgetId getId()
getId in interface Widget<GuiOutputManager>getId in class AbstractWidget<GuiOutputManager>public double height()
height in interface Widget<GuiOutputManager>height in class AbstractWidget<GuiOutputManager>public java.lang.Integer hitTest(int x,
int y)
null value.hitTest in interface TreeViewDelegatex - Mouse cursor x position.y - Mouse cursor y position.null if miss.public Dimension minimumSize()
minimumSize in interface Widget<GuiOutputManager>minimumSize in class AbstractWidget<GuiOutputManager>public void modelChanged(Model model)
modelChanged in interface ModelChangeListenermodel - the model that was changedpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenermouseClicked in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenermouseExited in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractWidget<GuiOutputManager>e - The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListenermouseWheelMoved in class AbstractWidget<GuiOutputManager>e - The mouse event.public void processKeyEvent(KeyInput event)
processKeyEvent in interface Widget<GuiOutputManager>processKeyEvent in class AbstractWidget<GuiOutputManager>event - Key event to process.public void setViewportHeight(double height)
setViewportHeight in interface Viewportheight - the new viewport heightpublic void setViewportWidth(double width)
setViewportWidth in interface Viewportwidth - the new viewport widthpublic void updateColors(TreeConfig c)
c - Tree config.public boolean updateVScrollModel()
updateVScrollModel in interface Scrollable2Dtrue if model was changed as the result of the call.public double width()
width in interface Widget<GuiOutputManager>width in class AbstractWidget<GuiOutputManager>protected int getNodeHeight()
protected final TreeGuiImpl.TreeNode getNodeInView(int rowIndex)
rowIndex - 0-based index.null if no node found.protected double getViewportWidth()
protected int calcNodeWidth(TreeGuiImpl.TreeNode node, int level)
node - The node to calculate.level - Node tree level.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>protected final java.lang.Iterable<TreeGuiImpl.TreeNode> nodesInView()
protected void oleDoDrop(java.awt.event.MouseEvent e)
oleDoDrop in class AbstractWidget<GuiOutputManager>e - The mouse event.protected void oleDragging(java.awt.event.MouseEvent e)
oleDragging in class AbstractWidget<GuiOutputManager>e - The mouse event.protected boolean oleStartDragging(java.awt.event.MouseEvent e)
oleStartDragging in class AbstractWidget<GuiOutputManager>e - The mouse event.true if is a drag source has been selected.protected final boolean updateHScrollModel(int width)
width - the widget widthtrue is the horizontal scroll model was changed due to this callprotected void deactivateTooltip()
private void fireChangeTopVisibleNode(int prevNodeId,
int scrollNodeCount)
prevNodeId - The node which was the previous top visible node.scrollNodeCount - The number of nodes which were scrolled in order to change the top
visible node. This can be either positive or negative.private boolean fireNodeClickEvent(TreeGuiImpl.TreeNode node)
node - The trigger nodeprotected final TreeGuiImpl.TreeNode isExpandIconAtLocation(NativePoint location)
location - The location to test.null.protected int getNodesColumnWidth()
private TreeGuiImpl.TreeNode getNodeAtLocation(NativePoint loc)
null if no node exists at the location.loc - Location.protected final TreeGuiImpl.TreeNode isNodeContentAtLocation(NativePoint loc)
loc - The location to test.null.protected TreeGuiImpl.TreeNode getCheckBoxNode(NativePoint loc)
null is returned.loc - The location to check.protected void move(TreeGuiImpl.TreeNode from, int key)
from - the currently selected nodekey - the keyboard event keyprivate void setMouseCursor(MousePointer cursor)
cursor - Mouse cursorprivate void triggerDefaultAction(TreeGuiImpl.TreeNode node)
node - The target node.