/* * 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.gpx.analysis.ui.charts; import javax.swing.JLabel; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYSeries; /** * * @author Serdar */ public class ChartPanelComponent extends javax.swing.JPanel { private static final long serialVersionUID = 1L; /** * Creates new form ChartPanel */ public ChartPanelComponent() { initComponents(); } public XYSeries getDataset() { return lineChart1.getDataset(); } public XYPlot getPlot() { return lineChart1.getPlot(); } public ValueAxis getRangeAxis() { return getPlot().getRangeAxis(); } public ValueAxis getDomainAxis() { return getPlot().getDomainAxis(); } 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(); lineChart1 = new de.fub.maps.gpx.analysis.ui.charts.LineChart(); jPanel2 = new javax.swing.JPanel(); titleLabel = new javax.swing.JLabel(); setBackground(new java.awt.Color(255, 216, 178)); setPreferredSize(new java.awt.Dimension(400, 300)); setLayout(new java.awt.BorderLayout()); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 1, 1, 16)); jPanel1.setLayout(new java.awt.BorderLayout()); jPanel1.add(lineChart1, java.awt.BorderLayout.CENTER); add(jPanel1, java.awt.BorderLayout.CENTER); jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 182, 112))); jPanel2.setMinimumSize(new java.awt.Dimension(100, 32)); jPanel2.setOpaque(false); jPanel2.setPreferredSize(new java.awt.Dimension(875, 32)); 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(ChartPanelComponent.class, "ChartPanelComponent.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 javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private de.fub.maps.gpx.analysis.ui.charts.LineChart lineChart1; private javax.swing.JLabel titleLabel; // End of variables declaration//GEN-END:variables }