|
||||
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 | +--uwcse.graphics.AppletGWindow
The AppletGWindow class is an abstract class to be extended by clients that are to be run in an applet window within a web page. This is in contrast to a FrameGWindow which is created to represent a separate window.
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 | |
AppletGWindow()
Create a new interface to an applet. |
Method Summary | |
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 |
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. |
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, 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, transferFocus |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AppletGWindow()
Method Detail |
public boolean add(Shape s)
add
in interface uwcse.graphics.InternalGWindow
s
- a shape object (Rectangle, etc)public void addEventHandler(GWindowEventHandler handler)
addEventHandler
in interface uwcse.graphics.InternalGWindow
public void display(Shape s)
display
in interface uwcse.graphics.InternalGWindow
public void dispose()
uwcse.graphics.InternalGWindow
dispose
in interface uwcse.graphics.InternalGWindow
public void doRepaint()
doRepaint
in interface uwcse.graphics.InternalGWindow
public void erase()
erase
in interface uwcse.graphics.InternalGWindow
public GWindowEventHandler getEventHandler()
getEventHandler
in interface uwcse.graphics.InternalGWindow
public java.awt.Image getImageFromFilename(java.lang.String imageName)
getImageFromFilename
in interface uwcse.graphics.InternalGWindow
imageName
- the filename containing the imagepublic java.awt.Image getImageFromURL(java.lang.String imageURLName)
getImageFromURL
in interface uwcse.graphics.InternalGWindow
imageURL
- the URL containing the imagepublic int getWindowHeight()
getWindowHeight
in interface uwcse.graphics.InternalGWindow
public int getWindowWidth()
getWindowWidth
in interface uwcse.graphics.InternalGWindow
public void init()
init
in class java.applet.Applet
public Shape intersects(Shape aShape)
intersects
in interface uwcse.graphics.InternalGWindow
aShape
- the shape to test intersection againstpublic void moveAllBy(int deltaX, int deltaY)
moveAllBy
in interface uwcse.graphics.InternalGWindow
x
- the deltaXy
- the deltaYpublic void paint(java.awt.Graphics g)
paint
in class java.awt.Container
g
- a graphics context.public void print(java.lang.String msg)
print
in interface uwcse.graphics.InternalGWindow
msg
- the message to displaypublic boolean remove(Shape s)
remove
in interface uwcse.graphics.InternalGWindow
s
- a shape object (Rectangle, etc)public void resumeRepaints()
resumeRepaints
in interface uwcse.graphics.InternalGWindow
public void setExitOnClose()
uwcse.graphics.InternalGWindow
setExitOnClose
in interface uwcse.graphics.InternalGWindow
public void startTimerEvents(int intervalInMSecs)
startTimerEvents
in interface uwcse.graphics.InternalGWindow
public void stopTimerEvents()
stopTimerEvents
in interface uwcse.graphics.InternalGWindow
public void suspendRepaints()
suspendRepaints
in interface uwcse.graphics.InternalGWindow
public java.lang.String toString()
toString
in class java.awt.Component
public void update(java.awt.Graphics g)
update
in class java.awt.Container
public double version()
version
in interface uwcse.graphics.InternalGWindow
|
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |