|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object buoy.event.EventSource buoy.widget.Widget buoy.widget.BColorChooser
public class BColorChooser
A BColorChooser is a Widget that allows the user to select a color. It has tabs which provide various ways of choosing the color, such as selecting one from a palette or specifying values for hue, saturation, and brightness.
BColorChooser can be used in two different ways. First, it can be added to a container like any other Widget. This is useful when you want it to appear inside of a window along with other Widgets.
Most often, however, BColorChooser is used in a modal dialog as a self contained user interface
element. To use it this way, you simply instantiate a BColorChooser, set any properties, and then
call showDialog()
to display it. showDialog()
will
automatically create a dialog, add the BColorChooser, display it, and block until the user
dismisses the dialog. You can reuse a single BColorChooser by repeatedly calling showDialog()
.
In addition to the event types generated by all Widgets, BColorChoosers generate the following event types:
Constructor Summary | |
---|---|
BColorChooser()
Create a new BColorChooser whose initial color is white. |
|
BColorChooser(java.awt.Color color,
java.lang.String title)
Create a new BColorChooser |
Method Summary | |
---|---|
java.awt.Color |
getColor()
Get the color selected in the BColorChooser. |
javax.swing.JColorChooser |
getComponent()
Get the java.awt.Component corresponding to this Widget. |
java.lang.String |
getTitle()
Get the title displayed on the dialog. |
void |
setColor(java.awt.Color color)
Set the color selected in the BColorChooser. |
void |
setTitle(java.lang.String title)
Set the title displayed on the dialog. |
boolean |
showDialog(Widget parent)
Show a dialog containing this BColorChooser and block until the user closes it. |
Methods inherited from class buoy.widget.Widget |
---|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible |
Methods inherited from class buoy.event.EventSource |
---|
addEventLink, addEventLink, removeEventLink |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BColorChooser()
public BColorChooser(java.awt.Color color, java.lang.String title)
color
- the color which is initially selectedtitle
- the title to display on the dialogMethod Detail |
---|
public javax.swing.JColorChooser getComponent()
Widget
getComponent
in class Widget
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public boolean showDialog(Widget parent)
getColor()
to determine what color was selected.
parent
- the dialog's parent Widget (usually a WindowWidget). This may be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |