From: Nathaniel G. A. <nat...@us...> - 2004-06-09 01:46:35
|
Update of /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/designer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24189/src/java/org/krysalis/jcharts/designer Modified Files: Designer.java Log Message: Index: Designer.java =================================================================== RCS file: /cvsroot/jcharts/krysalis-jcharts/src/java/org/krysalis/jcharts/designer/Designer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Designer.java 29 May 2004 13:50:13 -0000 1.2 --- Designer.java 9 Jun 2004 01:46:26 -0000 1.3 *************** *** 1,2 **** --- 1,35 ---- + /*********************************************************************************************** + * Copyright 2002 (C) Nathaniel G. Auvil. All Rights Reserved. + * + * Redistribution and use of this software and associated documentation ("Software"), with or + * without modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright statements and notices. + * Redistributions must also contain a copy of this document. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. The name "jCharts" or "Nathaniel G. Auvil" must not be used to endorse or promote + * products derived from this Software without prior written permission of Nathaniel G. + * Auvil. For written permission, please contact nat...@us... + * + * 4. Products derived from this Software may not be called "jCharts" nor may "jCharts" appear + * in their names without prior written permission of Nathaniel G. Auvil. jCharts is a + * registered trademark of Nathaniel G. Auvil. + * + * 5. Due credit should be given to the jCharts Project (http://jcharts.sourceforge.net/). + * + * THIS SOFTWARE IS PROVIDED BY Nathaniel G. Auvil AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * jCharts OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + ************************************************************************************************/ package org.krysalis.jcharts.designer; *************** *** 8,11 **** --- 41,48 ---- import org.krysalis.jcharts.designer.menuBar.DesignerMenuBar; import org.krysalis.jcharts.designer.tabs.LowerHalfPanel; + import org.krysalis.jcharts.designer.tabs.allChart.AllChartTabs; + import org.krysalis.jcharts.designer.tabs.allChart.ChartPropertiesTab; + import org.krysalis.jcharts.designer.tabs.allChart.GeneralTab; + import org.krysalis.jcharts.designer.tabs.allChart.legendProperties.LegendPropertiesTab; import javax.swing.*; *************** *** 19,23 **** public class Designer extends JFrame { - public static final String TITLE = "jCharts Designer - 1.0.0"; --- 56,59 ---- *************** *** 26,35 **** private DesignerPieChart designerPieChart; - private org.krysalis.jcharts.axisChart.AxisChart axisChart; /**************************************************************************** * ! * @throws org.krysalis.jcharts.chartData.ChartDataException ***************************************************************************/ public Designer() throws ChartDataException --- 62,70 ---- private DesignerPieChart designerPieChart; /**************************************************************************** * ! * @throws ChartDataException ***************************************************************************/ public Designer() throws ChartDataException *************** *** 54,59 **** this.getContentPane().add( jSplitPane ); ! //---so when they click on the 'x' in the upper right corner, the ! // program exits super.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); --- 89,93 ---- this.getContentPane().add( jSplitPane ); ! //---so when they click on the 'x' in the upper right corner, the program exits super.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); *************** *** 72,78 **** try { ! this.lowerHalfPanel.getTopLevelTabs().updateChartProperties( this.designerPieChart.getChartProperties() ); this.designerPieChart.updateChart(); this.chartPanel.repaint(); } --- 106,126 ---- try { ! AllChartTabs allChartTabs= this.lowerHalfPanel.getTopLevelTabs().getAllChartTabs(); ! ! GeneralTab generalTab= allChartTabs.getGeneralTab(); ! this.designerPieChart.setChartWidth( generalTab.getChartWidth() ); ! this.designerPieChart.setChartHeight( generalTab.getChartHeight() ); + ChartPropertiesTab chartPropertiesTab= allChartTabs.getChartPropertiesTab(); + chartPropertiesTab.updateChartProperties( this.designerPieChart.getChartProperties() ); + + LegendPropertiesTab legendPropertiesTab= allChartTabs.getLegendPropertiesTab(); + legendPropertiesTab.updateChartProperties( this.designerPieChart.getLegendProperties() ); + + this.designerPieChart.updateChart(); + this.chartPanel.setChart( this.designerPieChart.getPieChart2D(), + generalTab.getChartWidth(), + generalTab.getChartHeight() ); this.chartPanel.repaint(); } *************** *** 84,90 **** { JOptionPane.showMessageDialog( this, ! chartDataException.getMessage(), ! "Chart Data Exception", ! JOptionPane.ERROR_MESSAGE ); } } --- 132,138 ---- { JOptionPane.showMessageDialog( this, ! chartDataException.getMessage(), ! "Chart Data Exception", ! JOptionPane.ERROR_MESSAGE ); } } *************** *** 96,119 **** public static void main( String[] args ) throws ChartDataException { ! Designer designer = new Designer(); ! ! /* ! * int width= 450; int height= 450; ! * ! * try { String[] labels = {"BMW", "Audi", "Lexus"}; String title = "Cars ! * that Own"; Paint[] paints = {Color.blue, Color.gray, Color.red}; ! * double[] data = {50d, 30d, 20d}; ! * ! * PieChart2DProperties pieChart2DProperties = new PieChart2DProperties(); ! * PieChartDataSet pieChartDataSet = new PieChartDataSet( title, data, ! * labels, paints, pieChart2DProperties ); ! * ! * PieChart2D pieChart2D = new PieChart2D( pieChartDataSet, new ! * LegendProperties(), new ChartProperties(), width, height ); ! * ! * designer.chartPanel.setChart( pieChart2D, width, height ); } catch( ! * ChartDataException chartDataException ) { ! * chartDataException.printStackTrace(); } ! */ } } \ No newline at end of file --- 144,148 ---- public static void main( String[] args ) throws ChartDataException { ! new Designer(); } } \ No newline at end of file |