/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * InformationPanel.java
 *
 * Created on 05.01.2010., 13.45.59
 */

package org.neuroph.easyneurons.samples.mlperceptron;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;

/**
 *
 * @author Marko
 */
public class InformationPanel extends javax.swing.JPanel {

    /** Creates new form InformationPanel */
    public InformationPanel() {
        initComponents();
        setSize(180, 50);
    }

    /** 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() {

        setName("Form"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 200, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 60, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents

       public void paintComponent(Graphics g)
    {
        Rectangle rec = getRect();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, rec.width, rec.height);
        drawRect(g);

        g.setColor(Color.BLACK);
        g.drawArc(20, 10, 7, 7, 0, 360);
        g.setColor(Color.RED);
        g.fillArc(20, 10, 7, 7, 0, 360);

        g.setColor(Color.BLACK);
        g.drawString("output: 1", 35, 18);

        g.drawArc(20, 30, 7, 7, 0, 360);
        g.setColor(Color.BLUE);
        g.fillArc(20, 30, 7, 7, 0, 360);

        g.setColor(Color.BLACK);
        g.drawString("output: 0", 35, 38);

    }

    public Rectangle getRect()
    {
        Rectangle r = new Rectangle(this.getWidth(), this.getHeight());
        return r;
    }


    public void drawRect(Graphics g)
    {
        g.setColor(Color.BLACK);
        g.drawRect(0, 0, 180, 49);
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
