/* * 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.detector.model.statistics; import javax.swing.JLabel; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.plot.CategoryPlot; import org.jfree.data.category.DefaultCategoryDataset; /** * * @author Serdar */ public class BarChartContainer extends javax.swing.JPanel { private static final long serialVersionUID = 1L; /** * Creates new form ChartContainer */ public BarChartContainer() { initComponents(); } public DefaultCategoryDataset getDataset() { return barChartPanel1.getDataset(); } public JFreeChart getBarChart() { return barChartPanel1.getBarChart(); } public CategoryPlot getPlot() { return barChartPanel1.getPlot(); } public ChartPanel getChartPanel() { return barChartPanel1.getChartPanel(); } public CategoryAxis getDomainAxis() { return barChartPanel1.getDomainAxis(); } public ValueAxis getRangeAxis() { return barChartPanel1.getRangeAxis(); } public void setTitle(String title) { titleLabel.setText(title); } public String getTitle() { return titleLabel.getText(); } public JLabel getTitleLabel() { return titleLabel; } /** * 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() { jPanel1 = new javax.swing.JPanel(); barChartPanel1 = new de.fub.maps.project.detector.model.statistics.BarChartPanel(); jPanel2 = new javax.swing.JPanel(); titleLabel = new javax.swing.JLabel(); setBackground(new java.awt.Color(255, 216, 178)); setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); setLayout(new java.awt.BorderLayout()); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setLayout(new java.awt.BorderLayout()); jPanel1.add(barChartPanel1, java.awt.BorderLayout.CENTER); add(jPanel1, java.awt.BorderLayout.CENTER); jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(235, 195, 157))); jPanel2.setMinimumSize(new java.awt.Dimension(100, 24)); jPanel2.setOpaque(false); jPanel2.setPreferredSize(new java.awt.Dimension(400, 24)); jPanel2.setLayout(new java.awt.BorderLayout()); titleLabel.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N titleLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(BarChartContainer.class, "BarChartContainer.titleLabel.text")); // NOI18N jPanel2.add(titleLabel, java.awt.BorderLayout.CENTER); add(jPanel2, java.awt.BorderLayout.NORTH); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private de.fub.maps.project.detector.model.statistics.BarChartPanel barChartPanel1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JLabel titleLabel; // End of variables declaration//GEN-END:variables }