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, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
TreeBodyGuiImpl(TreeGuiImpl tree)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private 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.
|
private 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.
|
double |
height()
Get widget height.
|
java.lang.Integer |
hitTest(int x,
int y)
Get the TreeView node under mouse cursor.
|
private TreeGuiImpl.TreeNode |
isExpandIconAtLocation(NativePoint location)
The method returns the node at the specified location.
|
private 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.
|
private 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, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, 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, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, unrealize, unregisterWidgetStateListener, updateSizeWorker, widgetStateChanged, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
updateHScrollModel
setViewportDimensions
canMovetoTop, defaultMousePtr, enforceDefaultMousePtr, getLegacyWidget, getTriggerWidget, getTriggerWidget, hasFocus, ignoreEnable, isDirectManipulable, isDroppable, isInitialValueLayout, isLegacyFocus, maySwitchFocus, parent, refreshWidget, requestFocus, requestFocus, systemFocusGrabbed, validateDisplayValue
public 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 TreeViewDelegate
x
- 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 ModelChangeListener
model
- the model that was changedpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
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 Viewport
height
- the new viewport heightpublic void setViewportWidth(double width)
setViewportWidth
in interface Viewport
width
- the new viewport widthpublic void updateColors(TreeConfig c)
c
- Tree config.public boolean updateVScrollModel()
updateVScrollModel
in interface Scrollable2D
true
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 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 callprivate 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 nodeprivate final TreeGuiImpl.TreeNode isExpandIconAtLocation(NativePoint location)
location
- The location to test.null
.private TreeGuiImpl.TreeNode getNodeAtLocation(NativePoint loc)
null
if no node exists at the location.loc
- Location.private final TreeGuiImpl.TreeNode isNodeContentAtLocation(NativePoint loc)
loc
- The location to test.null
.private TreeGuiImpl.TreeNode getCheckBoxNode(NativePoint loc)
null
is returned.loc
- The location to chck.private final 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.