mWaba.gui
Class mControl

java.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Container
              |
              +--mWaba.gui.mControl
Direct Known Subclasses:
ButtonControl, CardPanel, ChoiceControl, mCanvas, MessageArea, mInput, mLabel, PullDownMenu, TrackControl

public class mControl
extends waba.ui.Container
implements TimerProc, CallBack, EventListener


Field Summary
 boolean _debug
           
static int AlwaysEnabled
           
static int AlwaysRecalculateSize
           
 waba.fx.Color backGround
           
 int borderWidth
           
static int CapturesPen
           
 int columns
           
static boolean debugGui
           
 int defaultAddMeCellConstraints
           
 int defaultAddMeControlConstraints
           
protected static int DidHoldDown
           
static int Disabled
           
static boolean doubleBuffer
           
static int doubleClickTime
           
protected  DragContext dragging
           
 int dragResolution
           
static int DrawFlat
           
protected static waba.fx.Rect emptySize
           
static boolean firstPress
           
 waba.fx.Rect fixedPreferredSize
           
 waba.fx.Rect fixedSize
           
static int ForceResize
           
 waba.fx.Color foreGround
           
static boolean globalDrawFlat
           
static boolean globalEditable
           
static boolean globalEnabled
           
static boolean globalSmallControls
           
protected static int GotPenDown
           
static int GotPreferredSize
           
static int holdDownPause
           
static int holdTick
           
static int ImageChanged
           
static int Invisible
           
static int KeepImage
           
protected  mVector kids
           
protected  Vector listeners
           
 int modifiers
           
 waba.fx.Font myFont
           
protected  mFrame myFrame
           
static int NoFocus
           
static int NotAnEditor
           
static int NotEditable
           
static int PenTransparent
           
 waba.fx.Rect preferredSize
           
static int PreferredSizeOnly
           
 Point pressPoint
           
 java.lang.String prompt
           
static int SendUpKeyEvents
           
static int SendUpPenEvents
           
static int ShrinkToNothing
           
static int SmallControl
           
static int SpecialBackground
           
static int TakeControlEvents
           
 java.lang.String text
           
static int Transparent
           
static int WantDrag
           
static int WantHoldDown
           
 
Fields inherited from class waba.ui.Container
children, numChildren, tail
 
Fields inherited from class waba.ui.Control
height, next, parent, width, x, y
 
Constructor Summary
mControl()
           
 
Method Summary
 void add(waba.ui.Control c)
           
 void addListener(EventListener list)
           
 void addToFront(mControl c)
           
static boolean amFlat(waba.ui.Control who)
           
 boolean amOnTopFrame()
           
static boolean amSmall(waba.ui.Control who)
           
protected  void calculatePreferredSize()
           
 void callBack(java.lang.Object data)
           
protected static boolean checkHasModifier(waba.ui.Control who, int what, boolean shouldInherit, boolean defaultValue)
           
 boolean checkPenTransparent(waba.ui.PenEvent ev)
           
static void consume(waba.ui.Event ev)
           
 boolean contains(waba.ui.Control who)
           
 void doBackground(waba.fx.Graphics g)
           
 void doBorder(waba.fx.Graphics g)
           
 void doPaint(waba.fx.Graphics g, waba.fx.Rect r)
           
 void doPaintChildren(waba.fx.Graphics g, int x, int y, int w, int h)
           
 void doPaintData(waba.fx.Graphics g)
           
 void dragged(DragContext dc)
           
static boolean editable(waba.ui.Control who)
           
static boolean enabled(waba.ui.Control who)
           
 void fixSizeAt(int width, int height)
           
 waba.fx.Color getBackground()
           
 waba.ui.Control getChildren()
           
 Enumeration getChildren(int direction)
           
 waba.fx.Image getControlBuffer()
           
 waba.fx.Image getControlBuffer(waba.fx.Rect _rect)
           
 waba.fx.Rect getDim()
           
 waba.fx.Font getFont()
           
 waba.fx.FontMetrics getFontMetrics()
           
 waba.fx.Color getForeground()
           
 mFrame getFrame()
           
 waba.ui.Container getFrameOrContainer()
           
 waba.fx.Graphics getGraphics()
           
 waba.ui.Control getNext()
           
 Point getPosInFrame()
           
 waba.fx.Rect getPreferredSize()
           
 waba.fx.ISurface getSurface()
           
 void gotFocus()
           
 void handedPenEvent(waba.ui.PenEvent ev)
           
 void handOffPenEvent(waba.ui.Control toWho, int type, Point whereOnMe)
           
 void handOffPenEvent(waba.ui.Control toWho, waba.ui.PenEvent pe)
           
 boolean hasModifier(int what, boolean shouldInherit)
           
 void inheritModifiers(mControl fromWho, int what, boolean setChildren)
           
protected  boolean isOnMe(Point p)
           
 void lostFocus()
           
 void make()
          This is called when the component has been added and therefore about to be shown on the screen.
 void makeFrameTopMost()
           
 java.lang.Object modify(int flagsToSet, int flagsToClear)
           
 void modifyAll(int set, int clear)
           
 void modifyAll(int set, int clear, boolean doThisOne)
           
 void notifyAction()
           
 void onControlEvent(waba.ui.ControlEvent ev)
           
 void onEvent(waba.ui.Event ev)
           
 void onKeyEvent(waba.ui.KeyEvent ev)
           
 void onLabelPenEvent(waba.ui.PenEvent ev)
           
 void onPaint(waba.fx.Graphics gr)
           
 void onPenEvent(waba.ui.PenEvent ev)
           
 void paintBackground(waba.fx.Graphics g)
           
 void paintChildren(waba.fx.Graphics gr, int x, int y, int w, int h)
           
 void penClicked(Point p)
           
 void penDoubleClicked(Point p)
           
 void penHeld(Point p)
           
 void penPressed(Point p)
           
 void penReleased(Point p)
           
 void postEvent(waba.ui.Event ev)
           
 waba.fx.Rect recalculateSize()
           
 void redisplay()
           
 void reduceClip(waba.fx.Graphics g, waba.fx.Rect r)
           
 void remove(waba.ui.Control c)
           
 void removeListener(EventListener list)
           
 void repaint()
          This is overidden to get rid of to many repaint() calls in the base Waba implementation.
 void repaintDataNow()
           
 void repaintNow()
           
 void repaintNow(waba.fx.Graphics gr, waba.fx.Rect where)
           
 void requestCallBack(java.lang.Object data)
           
 void requestResizeTo(int width, int height)
          This requests that the size be changed to the following dimensions but the control is free to ignore it or to change to a different value.
 void resetRect()
           
 void resizeTo(int width, int height)
          This will change the _rect.width and _rect.height values.
 void restore(java.lang.Object old)
           
 void sendToListeners(waba.ui.Event ev)
           
 java.lang.Object set(int flag, boolean status)
           
 void setNext(waba.ui.Control c)
           
 void setParent(waba.ui.Container p)
           
 void setRect(int x, int y, int width, int height)
           
 void show(waba.fx.Rect where)
           
 void shown()
           
 void startDragging(DragContext dc)
           
 void stopDragging(DragContext dc)
           
 void ticked(int id, int howLate)
           
static boolean visible(waba.ui.Control who)
           
 
Methods inherited from class waba.ui.Container
findChild
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getMainWindow, getParent, getRect, removeTimer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Disabled

public static final int Disabled

NotEditable

public static final int NotEditable

Invisible

public static final int Invisible

PreferredSizeOnly

public static final int PreferredSizeOnly

NoFocus

public static final int NoFocus

NotAnEditor

public static final int NotAnEditor

AlwaysEnabled

public static final int AlwaysEnabled

CapturesPen

public static final int CapturesPen

WantHoldDown

public static final int WantHoldDown

WantDrag

public static final int WantDrag

GotPenDown

protected static final int GotPenDown

DidHoldDown

protected static final int DidHoldDown

DrawFlat

public static final int DrawFlat

TakeControlEvents

public static final int TakeControlEvents

SpecialBackground

public static final int SpecialBackground

ShrinkToNothing

public static final int ShrinkToNothing

SmallControl

public static final int SmallControl

GotPreferredSize

public static final int GotPreferredSize

ForceResize

public static final int ForceResize

AlwaysRecalculateSize

public static final int AlwaysRecalculateSize

SendUpPenEvents

public static final int SendUpPenEvents

SendUpKeyEvents

public static final int SendUpKeyEvents

PenTransparent

public static final int PenTransparent

KeepImage

public static final int KeepImage

Transparent

public static final int Transparent

ImageChanged

public static final int ImageChanged

doubleBuffer

public static boolean doubleBuffer

modifiers

public int modifiers

_debug

public boolean _debug

text

public java.lang.String text

prompt

public java.lang.String prompt

defaultAddMeCellConstraints

public int defaultAddMeCellConstraints

defaultAddMeControlConstraints

public int defaultAddMeControlConstraints

backGround

public waba.fx.Color backGround

foreGround

public waba.fx.Color foreGround

dragResolution

public int dragResolution

columns

public int columns

borderWidth

public int borderWidth

globalEnabled

public static boolean globalEnabled

globalEditable

public static boolean globalEditable

debugGui

public static boolean debugGui

globalDrawFlat

public static boolean globalDrawFlat

globalSmallControls

public static boolean globalSmallControls

listeners

protected Vector listeners

fixedSize

public waba.fx.Rect fixedSize

fixedPreferredSize

public waba.fx.Rect fixedPreferredSize

preferredSize

public waba.fx.Rect preferredSize

emptySize

protected static waba.fx.Rect emptySize

myFont

public waba.fx.Font myFont

myFrame

protected mFrame myFrame

doubleClickTime

public static int doubleClickTime

holdDownPause

public static int holdDownPause

holdTick

public static int holdTick

dragging

protected DragContext dragging

pressPoint

public Point pressPoint

firstPress

public static boolean firstPress

kids

protected mVector kids
Constructor Detail

mControl

public mControl()
Method Detail

set

public final java.lang.Object set(int flag,
                                  boolean status)

modify

public java.lang.Object modify(int flagsToSet,
                               int flagsToClear)

restore

public void restore(java.lang.Object old)

hasModifier

public boolean hasModifier(int what,
                           boolean shouldInherit)

inheritModifiers

public final void inheritModifiers(mControl fromWho,
                                   int what,
                                   boolean setChildren)

addListener

public void addListener(EventListener list)

removeListener

public void removeListener(EventListener list)

sendToListeners

public void sendToListeners(waba.ui.Event ev)

postEvent

public void postEvent(waba.ui.Event ev)
Overrides:
postEvent in class waba.ui.Control

getControlBuffer

public waba.fx.Image getControlBuffer(waba.fx.Rect _rect)

getControlBuffer

public waba.fx.Image getControlBuffer()

setNext

public void setNext(waba.ui.Control c)

setParent

public void setParent(waba.ui.Container p)

getNext

public waba.ui.Control getNext()
Overrides:
getNext in class waba.ui.Control

getChildren

public waba.ui.Control getChildren()

remove

public void remove(waba.ui.Control c)
Overrides:
remove in class waba.ui.Container

modifyAll

public void modifyAll(int set,
                      int clear)

modifyAll

public void modifyAll(int set,
                      int clear,
                      boolean doThisOne)

recalculateSize

public final waba.fx.Rect recalculateSize()

getPreferredSize

public final waba.fx.Rect getPreferredSize()

calculatePreferredSize

protected void calculatePreferredSize()

fixSizeAt

public final void fixSizeAt(int width,
                            int height)

resizeTo

public void resizeTo(int width,
                     int height)
This will change the _rect.width and _rect.height values.

redisplay

public void redisplay()

requestResizeTo

public void requestResizeTo(int width,
                            int height)
This requests that the size be changed to the following dimensions but the control is free to ignore it or to change to a different value.

setRect

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

make

public void make()
This is called when the component has been added and therefore about to be shown on the screen.

getFontMetrics

public waba.fx.FontMetrics getFontMetrics()

getFont

public waba.fx.Font getFont()

getBackground

public waba.fx.Color getBackground()

getForeground

public waba.fx.Color getForeground()

doBorder

public void doBorder(waba.fx.Graphics g)

doPaint

public void doPaint(waba.fx.Graphics g,
                    waba.fx.Rect r)

getSurface

public waba.fx.ISurface getSurface()

getFrame

public mFrame getFrame()

getFrameOrContainer

public waba.ui.Container getFrameOrContainer()

amOnTopFrame

public boolean amOnTopFrame()

getPosInFrame

public Point getPosInFrame()

getGraphics

public waba.fx.Graphics getGraphics()

reduceClip

public void reduceClip(waba.fx.Graphics g,
                       waba.fx.Rect r)

contains

public boolean contains(waba.ui.Control who)

onControlEvent

public void onControlEvent(waba.ui.ControlEvent ev)

onEvent

public void onEvent(waba.ui.Event ev)
Specified by:
onEvent in interface EventListener
Overrides:
onEvent in class waba.ui.Control

ticked

public void ticked(int id,
                   int howLate)
Specified by:
ticked in interface TimerProc

gotFocus

public void gotFocus()

lostFocus

public void lostFocus()

onKeyEvent

public void onKeyEvent(waba.ui.KeyEvent ev)

handOffPenEvent

public void handOffPenEvent(waba.ui.Control toWho,
                            int type,
                            Point whereOnMe)

handOffPenEvent

public void handOffPenEvent(waba.ui.Control toWho,
                            waba.ui.PenEvent pe)

handedPenEvent

public void handedPenEvent(waba.ui.PenEvent ev)

checkPenTransparent

public boolean checkPenTransparent(waba.ui.PenEvent ev)

onPenEvent

public void onPenEvent(waba.ui.PenEvent ev)

isOnMe

protected boolean isOnMe(Point p)

penPressed

public void penPressed(Point p)

penHeld

public void penHeld(Point p)

penReleased

public void penReleased(Point p)

penClicked

public void penClicked(Point p)

penDoubleClicked

public void penDoubleClicked(Point p)

startDragging

public void startDragging(DragContext dc)

stopDragging

public void stopDragging(DragContext dc)

dragged

public void dragged(DragContext dc)

repaintDataNow

public void repaintDataNow()

doPaintData

public void doPaintData(waba.fx.Graphics g)

repaintNow

public void repaintNow()

repaintNow

public void repaintNow(waba.fx.Graphics gr,
                       waba.fx.Rect where)

onPaint

public void onPaint(waba.fx.Graphics gr)
Overrides:
onPaint in class waba.ui.Control

getChildren

public Enumeration getChildren(int direction)

resetRect

public void resetRect()

makeFrameTopMost

public void makeFrameTopMost()

add

public void add(waba.ui.Control c)
Overrides:
add in class waba.ui.Container

addToFront

public void addToFront(mControl c)

show

public void show(waba.fx.Rect where)

shown

public void shown()

doPaintChildren

public void doPaintChildren(waba.fx.Graphics g,
                            int x,
                            int y,
                            int w,
                            int h)

paintChildren

public void paintChildren(waba.fx.Graphics gr,
                          int x,
                          int y,
                          int w,
                          int h)
Overrides:
paintChildren in class waba.ui.Container

paintBackground

public void paintBackground(waba.fx.Graphics g)

doBackground

public void doBackground(waba.fx.Graphics g)

notifyAction

public void notifyAction()

getDim

public waba.fx.Rect getDim()

requestCallBack

public void requestCallBack(java.lang.Object data)

callBack

public void callBack(java.lang.Object data)
Specified by:
callBack in interface CallBack

onLabelPenEvent

public void onLabelPenEvent(waba.ui.PenEvent ev)

checkHasModifier

protected static boolean checkHasModifier(waba.ui.Control who,
                                          int what,
                                          boolean shouldInherit,
                                          boolean defaultValue)

enabled

public static boolean enabled(waba.ui.Control who)

editable

public static boolean editable(waba.ui.Control who)

visible

public static boolean visible(waba.ui.Control who)

amFlat

public static boolean amFlat(waba.ui.Control who)

amSmall

public static boolean amSmall(waba.ui.Control who)

repaint

public void repaint()
This is overidden to get rid of to many repaint() calls in the base Waba implementation. It actually does nothing at all. To repaint an mControl call one of the repaintNow() methods.
Overrides:
repaint in class waba.ui.Control

consume

public static void consume(waba.ui.Event ev)