java/SuperPostak/src/cz/frantovo/superPostak/GrafPokus.java
changeset 0 e76872ad5226
child 3 03d27d3b3f7b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/SuperPostak/src/cz/frantovo/superPostak/GrafPokus.java	Sun Nov 23 22:19:20 2008 +0100
     1.3 @@ -0,0 +1,90 @@
     1.4 +/*
     1.5 + * GrafPokus.java
     1.6 + *
     1.7 + * Created on 7. prosinec 2007, 22:33
     1.8 + */
     1.9 +
    1.10 +package cz.frantovo.superPostak;
    1.11 +
    1.12 +import java.awt.Color;
    1.13 +import org.jdesktop.swingx.JXGraph.Plot;
    1.14 +
    1.15 +/**
    1.16 + *
    1.17 + * @author  fiki
    1.18 + */
    1.19 +public class GrafPokus extends javax.swing.JFrame {
    1.20 +    
    1.21 +    /** Creates new form GrafPokus */
    1.22 +    public GrafPokus() {
    1.23 +        initComponents();
    1.24 +        
    1.25 +        mujGraf.addPlots(Color.GREEN, new Plot(){
    1.26 +
    1.27 +            @Override
    1.28 +            public double compute(double value) {
    1.29 +                return value * value;
    1.30 +            }
    1.31 +        
    1.32 +        });
    1.33 +    }
    1.34 +    
    1.35 +    /** This method is called from within the constructor to
    1.36 +     * initialize the form.
    1.37 +     * WARNING: Do NOT modify this code. The content of this method is
    1.38 +     * always regenerated by the Form Editor.
    1.39 +     */
    1.40 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    1.41 +    private void initComponents() {
    1.42 +
    1.43 +        mujGraf = new org.jdesktop.swingx.JXGraph();
    1.44 +
    1.45 +        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    1.46 +
    1.47 +        javax.swing.GroupLayout mujGrafLayout = new javax.swing.GroupLayout(mujGraf);
    1.48 +        mujGraf.setLayout(mujGrafLayout);
    1.49 +        mujGrafLayout.setHorizontalGroup(
    1.50 +            mujGrafLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.51 +            .addGap(0, 465, Short.MAX_VALUE)
    1.52 +        );
    1.53 +        mujGrafLayout.setVerticalGroup(
    1.54 +            mujGrafLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.55 +            .addGap(0, 422, Short.MAX_VALUE)
    1.56 +        );
    1.57 +
    1.58 +        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    1.59 +        getContentPane().setLayout(layout);
    1.60 +        layout.setHorizontalGroup(
    1.61 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.62 +            .addGroup(layout.createSequentialGroup()
    1.63 +                .addContainerGap()
    1.64 +                .addComponent(mujGraf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    1.65 +                .addContainerGap())
    1.66 +        );
    1.67 +        layout.setVerticalGroup(
    1.68 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    1.69 +            .addGroup(layout.createSequentialGroup()
    1.70 +                .addContainerGap()
    1.71 +                .addComponent(mujGraf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    1.72 +                .addContainerGap())
    1.73 +        );
    1.74 +
    1.75 +        pack();
    1.76 +    }// </editor-fold>//GEN-END:initComponents
    1.77 +    
    1.78 +    /**
    1.79 +     * @param args the command line arguments
    1.80 +     */
    1.81 +    public static void main(String args[]) {
    1.82 +        java.awt.EventQueue.invokeLater(new Runnable() {
    1.83 +            public void run() {
    1.84 +                new GrafPokus().setVisible(true);
    1.85 +            }
    1.86 +        });
    1.87 +    }
    1.88 +    
    1.89 +    // Variables declaration - do not modify//GEN-BEGIN:variables
    1.90 +    private org.jdesktop.swingx.JXGraph mujGraf;
    1.91 +    // End of variables declaration//GEN-END:variables
    1.92 +    
    1.93 +}