quoggles
Class QGraphConnect

java.lang.Object
  |
  +--quoggles.QGraphConnect

public class QGraphConnect
extends java.lang.Object


Field Summary
private  QMain qMain
           
private  java.util.Collection signs
          Colored bulbs indicating good / bad connections between boxes
 
Constructor Summary
QGraphConnect(QMain q)
           
 
Method Summary
 void checkConnections(boolean addEdges)
          Check which inputs and outputs are connected by searching through the io positions.
private  void connect(boolean addEdges, IBox box1, boolean isInput1, int index1, IBox box2, boolean isInput2, int index2, java.awt.Point conPoint)
          Adds a (green) sign showing the validness of the connection between box1 and box2.
private  void doCheckList(java.util.ArrayList checkList, boolean addEdges, java.awt.Point pt, javax.swing.JPanel mainPanel)
           
private  java.util.SortedMap fillTreeMap(PointComparator pointComparator)
          Sorts the absolute positions of ALL input and output positions.
 void reset()
           
private  void showUnconnected(java.awt.Point pt)
          Adds a (red) sign showing that tere is no valid connection at the given point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

signs

private java.util.Collection signs
Colored bulbs indicating good / bad connections between boxes


qMain

private QMain qMain
Constructor Detail

QGraphConnect

public QGraphConnect(QMain q)
Method Detail

connect

private void connect(boolean addEdges,
                     IBox box1,
                     boolean isInput1,
                     int index1,
                     IBox box2,
                     boolean isInput2,
                     int index2,
                     java.awt.Point conPoint)
Adds a (green) sign showing the validness of the connection between box1 and box2. The boolean parameters indicate whether the boxes need input (true) or output (false). The indices specify the index of the IO connection at the box. If the first parameter is true, an edge will be added to the query graph (if it does not already exist).

Parameters:
addEdges - specifies whether or not to update the query graph
box1 -
isInput1 - true iff first box wants an input
index1 -
box2 -
isInput2 -
index2 -
conPoint - the position where the sign appears

showUnconnected

private void showUnconnected(java.awt.Point pt)
Adds a (red) sign showing that tere is no valid connection at the given point.

Parameters:
pt -

fillTreeMap

private java.util.SortedMap fillTreeMap(PointComparator pointComparator)
Sorts the absolute positions of ALL input and output positions.

Parameters:
pointComparator -
Returns:
sorted map mapping absolute IO positions to BoxBooleanIndex objects

checkConnections

public void checkConnections(boolean addEdges)
Check which inputs and outputs are connected by searching through the io positions.

Parameters:
addEdges - if true, edges will be added to the queryGraph if two boxes are found to be connected.

doCheckList

private void doCheckList(java.util.ArrayList checkList,
                         boolean addEdges,
                         java.awt.Point pt,
                         javax.swing.JPanel mainPanel)

reset

public void reset()