Skip to content

Commit

Permalink
show label when test database is used
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Oct 18, 2014
1 parent ee297a8 commit 99e2a6e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/de/mpg/molgen/buczek/portifix/Gui.form
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<Component id="button_ok" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="button_cancel" min="-2" pref="78" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="testDatabaseLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="button_refresh" min="-2" max="-2" attributes="0"/>
</Group>
Expand All @@ -85,6 +87,7 @@
<Component id="button_ok" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="button_cancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="button_refresh" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="testDatabaseLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
Expand Down Expand Up @@ -229,6 +232,11 @@
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="testDatabaseLabel">
<Properties>
<Property name="text" type="java.lang.String" value="(test database)"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
Expand Down
16 changes: 13 additions & 3 deletions src/de/mpg/molgen/buczek/portifix/Gui.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class Gui extends javax.swing.JFrame {
Connection connection;
TableModel tableModel;

private static final boolean useTestDatabase=true;
private static final boolean useTestDatabase=false;
private static final String connectString=
useTestDatabase
? "jdbc:firebirdsql://portier-db//project/portier/firebird/data/x.fdb?encoding=UTF8"
Expand Down Expand Up @@ -210,7 +210,10 @@ public void run() {
label_schluessel.setText("");
textField_datum.setText("");
textField_datum.setEnabled(false);

if (!useTestDatabase) {
testDatabaseLabel.setVisible(false);
}

jTable1.addMouseListener(popupListener);

jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
Expand Down Expand Up @@ -305,6 +308,7 @@ private void initComponents() {
jLabel5 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
textField_datum = new javax.swing.JTextField();
testDatabaseLabel = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();

Expand Down Expand Up @@ -396,6 +400,8 @@ private void initComponents() {
.addGap(34, 34, 34))
);

testDatabaseLabel.setText("(test database)");

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
Expand All @@ -412,6 +418,8 @@ private void initComponents() {
.addComponent(button_ok)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(button_cancel, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(testDatabaseLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(button_refresh)))
.addContainerGap())
Expand All @@ -427,7 +435,8 @@ private void initComponents() {
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(button_ok)
.addComponent(button_cancel)
.addComponent(button_refresh))
.addComponent(button_refresh)
.addComponent(testDatabaseLabel))
.addGap(0, 0, 0))
);

Expand Down Expand Up @@ -491,6 +500,7 @@ public void run() {
private javax.swing.JLabel label_abteilung;
private javax.swing.JLabel label_name;
private javax.swing.JLabel label_schluessel;
private javax.swing.JLabel testDatabaseLabel;
private javax.swing.JTextField textField_datum;
// End of variables declaration//GEN-END:variables

Expand Down

0 comments on commit 99e2a6e

Please sign in to comment.