Class BApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by BApplet
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer

public abstract class BApplet
extends javax.swing.JApplet
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.lang.Runnable

See Also:
Serialized Form

Nested Class Summary
(package private)  class BApplet.ImagePanel
           
 
Nested classes/interfaces inherited from class
javax.swing.JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  java.lang.Thread animator
           
(package private)  java.awt.Color backgroundColor
           
(package private)  int delay
           
(package private)  int frame
           
(package private)  boolean isAnimation
           
(package private)  java.awt.image.BufferedImage offScreen
           
(package private)  int x
           
 
Fields inherited from class
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BApplet()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent thisEvent)
           
 void addItem(java.awt.Component c)
           
 void buttonPressed(java.awt.Component source)
           
 void clearScreen()
   Clears the set layer        
 void drawScreen()
           
 void echo(double s)
           
 void echo(int s)
           
 void echo(java.lang.String s)
           
 int findRandom(int start, int end)
           
 java.awt.Color findRandomColor()
           
 java.awt.Graphics

getG()

This returns the set layer to draw on

 java.awt.Graphics

getTempG()

This returns the temporary layer to draw on, always blank

 void init()
           
 void initialize()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(java.awt.Graphics g)
           
 void paintScreen(java.awt.Graphics g)
           
 void playSound(java.awt.Graphics g)
           
 double readDouble()
           
 int readInt()
           
 java.lang.String readString()
           
 void run()
          This method is called by the thread that was created in the start method.
 void setBackgroundColor(java.awt.Color c)
           
 void setBackgroundImage(java.lang.String filename)
           
 void start()
          This method is called when the applet becomes visible on the screen.
 void stop()
          This method is called when the applet is no longer visible.
 void update()
           
 void updateIt()
           
 
Methods inherited from class
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class
addNotify
 
Methods inherited from class
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, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

animator

java.lang.Thread animator

backgroundColor

java.awt.Color backgroundColor

delay

int delay

frame

int frame

isAnimation

boolean isAnimation

offScreen

java.awt.image.BufferedImage offScreen

x

int x
Constructor Detail

BApplet

public BApplet()
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent thisEvent)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

addItem

public void addItem(java.awt.Component c)

buttonPressed

public void buttonPressed(java.awt.Component source)

drawOnScreen

public void drawOnScreen()

echo

public void echo(double s)

echo

public void echo(int s)

echo

public void echo(java.lang.String s)

findRandom

public int findRandom(int start,
                      int end)

findRandomColor

public java.awt.Color findRandomColor()

getG

public java.awt.Graphics getG()

init

public void init()
Overrides:
init in class java.applet.Applet

initialize

public void initialize()

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

paintScreen

public void paintScreen(java.awt.Graphics g)

readDouble

public double readDouble()

readInt

public int readInt()

readString

public java.lang.String readString()

run

public void run()
This method is called by the thread that was created in the start method. It does the main animation.

Specified by:
run in interface java.lang.Runnable

setBackgroundColor

public void setBackgroundColor(java.awt.Color c)

setBackgroundImage

public void setBackgroundImage(java.lang.String filename)

start

public void start()
This method is called when the applet becomes visible on the screen. Create a thread and start it.

Overrides:
start in class java.applet.Applet

stop

public void stop()
This method is called when the applet is no longer visible. Set the animator variable to null so that the thread will exit before displaying the next frame.

Overrides:
stop in class java.applet.Applet

update

public void update()

updateIt

public void updateIt()