/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * CharForm.java * * Created on Dec 9, 2009, 3:31:26 PM */ package automenta.spacenet.run.geom.text; import javax.swing.JSlider; /** * * @author seh */ abstract public class CharForm extends javax.swing.JFrame { /** Creates new form CharForm */ public CharForm() { initComponents(); } /** 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() { textField = new javax.swing.JTextField(); updateButton = new javax.swing.JButton(); pointSize = new javax.swing.JSlider(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); textField.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N updateButton.setText("Update"); updateButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { updateButtonActionPerformed(evt); } }); pointSize.setMinimum(8); pointSize.setValue(16); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(updateButton) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(textField, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pointSize, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(textField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(pointSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(updateButton) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed update(); }//GEN-LAST:event_updateButtonActionPerformed abstract protected void update(); // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JSlider pointSize; private javax.swing.JTextField textField; private javax.swing.JButton updateButton; // End of variables declaration//GEN-END:variables public int getPointSize() { return pointSize.getValue(); } public String getText() { return textField.getText(); } }