snap.adapter
Class JavaTechnologyAdapter

java.lang.Object
  |
  +--snap.adapter.TechnologyAdapter
        |
        +--snap.adapter.JavaTechnologyAdapter
All Implemented Interfaces:
java.util.EventListener, java.lang.Runnable, SnapEventListener

public class JavaTechnologyAdapter
extends TechnologyAdapter
implements SnapEventListener, java.lang.Runnable

Adapter between Snap's general interface to the interface specific for Java visualizations. This adapter makes the event multi-threaded by implementing a thread for event visualization. All events are queued and fired in FIFO manner. The adapter adds a "Load" action as a supported event. Any "Load" SnapEvents are converted into a call to the Snapable interface's load() method.

Author:
Nathan Conklin - nathan@conklinfamily.net, Varun Saini - vsaini@vt.edu, Chris North - north@cs.vt.edu, Umer Farooq - ufarooq@vt.edu

Constructor Summary
JavaTechnologyAdapter(snap.Snap snap, snap.Snapable visualization)
          Constructs the JavaTechnologyAdapter with a reference to the Java-based visualization that it will talk to.
 
Method Summary
 javax.swing.Icon getIcon()
          Returns the component's Icon or tries to find a default Icon
 java.util.Enumeration getSupportedActions()
          Returns the list of Actions supported by the visualization
 void load(snap.database.Query query)
          Enqueues the Query to be loaded by the visualization
 void performSnapEvent(snap.SnapEvent event)
          Enqueues the SnapEvent to be performed by the visualization
 void run()
          Run's the JavaTechnologyAdapter in its own thread.
 void snapEventOccured(snap.SnapEvent e)
          Enqueues the SnapEvent to be performed by Snap
 
Methods inherited from class snap.adapter.TechnologyAdapter
addSnapEventListener, getNode, removeSnapEventListener, setNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaTechnologyAdapter

public JavaTechnologyAdapter(snap.Snap snap,
                             snap.Snapable visualization)
Constructs the JavaTechnologyAdapter with a reference to the Java-based visualization that it will talk to.

Method Detail

getIcon

public javax.swing.Icon getIcon()
Returns the component's Icon or tries to find a default Icon

Specified by:
getIcon in class TechnologyAdapter

load

public void load(snap.database.Query query)
Enqueues the Query to be loaded by the visualization

Specified by:
load in class TechnologyAdapter

performSnapEvent

public void performSnapEvent(snap.SnapEvent event)
Enqueues the SnapEvent to be performed by the visualization

Specified by:
performSnapEvent in class TechnologyAdapter

snapEventOccured

public void snapEventOccured(snap.SnapEvent e)
Enqueues the SnapEvent to be performed by Snap

Specified by:
snapEventOccured in interface SnapEventListener

getSupportedActions

public java.util.Enumeration getSupportedActions()
Returns the list of Actions supported by the visualization

Specified by:
getSupportedActions in class TechnologyAdapter

run

public void run()
Run's the JavaTechnologyAdapter in its own thread.

Specified by:
run in interface java.lang.Runnable