commit 41ad1f2f2dcd0aa5ac125904d025d6e248d35f03 Author: christophal67389 Date: Tue Jun 4 12:58:48 2019 +0200 cool diff --git a/src/graph/GuiChart.java b/src/graph/GuiChart.java new file mode 100644 index 0000000..5b995d9 --- /dev/null +++ b/src/graph/GuiChart.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package graph; + +import org.jfree.chart.ChartPanel; + +/** + * + * @author christophal67389 + */ +public class GuiChart extends ChartPanel +{ + public GuiChart() + { + super(null); + } + + + +} diff --git a/src/graph/Start.java b/src/graph/Start.java new file mode 100644 index 0000000..9de7c36 --- /dev/null +++ b/src/graph/Start.java @@ -0,0 +1,47 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package graph; + +import org.jfree.chart.ChartFactory; +import org.jfree.chart.ChartFrame; +import org.jfree.chart.JFreeChart; +import org.jfree.data.general.DefaultPieDataset; + +/** + * + * @author christophal67389 + */ + +public class Start +{ + + /** + * @param args the command line arguments + */ + public static void main(String[] args) + { + // create a dataset... + DefaultPieDataset data = new DefaultPieDataset(); + data.setValue("Category 1", 43.2); + data.setValue("Category 2", 27.9); + data.setValue("Category 3", 79.5); + // create a chart... + JFreeChart chart = ChartFactory.createPieChart( + "Sample Pie Chart", + data, + true, // legend? + true, // tooltips? + false // URLs? + ); + // create and display a frame... + ChartFrame frame = new ChartFrame("First", chart); + frame.pack(); + frame.setVisible(true); + } + +} + + diff --git a/src/graph/view.form b/src/graph/view.form new file mode 100644 index 0000000..a79a37a --- /dev/null +++ b/src/graph/view.form @@ -0,0 +1,89 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/graph/view.java b/src/graph/view.java new file mode 100644 index 0000000..5e106fd --- /dev/null +++ b/src/graph/view.java @@ -0,0 +1,120 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package graph; + +/** + * + * @author christophal67389 + */ +public class view extends javax.swing.JFrame { + + /** + * Creates new form view + */ + public view() { + initComponents(); + } + + /** + * 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") + // //GEN-BEGIN:initComponents + private void initComponents() { + + guiChart1 = new graph.GuiChart(); + jPanel1 = new javax.swing.JPanel(); + guiChart2 = new graph.GuiChart(); + + javax.swing.GroupLayout guiChart1Layout = new javax.swing.GroupLayout(guiChart1); + guiChart1.setLayout(guiChart1Layout); + guiChart1Layout.setHorizontalGroup( + guiChart1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 375, Short.MAX_VALUE) + ); + guiChart1Layout.setVerticalGroup( + guiChart1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 275, Short.MAX_VALUE) + ); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + javax.swing.GroupLayout guiChart2Layout = new javax.swing.GroupLayout(guiChart2); + guiChart2.setLayout(guiChart2Layout); + guiChart2Layout.setHorizontalGroup( + guiChart2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 680, Short.MAX_VALUE) + ); + guiChart2Layout.setVerticalGroup( + guiChart2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 420, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(guiChart2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(guiChart2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(view.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(view.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(view.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(view.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new view().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private graph.GuiChart guiChart1; + private graph.GuiChart guiChart2; + private javax.swing.JPanel jPanel1; + // End of variables declaration//GEN-END:variables +}