(int i=0; i lt; aout; i ++)
{= new Ellipse2D.Double () ;. setFrameFromCenter (centerX, centerY, centerX + r, centerY + r) ;. setStroke (new BasicStroke (1.0F)) ;. draw (neiron); =new Point2D.Double (centerX-r, centerY); (int k=0; k lt; massivPoint.size (); k ++)
{. draw (new Line2D.Double ((Point2D) massivPoint.get (k), p));
}. setStroke (new BasicStroke (2.0F)) ;. draw (new Line2D.Double (centerX + r, centerY, centerX + r + dX/3, centerY)) ;. draw (new Line2D.Double (centerX + r + dX/3, centerY, centerX + r + dX/3-10, centerY - 4)) ;. draw (new Line2D.Double (centerX + r + dX/3, centerY, centerX + r + dX/3-10, centerY + 4));=centerY + dY;
}
}
} Ellipse2D neiron; Point2D p; ArrayList massivPoint; ArrayList tempMassivPoint; int temp; int; int height=550; double dX; double dY; double centerX; double centerY; int kL; double r; int ain; int asubS; int [] asub=new int [0];
private int aout;
}
Листинги класу діалогового вікна виведення результатів в графічному і числовому вигляді
package classWindow; java.awt. *; java.awt.geom. *; java.util. *; javax.swing. *; class VivodRez extends JDialog
{VivodRez (double [] massiv2)
{= massiv2; contentPane=getContentPane (); ((massivVivod.length * 25 + 200), 250);
setTitle ( Результат роботи нейронної мережі );
setResizable (false); (true);=new JScrollPane (rezultat) ;. add (scrollPane2, BorderLayout.EAST); (int i=0; i lt; massivVivod.length; i ++)
{. append ((i + 1) + = + massivVivod [i] + n );
} panel=new DrPanel () ;. add (panel, BorderLayout.CENTER); (true);
} class DrPanel extends JPanel
{void paintComponent (Graphics g)
{. paintComponent (g); D g2=(Graphics2D) g; .setPaint (new Color (180, 120, 180)); (int i=0; i lt; massivVivod.length; i ++ )
{(massivVivod [i] gt;=0)
{= massivVivod [i] * 100;=109 - height;
}
{= - (massivVivod [i] * 100);=111;
} D rect=new Rectangle2D.Double (leftX, topY, width, height) ;. draw (rect) ;. fill (rect) ;. drawString ( + (i + 1 ), messageX, messageY);=leftX + 25;=messageX + 25;
}. setPaint (new Color (90, 60, 90)) ;. draw (new Line2D.Double (5, 10, leftX - 5, 10)) ;. draw (new Line2D.Double (5, 110, leftX - 5, 110)) ;. draw (new Line2D.Double (5, 210, leftX - 5, 210)) ;. drawString ( + 1 raquo ;, 1, 10) ;. drawString ( 0 raquo ;, 1, 110) ;. drawString ( - 1 raquo ;, 1, 210);
}
} int messageX=20; int messageY=225; double width=20; double height; double leftX=15; double topY; JTextArea rezultat=new JTextArea (); JScrollPane scrollPane2; double [] massivVivod ;
}
Листинги класу діалогового вікна введення числових значень
package classWindow; java.awt. *; java.awt.event. *; java.util. *; javax.swing. *; java.text. *; class VvodCifr extends JDialog
{VvodCifr (Frame owner, int kol)
{(owner, Введення числових даних raquo ;, true);
k=kol;=new JLabel () ;. setText (text);=new ArrayList (k);=new double [k]; (150, (3 + k) * 30); contentPane=getContentPane (); panel=new InpPanel (VvodCifr.this) ;. add (panel, BorderLayout.CENTER) ;. add (label, BorderLayout.NORTH);
} class InpPanel extends JPanel
{InpPanel (final JDialog owner)
{layout=new GridBagLayout (); (layout); constraints=new GridBagConstraints (); (int i=0; i lt; k; i ++)
{= getConstr (0, i, 1, 1);=new JLabel () ;. setText ( нейрон + (i + 1)); (labelNumber, constraints);= getConstr (1, i, 1, 1); sb=new SmallButton (); (sb, constraints) ;. add (sb);
} panel22=new UprPanel (owner);=getConstr (0, k + 1, 2, 1); (panel22, constraints);
} GridBagConstraints getConstr (int x, int y, int w, int h)
{constraint=new GridBagConstraints () ;. fill=GridBagConstraints.BOTH; ins=new Insets (1,1,1,1) ;. insets=ins; .weightx=100; .weighty= 100; .gridx=x; .gridy=y; .gridwidth=w; .gridheight=h; constraint;
} class SmallButton extends JFormattedTextField
{SmallButton ()
{(new Integer (0));
}
} class UprPanel extends JPanel
{UprPanel ...