checkstyle

This commit is contained in:
jendave
2011-10-27 08:41:53 +00:00
parent 54f8ebac13
commit 7906420617
15 changed files with 736 additions and 564 deletions

View File

@@ -376,7 +376,7 @@ public final class AllZone implements NewConstants {
* getGameInfo.
* </p>
*
* @return a {@link forge.GameSummary} object.
* @return a {@link forge.game.GameSummary} object.
* @since 1.0.15
*/
public static GameSummary getGameInfo() {

View File

@@ -3771,7 +3771,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* Getter for the field <code>enchanting</code>.
* </p>
*
* @return a {@link forge.enchanting} object.
* @return a {@link forge.GameEntity} object.
*/
public final GameEntity getEnchanting() {
return enchanting;

View File

@@ -35,7 +35,7 @@ public class GuiDownloadQuestImages extends GuiDownloader {
* getNeededCards.
* </p>
*
* @return an array of {@link forge.Gui_DownloadSetPictures_LQ.mCard}
* @return an array of {@link forge.Gui_DownloadSetPictures_LQ}
* objects.
*/
protected final DownloadObject[] getNeededImages() {

View File

@@ -86,6 +86,6 @@ public class Gui_DownloadSetPictures_LQ extends GuiDownloader {
cList.toArray(out);
return out;
}// getNeededImages()
} // getNeededImages()
} // end class Gui_DownloadSetPictures_LQ

View File

@@ -677,7 +677,7 @@ public class AbilityFactory_Attach {
}
}
list = list.getNotType(type);// Filter out Basic Lands that have the
list = list.getNotType(type); // Filter out Basic Lands that have the
// same type as the changing type
Card c = CardFactoryUtil.AI_getBest(list);
@@ -997,8 +997,8 @@ public class AbilityFactory_Attach {
crd.addController(card);
}// execute()
};// Command
} // execute()
}; // Command
Command onUnEnchant = new Command() {
private static final long serialVersionUID = 3426441132121179288L;
@@ -1013,8 +1013,8 @@ public class AbilityFactory_Attach {
crd.removeController(card);
}
}// execute()
};// Command
} // execute()
}; // Command
Command onChangesControl = new Command() {
/** automatically generated serialVersionUID. */
@@ -1028,8 +1028,8 @@ public class AbilityFactory_Attach {
crd.removeController(card); // This looks odd, but will
// simply refresh controller
crd.addController(card);
}// execute()
};// Command
} // execute()
}; // Command
// Add Enchant Commands for Control changers
card.addEnchantCommand(onEnchant);
@@ -1048,7 +1048,7 @@ public class AbilityFactory_Attach {
card.unEnchantEntity(entity);
}
};// Command
}; // Command
card.addLeavesPlayCommand(onLeavesPlay);
card.enchantEntity(tgt);

View File

@@ -136,7 +136,7 @@ public class CardFactoryUtil {
* a boolean.
* @return a {@link forge.Card} object.
*/
public static Card AI_getCheapestCreature(final CardList list, final Card spell, final boolean targeted) {
public static Card AI_getCheapestCreature(CardList list, final Card spell, final boolean targeted) {
list = list.filter(new CardListFilter() {
public boolean addCard(final Card c) {
return c.isCreature();

View File

@@ -28,9 +28,10 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
/**
* <p>GuiUtils class.</p>
* <p>
* GuiUtils class.
* </p>
*
* @author Forge
* @version $Id$
@@ -42,10 +43,11 @@ public final class GuiUtils {
}
/**
* This method takes a collection of components and sets the width of each component
* to the maximum of the collection.
* This method takes a collection of components and sets the width of each
* component to the maximum of the collection.
*
* @param components a {@link java.util.Collection} object.
* @param components
* a {@link java.util.Collection} object.
*/
public static void setWidthToMax(final Collection<Component> components) {
int maxWidth = 0;
@@ -67,7 +69,8 @@ public final class GuiUtils {
/**
* Adds a Horizontal Glue to panel.
*
* @param panel a {@link javax.swing.JPanel} object.
* @param panel
* a {@link javax.swing.JPanel} object.
*/
public static void addExpandingHorizontalSpace(final JPanel panel) {
panel.add(Box.createHorizontalGlue());
@@ -76,7 +79,8 @@ public final class GuiUtils {
/**
* Adds a Vertical Glue to panel.
*
* @param panel a {@link javax.swing.JPanel} object.
* @param panel
* a {@link javax.swing.JPanel} object.
*/
public static void addExpandingVerticalSpace(final JPanel panel) {
panel.add(Box.createHorizontalGlue());
@@ -85,8 +89,10 @@ public final class GuiUtils {
/**
* Adds a rigid area of size strutSize to panel.
*
* @param panel a {@link javax.swing.JPanel} object.
* @param strutSize a int.
* @param panel
* a {@link javax.swing.JPanel} object.
* @param strutSize
* a int.
*/
public static void addGap(final JPanel panel, final int strutSize) {
panel.add(Box.createRigidArea(new Dimension(strutSize, strutSize)));
@@ -95,7 +101,8 @@ public final class GuiUtils {
/**
* Adds a rigid area of size 5 to panel.
*
* @param panel a {@link javax.swing.JPanel} object.
* @param panel
* a {@link javax.swing.JPanel} object.
*/
public static void addGap(final JPanel panel) {
panel.add(Box.createRigidArea(new Dimension(5, 5)));
@@ -104,8 +111,10 @@ public final class GuiUtils {
/**
* Sets the font size of a component.
*
* @param component a {@link java.awt.Component} object.
* @param newSize a int.
* @param component
* a {@link java.awt.Component} object.
* @param newSize
* a int.
*/
public static void setFontSize(final Component component, final int newSize) {
Font oldFont = component.getFont();
@@ -113,9 +122,12 @@ public final class GuiUtils {
}
/**
* <p>getIconFromFile.</p>
* <p>
* getIconFromFile.
* </p>
*
* @param filename a {@link java.lang.String} object.
* @param filename
* a {@link java.lang.String} object.
* @return a {@link javax.swing.ImageIcon} object.
*/
public static ImageIcon getIconFromFile(final String filename) {
@@ -129,41 +141,50 @@ public final class GuiUtils {
}
/**
* <p>getResizedIcon.</p>
* <p>
* getResizedIcon.
* </p>
*
* @param {@link java.lang.String} filename.
* @param {@link java.lang.Double} scale
* @param filename String.
* @param scale Double.
* @return {@link javax.swing.ImageIcon} object
*/
public static ImageIcon getResizedIcon(final String filename, double scale) {
public static ImageIcon getResizedIcon(final String filename, final double scale) {
ImageIcon icon = getIconFromFile(filename);
int w = (int) (icon.getIconWidth()*scale);
int h = (int) (icon.getIconHeight()*scale);
int w = (int) (icon.getIconWidth() * scale);
int h = (int) (icon.getIconHeight() * scale);
return new ImageIcon(icon.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
}
/**
* <p>getResizedIcon.</p>
* <p>
* getResizedIcon.
* </p>
*
* @param {@link javax.swing.ImageIcon} object
* @param {@link java.lang.Double} scale
* @param icon ImageIcon
* @param scale Double
* @return {@link javax.swing.ImageIcon} object
*/
public static ImageIcon getResizedIcon(final ImageIcon icon, double scale) {
int w = (int) (icon.getIconWidth()*scale);
int h = (int) (icon.getIconHeight()*scale);
public static ImageIcon getResizedIcon(final ImageIcon icon, final double scale) {
int w = (int) (icon.getIconWidth() * scale);
int h = (int) (icon.getIconHeight() * scale);
return new ImageIcon(icon.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
}
/**
* <p>getResizedIcon.</p>
* <p>
* getResizedIcon.
* </p>
*
* @param icon a {@link javax.swing.ImageIcon} object.
* @param width a int.
* @param height a int.
* @param icon
* a {@link javax.swing.ImageIcon} object.
* @param width
* a int.
* @param height
* a int.
* @return a {@link javax.swing.ImageIcon} object.
*/
public static ImageIcon getResizedIcon(final ImageIcon icon, final int width, final int height) {
@@ -171,10 +192,14 @@ public final class GuiUtils {
}
/**
* <p>getEmptyIcon.</p>
* <p>
* getEmptyIcon.
* </p>
*
* @param width a int.
* @param height a int.
* @param width
* a int.
* @param height
* a int.
* @return a {@link javax.swing.ImageIcon} object.
*/
public static ImageIcon getEmptyIcon(final int width, final int height) {
@@ -186,13 +211,16 @@ public final class GuiUtils {
*
* @see #getChoices(String, int, int, Object...)
*
* @param message a {@link java.lang.String} object.
* @param choices a T object.
* @param <T> is automatically inferred.
* @param message
* a {@link java.lang.String} object.
* @param choices
* a T object.
* @param <T>
* is automatically inferred.
*
* @return null if choices is missing, empty, or if the users'
* choices are empty; otherwise, returns the first item in
* the List returned by getChoices.
* @return null if choices is missing, empty, or if the users' choices are
* empty; otherwise, returns the first item in the List returned by
* getChoices.
*/
public static <T> T getChoiceOptional(final String message, final T... choices) {
if (choices == null || choices.length == 0) {
@@ -200,20 +228,23 @@ public final class GuiUtils {
}
List<T> choice = getChoices(message, 0, 1, choices);
return choice.isEmpty() ? null : choice.get(0);
} //getChoiceOptional(String,T...)
} // getChoiceOptional(String,T...)
/**
* Like getChoiceOptional, but this takes an Iterator instead of a
* variable number of arguments.
* Like getChoiceOptional, but this takes an Iterator instead of a variable
* number of arguments.
*
*
* @param message a {@link java.lang.String} object.
* @param choices an Iterator over T objects.
* @param <T> is automatically inferred.
* @param message
* a {@link java.lang.String} object.
* @param choices
* an Iterator over T objects.
* @param <T>
* is automatically inferred.
*
* @return null if choices is missing, empty, or if the users'
* choices are empty; otherwise, returns the first item in
* the List returned by getChoices.
* @return null if choices is missing, empty, or if the users' choices are
* empty; otherwise, returns the first item in the List returned by
* getChoices.
*/
public static <T> T getChoiceOptional(final String message, final Iterator<T> choices) {
if (choices == null | !choices.hasNext()) {
@@ -226,58 +257,80 @@ public final class GuiUtils {
List<T> choice = getChoices(message, 0, 1, choicesArray);
return choice.isEmpty() ? null : choice.get(0);
} //getChoiceOptional(String,Iterator<T>)
} // getChoiceOptional(String,Iterator<T>)
// returned Object will never be null
/**
* <p>getChoice.</p>
* <p>
* getChoice.
* </p>
*
* @param message a {@link java.lang.String} object.
* @param choices a T object.
* @param <T> a T object.
* @param message
* a {@link java.lang.String} object.
* @param choices
* a T object.
* @param <T>
* a T object.
* @return a T object.
*/
public static <T> T getChoice(final String message, final T... choices) {
List<T> choice = getChoices(message, 1, 1, choices);
assert choice.size() == 1;
return choice.get(0);
} //getChoice()
} // getChoice()
// returned Object will never be null
/**
* <p>getChoicesOptional.</p>
* <p>
* getChoicesOptional.
* </p>
*
* @param message a {@link java.lang.String} object.
* @param choices a T object.
* @param <T> a T object.
* @param message
* a {@link java.lang.String} object.
* @param choices
* a T object.
* @param <T>
* a T object.
* @return a {@link java.util.List} object.
*/
public static <T> List<T> getChoicesOptional(final String message, final T... choices) {
return getChoices(message, 0, choices.length, choices);
} //getChoice()
} // getChoice()
// returned Object will never be null
/**
* <p>getChoices.</p>
* <p>
* getChoices.
* </p>
*
* @param message a {@link java.lang.String} object.
* @param choices a T object.
* @param <T> a T object.
* @param message
* a {@link java.lang.String} object.
* @param choices
* a T object.
* @param <T>
* a T object.
* @return a {@link java.util.List} object.
*/
public static <T> List<T> getChoices(final String message, final T... choices) {
return getChoices(message, 1, choices.length, choices);
} //getChoice()
} // getChoice()
// returned Object will never be null
/**
* <p>getChoices.</p>
* <p>
* getChoices.
* </p>
*
* @param message a {@link java.lang.String} object.
* @param min a int.
* @param max a int.
* @param choices a T object.
* @param <T> a T object.
* @param message
* a {@link java.lang.String} object.
* @param min
* a int.
* @param max
* a int.
* @param choices
* a T object.
* @param <T>
* a T object.
* @return a {@link java.util.List} object.
*/
public static <T> List<T> getChoices(final String message, final int min, final int max, final T... choices) {
@@ -292,12 +345,13 @@ public final class GuiUtils {
});
c.show();
return c.getSelectedValues();
} //getChoice()
} // getChoice()
/**
* Centers a frame on the screen based on its current size.
*
* @param frame a fully laid-out frame
* @param frame
* a fully laid-out frame
*/
public static void centerFrame(final Window frame) {
Dimension screen = frame.getToolkit().getScreenSize();
@@ -310,21 +364,22 @@ public final class GuiUtils {
}
/**
* Attempts to create a font from a filename. Concise error reported
* if exceptions found.
* Attempts to create a font from a filename. Concise error reported if
* exceptions found.
*
* @param {@link java.lang.String} filename
* @param filename String
* @return Font
*/
public static Font newFont(String filename) {
public static Font newFont(final String filename) {
File file = new File(filename);
Font ttf = null;
try {
ttf = Font.createFont(Font.TRUETYPE_FONT,file);
ttf = Font.createFont(Font.TRUETYPE_FONT, file);
} catch (FontFormatException e) {
System.err.println("GuiUtils > newFont: bad font format \"" + filename + "\"");
} catch (IOException e) {
System.err.println("GuiUtils > newFont: can't find \""+filename+"\"");
System.err.println("GuiUtils > newFont: can't find \"" + filename + "\"");
}
return ttf;
}

View File

@@ -51,7 +51,7 @@ import forge.item.ItemPoolView;
*/
public class DeckAnalysis extends javax.swing.JDialog {
/** Constant <code>serialVersionUID=-8475271235196182185L</code> */
/** Constant <code>serialVersionUID=-8475271235196182185L</code>. */
private static final long serialVersionUID = -8475271235196182185L;
private JPanel jPanel1;
private JLabel jLabelColorless;
@@ -1009,12 +1009,12 @@ public class DeckAnalysis extends javax.swing.JDialog {
}
if (rList.size() >= 40) {
jList1Model = new DefaultComboBoxModel(new String[] { rList.get(0).getName(), rList.get(1).getName(),
jList1Model = new DefaultComboBoxModel(new String[] {rList.get(0).getName(), rList.get(1).getName(),
rList.get(2).getName(), rList.get(3).getName(), rList.get(4).getName(), rList.get(5).getName(),
rList.get(6).getName() });
rList.get(6).getName()});
} else {
jList1Model = new DefaultComboBoxModel(new String[] { "Few cards." });
jList1Model = new DefaultComboBoxModel(new String[] {"Few cards."});
}
jListFirstHand.setModel(jList1Model);
@@ -1180,8 +1180,8 @@ public class DeckAnalysis extends javax.swing.JDialog {
private JTable getJTable1() {
if (jTable1 == null) {
DefaultTableModel dm = new DefaultTableModel();
dm.setDataVector(new Object[][] { {} }, new Object[] { "Card", "Qty", "1st", "2nd", "3rd", "4th", "5th",
"6th", "7th" });
dm.setDataVector(new Object[][] { {} }, new Object[] {"Card", "Qty", "1st", "2nd", "3rd", "4th", "5th",
"6th", "7th"});
jTable1 = new JTable(dm);
List<CardPrinted> rList = deck.toFlatList();
@@ -1204,7 +1204,7 @@ public class DeckAnalysis extends javax.swing.JDialog {
cCount = cCount + 1;
} else {
dm.addRow(new Object[][] { {} });
dm.addRow(new Object[][] {{}});
jTable1.setValueAt(cardsName[i], dm.getRowCount() - 1, 0);
jTable1.setValueAt(cCount, dm.getRowCount() - 2, 1);
fCount = cCount;

View File

@@ -252,6 +252,9 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
*
* @see javax.swing.table.TableModel#getRowCount()
*/
/**
* @return int
*/
public int getRowCount() {
return data.countDistinct();
}
@@ -261,6 +264,9 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
*
* @see javax.swing.table.TableModel#getColumnCount()
*/
/**
* @return int
*/
public int getColumnCount() {
return columns.size();
}
@@ -280,11 +286,10 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
* The listener interface for receiving column events. The class that is
* interested in processing a column event implements this interface, and
* the object created with that class is registered with a component using
* the component's <code>addColumnListener<code> method. When
* the component's addColumnListener method. When
* the column event occurs, that object's appropriate
* method is invoked.
*
* @see ColumnEvent
*/
class ColumnListener extends MouseAdapter {
@@ -307,6 +312,9 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
* @see
* java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
*/
/**
* @param e MouseEvent
*/
public void mouseClicked(final MouseEvent e) {
TableColumnModel colModel = table.getColumnModel();
int columnModelIndex = colModel.getColumnIndexAtX(e.getX());
@@ -376,7 +384,7 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
table.getTableHeader().addMouseListener(new ColumnListener(table));
}// addCardListener()
} // addCardListener()
/**
* Resort.
@@ -398,4 +406,4 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
resort();
}
}// CardTableModel
} // CardTableModel

View File

@@ -41,7 +41,7 @@ public class ForgeProps {
/**
* Returns the tree properties of forge.
*
* @return a {@link treeProperties.TreeProperties} object.
* @return a {@link tree.properties.TreeProperties} object.
*/
public static TreeProperties getProperties() {
return properties;

View File

@@ -36,7 +36,7 @@ public interface PropertyType<T> {
* TreeProperties.
*
* @param p
* a {@link treeProperties.TreeProperties} object.
* a {@link tree.properties.TreeProperties} object.
* @param s
* a {@link java.lang.String} object.
* @return a T object.

View File

@@ -128,7 +128,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
* </p>
*
* @param type
* a {@link treeProperties.PropertyType} object.
* a {@link tree.properties.PropertyType} object.
*/
public static void addType(final PropertyType<?> type) {
TYPES.put(type.getType(), type);
@@ -141,7 +141,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
* </p>
*
* @param type
* a {@link treeProperties.PropertyType} object.
* a {@link tree.properties.PropertyType} object.
*/
public static void removeType(final PropertyType<?> type) {
TYPES.remove(type.getType());
@@ -330,7 +330,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
*
* @param key
* a {@link java.lang.String} object.
* @return a {@link treeProperties.TreeProperties} object.
* @return a {@link tree.properties.TreeProperties} object.
*/
public final TreeProperties getTransparentProperties(final String key) {
return (TreeProperties) getProperty(key, "--" + TRANSPARENT, true);
@@ -437,7 +437,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
*
* @param prefix
* a {@link java.lang.String} object.
* @return a {@link treeProperties.TreeProperties.TreePropertiesIterator}
* @return a {@link tree.properties.TreeProperties.TreePropertiesIterator}
* object.
*/
private TreePropertiesIterator iterator(final String prefix) {

View File

@@ -39,11 +39,11 @@ Forge
* {{{http://cardforge.org/releases/snapshots/forge/forge}Forge Snapshot Builds}}
* {{{/apidocs/index.html}JavaDocs}}
* {{{./apidocs/index.html}JavaDocs}}
* {{{/xref/index.html}Browsable Source Code}}
* {{{./xref/index.html}Browsable Source Code}}
* {{{/project-reports.html}Project Reports}}
* {{{./project-reports.html}Project Reports}}
<<Related Links>>