root/java/SuperPostak/src/cz/frantovo/superPostak/GrafPokus.java @ 0:e76872ad5226

Revision 0:e76872ad5226, 2.9 KB (checked in by František Kučera <franta-hg@…>, 15 years ago)

Přidání SuperPošťáka? do Mercurialu (původně byl v Subversionu)
Postak – základ, knihovna
SuperPostak? – GUI nadstavba
SuperPostak?2 – pokus o implementaci aplikace jako modulu pro Netbeans, POZOR: není přidán do Mercurialu, možná později (pravděpodobně se ale nebude používat)

Line 
1/*
2 * GrafPokus.java
3 *
4 * Created on 7. prosinec 2007, 22:33
5 */
6
7package cz.frantovo.superPostak;
8
9import java.awt.Color;
10import org.jdesktop.swingx.JXGraph.Plot;
11
12/**
13 *
14 * @author  fiki
15 */
16public class GrafPokus extends javax.swing.JFrame {
17   
18    /** Creates new form GrafPokus */
19    public GrafPokus() {
20        initComponents();
21       
22        mujGraf.addPlots(Color.GREEN, new Plot(){
23
24            @Override
25            public double compute(double value) {
26                return value * value;
27            }
28       
29        });
30    }
31   
32    /** This method is called from within the constructor to
33     * initialize the form.
34     * WARNING: Do NOT modify this code. The content of this method is
35     * always regenerated by the Form Editor.
36     */
37    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
38    private void initComponents() {
39
40        mujGraf = new org.jdesktop.swingx.JXGraph();
41
42        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
43
44        javax.swing.GroupLayout mujGrafLayout = new javax.swing.GroupLayout(mujGraf);
45        mujGraf.setLayout(mujGrafLayout);
46        mujGrafLayout.setHorizontalGroup(
47            mujGrafLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
48            .addGap(0, 465, Short.MAX_VALUE)
49        );
50        mujGrafLayout.setVerticalGroup(
51            mujGrafLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
52            .addGap(0, 422, Short.MAX_VALUE)
53        );
54
55        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
56        getContentPane().setLayout(layout);
57        layout.setHorizontalGroup(
58            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
59            .addGroup(layout.createSequentialGroup()
60                .addContainerGap()
61                .addComponent(mujGraf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
62                .addContainerGap())
63        );
64        layout.setVerticalGroup(
65            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
66            .addGroup(layout.createSequentialGroup()
67                .addContainerGap()
68                .addComponent(mujGraf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
69                .addContainerGap())
70        );
71
72        pack();
73    }// </editor-fold>//GEN-END:initComponents
74   
75    /**
76     * @param args the command line arguments
77     */
78    public static void main(String args[]) {
79        java.awt.EventQueue.invokeLater(new Runnable() {
80            public void run() {
81                new GrafPokus().setVisible(true);
82            }
83        });
84    }
85   
86    // Variables declaration - do not modify//GEN-BEGIN:variables
87    private org.jdesktop.swingx.JXGraph mujGraf;
88    // End of variables declaration//GEN-END:variables
89   
90}
Note: See TracBrowser for help on using the browser.