|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--javax.swing.JApplet | +--GooguRedo.googu
GOOGU is a utility for displaying and monitoring the output of a wide variety of computation-intensive programs, including those programs which make use of GAGA, the General Architecture for Genetic Algorithms. It reads text files in a simple format free of architecture-dependencies. GOOGU is designed to be reasonably fast, capable of reading files from any number of sources in serial or parallel and in realtime or after action, usable on a wide variety of platforms and across the Internet, extremely powerful, and easily extensible by relatively inexperienced programmers. To meet these goals, GOOGU is written using fully standard, documented features of Java 1.0.3, and has been extensively tested as both an application and an applet running in many popular browser versions. All I/O operations, threading details, and non-view-specific user input are isolated from the actual graphical views, making the addition of a new almost-arbitrary view trivial even to those unfamiliar with the internals of GOOGU.
------------------------------------------------------------------------------- Construction of a View In the old versions of GAVis and GOOGU prior to version 1.1.1, a view was simply an object derived from java.awt.Canvas. However, GOOGU version 1.1.2 and later, including the stable 1.2 series, offers a slightly more complex but much more powerful model. The concept of a view has been replaced by a ViewContainer, which is derived from java.awt.Panel. The ViewContainer need only implement a few simple methods and hold the parts of the view which are capable of actually drawing the data. Unlike the old view model, ViewContainers also offer the ability to include non-drawing objects such as buttons and pulldown menus, and multiple drawing objects in the same view. The ViewContainer will contain the following by default: protected ViewLoader _vl; protected Thread _vlThread; Also, several methods are included for control of the ViewLoader and its Thread. These methods are invoked automatically by GOOGU. You should not need to override or invoke these methods. You have been warned. In fact, having access to the _vlThread is not usually very useful as it should be controlled by GOOGU internals. Nevertheless, it is accessible if you need it for some reason. This leaves only four items of interest to view programmers: The ViewLoader, which contains the data you want to draw, the method void clear (), which clears your view, and the method void update (Observable o, Object arg). The clear () method may be empty or contain a few lines to clear off your drawing area(s). The ViewLoader object will probably be given as an argument to your drawing area(s)' constructors so they can access the data in it, and update, which will be called with o == _vl and arg an Integer ViewLoader.MSG_XXXXX. Typically, your response to this call should be to tell your drawing areas to update themselves in some way, most likely by using the Respond () method, followed by a call to validate (). These methods are covered in greater detail in a later section. ------------------------------------------------------------------------------- I/O Operations I/O operations are handled entirely within GOOGU internals. There should be no need to be concerned with the details of I/O. If you need to modify GOOGU's I/O operation, read the comments in ViewLoader.java and GooguReader.java. ------------------------------------------------------------------------------- The ColorMap GOOGU includes a general ColorMap class which provides three utility methods, both of which return objects of type java.awt.Color. If your view will use different colors to represent data, it is likely you will make use of this class. It provides: public static final long length (), which returns the number of base (full-saturation) colors available, public static final Color MAP (int i), which returns a full-saturation color from magenta (0) to red, orange, yellow, green, blue, and violet (length()). Invalid arguments result in black being returned. public static final Color ShadeMap (int i, double shade), which returns the fully-saturated color i with all its components multiplied by shade, which is between 0.0 (full black) and 1.0 (fully-saturated color). Invalid arguments result in a return value of black. The useful number of distinct colors from the ShadeMap is approximately 255 * 1276 + 1. MAP can return 1277 distinct colors. Although up to 16M colors are possible according to java.awt.Color, most views will not need more than the ~320K colors the ColorMap class provides. If you need more, you can use the appropriate methods from java.awt.Color.
Field Summary |
Fields inherited from class javax.swing.JApplet |
accessibleContext, rootPane, rootPaneCheckingEnabled |
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 | |
googu()
Creates new form googuApplet |
Method Summary | |
static void |
main(java.lang.String[] args)
|
java.awt.Dimension |
setMinimumSize()
|
java.awt.Dimension |
setPreferredSize()
|
void |
start()
|
void |
stop()
|
void |
update(java.util.Observable o,
java.lang.Object obj)
|
Methods inherited from class javax.swing.JApplet |
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.applet.Applet |
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, 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, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
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, getBackground, 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, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public googu()
Method Detail |
public static void main(java.lang.String[] args)
public void start()
start
in class java.applet.Applet
public void stop()
stop
in class java.applet.Applet
public void update(java.util.Observable o, java.lang.Object obj)
update
in interface java.util.Observer
public java.awt.Dimension setPreferredSize()
public java.awt.Dimension setMinimumSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |