From 9d20024aa35cd7f923ebfc1ed9a2ffbf2731da70 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 5 Nov 2009 21:02:40 +0000 Subject: Initial import. --- src/graphyx/gui/MainPanel.scala | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/graphyx/gui/MainPanel.scala (limited to 'src/graphyx/gui/MainPanel.scala') 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) + */ +} -- cgit v1.2.3