public abstract class AppletGWindow
extends java.applet.Applet
Constructor and Description |
---|
AppletGWindow()
Create a new interface to an applet.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Shape s)
Add the given shape and paint it onto the screen.
|
void |
addEventHandler(GWindowEventHandler handler)
Add the given event handler.
|
void |
display(Shape s)
Simply adds this shape to the to-be-displayed queue.
|
void |
dispose()
Close the window.
|
void |
doRepaint()
Update the screen, if updates aren't suspended.
|
void |
erase()
Discards all of the shape objects and clears the screen.
|
GWindowEventHandler |
getEventHandler()
Answer the current event handler.
|
java.awt.Image |
getImage(java.lang.String imageName)
Deprecated.
|
java.awt.Image |
getImage(java.net.URL imageURL)
Deprecated.
|
java.awt.Image |
getImageFromFilename(java.lang.String imageName)
Create and return a new Image, given the filename of the image.
|
java.awt.Image |
getImageFromURL(java.lang.String imageURLName)
Create and return a new Image, given the URL of the image.
|
int |
getWindowHeight()
Return the height of the drawing area of the window (ignoring
title bar, borders, etc.)
|
int |
getWindowWidth()
Return the width of the drawing area of the window (ignoring
title bar, borders, etc.)
|
void |
init()
Called to initialize the applet.
|
Shape |
intersects(Shape aShape)
Return the shape that the argument shape intersects with, or null if none.
|
void |
moveAllBy(int deltaX,
int deltaY)
Translate the position of every object by the given deltas,
and repaint the screen.
|
void |
paint(java.awt.Graphics g)
Do a paint operation.
|
void |
print(java.lang.String msg)
Display a dialog message in a pop-up window.
|
boolean |
remove(Shape s)
Remove the given shape and repaint the screen.
|
void |
resumeRepaints()
Resume repaints.
|
void |
setExitOnClose()
If this is called, the application will exit when a GWindow is
closed.
|
void |
startTimerEvents(int intervalInMSecs)
Start delivering timer events to the AppletGWindow.
|
void |
stopTimerEvents()
Stop delivering timer events to the AppletGWindow.
|
void |
suspendRepaints()
Suspend repaints.
|
java.lang.String |
toString() |
void |
update(java.awt.Graphics g)
When we update the window, we just do a paint(g).
|
double |
version()
Answer the version number.
|
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
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, transferFocusDownCycle, validate
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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
public AppletGWindow()
public void init()
init
in class java.applet.Applet
public void doRepaint()
public void suspendRepaints()
public void resumeRepaints()
public int getWindowWidth()
public int getWindowHeight()
public void paint(java.awt.Graphics g)
paint
in class java.awt.Container
g
- a graphics context.public void update(java.awt.Graphics g)
update
in class java.awt.Container
public boolean add(Shape s)
s
- a shape object (Rectangle, etc)public void display(Shape s)
public boolean remove(Shape s)
s
- a shape object (Rectangle, etc)public void erase()
public void moveAllBy(int deltaX, int deltaY)
x
- the deltaXy
- the deltaYpublic Shape intersects(Shape aShape)
aShape
- the shape to test intersection againstpublic void addEventHandler(GWindowEventHandler handler)
public GWindowEventHandler getEventHandler()
public void setExitOnClose()
public void dispose()
public void startTimerEvents(int intervalInMSecs)
public void stopTimerEvents()
public void print(java.lang.String msg)
msg
- the message to displaypublic java.awt.Image getImageFromFilename(java.lang.String imageName)
imageName
- the filename containing the imagepublic java.awt.Image getImageFromURL(java.lang.String imageURLName)
imageURL
- the URL containing the imagepublic java.awt.Image getImage(java.lang.String imageName)
imageName
- the filename containing the imagepublic java.awt.Image getImage(java.net.URL imageURL)
getImage
in class java.applet.Applet
imageURL
- the URL containing the imagepublic java.lang.String toString()
toString
in class java.awt.Component
public double version()