quoggles
Class QMain

java.lang.Object
  |
  +--quoggles.QMain
All Implemented Interfaces:
org.graffiti.attributes.AttributeConsumer, org.graffiti.selection.SelectionListener, org.graffiti.session.SessionListener

public class QMain
extends java.lang.Object
implements org.graffiti.session.SessionListener, org.graffiti.selection.SelectionListener, org.graffiti.attributes.AttributeConsumer

Main component. it delegats work to and communicates with several others.


Field Summary
private  QAuxiliary qAux
           
private  QGraphConnect qConnect
           
private  QDialog qDialog
           
private  QGraph qGraph
           
private  QGraphMouse qMouse
           
private  QRunQuery qRunQuery
           
private  QResultDialog resultTableDialog
          The dialog holding the result table
private  IBox selInputBox
           
 
Constructor Summary
QMain()
           
 
Method Summary
 void addBox()
           
 void addBox(IBoxIcon boxIcon)
           
 org.graffiti.graph.Node addBoxRep(BoxRepresentation boxRep)
          Calls addBoxRep(boxRep, null);
 org.graffiti.graph.Node addBoxRep(BoxRepresentation boxRep, org.graffiti.graph.Node boxNode)
          Adds a BoxRepresentation to the panel, the query graph and all relevant lists.
 void checkConnections(boolean addEdges)
           
 void checkSelectionInputBox()
           
 void clearQuery()
           
 void close()
           
private static org.graffiti.graph.Graph createExampleGraph(org.graffiti.attributes.AttributeConsumer ac)
          Create a small example graph to work on when in standalone mode.
 QDialog getDialog()
          Returns the main dialog.
 org.graffiti.attributes.CollectionAttribute getEdgeAttribute()
           
 org.graffiti.attributes.CollectionAttribute getGraphAttribute()
           
 javax.swing.JPanel getMainPanel()
           
 org.graffiti.attributes.CollectionAttribute getNodeAttribute()
           
 org.graffiti.graph.Graph getQueryGraph()
          Returns the query graph.
 void loadQuery()
           
static void main(java.lang.String[] args)
          main method for debugging purposes and start of standalone mode.
 void removeBoxRep(BoxRepresentation boxRep)
          Removes a BoxRepresentation from the panel, the query graph and all relevant lists.
 void reset()
          Reset the query system.
 void runQuery()
           
 void runQueryInFollowMode(java.awt.Point pt)
           
 void saveQuery()
           
 void saveSubQuery()
           
 void selectionChanged(org.graffiti.selection.SelectionEvent e)
          Calls checkSelectionInputBox() to see if a selection InputBox must be added /removed.
 void selectionListChanged(org.graffiti.selection.SelectionEvent e)
          Delegates to selectionChanged.
 void sessionChanged(org.graffiti.session.Session s)
          Sets the graph from the new session via setGraph(s.getGraph()).
 void sessionDataChanged(org.graffiti.session.Session s)
          Sets the graph from the changed session via setGraph(s.getGraph()).
 void setFollowMode(boolean isFMOn)
           
 void setGraph(org.graffiti.graph.Graph graph)
          Set a new graph on which the query will work.
 void setPlaceFreely(boolean isPFOn)
           
 void showQDialog(boolean modal)
          Show the main dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultTableDialog

private QResultDialog resultTableDialog
The dialog holding the result table


qDialog

private QDialog qDialog

qGraph

private QGraph qGraph

qMouse

private QGraphMouse qMouse

qConnect

private QGraphConnect qConnect

qAux

private QAuxiliary qAux

qRunQuery

private QRunQuery qRunQuery

selInputBox

private IBox selInputBox
Constructor Detail

QMain

public QMain()
Method Detail

setGraph

public void setGraph(org.graffiti.graph.Graph graph)
Set a new graph on which the query will work.

Parameters:
graph -

getQueryGraph

public org.graffiti.graph.Graph getQueryGraph()
Returns the query graph.

Returns:
the query graph

getMainPanel

public javax.swing.JPanel getMainPanel()

runQueryInFollowMode

public void runQueryInFollowMode(java.awt.Point pt)

getDialog

public QDialog getDialog()
Returns the main dialog.

Returns:
the main dialog

showQDialog

public void showQDialog(boolean modal)
Show the main dialog.


checkSelectionInputBox

public void checkSelectionInputBox()

checkConnections

public void checkConnections(boolean addEdges)

reset

public void reset()
Reset the query system.


runQuery

public void runQuery()
              throws QueryExecutionException
QueryExecutionException

close

public void close()

saveQuery

public void saveQuery()
               throws java.io.IOException
java.io.IOException

loadQuery

public void loadQuery()
               throws LoadFailedException
LoadFailedException

saveSubQuery

public void saveSubQuery()
                  throws QueryExecutionException,
                         java.io.IOException
QueryExecutionException
java.io.IOException

clearQuery

public void clearQuery()

addBox

public void addBox()

setPlaceFreely

public void setPlaceFreely(boolean isPFOn)

setFollowMode

public void setFollowMode(boolean isFMOn)

addBox

public void addBox(IBoxIcon boxIcon)

sessionChanged

public void sessionChanged(org.graffiti.session.Session s)
Sets the graph from the new session via setGraph(s.getGraph()).

Specified by:
sessionChanged in interface org.graffiti.session.SessionListener
See Also:
(org.graffiti.session.Session)

sessionDataChanged

public void sessionDataChanged(org.graffiti.session.Session s)
Sets the graph from the changed session via setGraph(s.getGraph()).

Specified by:
sessionDataChanged in interface org.graffiti.session.SessionListener
See Also:
(org.graffiti.session.Session)

selectionChanged

public void selectionChanged(org.graffiti.selection.SelectionEvent e)
Calls checkSelectionInputBox() to see if a selection InputBox must be added /removed.

Specified by:
selectionChanged in interface org.graffiti.selection.SelectionListener
See Also:
(org.graffiti.selection.SelectionEvent)

selectionListChanged

public void selectionListChanged(org.graffiti.selection.SelectionEvent e)
Delegates to selectionChanged.

Specified by:
selectionListChanged in interface org.graffiti.selection.SelectionListener
See Also:
(org.graffiti.selection.SelectionEvent)

removeBoxRep

public void removeBoxRep(BoxRepresentation boxRep)
Removes a BoxRepresentation from the panel, the query graph and all relevant lists.

Parameters:
boxRep -

addBoxRep

public org.graffiti.graph.Node addBoxRep(BoxRepresentation boxRep)
Calls addBoxRep(boxRep, null);

Parameters:
boxRep - new representation

addBoxRep

public org.graffiti.graph.Node addBoxRep(BoxRepresentation boxRep,
                                         org.graffiti.graph.Node boxNode)
Adds a BoxRepresentation to the panel, the query graph and all relevant lists. If the given node is null, a new node is added to the query graph.

Parameters:
boxRep - new representation
boxNode - the node associated with the box

getNodeAttribute

public org.graffiti.attributes.CollectionAttribute getNodeAttribute()
Specified by:
getNodeAttribute in interface org.graffiti.attributes.AttributeConsumer
See Also:
AttributeConsumer.getNodeAttribute()

getEdgeAttribute

public org.graffiti.attributes.CollectionAttribute getEdgeAttribute()
Specified by:
getEdgeAttribute in interface org.graffiti.attributes.AttributeConsumer
See Also:
AttributeConsumer.getEdgeAttribute()

getGraphAttribute

public org.graffiti.attributes.CollectionAttribute getGraphAttribute()
Specified by:
getGraphAttribute in interface org.graffiti.attributes.AttributeConsumer
See Also:
AttributeConsumer.getGraphAttribute()

main

public static void main(java.lang.String[] args)
main method for debugging purposes and start of standalone mode.

Parameters:
args -

createExampleGraph

private static org.graffiti.graph.Graph createExampleGraph(org.graffiti.attributes.AttributeConsumer ac)
Create a small example graph to work on when in standalone mode.