Package org.jfree.data.general

Examples of org.jfree.data.general.ValueDataset


     */
    public void setDataset(ValueDataset dataset) {

        // if there is an existing dataset, remove the plot from the list
        // of change listeners...
        ValueDataset existing = this.dataset;
        if (existing != null) {
            existing.removeChangeListener(this);
        }

        // set the new dataset, and register the chart as a change listener...
        this.dataset = dataset;
        if (dataset != null) {
View Full Code Here


     */
    public void setDataset(ValueDataset dataset) {

        // if there is an existing dataset, remove the plot from the list of
        // change listeners...
        ValueDataset existing = this.dataset;
        if (existing != null) {
            existing.removeChangeListener(this);
        }

        // set the new dataset, and register the chart as a change listener...
        this.dataset = dataset;
        if (dataset != null) {
View Full Code Here

        double meterMiddleX = meterArea.getCenterX();
        double meterMiddleY = meterArea.getCenterY();

        // plot the data (unless the dataset is null)...
        ValueDataset data = getDataset();
        if (data != null) {
            double dataMin = this.range.getLowerBound();
            double dataMax = this.range.getUpperBound();

            Shape savedClip = g2.getClip();
            g2.clip(originalArea);
            Composite originalComposite = g2.getComposite();
            g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
                    getForegroundAlpha()));

            if (this.dialBackgroundPaint != null) {
                fillArc(g2, originalArea, dataMin, dataMax,
                        this.dialBackgroundPaint, true);
            }
            drawTicks(g2, meterArea, dataMin, dataMax);
            drawArcForInterval(g2, meterArea, new MeterInterval("", this.range,
                    this.dialOutlinePaint, new BasicStroke(1.0f), null));

            Iterator iterator = this.intervals.iterator();
            while (iterator.hasNext()) {
                MeterInterval interval = (MeterInterval) iterator.next();
                drawArcForInterval(g2, meterArea, interval);
            }

            Number n = data.getValue();
            if (n != null) {
                double value = n.doubleValue();
                drawValueLabel(g2, meterArea);

                if (this.range.contains(value)) {
View Full Code Here

   * @param dataset  the dataset (<code>null</code> permitted).
   */
  public void setDataset(ValueDataset dataset) {

    // if there is an existing dataset, remove the plot from the list of change listeners...
    ValueDataset existing = this.dataset;
    if (existing != null) {
      existing.removeChangeListener(this);
    }

    // set the new dataset, and register the chart as a change listener...
    this.dataset = dataset;
    if (dataset != null) {
View Full Code Here

        int x = this.seriesNeedle.length;
        int current = 0;
        double value = 0;
        int i = (this.datasets.length - 1);
        for (; i >= 0; --i) {
            ValueDataset data = this.datasets[i];

            if (data != null && data.getValue() != null) {
                value = (data.getValue().doubleValue()) % this.revolutionDistance;
                value = value / this.revolutionDistance * 360;
                current = i % x;
                this.seriesNeedle[current].draw(g2, needleArea, value);
            }
        }
View Full Code Here

     * @param dataset  the dataset (<code>null</code> permitted).
     */
    public void setDataset(ValueDataset dataset) {
       
        // if there is an existing dataset, remove the plot from the list of change listeners...
        ValueDataset existing = this.dataset;
        if (existing != null) {
            existing.removeChangeListener(this);
        }

        // set the new dataset, and register the chart as a change listener...
        this.dataset = dataset;
        if (dataset != null) {
View Full Code Here

        double meterMiddleX = meterArea.getCenterX();
        double meterMiddleY = meterArea.getCenterY();

        // plot the data (unless the dataset is null)...
        ValueDataset data = getDataset();
        if (data != null) {
            //double dataMin = data.getMinimumValue().doubleValue();
            //double dataMax = data.getMaximumValue().doubleValue();
            double dataMin = this.range.getLowerBound();
            double dataMax = this.range.getUpperBound();
            this.minMeterValue = dataMin;

            this.meterCalcAngle = 180 + ((this.meterAngle - 180) / 2);
            this.meterRange = dataMax - dataMin;

            Shape savedClip = g2.getClip();
            g2.clip(originalArea);
            Composite originalComposite = g2.getComposite();
            g2.setComposite(AlphaComposite.getInstance(
                AlphaComposite.SRC_OVER, getForegroundAlpha())
            );

            if (this.dialBackgroundPaint != null) {
                drawArc(g2, originalArea, dataMin, dataMax, this.dialBackgroundPaint, 1);
            }
            drawTicks(g2, meterArea, dataMin, dataMax);
            drawArcFor(g2, meterArea, data, FULL_DATA_RANGE);
            if (this.normalRange != null) {
                drawArcFor(g2, meterArea, data, NORMAL_DATA_RANGE);
            }
            if (this.warningRange != null) {
                drawArcFor(g2, meterArea, data, WARNING_DATA_RANGE);
            }
            if (this.criticalRange != null) {
                drawArcFor(g2, meterArea, data, CRITICAL_DATA_RANGE);
            }

            if (data.getValue() != null) {

                double dataVal = data.getValue().doubleValue();
                drawTick(g2, meterArea, dataVal, true, this.valuePaint, true, getUnits());

                g2.setPaint(this.needlePaint);
                g2.setStroke(new BasicStroke(2.0f));
View Full Code Here

        Plot plot = getChart().getPlot();
        if (!(plot instanceof MeterPlot)) {
            throw new IllegalArgumentException("Plot must be MeterPlot");
        }
        MeterPlot meterPlot = (MeterPlot) plot;
        ValueDataset data = meterPlot.getDataset();

        legendCount = 1// Name of the Chart.
        legendCount++;    // Display Full Range
        if (this.showCritical) {
            legendCount++;
        }
        if (this.showWarning) {
            legendCount++;
        }
        if (this.showNormal) {
            legendCount++;
        }

        LegendItem[] legendItems = new LegendItem[legendCount];
        Color[] legendItemColors = new Color[legendCount];

        int currentItem = 0;
        String label = this.legendText
            + (data.getValue() != null ? ("   Current Value: " + data.getValue().toString()) : "");
        legendItems[currentItem] = new LegendItem(label, label, null, true, null, null, null, null);
        legendItemColors[currentItem] = null// no color
        currentItem++;
        if (updateInformation(meterPlot, data, MeterPlot.FULL_DATA_RANGE,
            currentItem, legendItems, legendItemColors)) {
View Full Code Here

     */
    public void setDataset(ValueDataset dataset) {

        // if there is an existing dataset, remove the plot from the list
        // of change listeners...
        ValueDataset existing = this.dataset;
        if (existing != null) {
            existing.removeChangeListener(this);
        }

        // set the new dataset, and register the chart as a change listener...
        this.dataset = dataset;
        if (dataset != null) {
View Full Code Here

        int x = this.seriesNeedle.length;
        int current = 0;
        double value = 0;
        int i = (this.datasets.length - 1);
        for (; i >= 0; --i) {
            ValueDataset data = this.datasets[i];

            if (data != null && data.getValue() != null) {
                value = (data.getValue().doubleValue())
                    % this.revolutionDistance;
                value = value / this.revolutionDistance * 360;
                current = i % x;
                this.seriesNeedle[current].draw(g2, needleArea, value);
            }
View Full Code Here

TOP

Related Classes of org.jfree.data.general.ValueDataset

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.