package pointGroups.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import pointGroups.gui.event.EventDispatcher;
import pointGroups.gui.symchooser.SymmetryChooser;


public class MainFrame
  extends JFrame
{

  private static final long serialVersionUID = 1886397100814345247L;

  protected JMenuBar menuBar;
  protected JPanel schlegelView = new SchlegelView();
  protected JPanel pointPicker = new JPanel();
  protected JPanel symmetryChooser;
  protected JPanel coordinates;
  protected JPanel statusBar;
  
  protected EventDispatcher dispatcher = EventDispatcher.get();

  public MainFrame() {
 // setting up main split pane
    
    Component leftPanel = setUpLeftPanel();
    Component rightPanel = setUpRightPanel();    
    
    // ensures to drag the divider all the way to both sides
    Dimension minimumSize = new Dimension(0,0);
    leftPanel.setMinimumSize(minimumSize);
    rightPanel.setMinimumSize(minimumSize);
    
    JSplitPane mainSplitPane =
        new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel);
    mainSplitPane.setResizeWeight(0);
    mainSplitPane.setDividerLocation(320);
    mainSplitPane.setOneTouchExpandable(true);
    mainSplitPane.setBorder(BorderFactory.createEmptyBorder());
    
    menuBar = new Menubar(dispatcher);
    statusBar = new StatusBar(dispatcher);

    add(menuBar, BorderLayout.NORTH);
    add(mainSplitPane, BorderLayout.CENTER);
    add(statusBar, BorderLayout.SOUTH);
    
    setTitle("Point groups");
    setSize(1000, 800);
    setLocationRelativeTo(null); // center window
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
  }
  
  private JPanel setUpRightPanel() {
    schlegelView.setBackground(Color.CYAN);
    return schlegelView;
  }

  private Component setUpLeftPanel() {
    
    symmetryChooser = new SymmetryChooser();
    pointPicker.setBackground(Color.YELLOW);
    coordinates = new CoordinateView(3,dispatcher);
    
    JSplitPane leftTopComponent = new JSplitPane(JSplitPane.VERTICAL_SPLIT, symmetryChooser, pointPicker);
    JSplitPane leftComponent = new JSplitPane(JSplitPane.VERTICAL_SPLIT, leftTopComponent, coordinates);
    leftComponent.setBorder(BorderFactory.createEmptyBorder());
    leftTopComponent.setBorder(BorderFactory.createEmptyBorder());
    leftComponent.setOneTouchExpandable(true);
    leftTopComponent.setOneTouchExpandable(true);
    
    leftComponent.setDividerLocation(600);
    leftTopComponent.setDividerLocation(500);
    
    
    return leftComponent;
  }

  public static void main(String args[]) {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

      SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          new MainFrame();
        }
      });
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }
}

@@ -618,29 +618,8 @@
 View
- = new SchlegelView()
 ;%0A  
@@ -780,160 +780,439 @@
 ted 
-EventDispatcher dispatcher = EventDispatcher.get();%0A%0A  public MainFrame() %7B%0A // setting up main split pane%0A    %0A    Component leftPanel = setUpLeftPanel
+JSplitPane mainSplitPane;%0A  protected JSplitPane leftTopComponent;%0A  protected JSplitPane leftComponent;%0A  %0A  protected EventDispatcher dispatcher = EventDispatcher.get();%0A%0A  public MainFrame() %7B%0A    %0A    setTitle(%22Point groups%22);%0A    setSize(1000, 800);%0A    setLocationRelativeTo(null); // center window%0A    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A    %0A    // setting up main split pane%0A    schlegelView = new SchlegelView
 ();%0A
@@ -1225,20 +1225,19 @@
 mponent 
-righ
+lef
 tPanel =
@@ -1238,28 +1238,27 @@
 anel = setUp
-Righ
+Lef
 tPanel();   
@@ -1257,17 +1257,16 @@
 el();   
- 
 %0A    %0A  
@@ -1419,26 +1419,28 @@
 e);%0A    
-rightPanel
+schlegelView
 .setMini
@@ -1470,27 +1470,16 @@
    %0A    
-JSplitPane 
 mainSpli
@@ -1553,18 +1553,20 @@
 el, 
-rightPanel
+schlegelView
 );%0A 
@@ -1983,290 +1983,21 @@
  set
-Title(%22Point groups%22);%0A    setSize(1000, 800);%0A    setLocationRelativeTo(null); // center window%0A    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A    setVisible(true);%0A  %7D%0A  %0A  private JPanel setUpRightPanel() %7B%0A    schlegelView.setBackground(Color.CYAN);%0A    return schlegelView
+Visible(true)
 ;%0A  
@@ -2190,35 +2190,24 @@
 );%0A    %0A    
-JSplitPane 
 leftTopCompo
@@ -2290,27 +2290,16 @@
 r);%0A    
-JSplitPane 
 leftComp

add JSplitPanes as member variables to MainFrame.java