Thread: [Japi-cvs] SF.net SVN: japi: [451] libs/swing-misc/trunk/src/net/sf/japi/swing/misc
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2007-06-25 20:24:54
|
Revision: 451 http://svn.sourceforge.net/japi/?rev=451&view=rev Author: christianhujer Date: 2007-06-25 13:24:53 -0700 (Mon, 25 Jun 2007) Log Message: ----------- Fixed checkstyle issues. Modified Paths: -------------- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java 2007-06-25 20:22:56 UTC (rev 450) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java 2007-06-25 20:24:53 UTC (rev 451) @@ -27,6 +27,7 @@ /** * A ListModel for {@link java.util.List}. + * @param <E> element type for the collection to be a list model for. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class CollectionsListModel<E> extends AbstractListModel implements List<E> { Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java 2007-06-25 20:22:56 UTC (rev 450) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JSAXErrorHandler.java 2007-06-25 20:24:53 UTC (rev 451) @@ -37,7 +37,7 @@ public final class JSAXErrorHandler extends JOptionPane implements ErrorHandler { /** Action Factory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("net.sf.japi.swing"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.japi.swing"); /** The JTextArea which displays the errors. * @serial include @@ -60,13 +60,13 @@ private JButton closeButton; /** Create a JSAXErrorHandler. - * @param parent + * @param parent Parent component to display on. */ public JSAXErrorHandler(final Component parent) { errorPane.setEditable(false); setMessage(new JScrollPane(errorPane)); - final JButton clearButton = new JButton(JSAXErrorHandler.actionFactory.createAction(false, "saxErrorClear", this)); - closeButton = new JButton(JSAXErrorHandler.actionFactory.createAction(false, "saxErrorClose", this)); + final JButton clearButton = new JButton(JSAXErrorHandler.ACTION_FACTORY.createAction(false, "saxErrorClear", this)); + closeButton = new JButton(JSAXErrorHandler.ACTION_FACTORY.createAction(false, "saxErrorClose", this)); this.parent = parent; setOptions(new Object[] { closeButton, clearButton }); } @@ -121,7 +121,7 @@ /** Show the dialog. */ private void showDialog() { if (dialog == null) { - dialog = createDialog(parent, JSAXErrorHandler.actionFactory.getString("saxError_title")); + dialog = createDialog(parent, JSAXErrorHandler.ACTION_FACTORY.getString("saxError_title")); closeButton.requestFocusInWindow(); dialog.getRootPane().setDefaultButton(closeButton); dialog.setModal(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-07-30 20:30:53
|
Revision: 562 http://japi.svn.sourceforge.net/japi/?rev=562&view=rev Author: christianhujer Date: 2007-07-30 13:30:49 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Fixed javadoc and inspections issues. Modified Paths: -------------- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/CollectionsListModel.java 2007-07-30 20:30:49 UTC (rev 562) @@ -32,13 +32,19 @@ */ public class CollectionsListModel<E> extends AbstractListModel implements List<E> { - /** The list to delegate to. */ + /** The list to delegate to. + * @serial include + */ private final List<E> list; /** * Creates a new CollectionsListModel. - * @param list List to delegate to + * @param list List to delegate to. + * @note This ListModel does not hold a copy of the supplied list but references it. + * All changes to the list model will be reflected in the supplied list and vice versa. + * @note In order for events to be fired, this ListModel must be used for list modifications, not the underlying list. */ + @SuppressWarnings({"AssignmentToCollectionOrArrayFieldFromParameter"}) public CollectionsListModel(final List<E> list) { this.list = list; } @@ -148,12 +154,12 @@ } /** {@inheritDoc} */ - public boolean equals(final Object o) { + @Override public boolean equals(final Object o) { return list.equals(o); } /** {@inheritDoc} */ - public int hashCode() { + @Override public int hashCode() { return list.hashCode(); } Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ConsoleProgress.java 2007-07-30 20:30:49 UTC (rev 562) @@ -2,8 +2,8 @@ import java.awt.Component; import java.io.Closeable; +import java.io.Flushable; import java.io.IOException; -import java.io.Flushable; import org.jetbrains.annotations.Nullable; /** @@ -106,6 +106,7 @@ return; } try { + //noinspection MagicNumber final int prog = value * 100 / max; out.append(String.format("%3d", prog)); flush(); Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-07-30 20:30:49 UTC (rev 562) @@ -19,13 +19,14 @@ package net.sf.japi.swing.misc; +import java.awt.Insets; +import java.io.File; +import java.io.IOException; import javax.swing.JButton; +import javax.swing.JFileChooser; import javax.swing.JTextField; -import javax.swing.JFileChooser; import net.sf.japi.swing.ActionFactory; -import java.io.File; -import java.io.IOException; -import java.awt.Insets; +import net.sf.japi.swing.ActionMethod; /** JButton for choosing a file from hd. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> @@ -135,9 +136,8 @@ return chooser; } - /** Action method. - * @used - */ + /** Action method. */ + @ActionMethod public void optionsChooseFile() { final String oldFilename = textField.getText(); final File oldFile = new File(base, oldFilename); Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileField.java 2007-07-30 20:30:49 UTC (rev 562) @@ -20,33 +20,42 @@ package net.sf.japi.swing.misc; import java.awt.FlowLayout; +import javax.swing.JComponent; +import javax.swing.JLabel; import javax.swing.JTextField; -import javax.swing.JLabel; -import javax.swing.JComponent; /** Component for selecting a file. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class JFileField extends JComponent { - /** The label. */ + /** The default number of textfield columns. */ + private static final int DEFAULT_TEXTFIELD_COLUMNS = 16; + + /** The label. + * @serial include + */ private final JLabel label; - /** The file field. */ + /** The file field. + * @serial include + */ private final JTextField fileField; - /** The button to start the JFileChooser. */ + /** The button to start the JFileChooser. + * @serial include + */ private final JFileChooserButton chooserButton; /** * Create a JFileField. - * @param labelText the text for the label - * @param initial the initial path - * @param fileSelectionMode the mode for the file selection + * @param labelText The text for the label. + * @param initial The initial path. + * @param fileSelectionMode The mode for the file selection. */ public JFileField(final String labelText, final String initial, final int fileSelectionMode) { setLayout(new FlowLayout(FlowLayout.RIGHT)); - fileField = new JTextField(initial, 16); + fileField = new JTextField(initial, DEFAULT_TEXTFIELD_COLUMNS); chooserButton = new JFileChooserButton(fileField, fileSelectionMode); label = new JLabel(labelText); add(label); Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java 2007-07-30 20:19:09 UTC (rev 561) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/ProgressDisplay.java 2007-07-30 20:30:49 UTC (rev 562) @@ -19,17 +19,17 @@ package net.sf.japi.swing.misc; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.GridLayout; +import javax.swing.BorderFactory; import javax.swing.JDialog; -import javax.swing.JProgressBar; +import javax.swing.JFrame; import javax.swing.JLabel; -import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.BorderFactory; +import javax.swing.JProgressBar; import javax.swing.SwingConstants; -import java.awt.GridLayout; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Color; /** ProgressDisplay handles a popup dialog for the mainview * which displays a process progressBar. @@ -56,6 +56,7 @@ * @param max initial maximum of progress points * @param text the initial label text */ + @SuppressWarnings({"MagicNumber"}) public ProgressDisplay(final JFrame parent, final String title, final int max, final String text) { super(parent, title, false); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // can't close This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-09-09 11:56:07
|
Revision: 605 http://japi.svn.sourceforge.net/japi/?rev=605&view=rev Author: christianhujer Date: 2007-09-09 04:56:04 -0700 (Sun, 09 Sep 2007) Log Message: ----------- Fixed bug in swing misc with icon for JFileChooserButton not being found. Modified Paths: -------------- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java Added Paths: ----------- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/action.properties Modified: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-09-09 10:50:01 UTC (rev 604) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/JFileChooserButton.java 2007-09-09 11:56:04 UTC (rev 605) @@ -35,7 +35,7 @@ public class JFileChooserButton extends JButton { /** Action Builder. */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing"); + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.japi.swing.misc"); /** The JTextField to read/write the file path to. * @serial include Added: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/action.properties =================================================================== --- libs/swing-misc/trunk/src/net/sf/japi/swing/misc/action.properties (rev 0) +++ libs/swing-misc/trunk/src/net/sf/japi/swing/misc/action.properties 2007-09-09 11:56:04 UTC (rev 605) @@ -0,0 +1,20 @@ +# +# JAPI libs-swing-misc is a library that holds miscellaneous additions to Swing. +# Copyright (C) 2007 Christian Hujer. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# + +optionsChooseFile.icon=general/Open16 Property changes on: libs/swing-misc/trunk/src/net/sf/japi/swing/misc/action.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |