ewe.ui
Class mList

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.ChoiceControl
              extended byewe.ui.Menu
                  extended byewe.ui.BasicList
                      extended byewe.ui.mList
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, IndexSelectable, Intable, IScroll, ISimpleList, ScrollClient, Selectable, TimerProc, UIConstants

public class mList
extends BasicList
implements ScrollClient, Selectable


Field Summary
 
Fields inherited from class ewe.ui.BasicList
amScrolling, multiSelect, OPTION_CURSOR_EXIT_DOWN, OPTION_CURSOR_EXIT_LEFT, OPTION_CURSOR_EXIT_RIGHT, OPTION_CURSOR_EXIT_UP, OPTION_SELECT_FIRST_ON_KEY_FOCUS, options, penSelectMode
 
Fields inherited from class ewe.ui.Menu
autoSelectFirst, border3D, defaultBackground, defaultUseScrollBarSize, dontSearchForKeys, followPen, keepFrame, myFrame, parentMenu, popupController, pressedItem, use3DPopup, useScrollBarSize, wasSelected
 
Fields inherited from class ewe.ui.ChoiceControl
blockColor, blockSelected, calculateWidth, clipBuffer, container, dimRect, displayRows, dontAutoScroll, dropDownButton, dummyItem, firstItem, INDENT_ITEM_FLAG, indentDropItems, innerRect, isAList, isSingleLine, itemHeight, items, newClip, notifyDataChangeOnSelect, noWrapAround, selectedIndex, shortenItems, spacing, useMenuItems, xOffset, xShift
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.IScroll
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
mList(int rows, int columns, boolean multi)
           
 
Method Summary
 MenuItem addItem(String what)
           
protected  void calculateSizes()
          Override this to calculate the preferred, minimum and maximum size of your control.
 int countSelectedIndexes()
          Returns the number of items that are currently selected.
 boolean deleteSelection()
           
protected  void doPaintData(Graphics gr)
          Repaint the "data" part of the Control.
 Object getListItem(int index)
          Get the Object at the list index.
 Object[] getListItems()
          Get all the list items.
 ScrollablePanel getScrollablePanel()
           
 int getSelectedIndex(int selectedIndexIndex)
          This returns one of the selected index.
 int[] getSelectedIndexes()
          Get a list of all the currently selected items as an array of indexes.
 Object getSelection()
           
 boolean hasSelection()
           
 boolean isSelected(int index)
          Checks if an item is selected.
 boolean noSelection()
           
protected  void paintBox(Graphics g)
           
 void postEvent(Event ev)
           
 boolean replaceSelection(Object clipboard)
           
 void selectAll(boolean select)
          Use this to clear the selection or to select all the items.
 void selectItem(int index, boolean selected)
           
 void selectItem(String label)
           
 void setListItems(Object[] items)
          Set the list items.
 void setSelectedIndexes(int[] indexes)
          Set which indexes should be selected.
 
Methods inherited from class ewe.ui.BasicList
allowNotOnMeSelection, countListItems, dragged, gotFocus, onKeyEvent, penClicked, penDoubleClicked, penPressed, penReleased, pressedNewSelected, releasedOnNothing, selectAndView
 
Methods inherited from class ewe.ui.Menu
canGo, canScreenScroll, close, doActionKey, doDropMenu, doMenu, doScroll, exec, getActual, getCarrierFrame, getCarrierFrame, getCurrent, getItemRect, getMenuWidth, getTextRect, getVisible, needScrollBar, noMenu, onEvent, onPenEvent, postEventNormally, selectNewItem, trySubMenu, updateItems, whichItem
 
Methods inherited from class ewe.ui.ChoiceControl
addItem, addItems, addSection, centerSelected, changeItem, changeModifiers, checkOnlyOne, deleteItem, doPaint, findItem, findKeyed, getBlockColor, getDataRect, getDisplayRows, getDisplayString, getInt, getItemAt, getItemHeight, getItemToAdd, getMenuHeight, getMenuWidth, getScreenRows, getSelectedItem, getText, indexOf, insertItemAt, itemIsVisible, itemsSize, make, makeItemVisible, makeVisible, modifyItems, notifySelection, paintItem, paintItem, refresh, removeAll, repaintItem, select, select, selectItems, selectNext, selectOrUnselect, selectPrev, setData, setInt, setText, trySelectItem
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doBackground, doBorder, doHotKey, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doShowMenu, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getNextKeyFocus, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, lostFocus, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onLabelPenEvent, onPaint, paintBackground, paintChildren, penHeld, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, recalculatePreferredSize, redisplay, removeListener, removeTimer, repaint, repaintDataNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, resizeTo, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFocus, takeFromClipboard, takePromptControl, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 
Methods inherited from interface ewe.ui.ScrollClient
canGo, doScroll, getActual, getCurrent, getServer, getVisible, needScrollBar, setServer
 
Methods inherited from interface ewe.data.ISimpleList
itemIsVisible, makeItemVisible, updateItems
 
Methods inherited from interface ewe.data.IndexSelectable
select
 

Constructor Detail

mList

public mList(int rows,
             int columns,
             boolean multi)
Method Detail

isSelected

public boolean isSelected(int index)
Description copied from interface: IndexSelectable
Checks if an item is selected.

Specified by:
isSelected in interface IndexSelectable
Specified by:
isSelected in class BasicList

selectItem

public void selectItem(String label)
Overrides:
selectItem in class ChoiceControl

selectItem

public void selectItem(int index,
                       boolean selected)
Overrides:
selectItem in class ChoiceControl

postEvent

public void postEvent(Event ev)
Overrides:
postEvent in class Menu

paintBox

protected void paintBox(Graphics g)
Overrides:
paintBox in class ChoiceControl

calculateSizes

protected void calculateSizes()
Description copied from class: Control
Override this to calculate the preferred, minimum and maximum size of your control. This is only called once unless the modifier flag AlwaysRecalculateSizes is true. During the calculation you will set the variables preferredWidth, preferredHeight, etc. directly.

Overrides:
calculateSizes in class BasicList

getScrollablePanel

public ScrollablePanel getScrollablePanel()
Overrides:
getScrollablePanel in class BasicList

selectAll

public void selectAll(boolean select)
Use this to clear the selection or to select all the items.

Specified by:
selectAll in class BasicList

noSelection

public boolean noSelection()
Specified by:
noSelection in interface Selectable

hasSelection

public boolean hasSelection()
Specified by:
hasSelection in interface Selectable

deleteSelection

public boolean deleteSelection()
Specified by:
deleteSelection in interface Selectable

getSelection

public Object getSelection()
Specified by:
getSelection in interface Selectable

replaceSelection

public boolean replaceSelection(Object clipboard)
Specified by:
replaceSelection in interface Selectable

countSelectedIndexes

public int countSelectedIndexes()
Description copied from interface: IndexSelectable
Returns the number of items that are currently selected.

Specified by:
countSelectedIndexes in interface IndexSelectable
Overrides:
countSelectedIndexes in class BasicList

getSelectedIndexes

public int[] getSelectedIndexes()
Description copied from interface: IndexSelectable
Get a list of all the currently selected items as an array of indexes. If no items are selected this will return an integer array with zero elements.

Specified by:
getSelectedIndexes in interface IndexSelectable
Specified by:
getSelectedIndexes in class BasicList

getSelectedIndex

public int getSelectedIndex(int selectedIndexIndex)
Description copied from interface: IndexSelectable
This returns one of the selected index. Say a list has items 2, 5 and 11 selected. Then calling countSelectedIndexes() will return a value of 3 - indicating 3 items are selected. Calling this method with indexOfSelectedIndex being 0 will return the value 2 which is the index of the first selected item. Calling this method with indexOfSelectedIndex being 1 will return the value 5 and calling with a parameter of 2 will return the value 11.

Specified by:
getSelectedIndex in interface IndexSelectable
Specified by:
getSelectedIndex in class BasicList

addItem

public MenuItem addItem(String what)

setSelectedIndexes

public void setSelectedIndexes(int[] indexes)
Description copied from interface: IndexSelectable
Set which indexes should be selected. Any items not in this array will be deselected if they are currently selected. So if you call this with an int array of zero elements, this will have the effect of deselecting all indexes.

Specified by:
setSelectedIndexes in interface IndexSelectable
Specified by:
setSelectedIndexes in class BasicList

doPaintData

protected void doPaintData(Graphics gr)
Description copied from class: Control
Repaint the "data" part of the Control. This is only used for Controls with the HasData modifier. These are controls that distinguish between their data (e.g. contained text) and non-data (e.g. border) on-screen display.

Overrides:
doPaintData in class ChoiceControl

getListItems

public Object[] getListItems()
Description copied from interface: ISimpleList
Get all the list items.

Specified by:
getListItems in interface ISimpleList
Specified by:
getListItems in class BasicList

setListItems

public void setListItems(Object[] items)
Description copied from interface: ISimpleList
Set the list items.

Specified by:
setListItems in interface ISimpleList
Specified by:
setListItems in class BasicList

getListItem

public Object getListItem(int index)
Description copied from interface: ISimpleList
Get the Object at the list index.

Specified by:
getListItem in interface ISimpleList