quoggles
Class QGraph

java.lang.Object
  |
  +--quoggles.QGraph
All Implemented Interfaces:
RepChangeListener

public class QGraph
extends java.lang.Object
implements RepChangeListener


Field Summary
private  java.util.Collection boxReps
          All BoxRepresentations that appear in the active query graph
private  java.util.Set inputNodes
          Holds all nodes that belong to input boxes
static int nextBoxNr
          Distinct number for the boxes
private  QMain qMain
          Used to communicate between the individual parts of the system
private  org.graffiti.graph.Graph queryGraph
          The graph underlying the query boxes
 
Constructor Summary
QGraph(QMain q)
           
 
Method Summary
 org.graffiti.graph.Node addBoxRep(BoxRepresentation boxRep, org.graffiti.graph.Node boxNode)
           
 BoxRepresentation addGraphInputBox()
          Add graph input box to system.
 IBox addSelectionInputBox()
          Add graph input box to system.
 java.util.Set getInputNodes()
           
 org.graffiti.graph.Graph getQueryGraph()
           
 void removeBox(IBox box)
           
 void removeInputBox(IBox box)
           
 void repChanged(RepChangeEvent event)
          Called when a BoxRepresentation changed.
 void reset()
           
 void setQueryGraph(org.graffiti.graph.Graph qGraph)
          Set a new query graph.
private  void updateQueryGraph(org.graffiti.graph.Graph newQueryGraph)
          Add boxes etc. according to given graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

qMain

private QMain qMain
Used to communicate between the individual parts of the system


queryGraph

private org.graffiti.graph.Graph queryGraph
The graph underlying the query boxes


boxReps

private java.util.Collection boxReps
All BoxRepresentations that appear in the active query graph


nextBoxNr

public static int nextBoxNr
Distinct number for the boxes


inputNodes

private java.util.Set inputNodes
Holds all nodes that belong to input boxes

Constructor Detail

QGraph

public QGraph(QMain q)
Method Detail

addGraphInputBox

public BoxRepresentation addGraphInputBox()
Add graph input box to system. Add a node for that to query graph.

Returns:
the new selection input box

addBoxRep

public org.graffiti.graph.Node addBoxRep(BoxRepresentation boxRep,
                                         org.graffiti.graph.Node boxNode)

reset

public void reset()

repChanged

public void repChanged(RepChangeEvent event)
Description copied from interface: RepChangeListener
Called when a BoxRepresentation changed. Source of the given event should be the BoxRepresentation that initiated the event.

Specified by:
repChanged in interface RepChangeListener
Parameters:
event -
See Also:
RepChangeListener.repChanged(quoggles.event.RepChangeEvent)

addSelectionInputBox

public IBox addSelectionInputBox()
Add graph input box to system. Add a node for that to query graph.

Returns:
the new selection input box

removeInputBox

public void removeInputBox(IBox box)

removeBox

public void removeBox(IBox box)

getQueryGraph

public org.graffiti.graph.Graph getQueryGraph()

setQueryGraph

public void setQueryGraph(org.graffiti.graph.Graph qGraph)
                   throws LoadFailedException
Set a new query graph.

This method calls reset() prior to setting the new graph. Afterwards it uses updateQueryGraph(Graph) to update local information.

checkConnections(boolean) is not called.

LoadFailedException

getInputNodes

public java.util.Set getInputNodes()

updateQueryGraph

private void updateQueryGraph(org.graffiti.graph.Graph newQueryGraph)
                       throws LoadFailedException
Add boxes etc. according to given graph.

Parameters:
newQueryGraph - new query graph
Throws:
LoadFailedException