/*
* ReitstallverwaltungView.java
*/
package reitstallverwaltung;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import org.jdesktop.application.Task;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.RollbackException;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.jdesktop.beansbinding.AbstractBindingListener;
import org.jdesktop.beansbinding.Binding;
import org.jdesktop.beansbinding.PropertyStateEvent;
/**
* The application's main frame.
*/
public class SchuelerView extends FrameView
{
public SchuelerView(SingleFrameApplication app)
{
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++)
{
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener()
{
public void propertyChange(java.beans.PropertyChangeEvent evt)
{
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName))
{
if (!busyIconTimer.isRunning())
{
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
}
else if ("done".equals(propertyName))
{
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
}
else if ("message".equals(propertyName))
{
String text = (String)(evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
}
else if ("progress".equals(propertyName))
{
int value = (Integer)(evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
// tracking table selection
masterTable.getSelectionModel().addListSelectionListener
(
new ListSelectionListener()
{
public void valueChanged(ListSelectionEvent e)
{
firePropertyChange("recordSelected", !isRecordSelected(), isRecordSelected());
}
});
// tracking changes to save
bindingGroup.addBindingListener(new AbstractBindingListener()
{
@Override
public void targetChanged(Binding binding, PropertyStateEvent event)
{
// save action observes saveNeeded property
setSaveNeeded(true);
}
});
// have a transaction started
entityManager.getTransaction().begin();
}
public boolean isSaveNeeded()
{
return saveNeeded;
}
private void setSaveNeeded(boolean saveNeeded)
{
if (saveNeeded != this.saveNeeded)
{
this.saveNeeded = saveNeeded;
firePropertyChange("saveNeeded", !saveNeeded, saveNeeded);
}
}
public boolean isRecordSelected()
{
return masterTable.getSelectedRow() != -1;
}
@Action
public void newRecord()
{
reitstallverwaltung.Schueler rs = new reitstallverwaltung.Schueler();
entityManager.persist(rs);
list.add(rs);
int row = list.size()-1;
masterTable.setRowSelectionInterval(row, row);
masterTable.scrollRectToVisible(masterTable.getCellRect(row, 0, true));
setSaveNeeded(true);
}
@Action(enabledProperty = "recordSelected")
public void deleteRecord()
{
int[] selected = masterTable.getSelectedRows();
List<reitstallverwaltung.Schueler> toRemove = new ArrayList<reitstallverwaltung.Schueler>(selected.length);
for (int idx=0; idx<selected.length; idx++)
{
reitstallverwaltung.Schueler rs = list.get(masterTable.convertRowIndexToModel(selected[idx]));
toRemove.add(rs);
entityManager.remove(rs);
}
list.removeAll(toRemove);
setSaveNeeded(true);
}
@Action(enabledProperty = "saveNeeded")
public Task save()
{
return new SaveTask(getApplication());
}
private class SaveTask extends Task
{
SaveTask(org.jdesktop.application.Application app)
{
super(app);
}
@Override protected Void doInBackground()
{
try {
entityManager.getTransaction().commit();
entityManager.getTransaction().begin();
} catch (RollbackException rex) {
rex.printStackTrace();
entityManager.getTransaction().begin();
List<reitstallverwaltung.Schueler> merged = new ArrayList<reitstallverwaltung.Schueler>(list.size());
for (reitstallverwaltung.Schueler rs : list)
{
merged.add(entityManager.merge(rs));
}
list.clear();
list.addAll(merged);
}
return null;
}
@Override protected void finished()
{
setSaveNeeded(false);
}
}
/**
* An example action method showing how to create asynchronous tasks
* (running on background) and how to show their progress. Note the
* artificial 'Thread.sleep' calls making the task long enough to see the
* progress visualization - remove the sleeps for real application.
*/
@Action
public Task refresh()
{
return new RefreshTask(getApplication());
}
private class RefreshTask extends Task
{
RefreshTask(org.jdesktop.application.Application app)
{
super(app);
}
@SuppressWarnings("unchecked")
@Override protected Void doInBackground()
{
try
{
setProgress(0, 0, 4);
setMessage("Rolling back the current changes...");
setProgress(1, 0, 4);
entityManager.getTransaction().rollback();
Thread.sleep(1000L); // remove for real app
setProgress(2, 0, 4);
setMessage("Starting a new transaction...");
entityManager.getTransaction().begin();
Thread.sleep(500L); // remove for real app
setProgress(3, 0, 4);
setMessage("Fetching new data...");
java.util.Collection data = query.getResultList();
for (Object entity : data) {
entityManager.refresh(entity);
}
Thread.sleep(1300L); // remove for real app
setProgress(4, 0, 4);
Thread.sleep(150L); // remove for real app
list.clear();
list.addAll(data);
} catch(InterruptedException ignore) { }
return null;
}
@Override protected void finished()
{
setMessage("Done.");
setSaveNeeded(false);
}
}
@Action
public void showAboutBox()
{
if (aboutBox == null)
{
JFrame mainFrame = ReitstallverwaltungApp.getApplication().getMainFrame();
aboutBox = new ReitstallverwaltungAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
ReitstallverwaltungApp.getApplication().show(aboutBox);
}
/** 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() {
bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
mainPanel = new javax.swing.JPanel();
masterScrollPane = new javax.swing.JScrollPane();
masterTable = new javax.swing.JTable();
idLabel = new javax.swing.JLabel();
zunameLabel = new javax.swing.JLabel();
vornameLabel = new javax.swing.JLabel();
telnrLabel = new javax.swing.JLabel();
idField = new javax.swing.JTextField();
zunameField = new javax.swing.JTextField();
vornameField = new javax.swing.JTextField();
telnrField = new javax.swing.JTextField();
saveButton = new javax.swing.JButton();
refreshButton = new javax.swing.JButton();
newButton = new javax.swing.JButton();
deleteButton = new javax.swing.JButton();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem newRecordMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenuItem deleteRecordMenuItem = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JSeparator();
javax.swing.JMenuItem saveMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenuItem refreshMenuItem = new javax.swing.JMenuItem();
jSeparator2 = new javax.swing.JSeparator();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(reitstallverwaltung.ReitstallverwaltungApp.class).getContext().getResourceMap(SchuelerView.class);
entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory(resourceMap.getString("entityManager.persistenceUnit")).createEntityManager(); // NOI18N
query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N
list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(query.getResultList());
mainPanel.setName("mainPanel"); // NOI18N
masterScrollPane.setName("masterScrollPane"); // NOI18N
masterTable.setName("masterTable"); // NOI18N
org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable);
org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
columnBinding.setColumnName("Id");
columnBinding.setColumnClass(Integer.class);
columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${zuname}"));
columnBinding.setColumnName("Zuname");
columnBinding.setColumnClass(String.class);
columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${vorname}"));
columnBinding.setColumnName("Vorname");
columnBinding.setColumnClass(String.class);
columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${telnr}"));
columnBinding.setColumnName("Telnr");
columnBinding.setColumnClass(String.class);
bindingGroup.addBinding(jTableBinding);
masterScrollPane.setViewportView(masterTable);
idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N
idLabel.setName("idLabel"); // NOI18N
zunameLabel.setText(resourceMap.getString("zunameLabel.text")); // NOI18N
zunameLabel.setName("zunameLabel"); // NOI18N
vornameLabel.setText(resourceMap.getString("vornameLabel.text")); // NOI18N
vornameLabel.setName("vornameLabel"); // NOI18N
telnrLabel.setText(resourceMap.getString("telnrLabel.text")); // NOI18N
telnrLabel.setName("telnrLabel"); // NOI18N
idField.setName("idField"); // NOI18N
org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.id}"), idField, org.jdesktop.beansbinding.BeanProperty.create("text"));
binding.setSourceUnreadableValue(null);
bindingGroup.addBinding(binding);
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), idField, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
zunameField.setName("zunameField"); // NOI18N
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.zuname}"), zunameField, org.jdesktop.beansbinding.BeanProperty.create("text"));
binding.setSourceUnreadableValue(null);
bindingGroup.addBinding(binding);
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), zunameField, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
vornameField.setName("vornameField"); // NOI18N
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.vorname}"), vornameField, org.jdesktop.beansbinding.BeanProperty.create("text"));
binding.setSourceUnreadableValue(null);
bindingGroup.addBinding(binding);
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), vornameField, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
telnrField.setName("telnrField"); // NOI18N
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.telnr}"), telnrField, org.jdesktop.beansbinding.BeanProperty.create("text"));
binding.setSourceUnreadableValue(null);
bindingGroup.addBinding(binding);
binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"), telnrField, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
bindingGroup.addBinding(binding);
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(reitstallverwaltung.ReitstallverwaltungApp.class).getContext().getActionMap(SchuelerView.class, this);
saveButton.setAction(actionMap.get("save")); // NOI18N
saveButton.setName("saveButton"); // NOI18N
refreshButton.setAction(actionMap.get("refresh")); // NOI18N
refreshButton.setName("refreshButton"); // NOI18N
newButton.setAction(actionMap.get("newRecord")); // NOI18N
newButton.setName("newButton"); // NOI18N
deleteButton.setAction(actionMap.get("deleteRecord")); // NOI18N
deleteButton.setName("deleteButton"); // NOI18N
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addComponent(newButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deleteButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(refreshButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveButton))
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(idLabel)
.addComponent(zunameLabel)
.addComponent(vornameLabel)
.addComponent(telnrLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(idField, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
.addComponent(zunameField, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
.addComponent(vornameField, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
.addComponent(telnrField, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)))
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 427, Short.MAX_VALUE)))
.addContainerGap())
);
mainPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {deleteButton, newButton, refreshButton, saveButton});
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(masterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(idLabel)
.addComponent(idField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(zunameLabel)
.addComponent(zunameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(vornameLabel)
.addComponent(vornameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(telnrLabel)
.addComponent(telnrField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveButton)
.addComponent(refreshButton)
.addComponent(deleteButton)
.addComponent(newButton))
.addContainerGap())
);
menuBar.setName("menuBar"); // NOI18N
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
newRecordMenuItem.setAction(actionMap.get("newRecord")); // NOI18N
newRecordMenuItem.setName("newRecordMenuItem"); // NOI18N
fileMenu.add(newRecordMenuItem);
deleteRecordMenuItem.setAction(actionMap.get("deleteRecord")); // NOI18N
deleteRecordMenuItem.setName("deleteRecordMenuItem"); // NOI18N
fileMenu.add(deleteRecordMenuItem);
jSeparator1.setName("jSeparator1"); // NOI18N
fileMenu.add(jSeparator1);
saveMenuItem.setAction(actionMap.get("save")); // NOI18N
saveMenuItem.setName("saveMenuItem"); // NOI18N
fileMenu.add(saveMenuItem);
refreshMenuItem.setAction(actionMap.get("refresh")); // NOI18N
refreshMenuItem.setName("refreshMenuItem"); // NOI18N
fileMenu.add(refreshMenuItem);
jSeparator2.setName("jSeparator2"); // NOI18N
fileMenu.add(jSeparator2);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N
aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem.setName("aboutMenuItem"); // NOI18N
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
statusPanel.setLayout(statusPanelLayout);
statusPanelLayout.setHorizontalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 277, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
setComponent(mainPanel);
setMenuBar(menuBar);
setStatusBar(statusPanel);
bindingGroup.bind();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton deleteButton;
private javax.persistence.EntityManager entityManager;
private javax.swing.JTextField idField;
private javax.swing.JLabel idLabel;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JSeparator jSeparator2;
private java.util.List<reitstallverwaltung.Schueler> list;
private javax.swing.JPanel mainPanel;
private javax.swing.JScrollPane masterScrollPane;
private javax.swing.JTable masterTable;
private javax.swing.JMenuBar menuBar;
private javax.swing.JButton newButton;
private javax.swing.JProgressBar progressBar;
private javax.persistence.Query query;
private javax.swing.JButton refreshButton;
private javax.swing.JButton saveButton;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;
private javax.swing.JTextField telnrField;
private javax.swing.JLabel telnrLabel;
private javax.swing.JTextField vornameField;
private javax.swing.JLabel vornameLabel;
private javax.swing.JTextField zunameField;
private javax.swing.JLabel zunameLabel;
private org.jdesktop.beansbinding.BindingGroup bindingGroup;
// End of variables declaration//GEN-END:variables
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;
private boolean saveNeeded;
}