Package org.jamesii.gui.visualization.chart.model

Examples of org.jamesii.gui.visualization.chart.model.DefaultXYSeries


                (IPlotableObserver<IObservable>) observer;
            model.startUpdating();
            try {
              model.removeAllSeries();
              for (String name : ob.getVariableNames()) {
                DefaultXYSeries s = new DefaultXYSeries(name);
                List<Pair<? extends Number, ? extends Number>> variableData =
                    ob.getVariableData(name);
                for (Pair<? extends Number, ? extends Number> data : variableData) {
                  s.addValuePair(data.getFirstValue(), data.getSecondValue());
                }
                model.addSeries(s);
              }
            } finally {
              model.finishedUpdating();
View Full Code Here


    checkVariableNames(ob);

    try {
      model.startUpdating();
      for (String name : serieses.keySet()) {
        DefaultXYSeries s = serieses.get(name);

        Pair<? extends Number, ? extends Number> data = ob.getCurrentData(name);

        Pair<? extends Number, ? extends Number> min = ob.getMin();
        Pair<? extends Number, ? extends Number> max = ob.getMax();

        if (min != null) {
          s.setMin(0, min.getFirstValue());
          s.setMin(1, min.getSecondValue());
        }

        if (max != null) {
          s.setMax(0, max.getFirstValue());
          s.setMax(1, max.getSecondValue());
        }

        if (data != null) {
          s.addValuePair(data.getFirstValue(), data.getSecondValue());
        }

        // now check for sliding window flag
        if (slidingWindow) {
          // cut old values
          s.cutToValueCount(MAX_VALUES);
        }
      }
    } catch (Exception e) {
      SimSystem.report(e);
    } finally {
View Full Code Here

   */
  private void checkVariableNames(
      IIncrementalPlotableObserver<? extends IObservable> ob) {
    for (String name : ob.getVariableNames()) {
      if (!serieses.containsKey(name)) {
        DefaultXYSeries s = null;
        if (ob.isMonotonIncreasingX(name)) {
          s =
              new DefaultFunctionalXYSeries(name
                  + (runCounter.get() >= 1 ? " (run: " + runCounter.get() + ")"
                      : ""));

        } else {
          s =
              new DefaultXYSeries(name
                  + (runCounter.get() >= 1 ? " (run: " + runCounter.get() + ")"
                      : ""));
        }
        serieses.put(name, s);
        model.addSeries(s);
View Full Code Here

TOP

Related Classes of org.jamesii.gui.visualization.chart.model.DefaultXYSeries

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.