summaryrefslogtreecommitdiff
path: root/src/main/scala/graphyx/gui/MainPanel.scala
blob: e4989e8e07598063d6b913ae37b84956f2c0717b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * Graphyx
 * copyright (c) 2009 Jakob Odersky
 * made available under the MIT License
*/

package graphyx.gui

import graphyx.graphics._
import sims._
import scala.swing._
import swing.event._
import GridBagPanel._
import java.awt.Insets

class MainPanel(container: Container) extends scala.swing.GridBagPanel {
  val c = new Constraints
  
  val menuPanel = new MenuPanel(container)
  val worldPanel = new WorldPanel(container)
  val controlPanel = new ControlPanel(container)
  val infoPanel = new InfoPanel(container)
  val optionsPanel = new OptionsPanel(container)
  val shapeInfoPanel = new ShapeInfoPanel(container)
  val gravityPanel = new GravityPanel(container)
  
  val splitter = new SplitPane {
    orientation = Orientation.Vertical
    continuousLayout = true
    resizeWeight = 1
    dividerSize = 2
    leftComponent = worldPanel
    rightComponent = new SplitPane {
      orientation = Orientation.Horizontal
      continuousLayout = true
      resizeWeight = 1
      dividerSize = 2
      topComponent = new SplitPane{
        orientation = Orientation.Horizontal
        continuousLayout = true
        resizeWeight = 1
        dividerSize = 2
        topComponent = infoPanel
        bottomComponent = gravityPanel
      }
      bottomComponent = optionsPanel
    }
  }
  c.fill = Fill.Both

  c.gridx = 0
  c.gridy = 0
  c.weightx = 1.0
  c.weighty = 0.0
  super.add(menuPanel, c)
  
  c.gridx = 0
  c.gridy = 1
  c.weightx = 1.0
  c.weighty = 0.0
  super.add(controlPanel, c)
  
  
  c.gridx = 0
  c.gridy = 2
  c.weightx = 1.0
  c.weighty = 1.0
  super.add(splitter, c)
  
  /*
  c.gridx = 1
  c.gridy = 1
  c.weightx = 0.0
  c.weighty = 1.0
  super.add(infoPanel, c)
  */
}