ewe.ui
Class CardPanel

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.CardPanel
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, MultiPanel, TimerProc, UIConstants
Direct Known Subclasses:
ProgressAndControl

public class CardPanel
extends Container
implements MultiPanel

A CardPanel is a simple implementation of a MultiPanel and it provides no user controls for selecting an item to be displayed. It can be used as the main container for more complex MultiPanel implementations, such as a Tabbed Panel (see mTabbedPanel).


Field Summary
 boolean autoScroll
          If this is true, then the items are placed in ScrollBarPanels before being added to the MultiPanel.
 Vector cards
          The cards.
 boolean clearSipOnChange
          If this is set true, then when the displayed control is changed, the SIP will be turned off.
protected  Card curCard
          Focus on the first control on the active panel.
 boolean dontFocusOnNextSelect
          Set this true if you dont want the focus to move to the Card on the next select().
 Control focusOnHide
          If this is set to a control, then that control will gain the focus if a control within the card panel has the focus, and then the CardPanel is set such that no item is selected (using select(-1)), then the focusOnHide control will be given the focus.
protected  boolean gotSize
           
protected  boolean made
           
 int selectedItem
          The selected card, or -1 if none is selected.
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
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.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
CardPanel()
           
 
Method Summary
 Control addItem(Control item, String tabName, String longName)
          This adds a control to the MultiPanel with a specified short (Tab) name and optional long name.
protected  void calculateSizes()
          Override this to calculate the preferred, minimum and maximum size of your control.
protected  Card findCard(Control item, String tabName)
           
protected  Control getFirstFocus()
           
 Card getItem(Control item)
          This returns a Card object holding information about the item added for the specified control.
 Card getItem(int index)
          This returns a Card object holding information about the item added at the specified index.
 int getItemCount()
          This returns the number of items added to the MultiPanel.
 int getSelectedItem()
          This returns the index for the currently selected item.
 Iterator getSubControls()
           
 void make(boolean remake)
          This is used to "make" the control before being displayed.
protected  void select(Card who)
           
 void select(Control item)
          This selects for display one of the previously added Controls.
 void select(int index)
          This selects for display one of the previously added Controls, given the index of the item.
 void select(String tabName)
          This selects for display one of the previously added Controls, given the short (tab) name for the item.
protected  void selectAndPaint(Card c)
           
 void setRect(int x, int y, int width, int height)
           
 void shown()
           
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, addDirectly, containerHasFocus, dismantle, dismantle, doHotKey, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getNextKeyFocus, gotFocus, lostFocus, remove, removeAll, repaintDataNow, scrollToVisible, takeFocus, takePromptControl
 
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, doActionKey, doBackground, doBorder, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, 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, setServer, setTag, setTags, setText, setTextSize, setToolTip, show, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, 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
 

Field Detail

cards

public Vector cards
The cards.


selectedItem

public int selectedItem
The selected card, or -1 if none is selected.


autoScroll

public boolean autoScroll
If this is true, then the items are placed in ScrollBarPanels before being added to the MultiPanel.


focusOnHide

public Control focusOnHide
If this is set to a control, then that control will gain the focus if a control within the card panel has the focus, and then the CardPanel is set such that no item is selected (using select(-1)), then the focusOnHide control will be given the focus.


clearSipOnChange

public boolean clearSipOnChange
If this is set true, then when the displayed control is changed, the SIP will be turned off.


dontFocusOnNextSelect

public boolean dontFocusOnNextSelect
Set this true if you dont want the focus to move to the Card on the next select(). It is set back to false after each select() call.


curCard

protected Card curCard
Focus on the first control on the active panel.


made

protected boolean made

gotSize

protected boolean gotSize
Constructor Detail

CardPanel

public CardPanel()
Method Detail

getSelectedItem

public int getSelectedItem()
Description copied from interface: MultiPanel
This returns the index for the currently selected item. It will return -1 if none is currently selected.

Specified by:
getSelectedItem in interface MultiPanel

getSubControls

public Iterator getSubControls()
Overrides:
getSubControls in class Control

addItem

public Control addItem(Control item,
                       String tabName,
                       String longName)
Description copied from interface: MultiPanel
This adds a control to the MultiPanel with a specified short (Tab) name and optional long name. When an item is added a Card object is created to hold information about the item. The item to be added is first added to a CellPanel before being placed int the panel. It may be added in a ScrollableHolder or other such container before being added to the CellPanel.

Specified by:
addItem in interface MultiPanel

findCard

protected Card findCard(Control item,
                        String tabName)

getFirstFocus

protected Control getFirstFocus()
Overrides:
getFirstFocus in class Container

select

protected void select(Card who)

selectAndPaint

protected void selectAndPaint(Card c)

select

public void select(Control item)
Description copied from interface: MultiPanel
This selects for display one of the previously added Controls.

Specified by:
select in interface MultiPanel

select

public void select(String tabName)
Description copied from interface: MultiPanel
This selects for display one of the previously added Controls, given the short (tab) name for the item.

Specified by:
select in interface MultiPanel

select

public void select(int index)
Description copied from interface: MultiPanel
This selects for display one of the previously added Controls, given the index of the item.

Specified by:
select in interface MultiPanel

getItem

public Card getItem(int index)
Description copied from interface: MultiPanel
This returns a Card object holding information about the item added at the specified index.

Specified by:
getItem in interface MultiPanel

getItem

public Card getItem(Control item)
Description copied from interface: MultiPanel
This returns a Card object holding information about the item added for the specified control.

Specified by:
getItem in interface MultiPanel

getItemCount

public int getItemCount()
Description copied from interface: MultiPanel
This returns the number of items added to the MultiPanel.

Specified by:
getItemCount in interface MultiPanel

make

public void make(boolean remake)
Description copied from class: Control
This is used to "make" the control before being displayed. This is usually only overridden by containers.

Overrides:
make in class Control
Parameters:
remake - if this is true then you should do a full re-make.

shown

public void shown()
Overrides:
shown in class Control

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 Control

setRect

public void setRect(int x,
                    int y,
                    int width,
                    int height)
Overrides:
setRect in class Control