/* * Copyright 2013 Serdar. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.fub.maps.project.plugins.tasks.eval.heading; import java.awt.BorderLayout; import java.awt.Color; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.labels.StandardXYToolTipGenerator; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.renderer.xy.StandardXYBarPainter; import org.jfree.chart.renderer.xy.XYBarRenderer; import org.jfree.data.xy.XYSeriesCollection; /** * * @author Serdar */ public class HeadingHistogramm extends javax.swing.JPanel { private static final long serialVersionUID = 1L; private final XYSeriesCollection dataset = new XYSeriesCollection(); private final ChartPanel chartpanel; private final JFreeChart barChart; /** * Creates new form HeadingHistogramm */ public HeadingHistogramm() { initComponents(); barChart = ChartFactory.createXYBarChart(null, "Degree", false, null, dataset, PlotOrientation.VERTICAL, true, true, true); barChart.setBackgroundPaint(Color.WHITE); barChart.getPlot().setBackgroundPaint(Color.WHITE); XYBarRenderer barRenderer = new XYBarRenderer(.05); barRenderer.setShadowVisible(false); barRenderer.setBarPainter(new StandardXYBarPainter()); barRenderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); barChart.getXYPlot().setRenderer(barRenderer); chartpanel = new ChartPanel(barChart, false); add(chartpanel, BorderLayout.CENTER); } public XYSeriesCollection getDataset() { return dataset; } public ChartPanel getChartpanel() { return chartpanel; } public JFreeChart getBarChart() { return barChart; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { setLayout(new java.awt.BorderLayout()); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables // End of variables declaration//GEN-END:variables }