summaryrefslogtreecommitdiff
path: root/src/graphyx/gui/MainPanel.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphyx/gui/MainPanel.scala')
-rw-r--r--src/graphyx/gui/MainPanel.scala77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/graphyx/gui/MainPanel.scala b/src/graphyx/gui/MainPanel.scala
new file mode 100644
index 0000000..e4989e8
--- /dev/null
+++ b/src/graphyx/gui/MainPanel.scala
@@ -0,0 +1,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)
+ */
+}