Package org.jamesii.gui.visualization.chart.plot

Examples of org.jamesii.gui.visualization.chart.plot.IPlot


   * @param plotter
   *          the plotter to register
   * @return the plotter that previously was attached to that series if any
   */
  public IPlot setPlotterForSeries(ISeries series, IPlot plotter) {
    IPlot put = plotters.put(series, plotter);
    dataChanged = true;
    repaint();
    return put;
  }
View Full Code Here


                  - legendLines.size() * gBuffer.getFontMetrics().getHeight()
                  - BORDER);

          for (int i = 0; i < chartModel.getSeriesCount(); i++) {
            ISeries s = chartModel.getSeries(i);
            IPlot plot = hidden.contains(s) ? NULL_PLOT : getPlotForSeries(s);
            Point p =
                coordinateSystem.getPlotOrigin((Graphics2D) gBuffer, BORDER,
                    BORDER, getWidth() - TWOBORDERS, getHeight() - TWOBORDERS
                        - legendLines.size()
                        * gBuffer.getFontMetrics().getHeight() - BORDER);
            Dimension d =
                coordinateSystem.getPlotDimension((Graphics2D) gBuffer, BORDER,
                    BORDER, getWidth() - TWOBORDERS, getHeight() - TWOBORDERS
                        - legendLines.size()
                        * gBuffer.getFontMetrics().getHeight() - BORDER);
            plot.drawPlot(this, chartModel.getSeries(i), (Graphics2D) gBuffer,
                (int) p.getX(), (int) p.getY(), d.width, d.height);

          }

          if (showLegend) {
            // draw legend TODO sr137: make this more abstract aka
            // IAdditional
            width = legendLines.get(0);
            int x = (getWidth() - width) / 2;
            int y =
                getHeight() - 7 - (legendLines.size() - 1)
                    * gBuffer.getFontMetrics().getHeight();

            gBuffer.setColor(Color.white);
            gBuffer.fillRect((getWidth() - maxWidth) / 2 - BORDER, y
                - gBuffer.getFontMetrics().getHeight(), maxWidth + TWOBORDERS,
                gBuffer.getFontMetrics().getHeight() * legendLines.size()
                    + BORDER);
            gBuffer.setColor(Color.darkGray);
            gBuffer.drawRect((getWidth() - maxWidth) / 2 - BORDER, y
                - gBuffer.getFontMetrics().getHeight(), maxWidth + TWOBORDERS,
                gBuffer.getFontMetrics().getHeight() * legendLines.size()
                    + BORDER);

            for (int i = 0; i < chartModel.getSeriesCount(); i++) {
              IPlot plot = getPlotForSeries(chartModel.getSeries(i));
              String name = chartModel.getSeriesName(chartModel.getSeries(i));
              plot.drawPlotInLegend((Graphics2D) gBuffer, x, y
                  - gBuffer.getFontMetrics().getAscent(), TWOBORDERS, gBuffer
                  .getFontMetrics().getAscent());

              gBuffer.setColor(Color.darkGray);
              gBuffer.drawString(name, x + 12, y);
View Full Code Here

   * @param s
   *          the series the plotter is requested for
   * @return the plotter for series
   */
  private IPlot getPlotForSeries(ISeries s) {
    IPlot plot = plotters.get(s);
    if (plot == null) {
      int i = 0;
      for (i = 0; i < getModel().getSeriesCount(); i++) {
        if (getModel().getSeries(i) == s) {
          break;
View Full Code Here

        model.addSeries(s);
      }

      // also set plotter for series if any
      ISeries s = serieses.get(name);
      IPlot p = ob.getPlotFor(name, chart.getDefaultColorForSeries(s));
      if (p != null) {
        chart.setPlotterForSeries(s, p);
      } else {
        // FIXME sr137: use plot stored in type here (must be cloned and colore
        // set though)
View Full Code Here

TOP

Related Classes of org.jamesii.gui.visualization.chart.plot.IPlot

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.