allow the import panel to start small and grow with the data

This commit is contained in:
myk
2013-03-13 00:09:42 +00:00
parent f838dd8f3a
commit d74be36f1c

View File

@@ -228,7 +228,7 @@ public class DialogMigrateProfile {
JPanel overlay = FOverlay.SINGLETON_INSTANCE.getPanel(); JPanel overlay = FOverlay.SINGLETON_INSTANCE.getPanel();
overlay.setLayout(new MigLayout("insets 0, gap 0, wrap, ax center, ay center")); overlay.setLayout(new MigLayout("insets 0, gap 0, wrap, ax center, ay center"));
overlay.add(p, "w 800::80%, h 800::90%"); overlay.add(p, "w 400::80%, h 100::90%");
SOverlayUtils.showOverlay(); SOverlayUtils.showOverlay();
// focus cancel button // focus cancel button
@@ -354,7 +354,7 @@ public class DialogMigrateProfile {
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
JScrollPane scroller = new JScrollPane(_operationLog); JScrollPane scroller = new JScrollPane(_operationLog);
scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
_selectionPanel.add(scroller, "w 600:100%:100%, h 60:100%:100%"); _selectionPanel.add(scroller, "w 400:100%:100%, h 60:100%:100%");
// add progress bar // add progress bar
_progressBar = new JProgressBar(); _progressBar = new JProgressBar();
@@ -367,6 +367,10 @@ public class DialogMigrateProfile {
// set checkbox labels // set checkbox labels
_updateUI(); _updateUI();
// resize the panel properly now that the _selectionPanel is filled in
_selectionPanel.getParent().validate();
_selectionPanel.getParent().invalidate();
} }
private void _addSelectionWidget(JPanel parent, OpType type, String name) { private void _addSelectionWidget(JPanel parent, OpType type, String name) {
@@ -449,6 +453,7 @@ public class DialogMigrateProfile {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override public void run() { @Override public void run() {
if (_cancel) { return; } if (_cancel) { return; }
_progressBar.setString("Analyzing...");
_progressBar.setMaximum(numFilesToAnalyze); _progressBar.setMaximum(numFilesToAnalyze);
_progressBar.setValue(0); _progressBar.setValue(0);
_progressBar.setIndeterminate(false); _progressBar.setIndeterminate(false);
@@ -658,7 +663,7 @@ public class DialogMigrateProfile {
} }
// set progress bar bounds // set progress bar bounds
_progressBar.setString(_move ? "Moving files" : "Copying files"); _progressBar.setString(_move ? "Moving files..." : "Copying files...");
_progressBar.setMinimum(0); _progressBar.setMinimum(0);
_progressBar.setMaximum(_operations.size()); _progressBar.setMaximum(_operations.size());
} }