Minor UI cleanup
Project: http://git-wip-us.apache.org/repos/asf/logging-chainsaw/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-chainsaw/commit/4caf2826 Tree: http://git-wip-us.apache.org/repos/asf/logging-chainsaw/tree/4caf2826 Diff: http://git-wip-us.apache.org/repos/asf/logging-chainsaw/diff/4caf2826 Branch: refs/heads/master Commit: 4caf2826ee8ced88887f51b07244ab2298ca65e3 Parents: f95619e Author: Scott Deboy <[email protected]> Authored: Fri Nov 5 05:32:56 2010 +0000 Committer: Scott Deboy <[email protected]> Committed: Fri Nov 5 05:32:56 2010 +0000 ---------------------------------------------------------------------- .../ApplicationPreferenceModelPanel.java | 57 +++++++++----------- .../log4j/chainsaw/LogPanelPreferencePanel.java | 3 +- .../chainsaw/ReceiverConfigurationPanel.java | 14 ++--- 3 files changed, 34 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/4caf2826/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java b/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java index c1460e0..b96d052 100644 --- a/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java +++ b/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java @@ -170,11 +170,11 @@ public static void main(String[] args) { } public class VisualsPrefPanel extends BasicPrefPanel { - private final JRadioButton topPlacement = new JRadioButton("Top"); - private final JRadioButton bottomPlacement = new JRadioButton("Bottom"); - private final JCheckBox statusBar = new JCheckBox("Show Status bar"); - private final JCheckBox toolBar = new JCheckBox("Show Toolbar"); - private final JCheckBox receivers = new JCheckBox("Show Receivers"); + private final JRadioButton topPlacement = new JRadioButton(" Top "); + private final JRadioButton bottomPlacement = new JRadioButton(" Bottom "); + private final JCheckBox statusBar = new JCheckBox(" Show Status bar "); + private final JCheckBox toolBar = new JCheckBox(" Show Toolbar "); + private final JCheckBox receivers = new JCheckBox(" Show Receivers "); private UIManager.LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels(); private final ButtonGroup lookAndFeelGroup = new ButtonGroup(); @@ -306,12 +306,9 @@ public static void main(String[] args) { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel tabPlacementBox = new JPanel(); - tabPlacementBox.setLayout( - new BoxLayout(tabPlacementBox, BoxLayout.Y_AXIS)); + tabPlacementBox.setLayout(new BoxLayout(tabPlacementBox, BoxLayout.Y_AXIS)); - tabPlacementBox.setBorder( - BorderFactory.createTitledBorder( - BorderFactory.createEtchedBorder(), "Tab Placement")); + tabPlacementBox.setBorder(BorderFactory.createTitledBorder(" Tab Placement ")); ButtonGroup tabPlacementGroup = new ButtonGroup(); @@ -337,13 +334,11 @@ public static void main(String[] args) { JPanel lfPanel = new JPanel(); lfPanel.setLayout(new BoxLayout(lfPanel, BoxLayout.Y_AXIS)); - lfPanel.setBorder( - BorderFactory.createTitledBorder( - BorderFactory.createEtchedBorder(), "Look & Feel")); + lfPanel.setBorder(BorderFactory.createTitledBorder(" Look & Feel ")); for (int i = 0; i < lookAndFeels.length; i++) { final UIManager.LookAndFeelInfo lfInfo = lookAndFeels[i]; - final JRadioButton lfItem = new JRadioButton(lfInfo.getName()); + final JRadioButton lfItem = new JRadioButton(" " + lfInfo.getName() + " "); lfItem.setName(lfInfo.getClassName()); lfItem.addActionListener( new ActionListener() { @@ -359,7 +354,7 @@ public static void main(String[] args) { try { final Class gtkLF = Class.forName("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); - final JRadioButton lfIGTK = new JRadioButton("GTK+ 2.0"); + final JRadioButton lfIGTK = new JRadioButton(" GTK+ 2.0 "); lfIGTK.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -418,14 +413,14 @@ public static void main(String[] args) { */ public class GeneralAllPrefPanel extends BasicPrefPanel { private final JCheckBox showNoReceiverWarning = - new JCheckBox("Prompt me on startup if there are no Receivers defined"); - private final JCheckBox showSplash = new JCheckBox("Show Splash screen at startup"); + new JCheckBox(" Prompt me on startup if there are no Receivers defined "); + private final JCheckBox showSplash = new JCheckBox(" Show Splash screen at startup "); private final JSlider responsiveSlider = new JSlider(SwingConstants.HORIZONTAL, 1, 4, 2); - private final JCheckBox confirmExit = new JCheckBox("Confirm Exit"); + private final JCheckBox confirmExit = new JCheckBox(" Confirm Exit "); Dictionary sliderLabelMap = new Hashtable(); - private final JCheckBox okToRemoveSecurityManager = new JCheckBox("Ok to remove SecurityManager"); + private final JCheckBox okToRemoveSecurityManager = new JCheckBox(" Ok to remove SecurityManager "); public GeneralAllPrefPanel() { super("General"); @@ -449,7 +444,7 @@ public static void main(String[] args) { p.add(showNoReceiverWarning); p.add(Box.createHorizontalGlue()); - confirmExit.setToolTipText("Is set, you will be prompted to confirm the exit Chainsaw"); + confirmExit.setToolTipText("If set, you prompt to confirm Chainsaw exit"); okToRemoveSecurityManager.setToolTipText("You will need to tick this to be able to load Receivers/Plugins that require external dependancies."); setupInitialValues(); setupListeners(); @@ -459,7 +454,7 @@ public static void main(String[] args) { JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - p1.add(new JLabel("Tab name/event routing expression")); + p1.add(new JLabel(" Tab name/event routing expression ")); p1.add(Box.createHorizontalStrut(5)); p1.add(identifierExpression); add(p1); @@ -483,24 +478,24 @@ public static void main(String[] args) { JPanel p4 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - p4.add(new JLabel("ToolTip Display (millis)")); + p4.add(new JLabel(" ToolTip Display (millis) ")); p4.add(Box.createHorizontalStrut(5)); p4.add(toolTipDisplayMillis); add(p4); JPanel p5 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - p5.add(new JLabel("Cyclic buffer size")); + p5.add(new JLabel(" Cyclic buffer size ")); p5.add(Box.createHorizontalStrut(5)); p5.add(cyclicBufferSize); p5.add(Box.createHorizontalStrut(5)); - p5.add(new JLabel("Cyclic buffer size change will take effect on Chainsaw restart")); + p5.add(new JLabel(" (effective on restart) ")); add(p5); Box p6 = new Box(BoxLayout.Y_AXIS); Box configURLPanel = new Box(BoxLayout.X_AXIS); - JLabel configLabel = new JLabel("Auto Config URL"); + JLabel configLabel = new JLabel(" Auto Config URL "); configURLPanel.add(configLabel); configURLPanel.add(Box.createHorizontalStrut(5)); @@ -585,9 +580,7 @@ public static void main(String[] args) { responsiveSlider.setPaintLabels(true); responsiveSlider.setPaintTrack(true); - responsiveSlider.setBorder( - BorderFactory.createTitledBorder( - BorderFactory.createEtchedBorder(), "Responsiveness")); + responsiveSlider.setBorder(BorderFactory.createTitledBorder(" Responsiveness ")); // responsiveSlider.setAlignmentY(0); // responsiveSlider.setAlignmentX(0); @@ -740,10 +733,10 @@ public static void main(String[] args) { } private void setupInitialValues() { - sliderLabelMap.put(new Integer(1), new JLabel("Fastest")); - sliderLabelMap.put(new Integer(2), new JLabel("Fast")); - sliderLabelMap.put(new Integer(3), new JLabel("Medium")); - sliderLabelMap.put(new Integer(4), new JLabel("Slow")); + sliderLabelMap.put(new Integer(1), new JLabel(" Fastest ")); + sliderLabelMap.put(new Integer(2), new JLabel(" Fast ")); + sliderLabelMap.put(new Integer(3), new JLabel(" Medium ")); + sliderLabelMap.put(new Integer(4), new JLabel(" Slow ")); // showNoReceiverWarning.setSelected( http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/4caf2826/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java b/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java index 5cd7550..2beba05 100644 --- a/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java +++ b/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java @@ -233,6 +233,7 @@ public class LogPanelPreferencePanel extends AbstractPreferencePanel }); columnList.setCellRenderer(cellRenderer); columnBox.add(new JScrollPane(columnList)); + columnBox.add(Box.createVerticalStrut(5)); columnBox.add(setAsDefaultsButton); add(columnBox); add(Box.createVerticalGlue()); @@ -553,7 +554,7 @@ public class LogPanelPreferencePanel extends AbstractPreferencePanel private final JCheckBox scrollToBottom = new JCheckBox("Scroll to bottom (view tracks with new events)"); private final JCheckBox showMillisDeltaAsGap = - new JCheckBox("Display timestamp delta between displayed events as space between rows"); + new JCheckBox("Display timestamp delta between events as row gap"); private final JCheckBox toolTips = new JCheckBox("Show Event Detail Tooltips"); private final JCheckBox thumbnailBarToolTips = http://git-wip-us.apache.org/repos/asf/logging-chainsaw/blob/4caf2826/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java b/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java index d04a8e1..adbe826 100644 --- a/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java +++ b/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java @@ -133,7 +133,7 @@ class ReceiverConfigurationPanel extends JPanel { c.gridx = 0; c.gridy = yPos++; c.fill = GridBagConstraints.HORIZONTAL; - logFileReceiverRadioButton = new JRadioButton("Load and tail events from a regular text log file"); + logFileReceiverRadioButton = new JRadioButton(" Load and tail events from a regular text log file "); buttonGroup.add(logFileReceiverRadioButton); add(logFileReceiverRadioButton, c); @@ -141,7 +141,7 @@ class ReceiverConfigurationPanel extends JPanel { c.gridx = 0; c.gridy = yPos++; c.fill = GridBagConstraints.HORIZONTAL; - networkReceiverRadioButton = new JRadioButton("Receive events from the network"); + networkReceiverRadioButton = new JRadioButton(" Receive events from the network "); buttonGroup.add(networkReceiverRadioButton); add(networkReceiverRadioButton, c); @@ -149,7 +149,7 @@ class ReceiverConfigurationPanel extends JPanel { c.gridx = 0; c.gridy = yPos++; c.fill = GridBagConstraints.HORIZONTAL; - useExistingConfigurationRadioButton = new JRadioButton("Use an existing Chainsaw configuration file..."); + useExistingConfigurationRadioButton = new JRadioButton(" Use an existing Chainsaw configuration file "); buttonGroup.add(useExistingConfigurationRadioButton); add(useExistingConfigurationRadioButton, c); @@ -158,7 +158,7 @@ class ReceiverConfigurationPanel extends JPanel { c.gridy = yPos++; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(0, 0, 0, 0); - useAutoSavedConfigRadioButton = new JRadioButton("Use auto-saved configuration from $HOME/.chainsaw/receiver-config.xml"); + useAutoSavedConfigRadioButton = new JRadioButton(" Use auto-saved configuration from $HOME/.chainsaw/receiver-config.xml "); buttonGroup.add(useAutoSavedConfigRadioButton); add(useAutoSavedConfigRadioButton, c); @@ -211,7 +211,7 @@ class ReceiverConfigurationPanel extends JPanel { c.gridy = 0; c.weightx = 1.0; c.anchor = GridBagConstraints.LINE_START; - dontwarnIfNoReceiver = new JCheckBox("Always start Chainsaw with this configuration"); + dontwarnIfNoReceiver = new JCheckBox(" Always start Chainsaw with this configuration "); panel.add(dontwarnIfNoReceiver, c); saveButton = new JButton(" Save configuration as... "); @@ -287,7 +287,7 @@ class ReceiverConfigurationPanel extends JPanel { StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER); doc.setParagraphAttributes(0, doc.getLength(), center, false); - descriptionTextPane.setText("An example configuration file is available from the Welcome tab"); + descriptionTextPane.setText(" An example configuration file is available from the Welcome tab "); descriptionTextPane.setEditable(false); descriptionTextPane.setOpaque(false); descriptionTextPane.setFont(getFont()); @@ -455,7 +455,7 @@ class ReceiverConfigurationPanel extends JPanel { c.gridx = 0; c.gridy = 5; c.gridwidth=5; - c.insets = new Insets(5, 5, 0, 5); + c.insets = new Insets(15, 5, 0, 5); panel.add(new JLabel("<html> See PatternLayout or LogFilePatternReceiver JavaDoc for details </html>"), c); return panel; }
