oburn 2003/02/05 03:11:12 Modified: src/java/org/apache/log4j/chainsaw ControlPanel.java . build.xml Log: Patch from Luis Reis to clean up the layout on the control panel. Revision Changes Path 1.4 +41 -24 jakarta-log4j/src/java/org/apache/log4j/chainsaw/ControlPanel.java Index: ControlPanel.java =================================================================== RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/ControlPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ControlPanel.java 27 Mar 2002 09:25:24 -0000 1.3 +++ ControlPanel.java 5 Feb 2003 11:11:11 -0000 1.4 @@ -8,6 +8,9 @@ import java.awt.GridBagConstraints; import java.awt.GridBagLayout; +import java.awt.FlowLayout; +import java.awt.Dimension; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; @@ -28,7 +31,7 @@ */ class ControlPanel extends JPanel { /** use the log messages **/ - private static final Category LOG = + private static final Category LOG = Category.getInstance(ControlPanel.class); /** @@ -40,6 +43,7 @@ setBorder(BorderFactory.createTitledBorder("Controls: ")); final GridBagLayout gridbag = new GridBagLayout(); final GridBagConstraints c = new GridBagConstraints(); + final Dimension d = new Dimension(80,24); setLayout(gridbag); // Pad everything @@ -99,6 +103,7 @@ c.fill = GridBagConstraints.HORIZONTAL; + c.gridwidth = 2; c.gridy++; final JTextField threadField = new JTextField(""); threadField.getDocument().addDocumentListener(new DocumentListener () { @@ -166,30 +171,19 @@ add(msgField); // Add the 3rd column of buttons - c.weightx = 0; - c.fill = GridBagConstraints.HORIZONTAL; - c.anchor = GridBagConstraints.EAST; c.gridx = 2; - c.gridy = 0; - final JButton exitButton = new JButton("Exit"); - exitButton.setMnemonic('x'); - exitButton.addActionListener(ExitAction.INSTANCE); - gridbag.setConstraints(exitButton, c); - add(exitButton); - - c.gridy++; - final JButton clearButton = new JButton("Clear"); - clearButton.setMnemonic('c'); - clearButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent aEvent) { - aModel.clear(); - } - }); - gridbag.setConstraints(clearButton, c); - add(clearButton); + c.gridwidth = 1; + c.weightx = 0; + c.weighty = 0; + c.fill = GridBagConstraints.NONE; + c.anchor = GridBagConstraints.EAST; + final JPanel buttonPanel = new JPanel(); + gridbag.setConstraints(buttonPanel, c); + add(buttonPanel); + buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT,1,1)); - c.gridy++; + final Insets insets = new Insets(2,2,2,2); final JButton toggleButton = new JButton("Pause"); toggleButton.setMnemonic('p'); toggleButton.addActionListener(new ActionListener() { @@ -199,7 +193,30 @@ aModel.isPaused() ? "Resume" : "Pause"); } }); - gridbag.setConstraints(toggleButton, c); - add(toggleButton); + toggleButton.setMargin(insets); + toggleButton.setPreferredSize(d); + toggleButton.setMinimumSize(d); + buttonPanel.add(toggleButton); + + final JButton clearButton = new JButton("Clear"); + clearButton.setMnemonic('c'); + clearButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent aEvent) { + aModel.clear(); + } + }); + clearButton.setMargin(insets); + clearButton.setPreferredSize(d); + clearButton.setMinimumSize(d); + buttonPanel.add(clearButton); + + final JButton exitButton = new JButton("Exit"); + exitButton.setMnemonic('x'); + exitButton.addActionListener(ExitAction.INSTANCE); + exitButton.setMargin(insets); + exitButton.setPreferredSize(d); + exitButton.setMinimumSize(d); + buttonPanel.add(exitButton); + } } 1.50 +21 -21 jakarta-log4j/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-log4j/build.xml,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- build.xml 5 Feb 2003 10:50:04 -0000 1.49 +++ build.xml 5 Feb 2003 11:11:12 -0000 1.50 @@ -198,7 +198,7 @@ <copy todir="${javac.dest}"> <fileset dir="${java.source.dir}" - includes="${stem}/lf5/**/*.properties"/> + includes="${stem}/lf5/**/*.properties"/> <fileset dir="${java.source.dir}" includes="${stem}/lf5/viewer/images/*"/> </copy> @@ -208,7 +208,7 @@ <mkdir dir="${javac.dest}" /> <javac srcdir="${basedir}" destdir="${javac.dest}" - includes="examples/**/*.java" + includes="examples/**/*.java" excludes="misc/*, examples/jmx/*.java" deprecation="${deprecation}" debug="on"> @@ -298,7 +298,7 @@ convention="${jalopy.stylesheet.location}"> <fileset refid="styled_files"/> </jalopy> - </target> + </target> <!-- ================================================================= --> <!-- Runs jalopy preferences editor. --> @@ -307,7 +307,7 @@ <java classname="de.hunsicker.jalopy.swing.SettingsDialog" classpathref="jalopy.path" fork="true" /> - </target> + </target> <!-- ================================================================= --> <!-- Runs checkstyle. Available from http://checkstyle.sf.net --> @@ -322,7 +322,7 @@ <property name="checkstyle.maxmethodlen" value="500" /> <property name="checkstyle.maxconstructorlen" value="500" /> <property name="checkstyle.ignore.public.in.interface" value="true" /> - + <!-- by default checkstyle supports the Sun coding standard. --> <checkstyle> <fileset refid="styled_files"/> @@ -377,7 +377,7 @@ <attribute name="Manifest-version" value="1.0"/> <section name="org/apache/log4j/"> <attribute name="Implementation-Title" value="log4j"/> - <attribute name="Implementation-Version" value="${version}"/> + <attribute name="Implementation-Version" value="${version}"/> <attribute name="Implementation-Vendor" value="APache Software Foundation"/> </section> </manifest> @@ -394,16 +394,16 @@ <include name="${log4j-chainsaw.jar}"/> </fileset> </delete> - + <jar jarfile="${jar.dest}/${log4j-chainsaw.jar}" basedir="${javac.dest}" includes="${stem}/chainsaw/*.class" excludes="**/UnitTest**"> - + <manifest> <attribute name="Manifest-version" value="1.0"/> <section name="org/apache/log4j/"> <attribute name="Implementation-Title" value="log4j"/> - <attribute name="Implementation-Version" value="${version}"/> + <attribute name="Implementation-Version" value="${version}"/> <attribute name="Implementation-Vendor" value="APache Software Foundation"/> </section> <attribute name="Main-Class" value="org.apache.log4j.chainsaw.Main"/> @@ -422,18 +422,18 @@ <include name="${log4j-lf5.jar}"/> </fileset> </delete> - + <jar jarfile="${jar.dest}/${log4j-lf5.jar}" basedir="${javac.dest}" includes="${stem}/lf5/**/*.class, ${stem}/lf5/**/*.properties, ${stem}/lf5/**/*.gif" excludes="**/UnitTest**"> - + <manifest> <attribute name="Manifest-version" value="1.0"/> <section name="org/apache/log4j/"> <attribute name="Implementation-Title" value="log4j"/> - <attribute name="Implementation-Version" value="${version}"/> + <attribute name="Implementation-Version" value="${version}"/> <attribute name="Implementation-Vendor" value="APache Software Foundation"/> </section> <attribute name="Main-Class" value="org.apache.log4j.lf5.StartLogFactor5"/> @@ -486,28 +486,28 @@ <!-- ============================================== --> <!-- Build the site files using Anakia --> - <!-- ============================================== --> - <target name="prepareSite2"> + <!-- ============================================== --> + <target name="prepareSite2"> <available classname="org.apache.velocity.anakia.AnakiaTask" property="AnakiaTask.present"> <classpath refid="site2.classpath"/> </available> </target> - + <target name="checkSite2" depends="prepareSite2" unless="AnakiaTask.present"> <echo> - AnakiaTask is not present! Please check to make sure that + AnakiaTask is not present! Please check to make sure that velocity.jar is in your classpath. </echo> </target> - + <target name="site2" depends="checkSite2" if="AnakiaTask.present"> <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask"> <classpath refid="site2.classpath"/> </taskdef> <anakia basedir="${xdocs.src}" destdir="${docs.dest}/" - extension=".html" + extension=".html" style="site.vsl" projectFile="stylesheets/project.xml" excludes="**/stylesheets/**, empty.xml, lf5/**" @@ -515,9 +515,9 @@ lastModifiedCheck="true" templatePath="../jakarta-site2/xdocs/stylesheets"> </anakia> - + <anakia basedir="${xdocs.src}" destdir="${docs.dest}/" - extension=".html" + extension=".html" style="site.vsl" projectFile="stylesheets/lf5.xml" excludes="**/stylesheets/**, empty.xml" @@ -568,7 +568,7 @@ </delete> <mkdir dir="${dist.images}" /> - + <mkdir dir="${dist.tmp}/jakarta-log4j-${version}" /> <copy todir="${dist.tmp}/jakarta-log4j-${version}">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]