import javax.measure.quantity.Length;
import javax.measure.quantity.Quantity;
import javax.measure.unit.SI;
+import javax.swing.JFrame;
+import javax.swing.JSplitPane;
import org.jscience.physics.amount.Amount;
g.setLength(Amount.valueOf(70, SI.MILLIMETER));
g.setOD(Amount.valueOf(30, SI.MILLIMETER));
g.setID(Amount.valueOf(10, SI.MILLIMETER));
+
+ JFrame f = new JFrame();
+ f.setSize(1024, 768);
+ f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ JSplitPane jsp = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+ f.add(jsp);
Chart<Length, Area> c = new Chart<Length, Area>(SI.MILLIMETER,
SI.MILLIMETER.pow(2).asType(Area.class), g, "surfaceArea");
c.setDomain(c.new IntervalDomain(Amount.valueOf(0, SI.CENTIMETER), g
.webThickness()));
- c.show();
+ jsp.setTopComponent(c);
GraphSimplifier<Length, Area> gs = new GraphSimplifier(g,
"surfaceArea", c.new IntervalDomain(Amount.valueOf(0,
Chart<Length, Area> d = new Chart<Length, Area>(SI.MILLIMETER,
SI.MILLIMETER.pow(2).asType(Area.class), gs, "value");
d.setDomain(gs.getDomain());
- d.show();
+ jsp.setBottomComponent(d);
+
+ f.setVisible(true);
+ jsp.setDividerLocation(.5);
+ jsp.revalidate();
}
}