mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
checkstyle
This commit is contained in:
@@ -376,7 +376,7 @@ public final class AllZone implements NewConstants {
|
|||||||
* getGameInfo.
|
* getGameInfo.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return a {@link forge.GameSummary} object.
|
* @return a {@link forge.game.GameSummary} object.
|
||||||
* @since 1.0.15
|
* @since 1.0.15
|
||||||
*/
|
*/
|
||||||
public static GameSummary getGameInfo() {
|
public static GameSummary getGameInfo() {
|
||||||
|
|||||||
@@ -3771,7 +3771,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
* Getter for the field <code>enchanting</code>.
|
* Getter for the field <code>enchanting</code>.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return a {@link forge.enchanting} object.
|
* @return a {@link forge.GameEntity} object.
|
||||||
*/
|
*/
|
||||||
public final GameEntity getEnchanting() {
|
public final GameEntity getEnchanting() {
|
||||||
return enchanting;
|
return enchanting;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class GuiDownloadQuestImages extends GuiDownloader {
|
|||||||
* getNeededCards.
|
* getNeededCards.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return an array of {@link forge.Gui_DownloadSetPictures_LQ.mCard}
|
* @return an array of {@link forge.Gui_DownloadSetPictures_LQ}
|
||||||
* objects.
|
* objects.
|
||||||
*/
|
*/
|
||||||
protected final DownloadObject[] getNeededImages() {
|
protected final DownloadObject[] getNeededImages() {
|
||||||
|
|||||||
@@ -86,6 +86,6 @@ public class Gui_DownloadSetPictures_LQ extends GuiDownloader {
|
|||||||
cList.toArray(out);
|
cList.toArray(out);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}// getNeededImages()
|
} // getNeededImages()
|
||||||
|
|
||||||
} // end class Gui_DownloadSetPictures_LQ
|
} // end class Gui_DownloadSetPictures_LQ
|
||||||
|
|||||||
@@ -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
|
// same type as the changing type
|
||||||
|
|
||||||
Card c = CardFactoryUtil.AI_getBest(list);
|
Card c = CardFactoryUtil.AI_getBest(list);
|
||||||
@@ -997,8 +997,8 @@ public class AbilityFactory_Attach {
|
|||||||
|
|
||||||
crd.addController(card);
|
crd.addController(card);
|
||||||
|
|
||||||
}// execute()
|
} // execute()
|
||||||
};// Command
|
}; // Command
|
||||||
|
|
||||||
Command onUnEnchant = new Command() {
|
Command onUnEnchant = new Command() {
|
||||||
private static final long serialVersionUID = 3426441132121179288L;
|
private static final long serialVersionUID = 3426441132121179288L;
|
||||||
@@ -1013,8 +1013,8 @@ public class AbilityFactory_Attach {
|
|||||||
crd.removeController(card);
|
crd.removeController(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
}// execute()
|
} // execute()
|
||||||
};// Command
|
}; // Command
|
||||||
|
|
||||||
Command onChangesControl = new Command() {
|
Command onChangesControl = new Command() {
|
||||||
/** automatically generated serialVersionUID. */
|
/** automatically generated serialVersionUID. */
|
||||||
@@ -1028,8 +1028,8 @@ public class AbilityFactory_Attach {
|
|||||||
crd.removeController(card); // This looks odd, but will
|
crd.removeController(card); // This looks odd, but will
|
||||||
// simply refresh controller
|
// simply refresh controller
|
||||||
crd.addController(card);
|
crd.addController(card);
|
||||||
}// execute()
|
} // execute()
|
||||||
};// Command
|
}; // Command
|
||||||
|
|
||||||
// Add Enchant Commands for Control changers
|
// Add Enchant Commands for Control changers
|
||||||
card.addEnchantCommand(onEnchant);
|
card.addEnchantCommand(onEnchant);
|
||||||
@@ -1048,7 +1048,7 @@ public class AbilityFactory_Attach {
|
|||||||
|
|
||||||
card.unEnchantEntity(entity);
|
card.unEnchantEntity(entity);
|
||||||
}
|
}
|
||||||
};// Command
|
}; // Command
|
||||||
|
|
||||||
card.addLeavesPlayCommand(onLeavesPlay);
|
card.addLeavesPlayCommand(onLeavesPlay);
|
||||||
card.enchantEntity(tgt);
|
card.enchantEntity(tgt);
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public class CardFactoryUtil {
|
|||||||
* a boolean.
|
* a boolean.
|
||||||
* @return a {@link forge.Card} object.
|
* @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() {
|
list = list.filter(new CardListFilter() {
|
||||||
public boolean addCard(final Card c) {
|
public boolean addCard(final Card c) {
|
||||||
return c.isCreature();
|
return c.isCreature();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -28,9 +28,10 @@ import java.util.Collection;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>GuiUtils class.</p>
|
* <p>
|
||||||
|
* GuiUtils class.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
@@ -42,10 +43,11 @@ public final class GuiUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method takes a collection of components and sets the width of each component
|
* This method takes a collection of components and sets the width of each
|
||||||
* to the maximum of the collection.
|
* 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) {
|
public static void setWidthToMax(final Collection<Component> components) {
|
||||||
int maxWidth = 0;
|
int maxWidth = 0;
|
||||||
@@ -67,7 +69,8 @@ public final class GuiUtils {
|
|||||||
/**
|
/**
|
||||||
* Adds a Horizontal Glue to panel.
|
* 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) {
|
public static void addExpandingHorizontalSpace(final JPanel panel) {
|
||||||
panel.add(Box.createHorizontalGlue());
|
panel.add(Box.createHorizontalGlue());
|
||||||
@@ -76,7 +79,8 @@ public final class GuiUtils {
|
|||||||
/**
|
/**
|
||||||
* Adds a Vertical Glue to panel.
|
* 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) {
|
public static void addExpandingVerticalSpace(final JPanel panel) {
|
||||||
panel.add(Box.createHorizontalGlue());
|
panel.add(Box.createHorizontalGlue());
|
||||||
@@ -85,8 +89,10 @@ public final class GuiUtils {
|
|||||||
/**
|
/**
|
||||||
* Adds a rigid area of size strutSize to panel.
|
* Adds a rigid area of size strutSize to panel.
|
||||||
*
|
*
|
||||||
* @param panel a {@link javax.swing.JPanel} object.
|
* @param panel
|
||||||
* @param strutSize a int.
|
* a {@link javax.swing.JPanel} object.
|
||||||
|
* @param strutSize
|
||||||
|
* a int.
|
||||||
*/
|
*/
|
||||||
public static void addGap(final JPanel panel, final int strutSize) {
|
public static void addGap(final JPanel panel, final int strutSize) {
|
||||||
panel.add(Box.createRigidArea(new Dimension(strutSize, 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.
|
* 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) {
|
public static void addGap(final JPanel panel) {
|
||||||
panel.add(Box.createRigidArea(new Dimension(5, 5)));
|
panel.add(Box.createRigidArea(new Dimension(5, 5)));
|
||||||
@@ -104,8 +111,10 @@ public final class GuiUtils {
|
|||||||
/**
|
/**
|
||||||
* Sets the font size of a component.
|
* Sets the font size of a component.
|
||||||
*
|
*
|
||||||
* @param component a {@link java.awt.Component} object.
|
* @param component
|
||||||
* @param newSize a int.
|
* a {@link java.awt.Component} object.
|
||||||
|
* @param newSize
|
||||||
|
* a int.
|
||||||
*/
|
*/
|
||||||
public static void setFontSize(final Component component, final int newSize) {
|
public static void setFontSize(final Component component, final int newSize) {
|
||||||
Font oldFont = component.getFont();
|
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.
|
* @return a {@link javax.swing.ImageIcon} object.
|
||||||
*/
|
*/
|
||||||
public static ImageIcon getIconFromFile(final String filename) {
|
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 filename String.
|
||||||
* @param {@link java.lang.Double} scale
|
* @param scale Double.
|
||||||
* @return {@link javax.swing.ImageIcon} object
|
* @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);
|
ImageIcon icon = getIconFromFile(filename);
|
||||||
|
|
||||||
int w = (int) (icon.getIconWidth()*scale);
|
int w = (int) (icon.getIconWidth() * scale);
|
||||||
int h = (int) (icon.getIconHeight()*scale);
|
int h = (int) (icon.getIconHeight() * scale);
|
||||||
|
|
||||||
return new ImageIcon(icon.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
|
return new ImageIcon(icon.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>getResizedIcon.</p>
|
* <p>
|
||||||
|
* getResizedIcon.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param {@link javax.swing.ImageIcon} object
|
* @param icon ImageIcon
|
||||||
* @param {@link java.lang.Double} scale
|
* @param scale Double
|
||||||
* @return {@link javax.swing.ImageIcon} object
|
* @return {@link javax.swing.ImageIcon} object
|
||||||
*/
|
*/
|
||||||
public static ImageIcon getResizedIcon(final ImageIcon icon, double scale) {
|
public static ImageIcon getResizedIcon(final ImageIcon icon, final double scale) {
|
||||||
int w = (int) (icon.getIconWidth()*scale);
|
int w = (int) (icon.getIconWidth() * scale);
|
||||||
int h = (int) (icon.getIconHeight()*scale);
|
int h = (int) (icon.getIconHeight() * scale);
|
||||||
|
|
||||||
return new ImageIcon(icon.getImage().getScaledInstance(w, h, Image.SCALE_SMOOTH));
|
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 icon
|
||||||
* @param width a int.
|
* a {@link javax.swing.ImageIcon} object.
|
||||||
* @param height a int.
|
* @param width
|
||||||
|
* a int.
|
||||||
|
* @param height
|
||||||
|
* a int.
|
||||||
* @return a {@link javax.swing.ImageIcon} object.
|
* @return a {@link javax.swing.ImageIcon} object.
|
||||||
*/
|
*/
|
||||||
public static ImageIcon getResizedIcon(final ImageIcon icon, final int width, final int height) {
|
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 width
|
||||||
* @param height a int.
|
* a int.
|
||||||
|
* @param height
|
||||||
|
* a int.
|
||||||
* @return a {@link javax.swing.ImageIcon} object.
|
* @return a {@link javax.swing.ImageIcon} object.
|
||||||
*/
|
*/
|
||||||
public static ImageIcon getEmptyIcon(final int width, final int height) {
|
public static ImageIcon getEmptyIcon(final int width, final int height) {
|
||||||
@@ -186,13 +211,16 @@ public final class GuiUtils {
|
|||||||
*
|
*
|
||||||
* @see #getChoices(String, int, int, Object...)
|
* @see #getChoices(String, int, int, Object...)
|
||||||
*
|
*
|
||||||
* @param message a {@link java.lang.String} object.
|
* @param message
|
||||||
* @param choices a T object.
|
* a {@link java.lang.String} object.
|
||||||
* @param <T> is automatically inferred.
|
* @param choices
|
||||||
|
* a T object.
|
||||||
|
* @param <T>
|
||||||
|
* is automatically inferred.
|
||||||
*
|
*
|
||||||
* @return null if choices is missing, empty, or if the users'
|
* @return null if choices is missing, empty, or if the users' choices are
|
||||||
* choices are empty; otherwise, returns the first item in
|
* empty; otherwise, returns the first item in the List returned by
|
||||||
* the List returned by getChoices.
|
* getChoices.
|
||||||
*/
|
*/
|
||||||
public static <T> T getChoiceOptional(final String message, final T... choices) {
|
public static <T> T getChoiceOptional(final String message, final T... choices) {
|
||||||
if (choices == null || choices.length == 0) {
|
if (choices == null || choices.length == 0) {
|
||||||
@@ -200,20 +228,23 @@ public final class GuiUtils {
|
|||||||
}
|
}
|
||||||
List<T> choice = getChoices(message, 0, 1, choices);
|
List<T> choice = getChoices(message, 0, 1, choices);
|
||||||
return choice.isEmpty() ? null : choice.get(0);
|
return choice.isEmpty() ? null : choice.get(0);
|
||||||
} //getChoiceOptional(String,T...)
|
} // getChoiceOptional(String,T...)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like getChoiceOptional, but this takes an Iterator instead of a
|
* Like getChoiceOptional, but this takes an Iterator instead of a variable
|
||||||
* variable number of arguments.
|
* number of arguments.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param message a {@link java.lang.String} object.
|
* @param message
|
||||||
* @param choices an Iterator over T objects.
|
* a {@link java.lang.String} object.
|
||||||
* @param <T> is automatically inferred.
|
* @param choices
|
||||||
|
* an Iterator over T objects.
|
||||||
|
* @param <T>
|
||||||
|
* is automatically inferred.
|
||||||
*
|
*
|
||||||
* @return null if choices is missing, empty, or if the users'
|
* @return null if choices is missing, empty, or if the users' choices are
|
||||||
* choices are empty; otherwise, returns the first item in
|
* empty; otherwise, returns the first item in the List returned by
|
||||||
* the List returned by getChoices.
|
* getChoices.
|
||||||
*/
|
*/
|
||||||
public static <T> T getChoiceOptional(final String message, final Iterator<T> choices) {
|
public static <T> T getChoiceOptional(final String message, final Iterator<T> choices) {
|
||||||
if (choices == null | !choices.hasNext()) {
|
if (choices == null | !choices.hasNext()) {
|
||||||
@@ -226,58 +257,80 @@ public final class GuiUtils {
|
|||||||
|
|
||||||
List<T> choice = getChoices(message, 0, 1, choicesArray);
|
List<T> choice = getChoices(message, 0, 1, choicesArray);
|
||||||
return choice.isEmpty() ? null : choice.get(0);
|
return choice.isEmpty() ? null : choice.get(0);
|
||||||
} //getChoiceOptional(String,Iterator<T>)
|
} // getChoiceOptional(String,Iterator<T>)
|
||||||
|
|
||||||
// returned Object will never be null
|
// returned Object will never be null
|
||||||
/**
|
/**
|
||||||
* <p>getChoice.</p>
|
* <p>
|
||||||
|
* getChoice.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param message a {@link java.lang.String} object.
|
* @param message
|
||||||
* @param choices a T object.
|
* a {@link java.lang.String} object.
|
||||||
* @param <T> a T object.
|
* @param choices
|
||||||
|
* a T object.
|
||||||
|
* @param <T>
|
||||||
|
* a T object.
|
||||||
* @return a T object.
|
* @return a T object.
|
||||||
*/
|
*/
|
||||||
public static <T> T getChoice(final String message, final T... choices) {
|
public static <T> T getChoice(final String message, final T... choices) {
|
||||||
List<T> choice = getChoices(message, 1, 1, choices);
|
List<T> choice = getChoices(message, 1, 1, choices);
|
||||||
assert choice.size() == 1;
|
assert choice.size() == 1;
|
||||||
return choice.get(0);
|
return choice.get(0);
|
||||||
} //getChoice()
|
} // getChoice()
|
||||||
|
|
||||||
// returned Object will never be null
|
// returned Object will never be null
|
||||||
/**
|
/**
|
||||||
* <p>getChoicesOptional.</p>
|
* <p>
|
||||||
|
* getChoicesOptional.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param message a {@link java.lang.String} object.
|
* @param message
|
||||||
* @param choices a T object.
|
* a {@link java.lang.String} object.
|
||||||
* @param <T> a T object.
|
* @param choices
|
||||||
|
* a T object.
|
||||||
|
* @param <T>
|
||||||
|
* a T object.
|
||||||
* @return a {@link java.util.List} object.
|
* @return a {@link java.util.List} object.
|
||||||
*/
|
*/
|
||||||
public static <T> List<T> getChoicesOptional(final String message, final T... choices) {
|
public static <T> List<T> getChoicesOptional(final String message, final T... choices) {
|
||||||
return getChoices(message, 0, choices.length, choices);
|
return getChoices(message, 0, choices.length, choices);
|
||||||
} //getChoice()
|
} // getChoice()
|
||||||
|
|
||||||
// returned Object will never be null
|
// returned Object will never be null
|
||||||
/**
|
/**
|
||||||
* <p>getChoices.</p>
|
* <p>
|
||||||
|
* getChoices.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param message a {@link java.lang.String} object.
|
* @param message
|
||||||
* @param choices a T object.
|
* a {@link java.lang.String} object.
|
||||||
* @param <T> a T object.
|
* @param choices
|
||||||
|
* a T object.
|
||||||
|
* @param <T>
|
||||||
|
* a T object.
|
||||||
* @return a {@link java.util.List} object.
|
* @return a {@link java.util.List} object.
|
||||||
*/
|
*/
|
||||||
public static <T> List<T> getChoices(final String message, final T... choices) {
|
public static <T> List<T> getChoices(final String message, final T... choices) {
|
||||||
return getChoices(message, 1, choices.length, choices);
|
return getChoices(message, 1, choices.length, choices);
|
||||||
} //getChoice()
|
} // getChoice()
|
||||||
|
|
||||||
// returned Object will never be null
|
// returned Object will never be null
|
||||||
/**
|
/**
|
||||||
* <p>getChoices.</p>
|
* <p>
|
||||||
|
* getChoices.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param message a {@link java.lang.String} object.
|
* @param message
|
||||||
* @param min a int.
|
* a {@link java.lang.String} object.
|
||||||
* @param max a int.
|
* @param min
|
||||||
* @param choices a T object.
|
* a int.
|
||||||
* @param <T> a T object.
|
* @param max
|
||||||
|
* a int.
|
||||||
|
* @param choices
|
||||||
|
* a T object.
|
||||||
|
* @param <T>
|
||||||
|
* a T object.
|
||||||
* @return a {@link java.util.List} 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) {
|
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();
|
c.show();
|
||||||
return c.getSelectedValues();
|
return c.getSelectedValues();
|
||||||
} //getChoice()
|
} // getChoice()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Centers a frame on the screen based on its current size.
|
* 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) {
|
public static void centerFrame(final Window frame) {
|
||||||
Dimension screen = frame.getToolkit().getScreenSize();
|
Dimension screen = frame.getToolkit().getScreenSize();
|
||||||
@@ -310,21 +364,22 @@ public final class GuiUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to create a font from a filename. Concise error reported
|
* Attempts to create a font from a filename. Concise error reported if
|
||||||
* if exceptions found.
|
* 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);
|
File file = new File(filename);
|
||||||
Font ttf = null;
|
Font ttf = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ttf = Font.createFont(Font.TRUETYPE_FONT,file);
|
ttf = Font.createFont(Font.TRUETYPE_FONT, file);
|
||||||
} catch (FontFormatException e) {
|
} catch (FontFormatException e) {
|
||||||
System.err.println("GuiUtils > newFont: bad font format \"" + filename + "\"");
|
System.err.println("GuiUtils > newFont: bad font format \"" + filename + "\"");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("GuiUtils > newFont: can't find \""+filename+"\"");
|
System.err.println("GuiUtils > newFont: can't find \"" + filename + "\"");
|
||||||
}
|
}
|
||||||
return ttf;
|
return ttf;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ import forge.item.ItemPoolView;
|
|||||||
*/
|
*/
|
||||||
public class DeckAnalysis extends javax.swing.JDialog {
|
public class DeckAnalysis extends javax.swing.JDialog {
|
||||||
|
|
||||||
/** Constant <code>serialVersionUID=-8475271235196182185L</code> */
|
/** Constant <code>serialVersionUID=-8475271235196182185L</code>. */
|
||||||
private static final long serialVersionUID = -8475271235196182185L;
|
private static final long serialVersionUID = -8475271235196182185L;
|
||||||
private JPanel jPanel1;
|
private JPanel jPanel1;
|
||||||
private JLabel jLabelColorless;
|
private JLabel jLabelColorless;
|
||||||
@@ -1009,12 +1009,12 @@ public class DeckAnalysis extends javax.swing.JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rList.size() >= 40) {
|
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(2).getName(), rList.get(3).getName(), rList.get(4).getName(), rList.get(5).getName(),
|
||||||
rList.get(6).getName() });
|
rList.get(6).getName()});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
jList1Model = new DefaultComboBoxModel(new String[] { "Few cards." });
|
jList1Model = new DefaultComboBoxModel(new String[] {"Few cards."});
|
||||||
}
|
}
|
||||||
|
|
||||||
jListFirstHand.setModel(jList1Model);
|
jListFirstHand.setModel(jList1Model);
|
||||||
@@ -1180,8 +1180,8 @@ public class DeckAnalysis extends javax.swing.JDialog {
|
|||||||
private JTable getJTable1() {
|
private JTable getJTable1() {
|
||||||
if (jTable1 == null) {
|
if (jTable1 == null) {
|
||||||
DefaultTableModel dm = new DefaultTableModel();
|
DefaultTableModel dm = new DefaultTableModel();
|
||||||
dm.setDataVector(new Object[][] { {} }, new Object[] { "Card", "Qty", "1st", "2nd", "3rd", "4th", "5th",
|
dm.setDataVector(new Object[][] { {} }, new Object[] {"Card", "Qty", "1st", "2nd", "3rd", "4th", "5th",
|
||||||
"6th", "7th" });
|
"6th", "7th"});
|
||||||
|
|
||||||
jTable1 = new JTable(dm);
|
jTable1 = new JTable(dm);
|
||||||
List<CardPrinted> rList = deck.toFlatList();
|
List<CardPrinted> rList = deck.toFlatList();
|
||||||
@@ -1204,7 +1204,7 @@ public class DeckAnalysis extends javax.swing.JDialog {
|
|||||||
cCount = cCount + 1;
|
cCount = cCount + 1;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dm.addRow(new Object[][] { {} });
|
dm.addRow(new Object[][] {{}});
|
||||||
jTable1.setValueAt(cardsName[i], dm.getRowCount() - 1, 0);
|
jTable1.setValueAt(cardsName[i], dm.getRowCount() - 1, 0);
|
||||||
jTable1.setValueAt(cCount, dm.getRowCount() - 2, 1);
|
jTable1.setValueAt(cCount, dm.getRowCount() - 2, 1);
|
||||||
fCount = cCount;
|
fCount = cCount;
|
||||||
|
|||||||
@@ -252,6 +252,9 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
|
|||||||
*
|
*
|
||||||
* @see javax.swing.table.TableModel#getRowCount()
|
* @see javax.swing.table.TableModel#getRowCount()
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
public int getRowCount() {
|
public int getRowCount() {
|
||||||
return data.countDistinct();
|
return data.countDistinct();
|
||||||
}
|
}
|
||||||
@@ -261,6 +264,9 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
|
|||||||
*
|
*
|
||||||
* @see javax.swing.table.TableModel#getColumnCount()
|
* @see javax.swing.table.TableModel#getColumnCount()
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
public int getColumnCount() {
|
public int getColumnCount() {
|
||||||
return columns.size();
|
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
|
* The listener interface for receiving column events. The class that is
|
||||||
* interested in processing a column event implements this interface, and
|
* interested in processing a column event implements this interface, and
|
||||||
* the object created with that class is registered with a component using
|
* 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
|
* the column event occurs, that object's appropriate
|
||||||
* method is invoked.
|
* method is invoked.
|
||||||
*
|
*
|
||||||
* @see ColumnEvent
|
|
||||||
*/
|
*/
|
||||||
class ColumnListener extends MouseAdapter {
|
class ColumnListener extends MouseAdapter {
|
||||||
|
|
||||||
@@ -307,6 +312,9 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
|
|||||||
* @see
|
* @see
|
||||||
* java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
|
* java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
|
||||||
*/
|
*/
|
||||||
|
/**
|
||||||
|
* @param e MouseEvent
|
||||||
|
*/
|
||||||
public void mouseClicked(final MouseEvent e) {
|
public void mouseClicked(final MouseEvent e) {
|
||||||
TableColumnModel colModel = table.getColumnModel();
|
TableColumnModel colModel = table.getColumnModel();
|
||||||
int columnModelIndex = colModel.getColumnIndexAtX(e.getX());
|
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));
|
table.getTableHeader().addMouseListener(new ColumnListener(table));
|
||||||
|
|
||||||
}// addCardListener()
|
} // addCardListener()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resort.
|
* Resort.
|
||||||
@@ -398,4 +406,4 @@ public final class TableModel<T extends InventoryItem> extends AbstractTableMode
|
|||||||
resort();
|
resort();
|
||||||
}
|
}
|
||||||
|
|
||||||
}// CardTableModel
|
} // CardTableModel
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class ForgeProps {
|
|||||||
/**
|
/**
|
||||||
* Returns the tree properties of forge.
|
* Returns the tree properties of forge.
|
||||||
*
|
*
|
||||||
* @return a {@link treeProperties.TreeProperties} object.
|
* @return a {@link tree.properties.TreeProperties} object.
|
||||||
*/
|
*/
|
||||||
public static TreeProperties getProperties() {
|
public static TreeProperties getProperties() {
|
||||||
return properties;
|
return properties;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public interface PropertyType<T> {
|
|||||||
* TreeProperties.
|
* TreeProperties.
|
||||||
*
|
*
|
||||||
* @param p
|
* @param p
|
||||||
* a {@link treeProperties.TreeProperties} object.
|
* a {@link tree.properties.TreeProperties} object.
|
||||||
* @param s
|
* @param s
|
||||||
* a {@link java.lang.String} object.
|
* a {@link java.lang.String} object.
|
||||||
* @return a T object.
|
* @return a T object.
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* a {@link treeProperties.PropertyType} object.
|
* a {@link tree.properties.PropertyType} object.
|
||||||
*/
|
*/
|
||||||
public static void addType(final PropertyType<?> type) {
|
public static void addType(final PropertyType<?> type) {
|
||||||
TYPES.put(type.getType(), type);
|
TYPES.put(type.getType(), type);
|
||||||
@@ -141,7 +141,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param type
|
* @param type
|
||||||
* a {@link treeProperties.PropertyType} object.
|
* a {@link tree.properties.PropertyType} object.
|
||||||
*/
|
*/
|
||||||
public static void removeType(final PropertyType<?> type) {
|
public static void removeType(final PropertyType<?> type) {
|
||||||
TYPES.remove(type.getType());
|
TYPES.remove(type.getType());
|
||||||
@@ -330,7 +330,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
|||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
* a {@link java.lang.String} object.
|
* 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) {
|
public final TreeProperties getTransparentProperties(final String key) {
|
||||||
return (TreeProperties) getProperty(key, "--" + TRANSPARENT, true);
|
return (TreeProperties) getProperty(key, "--" + TRANSPARENT, true);
|
||||||
@@ -437,7 +437,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
|||||||
*
|
*
|
||||||
* @param prefix
|
* @param prefix
|
||||||
* a {@link java.lang.String} object.
|
* a {@link java.lang.String} object.
|
||||||
* @return a {@link treeProperties.TreeProperties.TreePropertiesIterator}
|
* @return a {@link tree.properties.TreeProperties.TreePropertiesIterator}
|
||||||
* object.
|
* object.
|
||||||
*/
|
*/
|
||||||
private TreePropertiesIterator iterator(final String prefix) {
|
private TreePropertiesIterator iterator(final String prefix) {
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ Forge
|
|||||||
|
|
||||||
* {{{http://cardforge.org/releases/snapshots/forge/forge}Forge Snapshot Builds}}
|
* {{{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>>
|
<<Related Links>>
|
||||||
|
|||||||
Reference in New Issue
Block a user