Beispiel #1
0
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents()
        {
            canvas = new BufferedImage(320, 320, BufferedImage.TYPE_BYTE_GRAY);

            buttonGroup1 = new ButtonGroup();
            buttonGroup2 = new ButtonGroup();
            jPanel4      = new JPanel();
            jSlider2     = new JSlider();
            jLabel1      = new JLabel();
            jPanel2      = new JPanel(new GridBagLayout());
            JLabel canvasLabel = new JLabel(new ImageIcon(canvas));

            jPanel2.add(canvasLabel, null);

            jPanel3       = new JPanel();
            jRadioButton3 = new JRadioButton();
            jRadioButton4 = new JRadioButton();
            jRadioButton5 = new JRadioButton();
            jRadioButton6 = new JRadioButton();
            jRadioButton7 = new JRadioButton();
            jRadioButton8 = new JRadioButton();
            jButton1      = new JButton();

            DefaultCloseOperation = WindowConstants.EXIT_ON_CLOSE;
            Title = "FuNet1 --- powered by Neuroph";

            jPanel4.Border = BorderFactory.createTitledBorder("Line thickness");


            jSlider2.MajorTickSpacing = 10;
            jSlider2.Maximum          = 51;
            jSlider2.Minimum          = 1;
            jSlider2.MinorTickSpacing = 5;
            jSlider2.PaintTicks       = true;
            jSlider2.addChangeListener(new ChangeListenerAnonymousInnerClassHelper(this));

            //        jLabel1.setText("Stroke Size (Radius)");

            GroupLayout jPanel4Layout = new GroupLayout(jPanel4);

            jPanel4.Layout = jPanel4Layout;
            jPanel4Layout.HorizontalGroup = jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 51, short.MaxValue).addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jLabel1).addComponent(jSlider2, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)).addContainerGap());

            label = new JLabel("");
            Font labelFont = label.Font;

            label.Font = new Font(labelFont.Name, Font.PLAIN, 30);


            jPanel4Layout.VerticalGroup = jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jSlider2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(jLabel1)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)));

            jPanel2.Background = new Color(0, 0, 0);
            jPanel2.Border     = BorderFactory.createBevelBorder(BevelBorder.RAISED);
            // add the listeners to the label that contains the canvas buffered image
            canvasLabel.addMouseListener(new MouseAdapterAnonymousInnerClassHelper(this));
            canvasLabel.addMouseMotionListener(new MouseMotionAdapterAnonymousInnerClassHelper(this));


            jButton1.Text = "Clear";
            jButton1.addActionListener(new ActionListenerAnonymousInnerClassHelper(this));

            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout     = layout;
            layout.HorizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jPanel2, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addGroup(layout.createSequentialGroup().addComponent(jPanel4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jPanel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jButton1, GroupLayout.DEFAULT_SIZE, 112, short.MaxValue).addComponent(label, GroupLayout.DEFAULT_SIZE, 112, short.MaxValue)))).addContainerGap());
            layout.VerticalGroup   = layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addGroup(layout.createSequentialGroup().addGap(4, 4, 4).addComponent(jButton1, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addComponent(label, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)).addComponent(jPanel4, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addComponent(jPanel3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addContainerGap());

            Graphics g = canvas.Graphics;

            g.Color = Color.WHITE;
            g.fillRect(0, 0, canvas.Width, canvas.Height);
            repaint();
            pack();
        }         // </editor-fold>
 public CostOSSliderUI(JSlider paramJSlider) : base(paramJSlider)
 {
 }