|
Chemistry AppletsDavid N. Blauch |
||||||
| 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
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--bulbs.Bulbs
This applet displays a pair of bulbs separated by stopcock.
Applet Parameters
| NAME | Variable Type | Default | Description |
|---|---|---|---|
| BGColor | String | null | String containing a representation of an integer describing the RGB color for the applet background. |
| HoleDiameter | int | 4 | Diameter in pixels of the hole in the stopcock. |
| LeftColor | String | #FFA0A0 | String containing a representation of an integer describing the RGB color of the gas in the left bulb. |
| LeftDiameter | int | 0 | Diameter in pixels of the left bulb. If the value is zero, the applet automatically sets the diameter to fill the available area. |
| LeftVolume | double | 1.0 | Volume in liters for the left bulb. The volume of the right bulb is determined by the volume of the left bulb and the relative diameters of the two bulbs. |
| MixtureColor | String | #A0A0FF | String representation of an integer describing the RGB color of the gas mixture, which the gas when the stopcock is open. |
| RightColor | String | #A0FFA0 | String representation of an integer describing the RGB color of the gas in the right bulb. |
| RightDiameter | int | 0 | Diameter in pixels of the right bulb. If the value is zero, the applet automatically sets the diameter so the bulb fills the available display. |
| StopcockBorder | int | 3 | Width in pixels of the extent of the stopcock above and below the tube. |
| StopcockDiameter | int | 10 | Diameter in pixels of the body of the stopcock. |
| StopcockWidth | int | 16 | Width in pixels of the stopcock knob in the open position. |
| TubeLength | int | 20 | Length in pixels of the tube bearing the stopcock and situated between the two bulbs. |
| TubeWidth | int | 8 | Width in pixels of the tube bearing the stopcock and situated between the two bulbs. |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
Bulbs()
|
|
| Method Summary | |
void |
destroy()
|
java.lang.String |
getAppletInfo()
|
double |
getLeftVolume()
Returns the volume of the left bulb in liters |
java.lang.String |
getParameter(java.lang.String key,
java.lang.String def)
|
java.lang.String[][] |
getParameterInfo()
|
double |
getRightVolume()
Returns the volume of the right bulb in liters |
double |
getVolume()
Returns the volume of the two bulbs in liters. |
void |
init()
|
void |
paint(java.awt.Graphics g)
|
void |
setDiameters(int _leftDiameter,
int _rightDiameter)
Sets the diameters of the two bulbs. |
void |
setLeftColor(int _red,
int _green,
int _blue)
Sets the color of the gas in the left bulb. |
void |
setLeftColor(java.lang.String _color)
Sets the color of the gas in the left bulb. |
void |
setLeftVolume(double _volume)
Sets the volume of the left bulb. |
void |
setMixtureColor(int _red,
int _green,
int _blue)
Sets the color of the gas mixture. |
void |
setMixtureColor(java.lang.String _color)
Sets the color of the gas mixture. |
void |
setRightColor(int _red,
int _green,
int _blue)
Sets the color of the gas in the right bulb. |
void |
setRightColor(java.lang.String _color)
Sets the color of the gas in the right bulb. |
void |
setRightVolume(double _volume)
Sets the volume of the right bulb. |
void |
setStopcockState(boolean _state)
Sets the state of the stopcock. |
void |
start()
|
void |
stop()
|
| Methods inherited from class java.applet.Applet |
getAppletContext,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
getParameter,
isActive,
newAudioClip,
play,
play,
resize,
resize,
setStub,
showStatus |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setCursor,
setFont,
setLayout,
update,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public Bulbs()
| Method Detail |
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public void init()
public void start()
public void stop()
public void destroy()
public java.lang.String getAppletInfo()
public java.lang.String[][] getParameterInfo()
public double getLeftVolume()
public double getRightVolume()
public double getVolume()
public void paint(java.awt.Graphics g)
public void setDiameters(int _leftDiameter,
int _rightDiameter)
_leftDiameter - diameter in pixels of the left bulb_rightDiameter - diameter in pixels of the right bulbpublic void setLeftColor(java.lang.String _color)
_color - integer value used to construct color
public void setLeftColor(int _red,
int _green,
int _blue)
_red - red component of the color_green - green component of the color_blue - blue component of the colorpublic void setLeftVolume(double _volume)
_volume - volume in liters of left bulbpublic void setMixtureColor(java.lang.String _color)
_color - integer value used to construct color
public void setMixtureColor(int _red,
int _green,
int _blue)
_red - red component of the color_green - green component of the color_blue - blue component of the colorpublic void setRightColor(java.lang.String _color)
_color - integer value used to construct color
public void setRightColor(int _red,
int _green,
int _blue)
_red - red component of the color_green - green component of the color_blue - blue component of the colorpublic void setRightVolume(double _volume)
_volume - volume in liters of right bulbpublic void setStopcockState(boolean _state)
|
Chemistry AppletsDavid N. Blauch |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||