Class ConceptWebClient

  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byConceptWebClient
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener,

public class ConceptWebClient
extends java.applet.Applet
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener

The ConceptWebClient class is the main class for the web client. It presents a concept map drawing tool similar in functionality to Dia, Visio (tm) or other schematic tools. The feature set implemented by this class is not as exhaustive as standard schematic tools; rather, it is limited to those features necessary to draw a concept map generally involving ten words or less. This reduces the size of the applet so as to be realistic in terms of network bandwidth as well as simplifying users' ability to understand and work with the applet interface.

Technical Notes

Description of pixel-based, graphical layout:
          <----------- applet_width ----------->
       ^   ------------------------------------
       |  |    ^                        ^      |
       |  |    |         top_space      |      |
       a  |    V                        V      |
       p  |------------------------------------|
       p  |<->|<------- space_width ------>|<->|
       l  | l |      ^                     | r |
       e  | e |      |                     | g |
       t  | f | space_height               | h |
       _  | t |      |                     | t |
       h  | s |      |                     | s |
       e  | p |      |                     | p |
       i  | a |      |                     | a |
       g  | c |      |                     | c |
       h  | e |      V                     | e |
       t  |------------------------------------|
       |  |    ^                        ^      |
       |  |    |       bottom_space     |      |
       |  |    V                        V      |
       V   ------------------------------------

JDK 1.3.1
See Also:
Serialized Form

Nested Class Summary
Nested classes inherited from class java.applet.Applet
Nested classes inherited from class java.awt.Panel
Nested classes inherited from class java.awt.Container
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
Field Summary
Fields inherited from class java.awt.Component
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Whenever an event occurs for an interface object.
 void destroy()
          Cleans up memory.
 void init()
          Run once at beginning of program.
 boolean is_disabled(int num)
          Is a given feature number disabled?
In order to condense the feature list, I am indexing them as numbers.
 void mouseClicked(java.awt.event.MouseEvent e)
          Nothing happens.
 void mouseDragged(java.awt.event.MouseEvent e)
          What to do when mouse is in motion.
 void mouseEntered(java.awt.event.MouseEvent e)
          Nothing happens.
 void mouseExited(java.awt.event.MouseEvent e)
          Nothing happens.
 void mouseMoved(java.awt.event.MouseEvent e)
 void mousePressed(java.awt.event.MouseEvent e)
          What to do when mouse button is pressed.
 void mouseReleased(java.awt.event.MouseEvent e)
          What to do when mouse button is released.
 void paint(java.awt.Graphics g)
          Coordinates push_information_everywhere invocation.
 void push_information_everywhere(java.awt.Graphics g, java.awt.Rectangle clip)
          Pushes information.
static void stringlist_shuffle(java.lang.String[] string_list)
          Take a list of strings and shuffle them.
 java.lang.String unescape(java.lang.String word)
          Unescape string.
 void update(java.awt.Graphics g)
          Whenever the applet needs to update.
Methods inherited from class java.applet.Applet
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
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, 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 ConceptWebClient()
Constructor. Things to do before launching applet in runtime environment.

Method Detail


public java.lang.String unescape(java.lang.String word)
Unescape string. A '@' ("at" sign) + ';' ("semicolon" sign) combination is used since java's getParameter method can pre-empt processing of ampersand-semicolon escaping.

word - The word to substitute escaped values with "real" values.


public static void stringlist_shuffle(java.lang.String[] string_list)
Take a list of strings and shuffle them.

string_list - The list to shuffle.


public void init()
Run once at beginning of program. Initializes values with various predefined constants. (Note that this is a very lengthy method.)


public void push_information_everywhere(java.awt.Graphics g,
                                        java.awt.Rectangle clip)
Pushes information.

Currently a lot of logic occurs inside here. This function brings together the pushing of information onto the:

Other interface state changes also occur here such as drawing in color mode versus gray mode. The strategic idea regarding this function was inspired by the fact that different java virtual machines invoke the the paint and update methods at irreconcilably different times. Thus, the goal is to synchronize the pushing of information in one function as opposed to relying on paint, update, or repaint to do everything consistently.

In some respects, an additional advantage to this strategy is that it makes the code organization less diffuse and, for the programmer, helps process all information that needs to be passed to the user in a concerted manner.


public void paint(java.awt.Graphics g)
Coordinates push_information_everywhere invocation. Standard applet method. Should try and use screen buffer if available. This method invokes the push_information_everywhere method. (push_information_everywhere combines painting with a number of other network and internal state transactions).


public void destroy()
Cleans up memory. Standard applet method. Dispose of buffered screen memory if it exists.


public void update(java.awt.Graphics g)
Whenever the applet needs to update. Standard applet method. Simply call the paint method.


public void actionPerformed(java.awt.event.ActionEvent event)
Whenever an event occurs for an interface object. ActionListener method. Currently, no events for any objects are handled, since there are a few browser compatibility issues with AWT object events.

Specified by:
actionPerformed in interface java.awt.event.ActionListener


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


public void mouseDragged(java.awt.event.MouseEvent e)
What to do when mouse is in motion. Note: selected areas of the applet are redrawn only when the interface is in "MOVE" mode.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener


public void mouseClicked(java.awt.event.MouseEvent e)
Nothing happens.

Specified by:
mouseClicked in interface java.awt.event.MouseListener


public void mouseEntered(java.awt.event.MouseEvent e)
Nothing happens.

Specified by:
mouseEntered in interface java.awt.event.MouseListener


public void mouseExited(java.awt.event.MouseEvent e)
Nothing happens.

Specified by:
mouseExited in interface java.awt.event.MouseListener


public void mouseReleased(java.awt.event.MouseEvent e)
What to do when mouse button is released. Note: redraw the entire applet. Also, record that no word is selected.

Specified by:
mouseReleased in interface java.awt.event.MouseListener


public void mousePressed(java.awt.event.MouseEvent e)
What to do when mouse button is pressed. Note: determine the object that was hit based upon the mouse pointer coordinates. Based on the number of possibilities, this is a lengthy method.

Specified by:
mousePressed in interface java.awt.event.MouseListener


public boolean is_disabled(int num)
Is a given feature number disabled?
In order to condense the feature list, I am indexing them as numbers. This method mimics a hash table. Should probably use a real hash table, but I seem to recall browser incompatibility with this....