public abstract class FileThumb extends ButtonGuiImpl
ButtonGuiImpl.Images| Modifier and Type | Field and Description |
|---|---|
protected java.nio.file.attribute.FileTime |
created
Cached file/folder creation timestamp.
|
private boolean |
doubleClick
Flag for a double-click event.
|
private java.lang.String |
doubleClickCommand
The action to be performed when the thumbnail is double clicked.
|
protected long |
fileSize
Cached file/folder size.
|
protected ImageWrapper<java.awt.image.BufferedImage> |
img
The icon to be displayed.
|
private boolean |
isDir
Flags the thumbnails that represents directories.
|
protected java.nio.file.attribute.FileTime |
lastModified
Cached last modified timestamp.
|
private java.nio.file.Path |
path
The path this thumbnail represents.
|
private static FileThumb |
selected
The currently selected thumbnail.
|
cc, DOT_LINE_WIDTH, gd, gf, imgUpconfig, widgetFocusedinsets, location, LOG, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
FileThumb(WidgetId id,
ButtonConfig cfg,
java.nio.file.Path path,
java.lang.String image,
boolean isDir,
java.lang.String click2Command)
Constructor used to create component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clearSelection()
Clears the selection flag.
|
void |
draw()
Draw the thumbnail.
|
protected abstract void |
drawForeground(int width,
int height,
Theme theme)
Draws the text and icon on this thumbnail.
|
(package private) java.lang.String |
getDoubleClickCommand()
Retrieves the action to be performed when the thumbnail is double clicked.
|
protected abstract NativeDimension |
getEditorDimension()
Obtain the dimension of the editor that when renaming this thumbnail.
|
protected abstract NativePoint |
getEditorLocation()
Obtain the physical location of the editor that when renaming this thumbnail.
|
ImageWrapper<java.awt.image.BufferedImage> |
getFileIcon()
Obtain the file icon, if set.
|
java.nio.file.Path |
getPath()
Obtain the path this thumbnail represents.
|
int |
getPreferredHeight()
Query the preferred height of this thumbnail.
|
int |
getPreferredWidth()
Query the preferred width of this thumbnail.
|
static FileThumb |
getSelected()
Query the currently selected thumbnail.
|
(package private) java.lang.String |
getTooltip()
Obtain the tooltip to be displayed when hovering this thumbnail.
|
protected void |
handleBasicEvents(KeyInput event)
Process basic events - key navigation event.
|
boolean |
isDir()
Checks whether this thumbnail represents a directory.
|
(package private) boolean |
isDoubleClick()
Check whether the mouse was double-clicked on this thumbnail.
|
boolean |
isSelected()
Checks if this thumbnail is selected.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
static void |
select(FileThumb ft)
Sets the selected thumb.
|
(package private) void |
setFileInfo(long fileSize,
java.nio.file.attribute.FileTime created,
java.nio.file.attribute.FileTime lastModified)
Sets information of the file that this thumbnail represents.
|
static void |
startRename(LineEditor rename)
Enter the rename mode for active thumbnail.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
afterConfigUpdate, createMnemonic, focusTraversable, getFontResolver, getImgDisabled, getImgDown, getImgUp, handleCursorKeys, height, highlighted, initialize, isAutoResize, isDefaultButton, isDroppable, isFocusable, isKeyPressed, isMnemonicSupported, isPressed, isResolverColorsUsed, loadImage, onFocusLost, physicalBounds, processEvent, processMnemonic, refresh, requestFocus, setActionCode, setColorResolver, setFontResolver, setImage, setImage, setResolverColorsUsed, setVisible, supportsCustomMousePointer, updateSize, widthisMouseOver, mouseActions, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleasedaddListener, checkKey, config, destroy, getColon, getColumnLabelText, getCommand, getLabelInstance, getLabelText, getMnemonic, getTo, initButtonText, isForceLabel, isNoLabels, isRightAligned, postprocessConfig, processKeyEvent, setCommand, setHidden, setLabelInstance, setMnemonic, setNoLabels, setSupportsMnemonic, setText, setTextLabel, setWasVisible, textLabel, wasVisibledimension, 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, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, findMouseSource, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, 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, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalDimensionInt, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, showPopupMenu, sync, topLevelWindow, translate, triggerLocationChanged, unrealize, unregisterWidgetListener, updateSizeWorker, updateSystemParent, widgetRealized, widgetStateChanged, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, defaultMousePtr, dimension, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isEnabled, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalDimension, physicalLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processFocusEvent, processKeyListeners, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, startTrigger, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, windowgetColumnMnemonic, getMnemonicCharacter, getMnemonicKeyCode, getMnemonicLabel, setColumnMnemonic, updateMnemonicprotected final ImageWrapper<java.awt.image.BufferedImage> img
protected long fileSize
protected java.nio.file.attribute.FileTime created
protected java.nio.file.attribute.FileTime lastModified
private final java.lang.String doubleClickCommand
private boolean doubleClick
private final boolean isDir
private final java.nio.file.Path path
private static FileThumb selected
FileThumb(WidgetId id, ButtonConfig cfg, java.nio.file.Path path, java.lang.String image, boolean isDir, java.lang.String click2Command)
id - The widget's ID.cfg - The widget's configuration.path - The path this thumbnail represents.image - The image to be displayed on the thumbnail.isDir - Flags the thumbnails that represents directories.click2Command - The action to be performed when the thumbnail is double clicked.public int getPreferredWidth()
public int getPreferredHeight()
public java.nio.file.Path getPath()
public void mouseClicked(java.awt.event.MouseEvent e)
doubleClick if double click is
detected.mouseClicked in interface java.awt.event.MouseListenermouseClicked in class ButtonGuiImple - The mouse event.public void draw()
drawForeground
for drawing the text/icon on the thumbnail.draw in interface Widget<GuiOutputManager>draw in class ButtonGuiImplprotected abstract void drawForeground(int width,
int height,
Theme theme)
width - The width of the widgetheight - The height of the widget.theme - The current theme.public boolean isSelected()
true if this thumbnail is selected.public static void clearSelection()
public static FileThumb getSelected()
public boolean isDir()
true if this thumbnail represents a directory.public ImageWrapper<java.awt.image.BufferedImage> getFileIcon()
public static void select(FileThumb ft)
ft - The new FileThumb to select. May be null to unselect.java.lang.String getDoubleClickCommand()
Note: this resets the doubleClick flag, so a subsequent call will return the simple
click command.
boolean isDoubleClick()
true if the mouse was double-clicked.void setFileInfo(long fileSize,
java.nio.file.attribute.FileTime created,
java.nio.file.attribute.FileTime lastModified)
fileSize - The file size.created - Creation timestamp.lastModified - The timestamp of last modification of the file.protected void handleBasicEvents(KeyInput event)
handleBasicEvents in class ButtonGuiImplevent - Key event to process.public java.lang.String toString()
toString in class ButtonGuiImpljava.lang.String getTooltip()
public static void startRename(LineEditor rename)
rename - The line editor that will be used for renaming.protected abstract NativeDimension getEditorDimension()
protected abstract NativePoint getEditorLocation()