|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
bulbs.Bulbs
public class 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. |
| IsReady | String | JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature. | |
| 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. |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| 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 |
|---|
getAccessibleContext, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, 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()
init in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic void stop()
stop in class java.applet.Appletpublic void destroy()
destroy in class java.applet.Appletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Appletpublic double getLeftVolume()
public double getRightVolume()
public double getVolume()
public void paint(java.awt.Graphics g)
paint in class java.awt.Container
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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||