001 /** 002 ############################################################################## 003 ## ## 004 ## EnvInfo ## 005 ## ## 006 ## Copyright (C) 2009 Frederic Roudaut <frederic.roudaut@free.fr> ## 007 ## ## 008 ## This class is an adaption of the one done by Nicolas Richasse for his ## 009 ## Java Iperf frontend. ## 010 ## ## 011 ## ## 012 ## This program is free software: you can redistribute it and/or modify ## 013 ## it under the terms of the GNU General Public License as published by ## 014 ## the Free Software Foundation, either version 3 of the License, or ## 015 ## (at your option) any later version. ## 016 ## ## 017 ## This program is distributed in the hope that it will be useful, ## 018 ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## 019 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## 020 ## GNU General Public License for more details. ## 021 ## ## 022 ## You should have received a copy of the GNU General Public License ## 023 ## along with this program. If not, see <http://www.gnu.org/licenses/>. ## 024 ## ## 025 ## ## 026 ############################################################################## 027 **/ 028 029 package com.envInfo; 030 031 032 import java.awt.BorderLayout; 033 034 import javax.swing.JPanel; 035 036 import org.jfree.chart.ChartPanel; 037 import org.jfree.chart.JFreeChart; 038 039 040 /** 041 * Class used to abstract charts for the Memory charts. 042 * <br/><br/> 043 * This class is one of those done by Nicolas Richasse for his 044 * Java Iperf frontend. 045 * 046 **/ 047 public abstract class AbstractChartPanel extends JPanel 048 { 049 private static final long serialVersionUID = 1L; 050 051 protected JFreeChart jFreeChart; 052 protected ChartPanel chartPanel; 053 054 /** 055 * Default Constructor. 056 * 057 **/ 058 public AbstractChartPanel() 059 { 060 init(); 061 } 062 063 /** 064 * Initialisation. 065 * 066 **/ 067 private void init() 068 { 069 // layout configuration 070 this.setLayout(new BorderLayout()); 071 } 072 073 /** 074 * Lower Quality. 075 * 076 **/ 077 public void setLowQuality() 078 { 079 jFreeChart.getRenderingHints().clear(); 080 } 081 082 /** 083 * Get the chart Panel. 084 * @return the chart Panel. 085 **/ 086 public ChartPanel getChartPanel() 087 { 088 return chartPanel; 089 } 090 091 /** 092 * Get JFreeChart. 093 * @return JFreeChart. 094 **/ 095 public JFreeChart getJFreeChart() 096 { 097 return jFreeChart; 098 } 099 }