コード例 #1
0
 /** Builds a ScatterPlotGenerator and attaches it as a display in a MASON simulation. */
 public static ScatterPlotGenerator buildScatterPlotGenerator(
     GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) {
   ScatterPlotGenerator chart = buildScatterPlotGenerator(title, rangeAxisLabel, domainAxisLabel);
   JFrame frame = chart.createFrame();
   frame.setVisible(true);
   frame.pack();
   state.controller.registerFrame(frame);
   return chart;
 }
コード例 #2
0
 /** Builds a ScatterPlotGenerator not attached to any MASON simulation. */
 public static ScatterPlotGenerator buildScatterPlotGenerator(
     String title, String rangeAxisLabel, String domainAxisLabel) {
   ScatterPlotGenerator chart = new ScatterPlotGenerator();
   if (title == null) title = "";
   chart.setTitle(title);
   if (rangeAxisLabel == null) rangeAxisLabel = "";
   chart.setYAxisLabel(rangeAxisLabel);
   if (domainAxisLabel == null) domainAxisLabel = "";
   chart.setXAxisLabel(domainAxisLabel);
   return chart;
 }
コード例 #3
0
 /** Adds a series to the ScatterPlotGenerator. */
 public static ScatterPlotSeriesAttributes addSeries(
     final ScatterPlotGenerator chart, String seriesName) {
   return (ScatterPlotSeriesAttributes) (chart.addSeries(new double[2][0], seriesName, null));
 }