package osa.attribute.atgrammar.gui.panels.atgrammar_panels;

import java.util.*;

import javax.swing.*;

import java.awt.*;
import java.awt.event.*;

import osa.attribute.atgrammar.grammar.*;
import osa.attribute.atgrammar.grammar.symbols.*;



/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: </p>
 * <p>Company: </p>
 * @author not attributable
 * @version
 */
public class ATGrammarPane
  extends JPanel
  {
  protected static ATGrammarPane instance=null;

  public static ATGrammarPane getInstance()
    {
    return instance;
    }

  Grammar grammar_reference;

  GridLayout gridLayout1 = new GridLayout();

  ATGrammarEditorPane grammar_editor_pane;
  DictionaryPane dictionary_pane;
  AssignmentsTablePane assignments_table_pane;
  AttributesPane attributes_pane;

  public ATGrammarPane(Grammar grammar_reference)
    {
    this.grammar_reference=grammar_reference;

    grammar_editor_pane=new ATGrammarEditorPane(grammar_reference);
    dictionary_pane=new DictionaryPane(grammar_reference.getDictionary());
    assignments_table_pane=new AssignmentsTablePane();
    attributes_pane= new AttributesPane();

    try{
       jbInit();
       }
    catch(Exception e)
      {
      e.printStackTrace();
      }

    instance=this;
    }

  private void jbInit() throws Exception
    {
    gridLayout1.setColumns(2);
    gridLayout1.setHgap(5);
    gridLayout1.setRows(2);
    gridLayout1.setVgap(5);
    this.setLayout(gridLayout1);
    this.add(grammar_editor_pane, null);
    this.add(dictionary_pane, null);
    this.add(assignments_table_pane, null);
    this.add(attributes_pane, null);
    }

  public ATGrammarEditorPane getATGrammarEditorPane()
    {
    return grammar_editor_pane;
    }

  public DictionaryPane getDictionaryPane()
    {
    return dictionary_pane;
    }

  public AssignmentsTablePane getAssignmentsTablePane()
    {
    return assignments_table_pane;
    }

  public AttributesPane getAttributesPane()
    {
    return attributes_pane;
    }
  }