|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--ptolemy.gui.Query
Create a query with various types of entry boxes and controls.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected java.awt.Color |
_background
The background color as set by setBackground(). |
protected java.awt.GridBagConstraints |
_constraints
Standard constraints for use with _grid. |
protected java.awt.GridBagLayout |
_grid
Layout control. |
protected java.util.Vector |
_listeners
List of registered listeners. |
static int |
DEFAULT_ENTRY_WIDTH
|
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
Query()
Construct a panel with no queries in it. |
Method Summary | |
protected void |
_addPair(javax.swing.JLabel label,
java.awt.Component widget)
Add a label and a widget to the panel. |
void |
addCheckBox(java.lang.String name,
java.lang.String label,
boolean defaultValue)
Create an on-off check box. |
void |
addChoice(java.lang.String name,
java.lang.String label,
java.lang.String[] values,
java.lang.String defaultValue)
Create a choice menu. |
void |
addDisplay(java.lang.String name,
java.lang.String label,
java.lang.String defaultValue)
Create a simple one-line text display, a non-editable value that is set externally using the setDisplay() method. |
void |
addLine(java.lang.String name,
java.lang.String label,
java.lang.String defaultValue)
Create a single-line entry box with the specified name, label, and default value. |
void |
addQueryListener(QueryListener listener)
Add a listener. |
void |
addRadioButtons(java.lang.String name,
java.lang.String label,
java.lang.String[] values,
java.lang.String defaultValue)
Create a bank of radio buttons. |
void |
addSlider(java.lang.String name,
java.lang.String label,
int defaultValue,
int min,
int max)
Create a slider with the specified name, label, default value, maximum, and minimum. |
boolean |
booleanValue(java.lang.String name)
Get the current value in the entry with the given name and return as a boolean. |
double |
doubleValue(java.lang.String name)
Get the current value in the entry with the given name and return as a double value. |
int |
intValue(java.lang.String name)
Get the current value in the entry with the given name and return as an integer. |
void |
removeQueryListener(QueryListener listener)
Remove a listener. |
void |
setBackground(java.awt.Color color)
Set the background color for all the widgets. |
void |
setBoolean(java.lang.String name,
boolean value)
Set the current value in the entry with the given name. |
void |
setDisplay(java.lang.String name,
java.lang.String value)
Set the displayed text of an item that has been added using addDisplay. |
void |
setEnabled(java.lang.String name,
boolean boole)
For entries for which it is appropriate, if the second argument is false, then it will be disabled. |
void |
setTextWidth(int characters)
Specify the preferred width to be used for entry boxes created in using addLine(). |
java.lang.String |
stringValue(java.lang.String name)
Get the current value in the entry with the given name, and return as a String. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int DEFAULT_ENTRY_WIDTH
protected java.awt.Color _background
protected java.awt.GridBagLayout _grid
protected java.awt.GridBagConstraints _constraints
protected java.util.Vector _listeners
Constructor Detail |
public Query()
Method Detail |
public void addCheckBox(java.lang.String name, java.lang.String label, boolean defaultValue)
name
- The name used to identify the entry (when calling get).label
- The label to attach to the entry.defaultValue
- The default value.public void addChoice(java.lang.String name, java.lang.String label, java.lang.String[] values, java.lang.String defaultValue)
name
- The name used to identify the entry (when calling get).label
- The label to attach to the entry.values
- The list of possible choices.defaultValue
- Default value (true for on).public void addDisplay(java.lang.String name, java.lang.String label, java.lang.String defaultValue)
name
- The name used to identify the entry (when calling get).label
- The label to attach to the entry.defaultValue
- Default string to display.public void addLine(java.lang.String name, java.lang.String label, java.lang.String defaultValue)
name
- The name used to identify the entry (when accessing
the entry).label
- The label to attach to the entry.defaultValue
- Default value to appear in the entry box.public void addQueryListener(QueryListener listener)
listener
- The listener to add.public void addRadioButtons(java.lang.String name, java.lang.String label, java.lang.String[] values, java.lang.String defaultValue)
name
- The name used to identify the entry (when calling get).label
- The label to attach to the entry.values
- The list of possible choices.defaultValue
- Default value.public void addSlider(java.lang.String name, java.lang.String label, int defaultValue, int min, int max)
name
- The name used to identify the slider.label
- The label to attach to the slider.defaultValue
- Initial position of slider.max
- Maximum value of slider.min
- Minimum value of slider.public boolean booleanValue(java.lang.String name) throws java.util.NoSuchElementException, java.lang.IllegalArgumentException
public double doubleValue(java.lang.String name) throws java.lang.IllegalArgumentException, java.util.NoSuchElementException, java.lang.NumberFormatException
public int intValue(java.lang.String name) throws java.lang.IllegalArgumentException, java.util.NoSuchElementException, java.lang.NumberFormatException
public void removeQueryListener(QueryListener listener)
listener
- The listener to remove.public void setBackground(java.awt.Color color)
color
- The background color.public void setBoolean(java.lang.String name, boolean value) throws java.util.NoSuchElementException, java.lang.IllegalArgumentException
public void setDisplay(java.lang.String name, java.lang.String value)
name
- The name of the entry.value
- The string to display.public void setEnabled(java.lang.String name, boolean boole)
name
- The name of the entry.boole
- If false, disables the entry.public void setTextWidth(int characters)
characters
- The preferred width.public java.lang.String stringValue(java.lang.String name) throws java.util.NoSuchElementException
protected void _addPair(javax.swing.JLabel label, java.awt.Component widget)
label
- The label.widget
- The interactive entry to the right of the label.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |