marimba.gui
Class DropDownTextBoxWidget

java.lang.Object
  |
  +--marimba.gui.Widget
        |
        +--marimba.gui.TextWidget
              |
              +--marimba.gui.TextBoxWidget
                    |
                    +--marimba.gui.DropDownTextBoxWidget
All Implemented Interfaces:
CutNPaste, java.awt.image.ImageObserver, PropertyObject, TimerClient, WidgetConstants
Direct Known Subclasses:
FlatDDTextBoxWidget

public class DropDownTextBoxWidget
extends TextBoxWidget

A text widget with an associated pull down menu which has to be used by other widgets and cannot be used standalone.

Version:
1.32, 12/12/97
Author:
Klaas Waslander

Field Summary
 int align
          Should the down arrowbutton be displayed at the left or the right.
 boolean down
          Determines whether the menu is being displayed right now.
 boolean editingText
          This is set to true when the user tries to enter something, meaning that no further key lookups are to take place.
 boolean fillButton
          If true, the dropdown button will be filled.
protected static int SIZ
           
 
Fields inherited from class marimba.gui.TextBoxWidget
alignOptions, caretPos, caretVisible, echoCharacter, keyDisplay, keyString, lastLocale, len, mouseDownFocus, savetext, scrollx, selDepth, selEnd, selPos, selStart, shadowColor, style, styleOptions, text, textColor
 
Fields inherited from class marimba.gui.Widget
adapter, background, clazz, defaultBackground, defaultFont, defaultForeground, defaultHilite, directGraphics, disabled, east, editor, focus, font, foreground, height, hilite, layoutMgr, name, north, nwidgets, parent, script, south, tip, transparent, tx, ty, valid, visible, wBackground, west, wFont, wForeground, wHilite, widgets, width, wScript, wTip, x, y
 
Fields inherited from interface marimba.gui.WidgetConstants
ALWAYS, ANYWHERE, APPLET, ASCENDING, BLINK, BLUE, BONGO_EVENT, BOTH, BOTTOM, BOXED, BUTTON, CENTER, CHAR, CHECK, COLLAPSE_EVENT, CONTENT, DESCENDING, DETACHED, DIAGONAL, DOWN, DRAG, EXCLUSIVE, EXPAND_EVENT, FILL, FILLED, GREEN, HORIZONTAL, INSIDE, INVISIBLE, JAVA_VERSION, JAVAOS, JDK10, JDK11, LAYERS, LEFT, LOWERED, MAC, MULTIPLE, NETCASTER, NETSCAPE, NEVER, NONE, NT, OPTIONAL, OS_ARCH, OS_NAME, OS_VERSION, OUTLINE, PAGE_DOWN, PAGE_EVENT, PAGE_UP, PATTERN, PC, PICTURE, PLAIN, PROPORTIONAL, RADIO, RAISED, RED, REST_EVENT, RIGHT, ROUNDED, SCALE, SCROLLBAR, SCROLLING, SOLID, SQUARE, TEXT_CHANGED_EVENT, TOP, TOPLEFT, TRUNCATE, UNDERLINE, UNIX, UP, VERTICAL, WAKE_EVENT, WIN95, WINDOWS, WORD
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DropDownTextBoxWidget()
          Constructor.
 
Method Summary
 void action()
          Forward actions to parent.
protected  boolean eventInText(java.awt.Event evt)
          Event is not in the text area when it is on the button.
 boolean focusInterest()
          Support for input focus, when it is NOT editable too!
 int getAlign()
          Get the current alignment.
 boolean getFillButton()
          Check whether the dropdown button is being filled.
 java.awt.Dimension getPreferredSize()
          Get the preferred size of URL text widgets.
 void getProperties(PropertyList list)
          Get the properties of the dropdown textbox.
 boolean handleEvent(java.awt.Event evt)
          Handle mouse and character events.
 boolean isDown()
          Check whether the DropDownTextBox is down.
 int leftMargin()
          Get the Left Margin.
 void paint(java.awt.Graphics g, int cx, int cy, int cw, int ch)
          Paint the text in the correct foreground color.
 void paintBackground(java.awt.Graphics g, int cx, int cy, int cw, int ch)
          Paint the menu button too.
protected  void repaintText()
          Only repaint the content of the textbox, do not repaint the arrow buton.
 int rightMargin()
          Get the Right Margin
 void setAlign(int align)
          Set alignment.
 void setDown(boolean down)
          Set whether or not the DropDown is down.
 void setFillButton(boolean fillButton)
          Set whether or not to fill the button.
 void setProperties(PropertyList list)
          Set the properties of the dropdown textbox.
 void setStyle(int style)
          Set the style of this widget the same as in the super class, but adjust the transparent boolean.
 
Methods inherited from class marimba.gui.TextBoxWidget
applyProperties, clearSelection, copyText, cutText, delete, focus, getAlignOptions, getEchoCharacter, getEditor, getLength, getSavetext, getSelected, getSelEnd, getSelStart, getShadowColor, getStyle, getStyleOptions, getText, getTextChars, inheritForeground, initAll, insert, insert, nextWordPos, paintBackground, pasteText, previousWordPos, select, setEchoCharacter, setForeground, setSavetext, setShadowColor, setText, tick, x2pos
 
Methods inherited from class marimba.gui.TextWidget
append, append, clear, getStringValue, getValue, isEditable, isKeyLookup, isWord, select, select, selectAll, setEditable, setKeyLookup, setValue
 
Methods inherited from class marimba.gui.Widget
action, add, add, adjustFont, adjustFont, audioLoop, audioLoop, audioPlay, audioPlay, audioStop, audioStop, bounds, clearFocus, clearPopups, clone, contains, contains, createImage, createImage, currentFocus, destroy, disable, disable, enable, findWidget, firstFocus, getAudioClip, getAudioClipAt, getBackground, getBounds, getCancelButton, getChildProperties, getCursor, getDefaultButton, getDescription, getEncoding, getFocusColor, getFont, getFontMetrics, getForeground, getHilite, getImage, getKey, getKey, getKey, getLayoutMgr, getLocale, getLocation, getName, getParent, getPlayerFrame, getPlayerPanel, getPresentation, getSelBackground, getSelFocusColor, getSelForeground, getSize, getText, getTip, getTip, getTipFont, getValue, getWidget, getWidgetAt, getWidgetAt, getWidgetClass, getWidgetsAt, getWidgetsAt, getWidgetsAt, gotFocus, gotoPage, gotoPage, hasFocus, hide, imageUpdate, inheritFont, init, inside, inside, invalidate, isDisabled, isShowing, isTransparent, isVisible, keyDown, keyUp, layout, list, list, locateWidget, locateWidgets, locateWidgets, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, overlap, paint, paintAll, paramString, postEvent, previousFocus, remove, remove, remove, removeAll, repaint, repaint, repaint, repaint, repaintParent, replace, replace, replace, requestFocus, resetCursor, reshape, reshape, resize, resize, rmove, rscroll, scroll, setAttach, setBackground, setBounds, setBounds, setCursor, setDisabled, setEditor, setEncoding, setFont, setHilite, setLayoutMgr, setLocale, setLocation, setName, setSize, setSize, setText, setTip, setTipFont, setTransparent, setValue, setVisible, show, show, size, start, stop, sync, toBack, toBack, toFront, toFront, toString, update, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZ

protected static final int SIZ

align

public int align
Should the down arrowbutton be displayed at the left or the right.
See Also:
getAlign(), setAlign(int)

down

public boolean down
Determines whether the menu is being displayed right now.
See Also:
isDown(), setDown(boolean)

fillButton

public boolean fillButton
If true, the dropdown button will be filled.
See Also:
getFillButton(), setFillButton(boolean)

editingText

public boolean editingText
This is set to true when the user tries to enter something, meaning that no further key lookups are to take place. It is set to false when the user selects something else.
Constructor Detail

DropDownTextBoxWidget

public DropDownTextBoxWidget()
Constructor.
Method Detail

getProperties

public void getProperties(PropertyList list)
Get the properties of the dropdown textbox.
Overrides:
getProperties in class TextBoxWidget
Following copied from class: marimba.gui.Widget
Parameters:
list - The list in which the current state needs to be saved.
See Also:
Widget.setProperties(PropertyList)

setProperties

public void setProperties(PropertyList list)
Set the properties of the dropdown textbox.
Overrides:
setProperties in class TextBoxWidget
Following copied from class: marimba.gui.Widget
Parameters:
list - The list that contains the new widget state.
See Also:
Widget.getProperties(PropertyList)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Get the preferred size of URL text widgets.
Overrides:
getPreferredSize in class TextBoxWidget

isDown

public boolean isDown()
Check whether the DropDownTextBox is down.
See Also:
down

setDown

public void setDown(boolean down)
Set whether or not the DropDown is down.
See Also:
down

getAlign

public int getAlign()
Get the current alignment.
Overrides:
getAlign in class TextBoxWidget
See Also:
align

setAlign

public void setAlign(int align)
Set alignment.
Overrides:
setAlign in class TextBoxWidget
See Also:
align

getFillButton

public boolean getFillButton()
Check whether the dropdown button is being filled.
See Also:
fillButton

setFillButton

public void setFillButton(boolean fillButton)
Set whether or not to fill the button.
See Also:
fillButton

setStyle

public void setStyle(int style)
Set the style of this widget the same as in the super class, but adjust the transparent boolean.
Overrides:
setStyle in class TextBoxWidget
See Also:
TextBoxWidget.style

leftMargin

public int leftMargin()
Get the Left Margin.
Overrides:
leftMargin in class TextBoxWidget
See Also:
rightMargin()

rightMargin

public int rightMargin()
Get the Right Margin
Overrides:
rightMargin in class TextBoxWidget
See Also:
leftMargin()

repaintText

protected void repaintText()
Only repaint the content of the textbox, do not repaint the arrow buton.
Overrides:
repaintText in class TextBoxWidget

paint

public void paint(java.awt.Graphics g,
                  int cx,
                  int cy,
                  int cw,
                  int ch)
Paint the text in the correct foreground color.
Overrides:
paint in class TextBoxWidget

paintBackground

public void paintBackground(java.awt.Graphics g,
                            int cx,
                            int cy,
                            int cw,
                            int ch)
Paint the menu button too.
Overrides:
paintBackground in class TextBoxWidget
See Also:
TextBoxWidget.paintBackground(java.awt.Graphics, int, int, int, int)

eventInText

protected boolean eventInText(java.awt.Event evt)
Event is not in the text area when it is on the button.
Overrides:
eventInText in class TextWidget

handleEvent

public boolean handleEvent(java.awt.Event evt)
Handle mouse and character events.
Overrides:
handleEvent in class TextBoxWidget
Following copied from class: marimba.gui.Widget
Parameters:
evt - the event that needs to be handled by the widget
See Also:
Widget.postEvent(java.awt.Event)

action

public void action()
Forward actions to parent.
Overrides:
action in class TextBoxWidget

focusInterest

public boolean focusInterest()
Support for input focus, when it is NOT editable too!
Overrides:
focusInterest in class TextWidget
Following copied from class: marimba.gui.Widget
See Also:
Widget.focus, Widget.requestFocus()