public class WachstumsFrontEndFrame extends javax.swing.JFrame
{
Gewachsenes G=new Gewachsenes();
/** Creates new form WachstumsFrontEndFrame */
public WachstumsFrontEndFrame() {
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">
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
BtnSave = new javax.swing.JToggleButton();
BtnLoad = new javax.swing.JToggleButton();
RBtn3Ecke = new javax.swing.JRadioButton();
RBtn4Ecke = new javax.swing.JRadioButton();
RBtn6Ecke = new javax.swing.JRadioButton();
JSPKarte = new javax.swing.JScrollPane();
JPK = new javax.swing.JPanel();
BtnCreate = new javax.swing.JToggleButton();
TxtFFlaeche = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Gewachsenes");
BtnSave.setText("Speichern");
BtnLoad.setText("Laden");
buttonGroup1.add(RBtn3Ecke);
RBtn3Ecke.setText("Dreiecke");
RBtn3Ecke.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RBtn3EckeActionPerformed(evt);
}
});
buttonGroup1.add(RBtn4Ecke);
RBtn4Ecke.setSelected(true);
RBtn4Ecke.setText("Vierecke");
buttonGroup1.add(RBtn6Ecke);
RBtn6Ecke.setText("Sechsecke");
JSPKarte.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Karte", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(0, 204, 0))); // NOI18N
JSPKarte.setWheelScrollingEnabled(false);
JPK.setMinimumSize(new java.awt.Dimension(5000, 5000));
JPK.setPreferredSize(new java.awt.Dimension(10000, 10000));
javax.swing.GroupLayout JPKLayout = new javax.swing.GroupLayout(JPK);
JPK.setLayout(JPKLayout);
JPKLayout.setHorizontalGroup(
JPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 10000, Short.MAX_VALUE)
);
JPKLayout.setVerticalGroup(
JPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 10000, Short.MAX_VALUE)
);
JSPKarte.setViewportView(JPK);
BtnCreate.setFont(new java.awt.Font("Tahoma", 1, 11));
BtnCreate.setForeground(new java.awt.Color(255, 0, 0));
BtnCreate.setText("Start");
BtnCreate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
BtnCreateActionPerformed(evt);
}
});
jLabel1.setText("Fläche");
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.LEADING)
.addComponent(JSPKarte, javax.swing.GroupLayout.PREFERRED_SIZE, 405, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(BtnLoad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
.addComponent(BtnSave, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(RBtn3Ecke)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(RBtn4Ecke)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(RBtn6Ecke)
.addGap(23, 23, 23)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(BtnCreate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(TxtFFlaeche))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(449, Short.MAX_VALUE)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(JSPKarte, javax.swing.GroupLayout.PREFERRED_SIZE, 412, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(BtnSave)
.addComponent(RBtn3Ecke)
.addComponent(RBtn4Ecke)
.addComponent(RBtn6Ecke)
.addComponent(TxtFFlaeche, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(BtnLoad)
.addComponent(BtnCreate))
.addContainerGap())
);
pack();
}// </editor-fold>
private void BtnCreateActionPerformed(java.awt.event.ActionEvent evt) {
int f,e=4;
f=Integer.parseInt(TxtFFlaeche.getText());
if(RBtn3Ecke.isSelected())
{
e=3;
}
if(RBtn4Ecke.isSelected())
{
e=4;
}
if(RBtn6Ecke.isSelected())
{
e=6;
}
if((f>1)&&(f<10001))
{
G.setRahmenWerte(f,e);
G.erstelleFlaeche();
//this.setContentPane(JSPKarte);
G.malen(JPK);
System.out.println("Fertig");
}
}
private void RBtn3EckeActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
// Variables declaration - do not modify
private javax.swing.JToggleButton BtnCreate;
private javax.swing.JToggleButton BtnLoad;
private javax.swing.JToggleButton BtnSave;
private javax.swing.JPanel JPK;
private javax.swing.JScrollPane JSPKarte;
private javax.swing.JRadioButton RBtn3Ecke;
private javax.swing.JRadioButton RBtn4Ecke;
private javax.swing.JRadioButton RBtn6Ecke;
private javax.swing.JTextField TxtFFlaeche;
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JLabel jLabel1;
// End of variables declaration
}