// file: BugSearch.java
//

// import java libraries
//
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.tree.*;

/**
 * Handles the bug searching functionality, an extension of JPanel
 */
public class BugSearch extends JPanel {

    // declare global variables
    // 

    /**
     * BugTable variable used by class
     */
    public BugTable bugTable = null;

    /**
     * BugQuery variable used by class
     */
    public BugQuery bugQuery = null;
    
    // ---------------------------------------------------
    //
    // declare class constructors
    //
    // ---------------------------------------------------

    /**
     * default class constructor
     * @param varmint VarmintPanel variable used for initialization
     */
    public BugSearch(VarmintPanel varmint) {


	// set the preferred and minimum sizes for the search panel
	//
	this.setMinimumSize(new Dimension(100,100));
	this.setPreferredSize(new Dimension(790,600));

	// set the layout to be the GridBag Layout
	//
	GridBagLayout gridbag = new GridBagLayout();
	this.setLayout(gridbag);
	GridBagConstraints c = new GridBagConstraints();
	
	// create the edit pane and add it to the panel
	//
	bugQuery = new BugQuery(varmint);
	
	// place the edit pane
	//
	c.gridx = 0;
	c.gridy = 0;
	c.gridwidth = GridBagConstraints.REMAINDER;
	c.gridheight = 2;
	c.weightx = 1;
	c.weighty = 0;
	c.anchor = GridBagConstraints.NORTHWEST;
	c.fill = GridBagConstraints.HORIZONTAL;
	c.insets = new Insets(0,0,0,0);
	gridbag.setConstraints(bugQuery.mountingPanel, c);
	this.add(bugQuery.mountingPanel);
	

	Vector vec1 = new Vector(6,6);
	Vector vec2 = new Vector(6,6);
	
	vec1.add("3Status");
	vec1.add("3BugNumber");
	vec1.add("3Priority");
	vec1.add("3Severity");
	vec1.add("3Owner");
	vec1.add("3Title");
	vec2.add(vec1);
	
	vec1 = new Vector(6,6);
	vec1.add("3Status");
	vec1.add("3BugNumber");
	vec1.add("3Priority");
	vec1.add("3Severity");
	vec1.add("3Owner");
	vec1.add("3Title");
	vec2.add(vec1);
	

	// create the table and add it to the panel
	//  
	bugTable = new BugTable(varmint, vec2);

	// place the table
	//
	c.gridx = 0;
	c.gridy = 2;
	c.gridwidth = GridBagConstraints.REMAINDER;
	c.gridheight = GridBagConstraints.REMAINDER;
	c.weightx = 1;
	c.weighty = 1;
	c.anchor = GridBagConstraints.NORTHWEST;
	c.fill = GridBagConstraints.BOTH;
	c.insets = new Insets(0,0,0,0);
	gridbag.setConstraints(bugTable.scrollPane, c);
	this.add(bugTable.scrollPane);

    }
}














