[Minor] Tweaked DebugLogDialog to maximize its real estate.
This commit is contained in:
parent
698c722c33
commit
c826062be3
@ -38,6 +38,9 @@ import javax.swing.table.TableCellRenderer;
|
|||||||
import javax.swing.table.TableModel;
|
import javax.swing.table.TableModel;
|
||||||
import javax.swing.table.TableRowSorter;
|
import javax.swing.table.TableRowSorter;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import net.sf.openrocket.gui.adaptors.Column;
|
import net.sf.openrocket.gui.adaptors.Column;
|
||||||
import net.sf.openrocket.gui.adaptors.ColumnTable;
|
import net.sf.openrocket.gui.adaptors.ColumnTable;
|
||||||
@ -56,9 +59,6 @@ import net.sf.openrocket.logging.StackTraceWriter;
|
|||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.util.NumericComparator;
|
import net.sf.openrocket.util.NumericComparator;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public class DebugLogDialog extends JDialog {
|
public class DebugLogDialog extends JDialog {
|
||||||
private static final Logger log = LoggerFactory.getLogger(DebugLogDialog.class);
|
private static final Logger log = LoggerFactory.getLogger(DebugLogDialog.class);
|
||||||
|
|
||||||
@ -133,20 +133,18 @@ public class DebugLogDialog extends JDialog {
|
|||||||
|
|
||||||
|
|
||||||
// Create the UI
|
// Create the UI
|
||||||
JPanel mainPanel = new JPanel(new MigLayout("fill"));
|
this.setLayout( new MigLayout("fill"));
|
||||||
this.add(mainPanel);
|
|
||||||
|
|
||||||
|
|
||||||
JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
|
JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
|
||||||
split.setDividerLocation(0.7);
|
split.setDividerLocation(0.7);
|
||||||
mainPanel.add(split, "grow");
|
this.add(split, "grow, pushy 200, growprioy 200");
|
||||||
|
|
||||||
// Top panel
|
// Top panel
|
||||||
JPanel panel = new JPanel(new MigLayout("fill"));
|
JPanel topPanel = new JPanel(new MigLayout("fill"));
|
||||||
split.add(panel);
|
split.add(topPanel);
|
||||||
|
|
||||||
//// Display log lines:
|
//// Display log lines:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.Displayloglines")), "gapright para, split");
|
topPanel.add(new JLabel(trans.get("debuglogdlg.Displayloglines")), "gapright para, split");
|
||||||
for (LogLevel l : LogLevel.values()) {
|
for (LogLevel l : LogLevel.values()) {
|
||||||
JCheckBox box = new JCheckBox(l.toString());
|
JCheckBox box = new JCheckBox(l.toString());
|
||||||
// By default display DEBUG and above
|
// By default display DEBUG and above
|
||||||
@ -157,14 +155,14 @@ public class DebugLogDialog extends JDialog {
|
|||||||
sorter.setRowFilter(new LogFilter());
|
sorter.setRowFilter(new LogFilter());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(box, "gapright unrel");
|
topPanel.add(box, "gapright unrel");
|
||||||
filterButtons.put(l, box);
|
filterButtons.put(l, box);
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Follow
|
//// Follow
|
||||||
followBox = new JCheckBox(trans.get("debuglogdlg.Follow"));
|
followBox = new JCheckBox(trans.get("debuglogdlg.Follow"));
|
||||||
followBox.setSelected(true);
|
followBox.setSelected(true);
|
||||||
panel.add(followBox, "skip, gapright para, right");
|
topPanel.add(followBox, "skip, gapright para, right");
|
||||||
|
|
||||||
//// Clear button
|
//// Clear button
|
||||||
JButton clear = new JButton(trans.get("debuglogdlg.but.clear"));
|
JButton clear = new JButton(trans.get("debuglogdlg.but.clear"));
|
||||||
@ -177,7 +175,7 @@ public class DebugLogDialog extends JDialog {
|
|||||||
model.fireTableDataChanged();
|
model.fireTableDataChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(clear, "right, wrap");
|
topPanel.add(clear, "right, wrap");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -293,45 +291,45 @@ public class DebugLogDialog extends JDialog {
|
|||||||
sorter.setRowFilter(new LogFilter());
|
sorter.setRowFilter(new LogFilter());
|
||||||
|
|
||||||
|
|
||||||
panel.add(new JScrollPane(table), "span, grow, width " +
|
topPanel.add(new JScrollPane(table), "span, grow, width " +
|
||||||
(Toolkit.getDefaultToolkit().getScreenSize().width * 8 / 10) +
|
(Toolkit.getDefaultToolkit().getScreenSize().width * 8 / 10) +
|
||||||
"px, height 400px");
|
"px, height 400px, growy, pushy 200, growprioy 200");
|
||||||
|
|
||||||
|
|
||||||
panel = new JPanel(new MigLayout("fill"));
|
JPanel bottomPanel = new JPanel(new MigLayout("fill"));
|
||||||
split.add(panel);
|
split.add(bottomPanel);
|
||||||
|
|
||||||
//// Log line number:
|
//// Log line number:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.lbl.Loglinenbr")), "split, gapright rel");
|
bottomPanel.add(new JLabel(trans.get("debuglogdlg.lbl.Loglinenbr")), "split, gapright rel");
|
||||||
numberLabel = new SelectableLabel();
|
numberLabel = new SelectableLabel();
|
||||||
panel.add(numberLabel, "width 70lp, gapright para");
|
bottomPanel.add(numberLabel, "width 70lp, gapright para");
|
||||||
|
|
||||||
//// Time:
|
//// Time:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.lbl.Time")), "split, gapright rel");
|
bottomPanel.add(new JLabel(trans.get("debuglogdlg.lbl.Time")), "split, gapright rel");
|
||||||
timeLabel = new SelectableLabel();
|
timeLabel = new SelectableLabel();
|
||||||
panel.add(timeLabel, "width 70lp, gapright para");
|
bottomPanel.add(timeLabel, "width 70lp, gapright para");
|
||||||
|
|
||||||
//// Level:
|
//// Level:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.lbl.Level")), "split, gapright rel");
|
bottomPanel.add(new JLabel(trans.get("debuglogdlg.lbl.Level")), "split, gapright rel");
|
||||||
levelLabel = new SelectableLabel();
|
levelLabel = new SelectableLabel();
|
||||||
panel.add(levelLabel, "width 70lp, gapright para");
|
bottomPanel.add(levelLabel, "width 70lp, gapright para");
|
||||||
|
|
||||||
//// Location:
|
//// Location:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.lbl.Location")), "split, gapright rel");
|
bottomPanel.add(new JLabel(trans.get("debuglogdlg.lbl.Location")), "split, gapright rel");
|
||||||
locationLabel = new SelectableLabel();
|
locationLabel = new SelectableLabel();
|
||||||
panel.add(locationLabel, "growx, wrap unrel");
|
bottomPanel.add(locationLabel, "growx, wrap unrel");
|
||||||
|
|
||||||
//// Log message:
|
//// Log message:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.lbl.Logmessage")), "split, gapright rel");
|
bottomPanel.add(new JLabel(trans.get("debuglogdlg.lbl.Logmessage")), "split, gapright rel");
|
||||||
messageLabel = new SelectableLabel();
|
messageLabel = new SelectableLabel();
|
||||||
panel.add(messageLabel, "growx, wrap para");
|
bottomPanel.add(messageLabel, "growx, wrap para");
|
||||||
|
|
||||||
//// Stack trace:
|
//// Stack trace:
|
||||||
panel.add(new JLabel(trans.get("debuglogdlg.lbl.Stacktrace")), "wrap rel");
|
bottomPanel.add(new JLabel(trans.get("debuglogdlg.lbl.Stacktrace")), "wrap rel");
|
||||||
stackTraceLabel = new JTextArea(8, 80);
|
stackTraceLabel = new JTextArea(8, 80);
|
||||||
stackTraceLabel.setEditable(false);
|
stackTraceLabel.setEditable(false);
|
||||||
GUIUtil.changeFontSize(stackTraceLabel, -2);
|
GUIUtil.changeFontSize(stackTraceLabel, -2);
|
||||||
panel.add(new JScrollPane(stackTraceLabel), "grow");
|
bottomPanel.add(new JScrollPane(stackTraceLabel), "grow, pushy 200, growprioy 200");
|
||||||
|
|
||||||
|
|
||||||
//Close button
|
//Close button
|
||||||
@ -342,7 +340,7 @@ public class DebugLogDialog extends JDialog {
|
|||||||
DebugLogDialog.this.dispose();
|
DebugLogDialog.this.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mainPanel.add(close, "newline para, right, tag ok");
|
this.add(close, "newline para, right, tag ok");
|
||||||
|
|
||||||
|
|
||||||
// Use timer to purge the queue so as not to overwhelm the EDT with events
|
// Use timer to purge the queue so as not to overwhelm the EDT with events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user