public class DropDownGuiImpl extends DropDown<GuiOutputManager>
Modifier and Type | Field and Description |
---|---|
private boolean |
drawEnabled
Flag to conrol whether the drop-dow be painting or not.
|
private GuiDriver |
gd
Screen driver
|
static int |
INNER_LINES_MIN
Inner lines minimum.
|
list, scrollpane
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
DropDownGuiImpl(ComboBox<GuiOutputManager> parent)
Create a drop-down container based on the parent combo-box and it's
associated data model.
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Draw widget.
|
void |
enableDraw()
Enables drawing for this drop-down.
|
protected int |
fixVisibleRows(int visibleRows,
int listSize)
Get the combo-box GUI specific visible row adjust.
|
double |
height()
Get widget height.
|
void |
hide()
Hide this widget and remove it.
|
boolean |
isDisplayed()
Check if widget is displayed.
|
void |
processKeyEvent(KeyInput event)
Process key event.
|
Point |
screenLocation()
Determine the location of the drop-down, relative to the parent window.
|
void |
setEnabled(boolean enabled)
Enable/disable widget.
|
void |
setHeightAndPos(ComboBox<GuiOutputManager> parent,
ComboBoxModel<java.lang.String> model)
Calculate (and set) the height and position of the drop-down
container based on the parent combo-box and it's associated data
model.
|
void |
show()
Show widget.
|
double |
width()
Get widget width.
|
forceInitialSelection, getComboBox, getLegacyWidget, getList, getScrollPane, getSelectedIndex, getSelectedItem
drawInt
destroy, destroyWidgets, findMouseSource, focusTraversable, getWorkspaceSize, getZOrderClass, hasFocus, hasTitle, hasTitlebar, isModal, processEvent, setTitle, title, toString
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, prepareWidgets, prevFocus, reflectAncestorChange, reflectLocationChange, remove, removeContainerStateListener, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setTabItemList, setWidth, startSizeChange, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, hidden, highlighted, ignoreAction, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, config, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, hidden, highlighted, isCurrent, isDirectManipulable, isDroppable, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenPhysicalLocation, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, supportsCustomMousePointer, topLevelWindow, window
public static final int INNER_LINES_MIN
private boolean drawEnabled
private GuiDriver gd
public DropDownGuiImpl(ComboBox<GuiOutputManager> parent)
parent
- The combo-box object which calls this drop-down.public void setHeightAndPos(ComboBox<GuiOutputManager> parent, ComboBoxModel<java.lang.String> model)
Precedence order (in the following list the term "max-space" is the number of rows from the top of the containing combo-box's frame to the bottom of the screen) for vertical size:
1. If there is an inner-lines definition AND it is smaller than the max-space, then it is honored. 2. If the number of elements in the data model is less than the number of rows in the max-space, then the number of data model elements will determine the vertical size. 3. max-space is used otherwise.
The drop-down box X coordinate is always the same as the X coordinate of the parent combo-box in absolute screen units. For the Y coordinate, the following positioning algorithm is used:
1. If the height of the drop-down is less than or equal to the space between the bottom of the combo-box and the bottom of the screen, then the drop-down T coordinate will be set to the combo-box Y + 1. 2. Otherwise, the drop-down Y coordinate will equal the Y coordinate of the bottom of the screen minus the height of the drop-down. This will result in the drop-down ending at the bottom of the screen and starting at or above the combo-box Y coordinate BUT never above the top of the frame containing the combo-box (because of the previously constrained height calculation above).
setHeightAndPos
in class DropDown<GuiOutputManager>
parent
- The combo-box object which calls this drop-down.model
- The data model to be used within this drop-down list.public boolean isDisplayed()
isDisplayed
in interface Widget<GuiOutputManager>
isDisplayed
in class TitledWindow<GuiOutputManager>
true
if widget is displayed.public double height()
height
in interface Widget<GuiOutputManager>
height
in class AbstractContainer<GuiOutputManager>
public double width()
width
in interface Widget<GuiOutputManager>
width
in class AbstractContainer<GuiOutputManager>
public void show()
show
in interface Widget<GuiOutputManager>
show
in class TitledWindow<GuiOutputManager>
public void hide()
hide
in interface Widget<GuiOutputManager>
hide
in class DropDown<GuiOutputManager>
public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class OuterFrame<GuiOutputManager>
public void setEnabled(boolean enabled)
setEnabled
in interface Widget<GuiOutputManager>
setEnabled
in class AbstractWidget<GuiOutputManager>
enabled
- public void enableDraw()
public Point screenLocation()
screenLocation
in interface Widget<GuiOutputManager>
screenLocation
in class TitledWindow<GuiOutputManager>
public void processKeyEvent(KeyInput event)
processKeyEvent
in interface Widget<GuiOutputManager>
processKeyEvent
in class TitledWindow<GuiOutputManager>
event
- Key event to process.protected int fixVisibleRows(int visibleRows, int listSize)
fixVisibleRows
in class DropDown<GuiOutputManager>
visibleRows
- The visible rows value to check and modify.listSize
- The total size of the items in the list to handle.