private class FileDialogGuiImpl.Folder extends ButtonGuiImpl
Modifier and Type | Field and Description |
---|---|
private FileDialogGuiImpl.Folder[] |
content
The list of sub-folders or
null if it was never expanded. |
private boolean |
expanded
true only if this folder is expanded, showing its children. |
private ImageWrapper<java.awt.image.BufferedImage> |
img
The image to be displayed in the lef-side of the button.
|
private int |
indent
Indentation of this folder.
|
private FileDialogGuiImpl.Folder |
parent
The parent folder or
null if this si a root. |
private java.lang.String |
path
The absolute path of this folder.
|
(package private) static int |
X_INDENT
Indentation step (in pixels).
|
cc, DOT_LINE_WIDTH, gd, gf
config, widgetFocused
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
Folder(WidgetId id,
FileDialogGuiImpl.Folder parent,
java.lang.String text,
java.lang.String path,
java.lang.String icon,
int indent)
The constructor creates a button with given properties.
|
Modifier and Type | Method and Description |
---|---|
private void |
collapse()
Collapse this folder.
|
(package private) int |
computePreferredWidth()
Computes the preferred width for this thumbnail.
|
void |
draw()
Draw the button.
|
protected void |
handleBasicEvents(KeyInput event)
Process basic events - key navigation event.
|
(package private) boolean |
isRoot()
Checks whether this is the root of the tree.
|
(package private) FileDialogGuiImpl.Folder |
lookup(java.lang.String child)
Searches for a child among all direct children.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
afterConfigUpdate, createMnemonic, focusTraversable, getImgDisabled, getImgDown, getImgUp, handleCursorKeys, hasImages, hasPrepackagedImages, height, highlighted, initialize, isAutoResize, isDefaultButton, isDroppable, isFocusable, isMnemonicSupported, isPressed, loadImage, onFocusLost, physicalBounds, processMnemonic, refresh, requestFocus, setActionCode, setImage, supportsCustomMousePointer, updateSize, updateSizeWorker, width
isMouseOver, mouseActions, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
addListener, checkKey, config, destroy, getColon, getColumnLabelText, getCommand, getLabelInstance, getLabelText, getMnemonic, getTo, initButtonText, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, processEvent, processKeyEvent, setCommand, setHidden, setLabelInstance, setMnemonic, setNoLabels, setSupportsMnemonic, setText, setTextLabel, setVisible, setWasVisible, textLabel, wasVisible
dimension, forceCursorOnFocus, getDefaultEvent, ignoreAction, manageSystemActions, minimumSize, onFocusGained, onKeyPressed, onKeyTyped, processKeyEventCommon
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, insets, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, showPopupMenu, sync, topLevelWindow, translate, unrealize, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, insets, isCurrent, isDirectManipulable, isDisplayed, isEnabled, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, topLevelWindow, unrealize, window
getColumnMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, setColumnMnemonic, updateMnemonic
static final int X_INDENT
private final FileDialogGuiImpl.Folder parent
null
if this si a root.private FileDialogGuiImpl.Folder[] content
null
if it was never expanded.private final java.lang.String path
private ImageWrapper<java.awt.image.BufferedImage> img
private final int indent
private boolean expanded
true
only if this folder is expanded, showing its children.public Folder(WidgetId id, FileDialogGuiImpl.Folder parent, java.lang.String text, java.lang.String path, java.lang.String icon, int indent)
id
- The widget's ID.parent
- The parent folder. null
if node is the root.text
- The string to be used as the button text.path
- The absolute path of the folder.icon
- The image to be displayed.indent
- The indentation of image and text.public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class ButtonGuiImpl
boolean isRoot()
true
if this is the root of the tree.int computePreferredWidth()
FileDialogGuiImpl.Folder lookup(java.lang.String child)
child
- The Folder
to search.Folder
or null
if not found.protected void handleBasicEvents(KeyInput event)
handleBasicEvents
in class ButtonGuiImpl
event
- Key event to process.private void collapse()
public void mouseClicked(java.awt.event.MouseEvent e)
doubleClick
if double click is
detected and expand the folder in this case. If the user clicks on expand area
[+]
, the folder will be expanded or collapsed.mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class ButtonGuiImpl
e
- The mouse event.public java.lang.String toString()
toString
in class ButtonGuiImpl