Пример #1
0
 /** Builds a HistogramGenerator not attached to any MASON simulation. */
 public static HistogramGenerator buildHistogramGenerator(String title, String rangeAxisLabel) {
   HistogramGenerator chart = new HistogramGenerator();
   if (title == null) title = "";
   chart.setTitle(title);
   if (rangeAxisLabel == null) rangeAxisLabel = "";
   chart.setYAxisLabel(rangeAxisLabel);
   return chart;
 }
Пример #2
0
 /** Builds a HistogramGenerator and attaches it as a display in a MASON simulation. */
 public static HistogramGenerator buildHistogramGenerator(
     GUIState state, String title, String rangeAxisLabel) {
   HistogramGenerator chart = buildHistogramGenerator(title, rangeAxisLabel);
   JFrame frame = chart.createFrame();
   frame.setVisible(true);
   frame.pack();
   state.controller.registerFrame(frame);
   return chart;
 }
Пример #3
0
 /**
  * Adds a series to the HistogramGenerator. You also provide the default number of histogram bins.
  */
 public static HistogramSeriesAttributes addSeries(
     final HistogramGenerator chart, String seriesName, final int bins) {
   return (HistogramSeriesAttributes) (chart.addSeries(new double[0], bins, seriesName, null));
 }