marimba.gui
Class Widget

java.lang.Object
  |
  +--marimba.gui.Widget
All Implemented Interfaces:
java.awt.image.ImageObserver, PropertyObject, TimerClient, WidgetConstants
Direct Known Subclasses:
AnimatedWidget, AudioControlWidget, AWTWidget, ButtonWidget, CalendarWidget, ChoiceWidget, ClockWidget, ColorButtonWidget, ColorPickerWidget, ContainerWidget, FieldWidget, FileBrowserWidget, FontWidget, LabelWidget, ListItemWidget, PixelWidget, PopupMenuItemWidget, ResourceWidget, ShapeWidget, TextView, TextWidget, TriangleWidget, ValueWidget, WidgetMenuItem

public abstract class Widget
extends java.lang.Object
implements WidgetConstants, PropertyObject, java.awt.image.ImageObserver, TimerClient

A generic widget implementation. This is the base class for all widgets in the marimba.gui package.

Version:
1.194, 05/06/98
Author:
Arthur van Hoff
See Also:
WidgetConstants

Field Summary
 java.lang.String adapter
          The name of the adapter class for this widget if this widget requires one.
 java.awt.Color background
          The current background.
 byte[] clazz
          The binary representation of the class that constitutes this widget.
static java.awt.Color defaultBackground
          The default background color of the widget.
static java.awt.Font defaultFont
          The default font of the widget.
static java.awt.Color defaultForeground
          The default foreground color of the widget.
static java.awt.Color defaultHilite
          The default hilite color, used to fill certain areas to hide the background.
protected  boolean directGraphics
          If a widget is opaque and so its update method can be called, when directGraphics is true the update method is passed the screen graphics context.
 boolean disabled
          A disabled widget does not accept any user input.
 int east
          The number of pixels that the distance between the eatern side and this widget has to be.
 java.lang.Object editor
          The editor for inline editing.
 boolean focus
          When a widget has focus, a focus rectangle is usually drawn around it telling the user that keyboard input goes to that widget now.
 java.awt.Font font
          The current font.
 java.awt.Color foreground
          The current foreground.
 int height
          The height of this widget.
 java.awt.Color hilite
          The current hilite color.
 WidgetLayoutMgr layoutMgr
          The layout manager for this widget.
 java.lang.String name
          The name of the widget.
 int north
          The number of pixels that the distance between the northern side and this widget has to be.
 int nwidgets
          The number of widgets that are in this widget.
 Widget parent
          The parent container of this class.
 java.lang.String script
          The current script of the widget which reflects the current state of the widget.
 int south
          The number of pixels that the distance between the southern side and this widget has to be.
 java.lang.String tip
          The tip that is displayed under the mouse pointer when it is pointing at this widget for a while.
protected  boolean transparent
          If a widget is transparent, the background behind this widget is still visible.
 int tx
          The widget is translated in the x-direction using this value.
 int ty
          The widget is translated in the y-direction using this value.
 boolean valid
          If the widget is invalid, the next time the widget is repainted, the layout has to be redone.
 boolean visible
          A widget can be made invisible.
protected  java.awt.Color wBackground
          When wBackground is null, background is the inherited value.
 int west
          The number of pixels that the distance between the western side and this widget has to be.
protected  java.awt.Font wFont
          When wFont is null, font is the inherited value.
protected  java.awt.Color wForeground
          When wForeground is null, foreground is the inherited value.
protected  java.awt.Color wHilite
          When wHilite is null, hilite is the inherited value.
 Widget[] widgets
          The widgets that are contained by this widget.
 int width
          The width of this widget.
 java.lang.String wScript
          This is the script which is currently being edited.
protected  java.lang.String wTip
          When wTip is null, the tip is the inherited value.
 int x
          The x-coordinate of the upper-left corner of this widget.
 int y
          The y-coordinate of the upper-left corner of this widget.
 
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
Widget()
          Construct a widget.
 
Method Summary
 void action()
          Execute the action associated with this widget.
 boolean action(java.awt.Event evt, java.lang.Object what)
          By default a widget calls this function when a action event occurs.
 void add(int pos, Widget w)
          Add a widget at a given position.
 void add(Widget w)
          Add a widget to this widget: a widget can contain any number of other widgets.
 void adjustFont(java.lang.String family)
          More of the same.
 void adjustFont(java.lang.String family, int style, int size)
          Set certain characteristics of the widget's font, but do not change the other characteristics thereof.
 void applyProperties(PropertyList list)
          Apply new properties to an object.
 void audioLoop(java.lang.String src)
          Play an audio clip looped.
 void audioLoop(java.net.URL url)
          Play the audio clip at the given url looped.
 void audioPlay(java.lang.String src)
          Play an audio clip.
 void audioPlay(java.net.URL url)
          Play an audio clip using a url.
 void audioStop(java.lang.String src)
          Stop an audio clip.
 void audioStop(java.net.URL url)
          Stop the audio clip with the given url.
 java.awt.Rectangle bounds()
          Deprecated. As of Bongo version 1.1.
 void clearFocus()
          Remove the character focus.
 void clearPopups()
          Clear any popups associated with this widget.
 java.lang.Object clone()
          Return a clone of this widget.
 boolean contains(int px, int py)
          Checks whether this widget "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this widget.
 boolean contains(java.awt.Point p)
          Checks whether this widget "contains" the specified point, where x and y in the point are defined to be relative to the coordinate system of this widget.
 java.awt.Image createImage(java.awt.image.ImageProducer producer)
          Creates an image from the specified image producer.
 java.awt.Image createImage(int width, int height)
          Creates an off-screen drawable Image, which can be used for double buffering.
 Widget currentFocus()
          Get the widget that has the current focus.
 void destroy()
          Called to destroy a widget.
 void disable()
          Disable the widget.
 void disable(boolean disabled)
          Deprecated. As of Bongo version 1.1.
 void enable()
          Enable the widget.
 Widget findWidget(java.lang.String nm)
          Find a widget in this container.
 void firstFocus()
          Assign the focus to the first widget in this presentation.
 boolean focusInterest()
          True if this widget is potentially interested in getting the focus.
 java.applet.AudioClip getAudioClip(java.lang.String src)
          Get an audio clip.
 java.applet.AudioClip getAudioClipAt(java.net.URL url)
          Get an audio clip using a url.
 java.awt.Color getBackground()
          Get the background color.
 java.awt.Rectangle getBounds()
          Get the bounds as a Rectangle object.
 CommandButtonWidget getCancelButton()
          Get the cancel button, that wants to be executed if something is cancelled.
 void getChildProperties(PropertyList list)
          Get the properties for the children of this widget.
 int getCursor()
          Get the current mouse cursor of the presentation.
 Widget getDefaultButton()
          Get the default button, which wants to be executed if something is done.
 java.lang.String getDescription()
          Get a short description of the widget that consists of the widget name and class name.
 java.lang.String getEditor()
          Get the name of the class that can be used for in-place editing.
 java.lang.String getEncoding()
          Gets the character encoding of the widget.
Java uses Unicode as its native character encoding; however, keyboard input arrives in 'native' format, which means that on a Greek computer I could never input anything but Greek even if I set my keyboard driver to another language.
The supported character encodings depend on what Java supports.
 java.awt.Color getFocusColor()
          Get the focus color, which is the standard color of the focus rectangle.
 java.awt.Font getFont()
          Get the font of the widget.
 java.awt.FontMetrics getFontMetrics(java.awt.Font font)
          Get the metrics for a font.
 java.awt.Color getForeground()
          Get the foreground color.
 java.awt.Color getHilite()
          Get the hilite color.
 java.awt.Image getImage(java.lang.String src)
          Get an image from a location.
 char[] getKey(char[] key)
          Another way of getting a key.
 java.lang.String getKey(java.lang.String key)
          Check whether the given string is a key and if that is true, get the key by asking the presentation for the value of that key.
 java.lang.String getKey(java.lang.String key, boolean editMode)
          Get the given key and do or don't let it assume edit mode.
 WidgetLayoutMgr getLayoutMgr()
          Get the layout manager for this widget.
 java.util.Locale getLocale()
          Gets the locale of the widget.
 java.awt.Point getLocation()
          Get the current location of the widget as a Point object.
 java.lang.String getName()
          Get the name.
 Widget getParent()
          Return the widget's parent.
 java.awt.Frame getPlayerFrame()
          Find the first parent frame in which this widget is playing; this can be several levels up in the Component and Widget hierarchy; this is very handy to get the top-level app/frame.
 PlayerPanel getPlayerPanel()
          Get the PlayerPanel in which the presentation of this widget is being 'played'.
 java.awt.Dimension getPreferredSize()
          Get the preferred size of this widget; when a widget is created it will initially have this size.
 Presentation getPresentation()
          Get the presentation in which this widget is embedded.
 void getProperties(PropertyList list)
          Get the properties of this widget, by setting them in the given PropertyList.
 java.awt.Color getSelBackground()
          Get the selection background color.
 java.awt.Color getSelFocusColor()
          Get the selection focus color, which is the color of the focus rectangle around the selection bar.
 java.awt.Color getSelForeground()
          Get the selection foreground color.
 java.awt.Dimension getSize()
          Get the size as a Dimension object.
 java.lang.String getText()
          Get the text of the widget.
 java.lang.String getText(java.lang.String name)
          Get the text of a named widget.
 java.lang.String getTip()
          Get the help tip of the widget.
 java.lang.String getTip(int x, int y)
          Get the tip for a particular x,y location within the widget.
 java.awt.Font getTipFont()
          Get the font for the tips in the widget.
 java.lang.Object getValue()
          Get the value of the widget.
 java.lang.Object getValue(java.lang.String name)
          Get the value of a named widget.
 Widget getWidget(java.lang.String name)
          Get a widget by name.
 Widget getWidgetAt(int x, int y)
          Locate the topmost widget that contains the specified coordinate.
 Widget getWidgetAt(java.awt.Point p)
          Locate the topmost widget that contains the specified point.
 java.lang.Class getWidgetClass()
          Get the widget class for this widget.
 java.util.Vector getWidgetsAt(int x, int y)
          Locate all the widgets that intersect with the given point and append them to the vector, so that the front most ends up first.
 java.util.Vector getWidgetsAt(int x, int y, int width, int height)
          Locate all the widgets inside a rectangle.
 java.util.Vector getWidgetsAt(java.awt.Point p)
          Locate all the widgets that intersect with the given point and append them to the vector, so that the front most ends up first.
 boolean gotFocus(java.awt.Event evt, java.lang.Object what)
          By default a widget calls this function when a gotFocus event occurs.
 void gotoPage(java.lang.String page)
          Go to a page in the current folder.
 void gotoPage(java.lang.String name, java.lang.String page)
          Goto a page in a named folder.
 boolean handleEvent(java.awt.Event evt)
          Lets the widget handle an event.
 boolean hasFocus()
          True if the current widget has the focus.
 void hide()
          Hide the widget.
 boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int width, int height)
          Update the widget after more image data arrive.
protected  void inheritFont()
          Inherit the font from the widget's parent.
 void init()
          Called to initialize a widget.
 boolean inside(int px, int py)
          Deprecated. As of Bongo version 1.1.
 boolean inside(int px, int py, int pw, int ph)
          Check if this widget is inside a rectangle.
 void invalidate()
          Invalidate the widget (the size has changed).
 boolean isDisabled()
          Check if the widget is disabled.
 boolean isShowing()
          Checks if this Widget is showing on screen.
 boolean isTransparent()
          Check whether this widget is transparent.
 boolean isVisible()
          Check if this widget is visible.
 boolean keyDown(java.awt.Event evt, int key)
          By default a widget calls this function when a keyDown event occurs.
 boolean keyUp(java.awt.Event evt, int key)
          By default a widget calls this function when a keyUp event occurs.
 void layout()
          Lay out the widget.
 void list()
          Print the widget for debugging.
 void list(java.io.PrintStream out, int n)
          Print the widget with indentation for debugging.
 Widget locateWidget(int x, int y)
          Deprecated. As of Bongo version 1.1.
 void locateWidgets(java.util.Vector v, int x, int y)
          Deprecated. As of Bongo version 1.1.
 void locateWidgets(java.util.Vector v, int x, int y, int width, int height)
          Deprecated. As of Bongo version 1.1.
 java.awt.Point location()
          Deprecated. As of Bongo version 1.1.
 boolean lostFocus(java.awt.Event evt, java.lang.Object what)
          By default a widget calls this function when a lostFocus event occurs.
 boolean mouseDown(java.awt.Event evt, int x, int y)
          By default a widget calls this function when a mouseDown event occurs.
 boolean mouseDrag(java.awt.Event evt, int x, int y)
          By default a widget calls this function when a mouseDrag event occurs.
 boolean mouseEnter(java.awt.Event evt, int x, int y)
          By default a widget calls this function when a mouseEnter event occurs.
 boolean mouseExit(java.awt.Event evt, int x, int y)
          By default a widget calls this function when a mouseExit event occurs.
 boolean mouseMove(java.awt.Event evt, int x, int y)
          By default a widget calls this function when a mouseMove event occurs.
 boolean mouseUp(java.awt.Event evt, int x, int y)
          By default a widget calls this function when a mouseUp event occurs.
 void move(int x, int y)
          Deprecated. As of Bongo version 1.1.
 void nextFocus()
          Assign the focus to the next widget that is located to the right or below the current focus.
 boolean overlap(int px, int py, int pw, int ph)
          Check if the widget overlaps with rectangle.
 void paint(java.awt.Graphics g)
          Paint from scratch.
 void paint(java.awt.Graphics g, int x, int y, int width, int height)
          Paint part of the screen.
protected  void paintAll(java.awt.Graphics g, int x, int y, int width, int height)
          Paint everyting in the indicated area.
 void paramString(java.lang.StringBuffer buf)
          Build a string describing the widget's parameters.
 boolean postEvent(java.awt.Event evt)
          Post an event to this widget.
 void previousFocus()
          Assign the focus to the previous widget that is located to the left or above the current focus.
 void remove()
          Remove this widget from the parent.
 void remove(Widget w)
          Remove a widget from this widget.
protected  void remove(Widget w, int i)
          Remove the widget, assuming that the given index is the index of the widget in the widgets array.
 void removeAll()
          Remove all widgets from this widget.
 void repaint()
          Repaint the entrire widget as soon as possible.
 void repaint(int x, int y, int width, int height)
          This will repaint the indicated area of the screen (local coordinates).
 void repaint(long tm)
          Repaint this widget.
 void repaint(long tm, int x, int y, int width, int height)
          This will repaint the indicated area of the screen (local coordinates).
 void repaintParent(long tm, int x, int y, int width, int height)
          Repaint a part of the parent window.
 void replace(int pos, Widget w)
          Replace a widget at a given position.
 void replace(Widget newWidget)
          Replace this widget with another widget.
 void replace(Widget oldWidget, Widget newWidget)
          Replace a widget by another widget.
 void requestFocus()
          Ask the playerPanel for the focus.
 void resetCursor()
          Reset the current cursor to the default cursor of the presentation.
 void reshape(int x, int y, int width, int height)
          Deprecated. As of Bongo version 1.1.
 void reshape(int x, int y, int width, int height, boolean repaint)
          Deprecated. As of Bongo version 1.1.
 void resize(java.awt.Dimension d)
          Deprecated. As of Bongo version 1.1.
 void resize(int width, int height)
          Deprecated. As of Bongo version 1.1.
 void rmove(int dx, int dy)
          Deprecated. As of Bongo version 1.1. This method has been removed, since it was not necessary.
 void rscroll(int dx, int dy)
          Scroll the contents of this widget, relative to their current location.
 void scroll(int tx, int ty)
          Scroll the contents of this widget to a certain location.
 void setAttach(int north, int east, int south, int west)
          Set the attachments of this widget to the given number of pixels.
 void setBackground(java.awt.Color c)
          Set the background color of the widget.
 void setBounds(int x, int y, int width, int height)
          Reshape the widget to the specified bounding box.
 void setBounds(int x, int y, int width, int height, boolean repaint)
          Reshape the widget and repaint/invalidate if the given boolean is true.
 void setCursor(int cursor)
          Set the current mouse cursor in the presentation.
 void setDisabled(boolean disabled)
          Disable the widget conditionally.
 void setEditor(java.lang.Object editor)
          Set the editor for this widget.
 void setEncoding(java.lang.String encoding)
          Sets the character encoding of the widget.
 void setFont(java.awt.Font f)
          Set the font of the widget.
 void setForeground(java.awt.Color c)
          Sets the foreground color of the widget.
 void setHilite(java.awt.Color c)
          Sets the hilite color of the widget.
 void setLayoutMgr(WidgetLayoutMgr layoutMgr)
          Set the layout manager for this widget.
 void setLocale(java.util.Locale locale)
          Set the locale of the widget.
 void setLocation(int x, int y)
          Moves the Widget to a new location.
 void setName(java.lang.String name)
          Set the name.
 void setProperties(PropertyList list)
          Set the properties of this widget, by getting them from the given property list.
 void setSize(java.awt.Dimension d)
          Resizes the widget to the specified dimension.
 void setSize(int width, int height)
          Resizes the widget to the specified width and height.
 void setText(java.lang.String text)
          Set the text of a widget.
 void setText(java.lang.String name, java.lang.String text)
          Set the text of a named widget.
 void setTip(java.lang.String tip)
          Set the tip of the widget.
 void setTipFont(java.awt.Font tipFont)
          Set the font for the tips in the widget.
protected  void setTransparent(boolean transparent)
          Set the transparency.
 void setValue(java.lang.Object value)
          Set the value of the widget.
 void setValue(java.lang.String name, java.lang.Object value)
          Set the value of a named widget.
 void setVisible(boolean visible)
          Shows or hides the widget.
 void show()
          Show the widget.
 void show(boolean visible)
          Deprecated. As of Bongo version 1.1.
 java.awt.Dimension size()
          Deprecated. As of Bongo version 1.1.
 void start()
          Called to start a widget.
 void stop()
          Called to stop a widget.
 void sync()
          Sync the toolkit.
 long tick(long tm, java.lang.Object arg)
          The clock is ticking...
 void toBack()
          Send this widget to the back.
 void toBack(Widget w)
          Move a widget in this widget to the back.
 void toFront()
          Bring this widget to the front.
 void toFront(Widget w)
          Bring a widget in this widget to the front.
 java.lang.String toString()
          Convert the widget to a string for debugging.
 void update(java.awt.Graphics g)
          Update the widget.
 void validate()
          Validate the widget.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultFont

public static final java.awt.Font defaultFont
The default font of the widget.

defaultForeground

public static final java.awt.Color defaultForeground
The default foreground color of the widget.

defaultBackground

public static final java.awt.Color defaultBackground
The default background color of the widget.

defaultHilite

public static final java.awt.Color defaultHilite
The default hilite color, used to fill certain areas to hide the background.

name

public java.lang.String name
The name of the widget. This name can be used to uniquely identify a widget, so you can 'get' other widgets using this name when calling the get or find widget methods.
See Also:
getName(), setName(java.lang.String), findWidget(java.lang.String), getWidget(java.lang.String)

wTip

protected java.lang.String wTip
When wTip is null, the tip is the inherited value. When wTip is not null, tip is the same as wTip, which is the value that overrides the inherited one.
See Also:
tip

tip

public java.lang.String tip
The tip that is displayed under the mouse pointer when it is pointing at this widget for a while.
See Also:
getTip(), setTip(java.lang.String)

valid

public boolean valid
If the widget is invalid, the next time the widget is repainted, the layout has to be redone.
See Also:
validate(), invalidate()

transparent

protected boolean transparent
If a widget is transparent, the background behind this widget is still visible.
See Also:
isTransparent(), setTransparent(boolean)

directGraphics

protected boolean directGraphics
If a widget is opaque and so its update method can be called, when directGraphics is true the update method is passed the screen graphics context. Otherwise the update method draws into a back buffer. This should be false unless you want to really optimize incremental redisplay yourself.
See Also:
transparent

visible

public boolean visible
A widget can be made invisible.
See Also:
isVisible(), isShowing(), setVisible(boolean)

disabled

public boolean disabled
A disabled widget does not accept any user input.
See Also:
isDisabled(), setDisabled(boolean)

focus

public boolean focus
When a widget has focus, a focus rectangle is usually drawn around it telling the user that keyboard input goes to that widget now. A widget can always get the focus.
See Also:
getFocusColor(), focusInterest(), currentFocus(), hasFocus(), requestFocus(), clearFocus(), firstFocus(), nextFocus(), previousFocus()

tx

public int tx
The widget is translated in the x-direction using this value.
See Also:
scroll(int, int), rscroll(int, int)

ty

public int ty
The widget is translated in the y-direction using this value.
See Also:
scroll(int, int), rscroll(int, int)

x

public int x
The x-coordinate of the upper-left corner of this widget.
See Also:
getLocation(), setLocation(int, int)

y

public int y
The y-coordinate of the upper-left corner of this widget.
See Also:
getLocation(), setLocation(int, int)

width

public int width
The width of this widget.
See Also:
getSize(), setSize(java.awt.Dimension)

height

public int height
The height of this widget.
See Also:
getSize(), setSize(java.awt.Dimension)

north

public int north
The number of pixels that the distance between the northern side and this widget has to be.
See Also:
WidgetConstants.DETACHED, setAttach(int, int, int, int)

east

public int east
The number of pixels that the distance between the eatern side and this widget has to be.
See Also:
WidgetConstants.DETACHED, setAttach(int, int, int, int)

south

public int south
The number of pixels that the distance between the southern side and this widget has to be.
See Also:
WidgetConstants.DETACHED, setAttach(int, int, int, int)

west

public int west
The number of pixels that the distance between the western side and this widget has to be.
See Also:
WidgetConstants.DETACHED, setAttach(int, int, int, int)

wFont

protected java.awt.Font wFont
When wFont is null, font is the inherited value. When wFont is not null, font is the same as wFont, which is the value that overrides the inherited one.
See Also:
font

font

public java.awt.Font font
The current font. The font can be null after construction. In that case getFont() returns wFont.
See Also:
getFont(), setFont(java.awt.Font)

wForeground

protected java.awt.Color wForeground
When wForeground is null, foreground is the inherited value. When wForeground is not null, foreground is the same as wForeground, which is the value that overrides the inherited one.
See Also:
foreground

foreground

public java.awt.Color foreground
The current foreground. The foreground can be null after construction. In that case getForeground() returns wForeground.
See Also:
getForeground(), setForeground(java.awt.Color)

wBackground

protected java.awt.Color wBackground
When wBackground is null, background is the inherited value. When wBackground is not null, background is the same as wBackground, which is the value that overrides the inherited one.
See Also:
background

background

public java.awt.Color background
The current background. The background can be null after construction. In that case getBackground() returns wBackground.
See Also:
getBackground(), setBackground(java.awt.Color)

wHilite

protected java.awt.Color wHilite
When wHilite is null, hilite is the inherited value. When wHilite is not null, hilite is the same as wHilite, which is the value that overrides the inherited one.
See Also:
hilite

hilite

public java.awt.Color hilite
The current hilite color. The hilite color can be null after construction. In that case getHilite() returns wHilite. When a widget wants to hide its background, it uses this color for certain areas to fill it.
See Also:
getHilite(), setHilite(java.awt.Color)

parent

public Widget parent
The parent container of this class.
See Also:
getParent()

nwidgets

public int nwidgets
The number of widgets that are in this widget.
See Also:
widgets

widgets

public Widget[] widgets
The widgets that are contained by this widget.
See Also:
nwidgets, getWidget(java.lang.String)

layoutMgr

public WidgetLayoutMgr layoutMgr
The layout manager for this widget.
See Also:
getLayoutMgr(), setLayoutMgr(marimba.gui.WidgetLayoutMgr)

editor

public java.lang.Object editor
The editor for inline editing.
See Also:
getEditor(), setEditor(java.lang.Object)

wScript

public java.lang.String wScript
This is the script which is currently being edited. This script may not reflect the actual state of the widget since it may still need to be compiled.
See Also:
script

script

public java.lang.String script
The current script of the widget which reflects the current state of the widget.
See Also:
wScript, clazz

clazz

public byte[] clazz
The binary representation of the class that constitutes this widget. If the widget does not have a script this variable is null.
See Also:
script

adapter

public java.lang.String adapter
The name of the adapter class for this widget if this widget requires one.

Provide the name of the class file which implements the interface marimba.gui.WidgetAdapter. Every lifecycle event in the adapter is guaranteed to be invoked by the corresponding lifecycle method of this widget.

This supports the MVC pattern withing the widget framework.

Constructor Detail

Widget

public Widget()
Construct a widget.
Method Detail

getProperties

public void getProperties(PropertyList list)
Get the properties of this widget, by setting them in the given PropertyList. This property list is used to persistify certain properties of a widget. They are saved by calling this method and restored using the setProperties method.
Each property in the property list has a name. This name uniquely identifies the property. In the visual Bongo builder some properties are used in the general property fields, like name, font and x/y/width/height. This means that those properties do not show up in the property table in Bongo. All additional properties do show up in that table. There is one exception to that and that involves the scrollbar colors: if a widget adds a color property with one of the following names, then they are used in a the color area of Bongo, instead of the property table: "scrollbarForeground", "scrollbarHilite", "scrollbarBackground". This allows users to set possible scrollbar color separately.
Specified by:
getProperties in interface PropertyObject
Parameters:
list - The list in which the current state needs to be saved.
See Also:
setProperties(PropertyList)

getChildProperties

public void getChildProperties(PropertyList list)
Get the properties for the children of this widget.

setProperties

public void setProperties(PropertyList list)
Set the properties of this widget, by getting them from the given property list. This method is used to restore a persistified state in the widget. The state is retreived by using the method getProperties.
Specified by:
setProperties in interface PropertyObject
Parameters:
list - The list that contains the new widget state.
See Also:
getProperties(PropertyList)

applyProperties

public void applyProperties(PropertyList list)
Apply new properties to an object.

clone

public java.lang.Object clone()
Return a clone of this widget. This requires that the presentation for this widget be set, and that the presentation has a class loader.
Overrides:
clone in class java.lang.Object

getParent

public Widget getParent()
Return the widget's parent.
See Also:
parent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Get the preferred size of this widget; when a widget is created it will initially have this size.

getName

public java.lang.String getName()
Get the name.
See Also:
name

setName

public void setName(java.lang.String name)
Set the name.
See Also:
name

getTip

public java.lang.String getTip()
Get the help tip of the widget.
See Also:
setTip(java.lang.String)

getTip

public java.lang.String getTip(int x,
                               int y)
Get the tip for a particular x,y location within the widget.
Parameters:
x - the x-coordinate of the tip
y - the y-coordinate of the tip
See Also:
setTip(java.lang.String)

setTip

public void setTip(java.lang.String tip)
Set the tip of the widget.
Parameters:
tip - The string that is the tip.
See Also:
getTip(), getTip(int, int)

getTipFont

public java.awt.Font getTipFont()
Get the font for the tips in the widget. If the widget does not have a tipFont, the tipFont of its parent is returned. If there is no parent or we are at the top-level, the default tipfont is returned.
See Also:
setTipFont(java.awt.Font), getTip()

setTipFont

public void setTipFont(java.awt.Font tipFont)
Set the font for the tips in the widget.
Parameters:
tipFont - the font that the tips will use
See Also:
getTipFont()

getFont

public java.awt.Font getFont()
Get the font of the widget.
See Also:
setFont(java.awt.Font)

setFont

public void setFont(java.awt.Font f)
Set the font of the widget.
Parameters:
f - The font that will be used for the widget.
See Also:
getFont()

adjustFont

public void adjustFont(java.lang.String family,
                       int style,
                       int size)
Set certain characteristics of the widget's font, but do not change the other characteristics thereof. Look for these first to wFont, then font. The defaults are null, -1, -1.

adjustFont

public void adjustFont(java.lang.String family)
More of the same. Since this will probably be the most common case, make a shortcut.

inheritFont

protected void inheritFont()
Inherit the font from the widget's parent.
See Also:
font

getForeground

public java.awt.Color getForeground()
Get the foreground color.
See Also:
foreground

setForeground

public void setForeground(java.awt.Color c)
Sets the foreground color of the widget.
Parameters:
c - the color to be used as foreground color
See Also:
foreground

getBackground

public java.awt.Color getBackground()
Get the background color.
See Also:
background

setBackground

public void setBackground(java.awt.Color c)
Set the background color of the widget.
Parameters:
c - the color to be used as background color
See Also:
background

getHilite

public java.awt.Color getHilite()
Get the hilite color.
See Also:
hilite

setHilite

public void setHilite(java.awt.Color c)
Sets the hilite color of the widget.
Parameters:
c - the color to be used as hilite color
See Also:
hilite

isTransparent

public boolean isTransparent()
Check whether this widget is transparent.
See Also:
setTransparent(boolean)

setTransparent

protected void setTransparent(boolean transparent)
Set the transparency. Only a widget itself is allowed to do this, since it has to make sure that it actually does paint everything when transparency is set to false.
See Also:
isTransparent()

getLayoutMgr

public WidgetLayoutMgr getLayoutMgr()
Get the layout manager for this widget.
See Also:
layoutMgr

setLayoutMgr

public void setLayoutMgr(WidgetLayoutMgr layoutMgr)
Set the layout manager for this widget.
See Also:
layoutMgr

getPlayerFrame

public java.awt.Frame getPlayerFrame()
Find the first parent frame in which this widget is playing; this can be several levels up in the Component and Widget hierarchy; this is very handy to get the top-level app/frame. Note that this returns a normal Frame, because the toplevel frame does not have to be a PlayerFrame, but can also be a Frame or another subclass of Frame.
Returns:
null, if no Frame was found
See Also:
getPlayerPanel(), getPresentation()

getPlayerPanel

public PlayerPanel getPlayerPanel()
Get the PlayerPanel in which the presentation of this widget is being 'played'.
Returns:
null, if no PlayerPanel was found
See Also:
#getFrame , getPresentation()

getPresentation

public Presentation getPresentation()
Get the presentation in which this widget is embedded.
Returns:
null, if no Presentation was found
See Also:
#getFrame , getPlayerPanel()

getEditor

public java.lang.String getEditor()
Get the name of the class that can be used for in-place editing. Return null if this widget can't be edited in-place.
See Also:
editor

setEditor

public void setEditor(java.lang.Object editor)
Set the editor for this widget.
See Also:
editor

getCursor

public int getCursor()
Get the current mouse cursor of the presentation.
See Also:
Presentation.cursor

setCursor

public void setCursor(int cursor)
Set the current mouse cursor in the presentation.
See Also:
Presentation.cursor

resetCursor

public void resetCursor()
Reset the current cursor to the default cursor of the presentation.
See Also:
Presentation.defaultCursor

getLocale

public java.util.Locale getLocale()
Gets the locale of the widget. If the widget does not have a locale, the locale of its parent is returned. If the widget does not have a parent yet, the default locale is returned by using Locale.getDefault().
See Also:
setLocale(java.util.Locale)

setLocale

public void setLocale(java.util.Locale locale)
Set the locale of the widget.
Parameters:
locale - the locale
See Also:
getLocale()

getEncoding

public java.lang.String getEncoding()
Gets the character encoding of the widget.
Java uses Unicode as its native character encoding; however, keyboard input arrives in 'native' format, which means that on a Greek computer I could never input anything but Greek even if I set my keyboard driver to another language.
The supported character encodings depend on what Java supports.
Returns:
If the encoding is set to null or "system", it returns the proper encoding and NOT null or system!
See Also:
setEncoding(java.lang.String)

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the character encoding of the widget. If the encoding is not supported it will set the encoding to the parent encoding and will print an error message.
Parameters:
encoding - The IANA name or the direct name of the Java converter for the character encoding. If null is given than the parent's encoding will be used. By setting it to "system" the default system encoding will be used.
See Also:
getEncoding(), StringResources

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
Get the metrics for a font.
Parameters:
font - the font that the font metrics are unknown of

getImage

public java.awt.Image getImage(java.lang.String src)
Get an image from a location.
Parameters:
src - a relative path (relative to presentation base) or any other url

isDisabled

public boolean isDisabled()
Check if the widget is disabled.
See Also:
setDisabled(boolean)

enable

public void enable()
Enable the widget.
See Also:
isDisabled()

disable

public void disable()
Disable the widget.
See Also:
isDisabled()

setDisabled

public void setDisabled(boolean disabled)
Disable the widget conditionally.
See Also:
isDisabled(), enable(), disable()

disable

public void disable(boolean disabled)
Deprecated. As of Bongo version 1.1.

See Also:
setDisabled(boolean)

isVisible

public boolean isVisible()
Check if this widget is visible.
See Also:
setVisible(boolean)

isShowing

public boolean isShowing()
Checks if this Widget is showing on screen. This means that the widget must be visible, and it must be in a container that is visible and showing.
See Also:
setVisible(boolean)

show

public void show()
Show the widget.
See Also:
setVisible(boolean)

hide

public void hide()
Hide the widget.
See Also:
setVisible(boolean)

setVisible

public void setVisible(boolean visible)
Shows or hides the widget.
Parameters:
visible - if true then shows, if false then hides the widget
See Also:
isVisible(), isShowing(), show(), hide()

show

public void show(boolean visible)
Deprecated. As of Bongo version 1.1.

See Also:
setVisible(boolean)

getValue

public java.lang.Object getValue()
Get the value of the widget. This will return a value object that is "appropriate" for this particular widget type. This will return null in cases where the object does not have a value.

getValue

public java.lang.Object getValue(java.lang.String name)
Get the value of a named widget.
See Also:
getWidget(java.lang.String)

setValue

public void setValue(java.lang.Object value)
Set the value of the widget. This only works if the value object is of the appropriate type, or if the value object can be converted to the appropriate type.

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
Set the value of a named widget.
See Also:
getWidget(java.lang.String)

getText

public java.lang.String getText()
Get the text of the widget. This will return the label for objects that have a label. It may return null for objects that don't have a text value or label.

getText

public java.lang.String getText(java.lang.String name)
Get the text of a named widget.
See Also:
getWidget(java.lang.String)

setText

public void setText(java.lang.String text)
Set the text of a widget. This will change the label for objects that have a label.

setText

public void setText(java.lang.String name,
                    java.lang.String text)
Set the text of a named widget.
See Also:
getWidget(java.lang.String)

gotoPage

public void gotoPage(java.lang.String page)
Go to a page in the current folder.
See Also:
FolderWidget.gotoPage(java.lang.String)

gotoPage

public void gotoPage(java.lang.String name,
                     java.lang.String page)
Goto a page in a named folder.
See Also:
FolderWidget.gotoPage(java.lang.String), getWidget(java.lang.String)

contains

public boolean contains(int px,
                        int py)
Checks whether this widget "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this widget.
Parameters:
x - the x coordinate
y - the y coordinate
See Also:
getWidgetAt(int, int)

inside

public boolean inside(int px,
                      int py)
Deprecated. As of Bongo version 1.1.

See Also:
contains(int, int)

contains

public boolean contains(java.awt.Point p)
Checks whether this widget "contains" the specified point, where x and y in the point are defined to be relative to the coordinate system of this widget.
Parameters:
p - the point
See Also:
getWidgetAt(int, int)

inside

public boolean inside(int px,
                      int py,
                      int pw,
                      int ph)
Check if this widget is inside a rectangle. The rectangle is specified in the parent's coordinate system.
Parameters:
pw - width
ph - height

overlap

public boolean overlap(int px,
                       int py,
                       int pw,
                       int ph)
Check if the widget overlaps with rectangle. The rectangle is specified in the parent's coordinate system.
Parameters:
pw - width
ph - height

getWidgetAt

public Widget getWidgetAt(int x,
                          int y)
Locate the topmost widget that contains the specified coordinate. The coordinates are specified in the parent's coordinate system. Only visible widgets are considered.

locateWidget

public Widget locateWidget(int x,
                           int y)
Deprecated. As of Bongo version 1.1.

See Also:
getWidgetAt(int, int)

getWidgetAt

public Widget getWidgetAt(java.awt.Point p)
Locate the topmost widget that contains the specified point. The point is specified in the parent's coordinate system. Only visible widgets are considered.
Parameters:
p - the point
See Also:
getWidgetAt(int, int)

getWidgetsAt

public java.util.Vector getWidgetsAt(int x,
                                     int y)
Locate all the widgets that intersect with the given point and append them to the vector, so that the front most ends up first. The coordinates are specified in the parent's coordinate system. Both visible and invisible widgets are considered.

locateWidgets

public void locateWidgets(java.util.Vector v,
                          int x,
                          int y)
Deprecated. As of Bongo version 1.1.

See Also:
getWidgetsAt(int, int)

getWidgetsAt

public java.util.Vector getWidgetsAt(java.awt.Point p)
Locate all the widgets that intersect with the given point and append them to the vector, so that the front most ends up first. The coordinates are specified in the parent's coordinate system. Both visible and invisible widgets are considered.
Parameters:
p - the point
See Also:
getWidgetsAt(int, int)

getWidgetsAt

public java.util.Vector getWidgetsAt(int x,
                                     int y,
                                     int width,
                                     int height)
Locate all the widgets inside a rectangle. The widget are added to the vector so that the front most ends up first. The coordinates are specified in the parent's coordinate system. Both visible and invisible widgets are considered.

locateWidgets

public void locateWidgets(java.util.Vector v,
                          int x,
                          int y,
                          int width,
                          int height)
Deprecated. As of Bongo version 1.1.

See Also:
getWidgetsAt(int, int, int, int)

paintAll

protected void paintAll(java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paint everyting in the indicated area. The area that needs painting is specified in the parent's coordinates. Calls paint(). Overriding this method in subclasses can break everything, so be sure what you're doing when you do that!
See Also:
paint(java.awt.Graphics, int, int, int, int)

paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height)
Paint part of the screen.

paint

public void paint(java.awt.Graphics g)
Paint from scratch. Remember only to paint what is inside the clipping area.

update

public void update(java.awt.Graphics g)
Update the widget. This will be called in response to a repaint() request. You can assume that the screen is still intact.

repaint

public void repaint()
Repaint the entrire widget as soon as possible.

repaint

public void repaint(long tm)
Repaint this widget. If the widget is not obscured and if the wiget is not transparent this will result in a call to update().
Parameters:
tm - The time to do the repaint.

repaint

public void repaint(int x,
                    int y,
                    int width,
                    int height)
This will repaint the indicated area of the screen (local coordinates). Note that this will always result in a call to paint().

repaintParent

public void repaintParent(long tm,
                          int x,
                          int y,
                          int width,
                          int height)
Repaint a part of the parent window. This is used when reshaping widgets, or when repainting transparent widgets. The coordinates are in the parent's coordinate system.

repaint

public void repaint(long tm,
                    int x,
                    int y,
                    int width,
                    int height)
This will repaint the indicated area of the screen (local coordinates). Note that this will always result in a call to paint().

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int flags,
                           int x,
                           int y,
                           int width,
                           int height)
Update the widget after more image data arrive.
Specified by:
imageUpdate in interface java.awt.image.ImageObserver

createImage

public java.awt.Image createImage(java.awt.image.ImageProducer producer)
Creates an image from the specified image producer.
Parameters:
producer - the image producer

createImage

public java.awt.Image createImage(int width,
                                  int height)
Creates an off-screen drawable Image, which can be used for double buffering.
Parameters:
width - the specified width
height - the specified height

tick

public long tick(long tm,
                 java.lang.Object arg)
The clock is ticking...
Specified by:
tick in interface TimerClient
See Also:
TimerClient

layout

public void layout()
Lay out the widget.

validate

public void validate()
Validate the widget.
See Also:
valid

invalidate

public void invalidate()
Invalidate the widget (the size has changed).
See Also:
valid

getLocation

public java.awt.Point getLocation()
Get the current location of the widget as a Point object. The location will be in the parent's coordinate space.
See Also:
setLocation(int, int)

location

public java.awt.Point location()
Deprecated. As of Bongo version 1.1.

See Also:
getLocation()

setLocation

public void setLocation(int x,
                        int y)
Moves the Widget to a new location. The x and y coordinates are in the parent's coordinate space.
Parameters:
x - the x coordinate
y - the y coordinate
See Also:
getLocation(), setBounds(int, int, int, int)

move

public void move(int x,
                 int y)
Deprecated. As of Bongo version 1.1.

See Also:
setLocation(int, int)

getSize

public java.awt.Dimension getSize()
Get the size as a Dimension object.
See Also:
width, height

size

public java.awt.Dimension size()
Deprecated. As of Bongo version 1.1.

See Also:
getSize()

setSize

public void setSize(java.awt.Dimension d)
Resizes the widget to the specified dimension.
Parameters:
d - the widget dimension
See Also:
getSize(), setBounds(int, int, int, int)

resize

public void resize(java.awt.Dimension d)
Deprecated. As of Bongo version 1.1.

See Also:
setSize(java.awt.Dimension)

setSize

public void setSize(int width,
                    int height)
Resizes the widget to the specified width and height.
Parameters:
width - the width of the widget
height - the height of the widget
See Also:
getSize(), setBounds(int, int, int, int)

resize

public void resize(int width,
                   int height)
Deprecated. As of Bongo version 1.1.

See Also:
setSize(java.awt.Dimension)

getBounds

public java.awt.Rectangle getBounds()
Get the bounds as a Rectangle object.
See Also:
setBounds(int, int, int, int), x, y, width, height

bounds

public java.awt.Rectangle bounds()
Deprecated. As of Bongo version 1.1.

See Also:
getBounds()

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Reshape the widget to the specified bounding box. The coordinates are specified in the parent's coordinate system.
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the widget
height - the height of the widget
See Also:
getBounds(), setLocation(int, int), setSize(java.awt.Dimension)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height,
                      boolean repaint)
Reshape the widget and repaint/invalidate if the given boolean is true. The coordinates are specified in the parent's coordinate system.
See Also:
setBounds(int, int, int, int)

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height)
Deprecated. As of Bongo version 1.1.

See Also:
setBounds(int, int, int, int)

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height,
                    boolean repaint)
Deprecated. As of Bongo version 1.1.

See Also:
setBounds(int, int, int, int, boolean)

setAttach

public void setAttach(int north,
                      int east,
                      int south,
                      int west)
Set the attachments of this widget to the given number of pixels. Use the constant DETACHED from widgetConstants to detach the widget from that side.

scroll

public void scroll(int tx,
                   int ty)
Scroll the contents of this widget to a certain location. This will change the translation of the widget.
See Also:
tx, ty

rscroll

public void rscroll(int dx,
                    int dy)
Scroll the contents of this widget, relative to their current location. This will change the translation of the widget.
See Also:
tx, ty

add

public void add(Widget w)
Add a widget to this widget: a widget can contain any number of other widgets.
Parameters:
w - the widget that is added to this widget
See Also:
widgets, nwidgets

add

public void add(int pos,
                Widget w)
Add a widget at a given position.
Parameters:
pos - the position at which the widget must be added/inserted
w - the widget that is added to this widget
See Also:
widgets, nwidgets

replace

public void replace(Widget newWidget)
Replace this widget with another widget. This is usually used when scripting widgets.
Parameters:
newWidget - the widget that will replace this widget in the parent

replace

public void replace(Widget oldWidget,
                    Widget newWidget)
Replace a widget by another widget.
Parameters:
oldWidget - the widget that currently is added to this widget
newWidget - the widget that will replace the old widget

replace

public void replace(int pos,
                    Widget w)
Replace a widget at a given position.
Parameters:
pos - the index of the widget in the widgets array that is currently added to this widget
w - the widget that will replace the old widget at widgets[pos]

remove

public void remove()
Remove this widget from the parent.
See Also:
widgets, nwidgets

remove

public void remove(Widget w)
Remove a widget from this widget.
Parameters:
w - the widget that is currently added to this widget and will be removed
See Also:
widgets, nwidgets

remove

protected void remove(Widget w,
                      int i)
Remove the widget, assuming that the given index is the index of the widget in the widgets array. It does not invalidate and/or repaint this widget.
Parameters:
w - the widget that is currently added to this widget and will be removed
i - the position of the given widget in the widgets array

removeAll

public void removeAll()
Remove all widgets from this widget.

toFront

public void toFront()
Bring this widget to the front.

toFront

public void toFront(Widget w)
Bring a widget in this widget to the front.
Parameters:
w - the widget that is currently added to this widget and will be brought to the front

toBack

public void toBack()
Send this widget to the back.

toBack

public void toBack(Widget w)
Move a widget in this widget to the back.
Parameters:
w - the widget that is currently added to this widget and will be brought to the back

init

public void init()
Called to initialize a widget.

start

public void start()
Called to start a widget.

stop

public void stop()
Called to stop a widget.

destroy

public void destroy()
Called to destroy a widget.

findWidget

public Widget findWidget(java.lang.String nm)
Find a widget in this container. This method will only look in the current container. It does not accept hierachical names.
Parameters:
nm - the (case sensitive) name of the widget
See Also:
getWidget(java.lang.String)

getWidget

public Widget getWidget(java.lang.String name)
Get a widget by name. This methods accepts hierarchical names. If the root name is not found in this container the parent of the container is tried.
Parameters:
name - the (case sensitive) name of the widget
See Also:
findWidget(java.lang.String)

getAudioClip

public java.applet.AudioClip getAudioClip(java.lang.String src)
Get an audio clip.
Parameters:
src - a relative path (relative to presentation base) or any other url

getAudioClipAt

public java.applet.AudioClip getAudioClipAt(java.net.URL url)
Get an audio clip using a url.
Parameters:
url - a relative url (relative to presentation base) or any other url

audioPlay

public void audioPlay(java.lang.String src)
Play an audio clip.
Parameters:
src - a relative path (relative to presentation base) or any other url

audioPlay

public void audioPlay(java.net.URL url)
Play an audio clip using a url.
Parameters:
url - a relative url (relative to presentation base) or any other url

audioLoop

public void audioLoop(java.lang.String src)
Play an audio clip looped.
Parameters:
src - a relative path (relative to presentation base) or any other url

audioLoop

public void audioLoop(java.net.URL url)
Play the audio clip at the given url looped.
Parameters:
url - a relative url (relative to presentation base) or any other url

audioStop

public void audioStop(java.lang.String src)
Stop an audio clip.
Parameters:
src - a relative path (relative to presentation base) or any other url

audioStop

public void audioStop(java.net.URL url)
Stop the audio clip with the given url.
Parameters:
url - a relative url (relative to presentation base) or any other url

getSelForeground

public java.awt.Color getSelForeground()
Get the selection foreground color.
See Also:
getSelBackground()

getSelBackground

public java.awt.Color getSelBackground()
Get the selection background color.
See Also:
getSelForeground()

getSelFocusColor

public java.awt.Color getSelFocusColor()
Get the selection focus color, which is the color of the focus rectangle around the selection bar.
See Also:
getFocusColor()

getFocusColor

public java.awt.Color getFocusColor()
Get the focus color, which is the standard color of the focus rectangle.
See Also:
getSelFocusColor()

getDefaultButton

public Widget getDefaultButton()
Get the default button, which wants to be executed if something is done. By default this is done when the Return key is pressed.
Returns null if no default button is found or if no playerpanel exists. Returns the first default button found, if more default buttons exist.
See Also:
getCancelButton()

getCancelButton

public CommandButtonWidget getCancelButton()
Get the cancel button, that wants to be executed if something is cancelled. By default this is done when the Esc key is pressed. Returns null if no cancel button is found or if no playerpanel exists. Returns the first cancel button found, if more cancel buttons exist.
See Also:
getDefaultButton()

focusInterest

public boolean focusInterest()
True if this widget is potentially interested in getting the focus. When this function returns false, this does not mean it cannot get the focus. It just means that you cannot give it the focus using the keyboard, you have to do that programmatically.
See Also:
focus, requestFocus()

currentFocus

public Widget currentFocus()
Get the widget that has the current focus.
See Also:
focus

hasFocus

public boolean hasFocus()
True if the current widget has the focus.
See Also:
focus

requestFocus

public void requestFocus()
Ask the playerPanel for the focus. When the playerPanel has given the focus to this widget, it sends a GOT_FOCUS event. A widget can always get the focus using this function, even when it is not interested in the focus.
See Also:
focus, focusInterest()

clearFocus

public void clearFocus()
Remove the character focus.
See Also:
focus

firstFocus

public void firstFocus()
Assign the focus to the first widget in this presentation.
See Also:
focus

nextFocus

public void nextFocus()
Assign the focus to the next widget that is located to the right or below the current focus.
See Also:
focus

previousFocus

public void previousFocus()
Assign the focus to the previous widget that is located to the left or above the current focus.
See Also:
focus

clearPopups

public void clearPopups()
Clear any popups associated with this widget.

getKey

public java.lang.String getKey(java.lang.String key)
Check whether the given string is a key and if that is true, get the key by asking the presentation for the value of that key. The string is a key if it starts and ends with '@', for example "@hello@". It returns the given key (it does nothing) when the PlayerPanel is editing.
Parameters:
key - the string (that might be a key) of which the value is returned
Returns:
empty string if this widget has not been added to a presentation
See Also:
Presentation.findResourceKey(java.lang.String)

getKey

public java.lang.String getKey(java.lang.String key,
                               boolean editMode)
Get the given key and do or don't let it assume edit mode.
Parameters:
key - the string (that might be a key) of which the value is returned
editMode - specify whether edit mode should be assumed or not
See Also:
Presentation.findResourceKey(java.lang.String)

getKey

public char[] getKey(char[] key)
Another way of getting a key. It returns the given key when the PlayerPanel is editing.
Parameters:
key - the character array (that might be a key) of which the value is returned
Returns:
empty array if this widget has not been added to a presentation

postEvent

public boolean postEvent(java.awt.Event evt)
Post an event to this widget. If the widget does not handle the event, it is passed to the parent.
Parameters:
evt - the event that needs to be posted to this widget
See Also:
handleEvent(java.awt.Event)

handleEvent

public boolean handleEvent(java.awt.Event evt)
Lets the widget handle an event.
Parameters:
evt - the event that needs to be handled by the widget
See Also:
postEvent(java.awt.Event)

mouseDown

public boolean mouseDown(java.awt.Event evt,
                         int x,
                         int y)
By default a widget calls this function when a mouseDown event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

mouseDrag

public boolean mouseDrag(java.awt.Event evt,
                         int x,
                         int y)
By default a widget calls this function when a mouseDrag event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

mouseUp

public boolean mouseUp(java.awt.Event evt,
                       int x,
                       int y)
By default a widget calls this function when a mouseUp event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

mouseMove

public boolean mouseMove(java.awt.Event evt,
                         int x,
                         int y)
By default a widget calls this function when a mouseMove event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

mouseEnter

public boolean mouseEnter(java.awt.Event evt,
                          int x,
                          int y)
By default a widget calls this function when a mouseEnter event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

mouseExit

public boolean mouseExit(java.awt.Event evt,
                         int x,
                         int y)
By default a widget calls this function when a mouseExit event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

keyDown

public boolean keyDown(java.awt.Event evt,
                       int key)
By default a widget calls this function when a keyDown event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

keyUp

public boolean keyUp(java.awt.Event evt,
                     int key)
By default a widget calls this function when a keyUp event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

action

public boolean action(java.awt.Event evt,
                      java.lang.Object what)
By default a widget calls this function when a action event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

gotFocus

public boolean gotFocus(java.awt.Event evt,
                        java.lang.Object what)
By default a widget calls this function when a gotFocus event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

lostFocus

public boolean lostFocus(java.awt.Event evt,
                         java.lang.Object what)
By default a widget calls this function when a lostFocus event occurs. We strongly advise against the use of this function and advise the use of doing the actions within handleEvent to reduce the number of method calls.

action

public void action()
Execute the action associated with this widget.

sync

public void sync()
Sync the toolkit.

paramString

public void paramString(java.lang.StringBuffer buf)
Build a string describing the widget's parameters. This string is used in toString.
See Also:
toString()

getWidgetClass

public java.lang.Class getWidgetClass()
Get the widget class for this widget. This is useful if you are interested in the actual widget class, rather than the class of the script.

getDescription

public java.lang.String getDescription()
Get a short description of the widget that consists of the widget name and class name.

toString

public java.lang.String toString()
Convert the widget to a string for debugging.
Overrides:
toString in class java.lang.Object
See Also:
paramString(java.lang.StringBuffer)

list

public void list()
Print the widget for debugging.

list

public void list(java.io.PrintStream out,
                 int n)
Print the widget with indentation for debugging. This function uses toString to print the widget.
See Also:
toString()

rmove

public void rmove(int dx,
                  int dy)
Deprecated. As of Bongo version 1.1. This method has been removed, since it was not necessary.

See Also:
setLocation(int, int)