java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--ClickBtn
click button, used on a html page as an applet, it will rotate between 2 images, looking like the image is turning round. the image is configured by applet parameters. these are as follows: ClickNoise the au file to play when clicked. EnterNoise the au file to play when mouse is over item ImageSrc the first image to rotate ImageDest the other image to rotate ImageBack use this to set an image background ImageBkCol use this to set a background colour URLName the name of the URL associated with the button
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
ClickBtn()
empty constructor, see init |
Method Summary | |
protected void |
BumpCurrentState()
move on the current state value, check if its looped. |
void |
init()
read in all the parameters, and get the applet ready to start rotating between the 2 images |
boolean |
mouseDown(java.awt.Event evt,
int x,
int y)
on a mouse down we draw the object "pressed" and play the click sound |
boolean |
mouseEnter(java.awt.Event evt,
int x,
int y)
when the mouse is entered, show status of goto: URLPage., then set the cursor to a hand pointer. |
boolean |
mouseExit(java.awt.Event evt,
int x,
int y)
when exited reset the cursor and unset the entered control condition |
boolean |
mouseUp(java.awt.Event evt,
int x,
int y)
on a mouse up we draw the object "normally" and goto the URL |
protected void |
myDraw3DRect(java.awt.Graphics g,
int x,
int y,
int w,
int h,
boolean raised)
draws a 3d rectangle, of a width and height, raised or indented |
void |
paint(java.awt.Graphics gfx)
draw my offscreen image, avoids paint problems. |
protected void |
redrawAll()
redraw the offscreen image, and bump the current state of the rotation |
void |
run()
stay in a loop repainting, the screen and delaying a while |
void |
start()
start applet and create new thread |
void |
stop()
kill the thread, were done |
Methods inherited from class java.applet.Applet |
destroy,
getAppletContext,
getAppletInfo,
getAudioClip,
getAudioClip,
getCodeBase,
getDocumentBase,
getImage,
getImage,
getLocale,
getParameter,
getParameterInfo,
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,
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,
mouseDrag,
mouseMove,
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,
setCursor,
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 ClickBtn()
Method Detail |
public void init()
protected void BumpCurrentState()
public void paint(java.awt.Graphics gfx)
protected void myDraw3DRect(java.awt.Graphics g, int x, int y, int w, int h, boolean raised)
g
- the device to draw onx
- the starting x locationy
- the starting y locationw
- the width of the rectangleh
- the height of the rectangleraised
- true to draw a raised rectangle, false indentedprotected void redrawAll()
public void start()
public void stop()
public void run()
public boolean mouseDown(java.awt.Event evt, int x, int y)
public boolean mouseUp(java.awt.Event evt, int x, int y)
public boolean mouseEnter(java.awt.Event evt, int x, int y)
public boolean mouseExit(java.awt.Event evt, int x, int y)