@@ -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); | |||
} | |||
} |
@@ -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); | |||
} | |||
} | |||
@@ -0,0 +1,89 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | |||
<NonVisualComponents> | |||
<Container class="graph.GuiChart" name="guiChart1"> | |||
<Layout> | |||
<DimensionLayout dim="0"> | |||
<Group type="103" groupAlignment="0" attributes="0"> | |||
<EmptySpace min="0" pref="375" max="32767" attributes="0"/> | |||
</Group> | |||
</DimensionLayout> | |||
<DimensionLayout dim="1"> | |||
<Group type="103" groupAlignment="0" attributes="0"> | |||
<EmptySpace min="0" pref="275" max="32767" attributes="0"/> | |||
</Group> | |||
</DimensionLayout> | |||
</Layout> | |||
</Container> | |||
</NonVisualComponents> | |||
<Properties> | |||
<Property name="defaultCloseOperation" type="int" value="3"/> | |||
</Properties> | |||
<SyntheticProperties> | |||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> | |||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/> | |||
</SyntheticProperties> | |||
<AuxValues> | |||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> | |||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> | |||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> | |||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> | |||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> | |||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> | |||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> | |||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> | |||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> | |||
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-70,0,0,2,-68"/> | |||
</AuxValues> | |||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> | |||
<SubComponents> | |||
<Container class="javax.swing.JPanel" name="jPanel1"> | |||
<Constraints> | |||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> | |||
<BorderConstraints direction="Center"/> | |||
</Constraint> | |||
</Constraints> | |||
<Layout> | |||
<DimensionLayout dim="0"> | |||
<Group type="103" groupAlignment="0" attributes="0"> | |||
<Group type="102" alignment="0" attributes="0"> | |||
<EmptySpace max="-2" attributes="0"/> | |||
<Component id="guiChart2" min="-2" max="-2" attributes="0"/> | |||
<EmptySpace max="32767" attributes="0"/> | |||
</Group> | |||
</Group> | |||
</DimensionLayout> | |||
<DimensionLayout dim="1"> | |||
<Group type="103" groupAlignment="0" attributes="0"> | |||
<Group type="102" alignment="0" attributes="0"> | |||
<EmptySpace max="-2" attributes="0"/> | |||
<Component id="guiChart2" min="-2" max="-2" attributes="0"/> | |||
<EmptySpace max="32767" attributes="0"/> | |||
</Group> | |||
</Group> | |||
</DimensionLayout> | |||
</Layout> | |||
<SubComponents> | |||
<Container class="graph.GuiChart" name="guiChart2"> | |||
<Layout> | |||
<DimensionLayout dim="0"> | |||
<Group type="103" groupAlignment="0" attributes="0"> | |||
<EmptySpace min="0" pref="680" max="32767" attributes="0"/> | |||
</Group> | |||
</DimensionLayout> | |||
<DimensionLayout dim="1"> | |||
<Group type="103" groupAlignment="0" attributes="0"> | |||
<EmptySpace min="0" pref="420" max="32767" attributes="0"/> | |||
</Group> | |||
</DimensionLayout> | |||
</Layout> | |||
</Container> | |||
</SubComponents> | |||
</Container> | |||
</SubComponents> | |||
</Form> |
@@ -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") | |||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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(); | |||
}// </editor-fold>//GEN-END:initComponents | |||
/** | |||
* @param args the command line arguments | |||
*/ | |||
public static void main(String args[]) { | |||
/* Set the Nimbus look and feel */ | |||
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> | |||
/* 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); | |||
} | |||
//</editor-fold> | |||
/* 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 | |||
} |