Class marimba.gui.Widget
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.gui.Widget
java.lang.Object
|
+----marimba.gui.Widget
- public class Widget
- extends Object
- implements WidgetConstants, PropertyObject, ImageObserver, TimerClient
A generic widget implementation. This is the base class for
all widgets in the marimba.gui package.
- Version:
- 1.138, 01/18/97
- Author:
- Arthur van Hoff
- See Also:
- WidgetConstants
-
background
- The current background.
-
clazz
- The binary representation of the class that constitutes this
widget.
-
defaultBackground
- The default background color.
-
defaultFont
- The default font.
-
defaultForeground
- The default foreground color.
-
defaultHilite
- The default hilite color,
used to fill certain areas to hide the background.
-
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.
-
disabled
- A disabled widget does not accept any user input.
-
east
- The number of pixels that the distance between the eatern
side and this widget has to be.
-
editor
- The editor for inline editing.
-
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.
-
font
- The current font.
-
foreground
- The current foreground.
-
height
- The height of this widget.
-
hilite
- The current hilite color.
-
layoutMgr
- The layout manager for this widget.
-
name
- The name of this widget.
-
north
- The number of pixels that the distance between the northern
side and this widget has to be.
-
nwidgets
- The number of widgets that are in this widget.
-
parent
- The parent container of this class.
-
script
- The current script of the widget which reflects the current
state of the widget.
-
south
- The number of pixels that the distance between the southern
side and this widget has to be.
-
tip
- The tip that is displayed under the mouse pointer
when it is pointing at this widget for a while.
-
transparent
- If a widget is transparent, the background behind this
widget is still visible.
-
tx
- The widget is translated in the x-direction
using this value.
-
ty
- The widget is translated in the y-direction
using this value.
-
valid
- If the widget is invalid, the next time the widget is
repainted, the layout has to be redone.
-
visible
- A widget can be made invisible.
-
wBackground
- When wBackground is null, background is the inherited value.
-
west
- The number of pixels that the distance between the western
side and this widget has to be.
-
wFont
- When wFont is null, font is the inherited value.
-
wForeground
- When wForeground is null, foreground is the inherited value.
-
wHilite
- When wHilite is null, hilite is the inherited value.
-
widgets
- The widgets that are contained by this widget.
-
width
- The width of this widget.
-
wScript
- This is the script which is currently being edited.
-
wTip
- REMIND
-
x
- The x-coordinate of the upper-left corner of this widget.
-
y
- The y-coordinate of the upper-left corner of this widget.
-
Widget()
- Construct a widget.
-
action()
- Execute the action associated with this widget.
-
action(Event, Object)
- By default a widget calls this function when a
action event occurs.
-
add(int, Widget)
- Add a widget at a given position.
-
add(Widget)
- Add a widget.
-
applyProperties(PropertyList)
- Apply new properties to an object
-
audioLoop(String)
- Play an audio clip looped.
-
audioLoop(URL)
- Play the audio clip at the given url looped.
-
audioPlay(String)
- Play an audio clip.
-
audioPlay(URL)
- Play an audio clip using a url.
-
audioStop(String)
- Stop an audio clip.
-
audioStop(URL)
- Stop the audio clip with the given url.
-
bounds()
- Get the bounds as a Rectangle object.
-
clearFocus()
- Remove the character focus.
-
clearPopups()
- Clear any popups associated with this widget.
-
createImage(ImageProducer)
- Creates an image from the specified image producer.
-
createImage(int, int)
- Creates an off-screen drawable Image to be used for double buffering.
-
currentFocus()
- Get the widget that has the current focus.
-
destroy()
- Called to destroy a widget.
-
disable()
- Disable the widget.
-
disable(boolean)
- Disable the widget.
-
enable()
- Enable the widget.
-
findWidget(String)
- Find a widget in this container.
-
firstFocus()
- Assign the focus to the first widget.
-
focusInterest()
- True if this widget is potentially interested in getting the focus.
-
getAudioClip(String)
- Get an audio clip.
-
getAudioClipAt(URL)
- Get an audio clip using a url.
-
getBackground()
- Get the background color.
-
getChildProperties(PropertyList)
- Get the properties for the children of this widget.
-
getCursor()
- Get the current mouse cursor of the presentation.
-
getDefaultButton()
- Get the default button.
-
getDescription()
- Get a short description of the widget.
-
getEditor()
- Get the name of the class that can be used for
in-place editing.
-
getFocusColor()
- Get the focus color,
which is the standard color of the focus rectangle.
-
getFont()
- Get the font.
-
getFontMetrics(Font)
- Get font metrics for a font.
-
getForeground()
- Get the foreground color.
-
getHilite()
- Get the hilite color.
-
getImage(String)
- Get an image.
-
getLayoutMgr()
- Get the layout manager for this widget.
-
getName()
- Get the name.
-
getParent()
- Return the widget's parent.
-
getPlayerPanel()
- Get the current player.
-
getPresentation()
- Get the presentation.
-
getProperties(PropertyList)
- Get the properties of this widget.
-
getSelBackground()
- Get the selection background color.
-
getSelFocusColor()
- Get the selection focus color,
which is the color of the focus rectangle around the selection bar.
-
getSelForeground()
- Get the selection foreground color.
-
getText()
- Get the text of the widget.
-
getText(String)
- Get the text of a named widget.
-
getTip()
- Get the tip.
-
getTip(int, int)
- Get the tip for a particular x,y location within the widget.
-
getValue()
- Get the value of the widget.
-
getValue(String)
- Get the value of a named widget.
-
getWidget(String)
- Get a widget by name.
-
getWidgetClass()
- Gets the widget class for this widget.
-
gotFocus(Event, Object)
- By default a widget calls this function when a
gotFocus event occurs.
-
gotoPage(String)
- Goto a page in the current folder.
-
gotoPage(String, String)
- Goto a page in a named folder
-
handleEvent(Event)
- Handle an event.
-
hasFocus()
- True if the current widget has the focus.
-
hide()
- Hide this widget.
-
imageUpdate(Image, int, int, int, int, int)
- Update the widget after more image data arrives.
-
init()
- Called to initialize a widget.
-
inside(int, int)
- Check if a point is inside the widget.
-
inside(int, int, int, int)
- Check if the widget is inside a rectangle.
-
invalidate()
- Invalidate the widget (the size has changed).
-
isDisabled()
- Check if disabled.
-
isShowing()
- Check if showing on screen.
-
isTransparent()
- Check whether this widget is transparent.
-
isVisible()
- Check if visible.
-
keyDown(Event, int)
- By default a widget calls this function when a
keyDown event occurs.
-
keyUp(Event, int)
- By default a widget calls this function when a
keyUp event occurs.
-
layout()
- Layout the widget.
-
list()
- Print the widget for debugging.
-
list(PrintStream, int)
- Print the widget with indentation for debugging.
-
locateWidget(int, int)
- Locate the topmost widget that contains the specified coordinate.
-
locateWidgets(Vector, int, int)
- Locate all the widgets that intersect with the given point and append them to
the vector, so that the front most ends up first.
-
locateWidgets(Vector, int, int, int, int)
- Locate all the widgets inside a rectangle.
-
location()
- Get the location as a Point object.
-
lostFocus(Event, Object)
- By default a widget calls this function when a
lostFocus event occurs.
-
mouseDown(Event, int, int)
- By default a widget calls this function when a
mouseDown event occurs.
-
mouseDrag(Event, int, int)
- By default a widget calls this function when a
mouseDrag event occurs.
-
mouseEnter(Event, int, int)
- By default a widget calls this function when a
mouseEnter event occurs.
-
mouseExit(Event, int, int)
- By default a widget calls this function when a
mouseExit event occurs.
-
mouseMove(Event, int, int)
- By default a widget calls this function when a
mouseMove event occurs.
-
mouseUp(Event, int, int)
- By default a widget calls this function when a
mouseUp event occurs.
-
move(int, int)
- Move the widget.
-
nextFocus()
- Assign the focus to the next widget that is located
to the right or below the current focus.
-
overlap(int, int, int, int)
- Check if the widget overlaps with rectangle.
-
paint(Graphics)
- Paint from scratch.
-
paint(Graphics, int, int, int, int)
- Paint part of the screen.
-
paintAll(Graphics, int, int, int, int)
- Paint everyting in the indicated area.
-
paramString(StringBuffer)
- Build a string describing the widget's parameters.
-
play(String)
- THIS METHOD WILL BE REMOVED IN the beta4 release,
It is still here for backward compatibility.
-
postEvent(Event)
- Post an event to this widget.
-
previousFocus()
- Assign the focus to the previous widget that is located
to the left or above the current focus.
-
remove()
- Remove this widget from its container.
-
remove(Widget)
- Remove a widget from this widget.
-
remove(Widget, int)
- Removes the widget, assuming that the given index
is the index of the widget in the widgets array.
-
removeAll()
- Remove all widgets from this widget.
-
repaint()
- Repaint the entrire widget as soon as possible.
-
repaint(int, int, int, int)
- This will repaint the indicated area of
the screen (local coordinates).
-
repaint(long)
- Repaint this widget.
-
repaint(long, int, int, int, int)
- This will repaint the indicated area of
the screen (local coordinates).
-
repaintParent(long, int, int, int, int)
- Repaint a part of the parent window.
-
replace(int, Widget)
- Replace a widget at a given position.
-
replace(Widget)
- Replace this widget with another widget.
-
replace(Widget, Widget)
- Replace a widget by another widget.
-
requestFocus()
- Ask the playerPanel for the focus.
-
resetCursor()
- Reset the current cursor to the default cursor
of the presentation.
-
reshape(int, int, int, int)
- Reshape the widget.
-
reshape(int, int, int, int, boolean)
- Reshape the widget.
-
resize(Dimension)
- Resize the widget.
-
resize(int, int)
- Resize the widget.
-
rmove(int, int)
- Move relative.
-
rscroll(int, int)
- Scroll the contents of this widget relative.
-
scroll(int, int)
- Scroll the contents of this widget.
-
setAttach(int, int, int, int)
- Set the attachments of this widget to the given
number of pixels.
-
setBackground(Color)
- Set the background color.
-
setCursor(int)
- Set the current mouse cursor in the presentation.
-
setEditor(Object)
- Set the editor for this widget.
-
setFont(Font)
- Set the font.
-
setForeground(Color)
- Set the foreground color.
-
setHilite(Color)
- Set the hilite color.
-
setLayoutMgr(WidgetLayoutMgr)
- Set the layout manager for this widget.
-
setName(String)
- Set the name.
-
setProperties(PropertyList)
- Set the properties of this widget.
-
setText(String)
- Set the text of a widget.
-
setText(String, String)
- Set the text of a named widget.
-
setTip(String)
- Set the tip.
-
setTransparent(boolean)
- Set the transparency.
-
setValue(Object)
- Set the value of the widget.
-
setValue(String, Object)
- Set the value of a named widget.
-
show()
- Show
-
show(boolean)
- Show conditionally.
-
size()
- Get the size as a Dimension object.
-
start()
- Called to start a widget.
-
stop()
- Called to stop a widget.
-
sync()
- Sync the toolkit.
-
tick(long, Object)
- The clock is ticking...
-
toBack()
- Send this widget to the back.
-
toBack(Widget)
- Move a widget to the back.
-
toFront()
- Bring this widget to the front.
-
toFront(Widget)
- Move a widget to the front.
-
toString()
- Convert the widget to a string for debugging.
-
update(Graphics)
- Update the widget, this will be called in
response to a repaint() request.
-
validate()
- Validate the widget.
defaultFont
public final static Font defaultFont
- The default font.
defaultForeground
public final static Color defaultForeground
- The default foreground color.
defaultBackground
public final static Color defaultBackground
- The default background color.
defaultHilite
public final static Color defaultHilite
- The default hilite color,
used to fill certain areas to hide the background.
name
public String name
- The name of this widget.
wTip
public String wTip
- REMIND
tip
public 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
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
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, show, hide
disabled
public boolean disabled
- A disabled widget does not accept any user input.
- See Also:
- isDisabled, enable, disable
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, rscroll
ty
public int ty
- The widget is translated in the y-direction
using this value.
- See Also:
- scroll, rscroll
x
public int x
- The x-coordinate of the upper-left corner of this widget.
y
public int y
- The y-coordinate of the upper-left corner of this widget.
width
public int width
- The width of this widget.
- See Also:
- resize
height
public int height
- The height of this widget.
- See Also:
- resize
north
public int north
- The number of pixels that the distance between the northern
side and this widget has to be.
- See Also:
- DETACHED, setAttach
east
public int east
- The number of pixels that the distance between the eatern
side and this widget has to be.
- See Also:
- DETACHED, setAttach
south
public int south
- The number of pixels that the distance between the southern
side and this widget has to be.
- See Also:
- DETACHED, setAttach
west
public int west
- The number of pixels that the distance between the western
side and this widget has to be.
- See Also:
- DETACHED, setAttach
wFont
public 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 Font font
- The current font. The font can be null after construction.
In that case getFont() returns wFont.
- See Also:
- wFont, getFont, setFont
wForeground
public 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 Color foreground
- The current foreground. The foreground can be null after construction.
In that case getForeground() returns wForeground.
- See Also:
- wForeground, getForeground, setForeground
wBackground
public 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 Color background
- The current background. The background can be null after construction.
In that case getBackground() returns wBackground.
- See Also:
- wBackground, getBackground, setBackground
wHilite
public 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 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:
- wHilite, getHilite, setHilite
parent
public Widget parent
- The parent container of this class.
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
layoutMgr
public WidgetLayoutMgr layoutMgr
- The layout manager for this widget.
- See Also:
- getLayoutMgr, setLayoutMgr
editor
public Object editor
- The editor for inline editing.
- See Also:
- getEditor, setEditor
wScript
public String wScript
- This is the script which is currently being edited. This script
may not reflect the actual state of the widget since it still
needs to be compiled
- See Also:
- script
script
public 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
Widget
public Widget()
- Construct a widget.
getProperties
public void getProperties(PropertyList list)
- Get the properties of this widget.
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.
applyProperties
public void applyProperties(PropertyList list)
- Apply new properties to an object
getParent
public Widget getParent()
- Return the widget's parent.
- See Also:
- parent
location
public Point location()
- Get the location as a Point object.
- See Also:
- x, y
size
public Dimension size()
- Get the size as a Dimension object.
- See Also:
- width, height
bounds
public Rectangle bounds()
- Get the bounds as a Rectangle object.
- See Also:
- x, y, width, height
getName
public String getName()
- Get the name.
- See Also:
- name
setName
public void setName(String name)
- Set the name.
- See Also:
- name
getTip
public String getTip()
- Get the tip.
- See Also:
- tip
getTip
public String getTip(int x,
int y)
- Get the tip for a particular x,y location within the widget.
- See Also:
- tip
setTip
public void setTip(String tip)
- Set the tip.
- See Also:
- tip
getFont
public Font getFont()
- Get the font.
- See Also:
- font
setFont
public void setFont(Font f)
- Set the font.
- See Also:
- font
getForeground
public Color getForeground()
- Get the foreground color.
- See Also:
- foreground
setForeground
public void setForeground(Color c)
- Set the foreground color.
- See Also:
- foreground
getBackground
public Color getBackground()
- Get the background color.
- See Also:
- background
setBackground
public void setBackground(Color c)
- Set the background color.
- See Also:
- background
getHilite
public Color getHilite()
- Get the hilite color.
- See Also:
- hilite
setHilite
public void setHilite(Color c)
- Set the hilite color.
- See Also:
- hilite
isTransparent
public boolean isTransparent()
- Check whether this widget is transparent.
- See Also:
- transparent
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:
- transparent
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
getPlayerPanel
public PlayerPanel getPlayerPanel()
- Get the current player.
getPresentation
public Presentation getPresentation()
- Get the presentation.
getEditor
public 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(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:
- cursor
setCursor
public void setCursor(int cursor)
- Set the current mouse cursor in the presentation.
- See Also:
- cursor
resetCursor
public void resetCursor()
- Reset the current cursor to the default cursor
of the presentation.
- See Also:
- defaultCursor
getFontMetrics
public FontMetrics getFontMetrics(Font font)
- Get font metrics for a font.
getImage
public Image getImage(String src)
- Get an image.
isDisabled
public boolean isDisabled()
- Check if disabled.
- See Also:
- disabled
enable
public void enable()
- Enable the widget.
- See Also:
- disabled
disable
public void disable()
- Disable the widget.
- See Also:
- disabled
disable
public void disable(boolean disabled)
- Disable the widget.
- See Also:
- disabled
isVisible
public boolean isVisible()
- Check if visible.
- See Also:
- visible
isShowing
public boolean isShowing()
- Check if showing on screen.
- See Also:
- visible
show
public void show()
- Show
- See Also:
- visible
show
public void show(boolean flag)
- Show conditionally.
- Parameters:
- flag - if true then shows, if false then hides this widget
- See Also:
- hide, show
hide
public void hide()
- Hide this widget.
- See Also:
- visible
getValue
public 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 Object getValue(String name)
- Get the value of a named widget.
- See Also:
- getWidget
setValue
public void setValue(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(String name,
Object value)
- Set the value of a named widget.
- See Also:
- getWidget
getText
public 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 String getText(String name)
- Get the text of a named widget.
- See Also:
- getWidget
setText
public void setText(String text)
- Set the text of a widget. This will change the label for objects
that have a label.
setText
public void setText(String name,
String text)
- Set the text of a named widget.
- See Also:
- getWidget
gotoPage
public void gotoPage(String page)
- Goto a page in the current folder.
- See Also:
- gotoPage
gotoPage
public void gotoPage(String name,
String page)
- Goto a page in a named folder
- See Also:
- gotoPage, getWidget
inside
public boolean inside(int px,
int py)
- Check if a point is inside the widget. The point is specified in
the parent's coordinate system.
inside
public boolean inside(int px,
int py,
int pw,
int ph)
- Check if the 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
locateWidget
public Widget locateWidget(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.
locateWidgets
public void locateWidgets(Vector v,
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(Vector v,
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.
paintAll
protected void paintAll(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
paint
public void paint(Graphics g,
int x,
int y,
int width,
int height)
- Paint part of the screen.
paint
public void paint(Graphics g)
- Paint from scratch. Remember only to paint
what is inside the clipping area.
update
public void update(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().
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(Image img,
int flags,
int x,
int y,
int width,
int height)
- Update the widget after more image data arrives.
createImage
public Image createImage(ImageProducer producer)
- Creates an image from the specified image producer.
- Parameters:
- producer - the image producer
createImage
public Image createImage(int width,
int height)
- Creates an off-screen drawable Image to be used for double buffering.
- Parameters:
- width - the specified width
- height - the specified height
tick
public long tick(long tm,
Object arg)
- The clock is ticking...
- See Also:
- TimerClient
layout
public void layout()
- Layout 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
reshape
public void reshape(int x,
int y,
int width,
int height)
- Reshape the widget.
The coordinates are specified in the parent's coordinate system.
reshape
public void reshape(int x,
int y,
int width,
int height,
boolean repaint)
- Reshape the widget.
The coordinates are specified in the parent's coordinate system.
move
public void move(int x,
int y)
- Move the widget.
The coordinates are specified in the parent's coordinate system.
- See Also:
- reshape
rmove
public void rmove(int dx,
int dy)
- Move relative.
- See Also:
- reshape
resize
public void resize(Dimension d)
- Resize the widget.
resize
public void resize(int width,
int height)
- Resize the widget.
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. 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. This will
change the translation of the widget.
- See Also:
- tx, ty
add
public void add(Widget w)
- Add a widget.
- See Also:
- widgets, nwidgets
add
public void add(int pos,
Widget w)
- Add a widget at a given position.
- See Also:
- widgets, nwidgets
replace
public void replace(Widget newWidget)
- Replace this widget with another widget. This is usually
used when scripting widgets.
replace
public void replace(Widget oldWidget,
Widget newWidget)
- Replace a widget by another widget.
replace
public void replace(int pos,
Widget w)
- Replace a widget at a given position.
remove
public void remove()
- Remove this widget from its container.
- See Also:
- widgets, nwidgets
remove
public void remove(Widget w)
- Remove a widget from this widget.
- See Also:
- widgets, nwidgets
remove
protected void remove(Widget w,
int i)
- Removes 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.
removeAll
public synchronized void removeAll()
- Remove all widgets from this widget.
toFront
public void toFront()
- Bring this widget to the front.
toFront
public void toFront(Widget w)
- Move a widget to the front.
toBack
public void toBack()
- Send this widget to the back.
toBack
public void toBack(Widget w)
- Move a widget 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(String nm)
- Find a widget in this container. This method will only
look in the current container. It does not accept hierachical
names.
- See Also:
- getWidget
getWidget
public Widget getWidget(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.
- See Also:
- findWidget
getAudioClip
public AudioClip getAudioClip(String src)
- Get an audio clip.
getAudioClipAt
public AudioClip getAudioClipAt(URL url)
- Get an audio clip using a url.
play
public void play(String src)
- THIS METHOD WILL BE REMOVED IN the beta4 release,
It is still here for backward compatibility.
New method: audioPlay.
- See Also:
- audioPlay
audioPlay
public void audioPlay(String src)
- Play an audio clip.
audioPlay
public void audioPlay(URL url)
- Play an audio clip using a url.
audioLoop
public void audioLoop(String src)
- Play an audio clip looped.
audioLoop
public void audioLoop(URL url)
- Play the audio clip at the given url looped.
audioStop
public void audioStop(String src)
- Stop an audio clip.
audioStop
public void audioStop(URL url)
- Stop the audio clip with the given url.
getSelForeground
public Color getSelForeground()
- Get the selection foreground color.
- See Also:
- getSelBackground
getSelBackground
public Color getSelBackground()
- Get the selection background color.
- See Also:
- getSelForeground
getSelFocusColor
public Color getSelFocusColor()
- Get the selection focus color,
which is the color of the focus rectangle around the selection bar.
- See Also:
- getFocusColor
getFocusColor
public 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.
Returns null if no default button is found or if no playerpanel exists.
Returns the first default button found, if more default buttons exist.
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.
- 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.
postEvent
public boolean postEvent(Event evt)
- Post an event to this widget. If the widget does not
handle the event, it is passed to the parent.
- See Also:
- handleEvent
handleEvent
public boolean handleEvent(Event evt)
- Handle an event.
- See Also:
- postEvent
mouseDown
public boolean mouseDown(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(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(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(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(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(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(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(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(Event evt,
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(Event evt,
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(Event evt,
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(StringBuffer buf)
- Build a string describing the widget's parameters.
This string is used in toString.
- See Also:
- toString
getWidgetClass
public Class getWidgetClass()
- Gets 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 String getDescription()
- Get a short description of the widget.
toString
public String toString()
- Convert the widget to a string for debugging.
- Overrides:
- toString in class Object
- See Also:
- paramString
list
public void list()
- Print the widget for debugging.
list
public void list(PrintStream out,
int n)
- Print the widget with indentation for debugging.
This function uses toString to print the widget.
- See Also:
- toString
All Packages Class Hierarchy This Package Previous Next Index