Skip to content

Commit

Permalink
UI fundamentally prompts for appropriate info
Browse files Browse the repository at this point in the history
  • Loading branch information
johncurrier committed Dec 13, 2006
1 parent 29a02ed commit 3386954
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 12 deletions.
16 changes: 14 additions & 2 deletions src/net/sourceforge/schemaspy/ui/DbConfigPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,20 @@ private void setDbSpecificConfig(DbSpecificConfig dbConfig) {
add(valueField, constraints);
}

if (getParent() != null)
getParent().validate();
Container root = getRoot();
if (root != null)
root.validate();
}

private Container getRoot() {
Container root = getParent();
while (root != null) {
Container parent = root.getParent();
if (parent == null)
return root;
root = parent;
}
return null;
}

/**
Expand Down
58 changes: 48 additions & 10 deletions src/net/sourceforge/schemaspy/ui/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.Dimension;
import javax.swing.JPanel;
import java.awt.GridBagLayout;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;

/**
* @author John Currier
Expand All @@ -19,6 +13,7 @@ public class MainFrame extends JFrame {
private JPanel dbConfigPanel = null;
private JPanel buttonBar = null;
private JButton launchButton = null;
private JPanel header;

/**
* This is the default constructor
Expand All @@ -36,7 +31,7 @@ public MainFrame() {
private void initialize() {
this.setContentPane(getJContentPane());
this.setTitle("SchemaSpy");
this.setSize(new Dimension(500, 281));
this.setSize(new Dimension(500, 312));
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
Expand All @@ -59,9 +54,37 @@ private JPanel getDbConfigPanel() {
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
jContentPane.add(getDbConfigPanel(), BorderLayout.NORTH);
jContentPane.add(getButtonBar(), BorderLayout.SOUTH);
jContentPane.setLayout(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = GridBagConstraints.RELATIVE;
constraints.weightx = 1.0;

constraints.anchor = GridBagConstraints.CENTER;
constraints.insets = new Insets(4, 0, 4, 0);
jContentPane.add(getHeaderPanel(), constraints);
constraints.insets = new Insets(0, 0, 0, 0);

constraints.fill = GridBagConstraints.BOTH;
constraints.anchor = GridBagConstraints.NORTHWEST;
constraints.weighty = 1.0;
JScrollPane scroller = new JScrollPane();
//scroller.setBorder(null);
scroller.setViewportView(getDbConfigPanel());
//scroller.setViewportBorder(new BevelBorder(BevelBorder.LOWERED));
jContentPane.add(scroller, constraints);

// constraints.fill = GridBagConstraints.VERTICAL;
// constraints.weighty = 0.0;
// JLabel filler = new JLabel();
// filler.setPreferredSize(new Dimension(0, 0));
// filler.setMinimumSize(new Dimension(0, 0));
// jContentPane.add(filler, constraints);

constraints.anchor = GridBagConstraints.SOUTHEAST;
constraints.fill = GridBagConstraints.NONE;
constraints.weighty = 0.0;
jContentPane.add(getButtonBar(), constraints);
}
return jContentPane;
}
Expand All @@ -79,6 +102,21 @@ private JPanel getButtonBar() {
}
return buttonBar;
}

private JPanel getHeaderPanel() {
if (header == null) {
header = new JPanel();
header.setLayout(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = 0;
header.add(new JLabel("SchemaSpy - Graphical Database Metadata Browser"), constraints);
constraints.gridx = 0;
constraints.gridy++;
header.add(new JLabel("Select a database type and fill in the required fields"), constraints);
}
return header;
}

/**
* This method initializes launchButton
Expand Down

0 comments on commit 3386954

Please sign in to comment.