mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Cleanup of imports and added lots of "@Override" lines.
This commit is contained in:
@@ -1252,9 +1252,9 @@ public class AbilityFactoryAttach {
|
||||
}
|
||||
}
|
||||
|
||||
final Object o = GuiUtils.chooseOne(source + " - Select a player to attach to.", players);
|
||||
if (o instanceof Player) {
|
||||
AbilityFactoryAttach.handleAura(source, (Player) o, false);
|
||||
final Player p = GuiUtils.chooseOne(source + " - Select a player to attach to.", players);
|
||||
if (p != null) {
|
||||
AbilityFactoryAttach.handleAura(source, p, false);
|
||||
//source.enchantEntity((Player) o);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import forge.card.spellability.AbilitySub;
|
||||
import forge.card.spellability.Spell;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.card.trigger.TriggerType;
|
||||
import forge.game.phase.PhaseType;
|
||||
import forge.game.player.ComputerUtil;
|
||||
import forge.game.player.Player;
|
||||
|
||||
@@ -1215,7 +1215,7 @@ public class AbilityFactoryCounters {
|
||||
}
|
||||
}
|
||||
// subtract all of selected type
|
||||
chosenAmount = tgtCounters.get((Object) chosenType);
|
||||
chosenAmount = tgtCounters.get(chosenType);
|
||||
if (chosenAmount > counterAmount) {
|
||||
chosenAmount = counterAmount;
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ public final class AbilityFactoryPlay {
|
||||
Card tgtCard = tgtCards.get(0);
|
||||
if (tgtCards.size() > 1) {
|
||||
if (controller.isHuman()) {
|
||||
tgtCard = (Card) GuiUtils.chooseOne("Select a card to play", tgtCards.toArray());
|
||||
tgtCard = GuiUtils.chooseOne("Select a card to play", tgtCards.toArray());
|
||||
} else {
|
||||
// AI
|
||||
tgtCards = tgtCards.filter(new CardListFilter() {
|
||||
|
||||
@@ -63,6 +63,7 @@ public final class AbilityFactoryRepeat {
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityRepeat(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
|
||||
@@ -866,6 +866,7 @@ public class CardFactoryUtil {
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityUnearth(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
@@ -1087,6 +1088,7 @@ public class CardFactoryUtil {
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityTransmute(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
@@ -1233,6 +1235,7 @@ public class CardFactoryUtil {
|
||||
super(ca, co, t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbilityActivated getCopy() {
|
||||
AbilityActivated res = new AbilityEquip(getSourceCard(),
|
||||
getPayCosts(), getTarget() == null ? null : new Target(getTarget()));
|
||||
|
||||
@@ -33,7 +33,6 @@ import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaPool;
|
||||
import forge.card.spellability.AbilityMana;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,6 +71,7 @@ public class DeckGroup extends DeckBase {
|
||||
this.humanDeck = humanDeck;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cloneFieldsTo(final DeckBase clone) {
|
||||
super.cloneFieldsTo(clone);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import forge.card.cardfactory.CardFactoryUtil;
|
||||
*
|
||||
*/
|
||||
public class CreatureComparator implements Comparator<Card> {
|
||||
@Override
|
||||
public int compare(final Card a, final Card b) {
|
||||
int cmcA = a.getCMC();
|
||||
cmcA *= 30; // average creature from evaluateCreature is about 30 * CMC
|
||||
|
||||
@@ -112,6 +112,7 @@ public final class SOverflowUtil {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void repaintSelf() {
|
||||
final Dimension d = OverflowLabel.this.getSize();
|
||||
repaint(0, 0, d.width, d.height);
|
||||
|
||||
@@ -25,5 +25,6 @@ public interface IVSubmenu extends IVDoc {
|
||||
EDocID getItemEnum();
|
||||
|
||||
/** Removes all children and (re)populates panel components, independent of constructor.*/
|
||||
@Override
|
||||
void populate();
|
||||
}
|
||||
|
||||
@@ -213,6 +213,7 @@ public enum VMainMenu implements IVDoc {
|
||||
// Make sure this is called last, so it doesn't interfere
|
||||
// with the selection display process.
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (item.getLayoutControl().getCommandOnSelect() != null) {
|
||||
item.getLayoutControl().getCommandOnSelect().execute();
|
||||
|
||||
@@ -101,6 +101,7 @@ public enum CSubmenuDuels implements ICDoc {
|
||||
public Command getCommandOnSelect() {
|
||||
final QuestController qc = AllZone.getQuest();
|
||||
return new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
if (qc.getAchievements() == null) {
|
||||
CMainMenu.SINGLETON_INSTANCE.itemClick(EDocID.HOME_QUESTDATA);
|
||||
|
||||
@@ -75,7 +75,7 @@ public class QuestFileLister extends JPanel {
|
||||
Collections.sort(sorted, new Comparator<QuestData>() {
|
||||
@Override
|
||||
public int compare(final QuestData x, final QuestData y) {
|
||||
return ((QuestData) x).getName().compareTo(((QuestData) y).getName());
|
||||
return x.getName().compareTo(y.getName());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ public class FButton extends JButton {
|
||||
|
||||
// Focus events
|
||||
this.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
if (isToggled()) { return; }
|
||||
|
||||
@@ -157,6 +158,7 @@ public class FButton extends JButton {
|
||||
addKeyListener(klEnter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
if (isToggled()) { return; }
|
||||
|
||||
|
||||
@@ -344,6 +344,7 @@ public class FLabel extends JLabel implements ILocalRepaint {
|
||||
}
|
||||
|
||||
/** Major performance kicker - won't repaint whole screen! */
|
||||
@Override
|
||||
public void repaintSelf() {
|
||||
final Dimension d = FLabel.this.getSize();
|
||||
repaint(0, 0, d.width, d.height);
|
||||
|
||||
@@ -62,6 +62,7 @@ public class FList extends JList {
|
||||
private class ComplexCellRenderer implements ListCellRenderer {
|
||||
private DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
|
||||
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList lst0, Object val0, int i0,
|
||||
boolean isSelected, boolean cellHasFocus) {
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
Backgrounds(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -83,6 +84,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
Colors(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -99,6 +101,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
ZoneImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -135,6 +138,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
ManaImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -164,6 +168,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
ColorlessManaImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -187,6 +192,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
GameplayImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -207,6 +213,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
Foils(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -225,6 +232,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
DockIcons(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -256,6 +264,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
QuestIcons(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -281,6 +290,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
InterfaceIcons(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -297,6 +307,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
LayoutImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -315,6 +326,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
EditorImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -352,6 +364,7 @@ public enum FSkin {
|
||||
/** @param xy   int[] coordinates */
|
||||
ButtonImages(final int[] xy) { this.coords = xy; }
|
||||
/** @return int[] */
|
||||
@Override
|
||||
public int[] getCoords() { return coords; }
|
||||
}
|
||||
|
||||
@@ -746,8 +759,8 @@ public enum FSkin {
|
||||
Color c;
|
||||
|
||||
// Center
|
||||
x = (int) (x0 + w0 / 2);
|
||||
y = (int) (y0 + h0 / 2);
|
||||
x = (x0 + w0 / 2);
|
||||
y = (y0 + h0 / 2);
|
||||
c = FSkin.getColorFromPixel(bimPreferredSprite.getRGB(x, y));
|
||||
if (c.getAlpha() != 0) { return bimPreferredSprite; }
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ public class FatPack extends OpenablePack {
|
||||
return "Fat Pack";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<CardPrinted> generate() {
|
||||
List<CardPrinted> result = new ArrayList<CardPrinted>();
|
||||
for (int i = 0; i < fpData.getCntBoosters(); i++) {
|
||||
|
||||
@@ -63,6 +63,7 @@ public class TournamentPack extends OpenablePack {
|
||||
return contents.getCommon() >= 30 ? "Tournament Pack" : "Starter Deck";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<CardPrinted> generate() {
|
||||
final BoosterGenerator gen = new BoosterGenerator(this.contents.getEditionFilter());
|
||||
return gen.getBoosterPack(this.contents);
|
||||
|
||||
@@ -50,6 +50,7 @@ public class QuestItemPoundFlesh extends QuestItemBasic {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final int getSellingPrice(QuestAssets qA) {
|
||||
int level = qA.getItemLevel(this.getItemType());
|
||||
if (qA.getLife(QuestMode.Fantasy) < 2) {
|
||||
|
||||
@@ -46,6 +46,7 @@ public class MultiplexOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void write(final int b) throws IOException {
|
||||
for (int i = 0; i < streams.length; i++) {
|
||||
streams[i].write(b);
|
||||
@@ -53,6 +54,7 @@ public class MultiplexOutputStream extends OutputStream {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void write(final byte[] b, final int off, final int len) throws IOException {
|
||||
for (int i = 0; i < streams.length; i++) {
|
||||
streams[i].write(b, off, len);
|
||||
|
||||
@@ -144,6 +144,7 @@ public abstract class StorageReaderFolder<T> implements IItemReader<T> {
|
||||
*/
|
||||
protected abstract FilenameFilter getFileFilter();
|
||||
|
||||
@Override
|
||||
public String getItemKey(T item) {
|
||||
return keySelector.apply(item);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public abstract class Lambda1<R, A1> implements Lambda<R> {
|
||||
* @param args Object[]
|
||||
* @return R
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public final R apply(final Object[] args) {
|
||||
return apply((A1) args[0]);
|
||||
|
||||
@@ -71,6 +71,7 @@ public final class Main {
|
||||
}
|
||||
|
||||
/** @throws Throwable */
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try { } catch (Exception e) { }
|
||||
finally {
|
||||
|
||||
@@ -84,6 +84,7 @@ public abstract class Animation {
|
||||
*/
|
||||
public Animation(final long duration, final long delay) {
|
||||
timerTask = new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (frameTimer == null) {
|
||||
start();
|
||||
@@ -195,10 +196,12 @@ public abstract class Animation {
|
||||
*/
|
||||
public static void tapCardToggle(final CardPanel panel) {
|
||||
new Animation(200) {
|
||||
@Override
|
||||
protected void start() {
|
||||
panel.setTapped(!panel.isTapped());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void update(final float percentage) {
|
||||
panel.setTappedAngle(CardPanel.TAPPED_ANGLE * percentage);
|
||||
if (!panel.isTapped()) {
|
||||
@@ -207,6 +210,7 @@ public abstract class Animation {
|
||||
panel.repaint();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void end() {
|
||||
panel.setTappedAngle(panel.isTapped() ? CardPanel.TAPPED_ANGLE : 0);
|
||||
}
|
||||
@@ -245,6 +249,7 @@ public abstract class Animation {
|
||||
final int endY, final int endWidth, final CardPanel animationPanel, final CardPanel placeholder,
|
||||
final JLayeredPane layeredPane, final int speed) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int startHeight = Math.round(startWidth * CardPanel.ASPECT_RATIO);
|
||||
final int endHeight = Math.round(endWidth * CardPanel.ASPECT_RATIO);
|
||||
@@ -260,6 +265,7 @@ public abstract class Animation {
|
||||
}
|
||||
|
||||
new Animation(700) {
|
||||
@Override
|
||||
protected void update(float percentage) {
|
||||
if (placeholder != null && !placeholder.isShowing()) {
|
||||
cancel();
|
||||
@@ -288,8 +294,10 @@ public abstract class Animation {
|
||||
animationPanel.setCardBounds(currentX, currentY, currentWidth, currentHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void end() {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (placeholder != null) {
|
||||
placeholder.setDisplayEnabled(true);
|
||||
@@ -336,6 +344,7 @@ public abstract class Animation {
|
||||
final int endY, final int endWidth, final CardPanel animationPanel, final CardPanel placeholder,
|
||||
final JLayeredPane layeredPane, final int speed) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int startHeight = Math.round(startWidth * CardPanel.ASPECT_RATIO);
|
||||
final int endHeight = Math.round(endWidth * CardPanel.ASPECT_RATIO);
|
||||
@@ -349,6 +358,7 @@ public abstract class Animation {
|
||||
}
|
||||
|
||||
new Animation(speed) {
|
||||
@Override
|
||||
protected void update(final float percentage) {
|
||||
int currentX = startX + Math.round((endX - startX) * percentage);
|
||||
int currentY = startY + Math.round((endY - startY) * percentage);
|
||||
@@ -357,8 +367,10 @@ public abstract class Animation {
|
||||
animationPanel.setCardBounds(currentX, currentY, currentWidth, currentHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void end() {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (placeholder != null) {
|
||||
placeholder.setDisplayEnabled(true);
|
||||
@@ -386,8 +398,10 @@ public abstract class Animation {
|
||||
*/
|
||||
public static void moveCard(final CardPanel placeholder) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (placeholder != null) {
|
||||
placeholder.setDisplayEnabled(true);
|
||||
@@ -431,6 +445,7 @@ public abstract class Animation {
|
||||
final int endHeight = Math.round(endWidth * CardPanel.ASPECT_RATIO);
|
||||
|
||||
new Animation(200) {
|
||||
@Override
|
||||
protected void update(final float percentage) {
|
||||
int currentWidth = startWidth + Math.round((endWidth - startWidth) * percentage);
|
||||
int currentHeight = startHeight + Math.round((endHeight - startHeight) * percentage);
|
||||
@@ -446,10 +461,12 @@ public abstract class Animation {
|
||||
animationPanel.setCardBounds(currentX, currentY, currentWidth, currentHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void end() {
|
||||
animationPanel.setVisible(false);
|
||||
animationPanel.repaint();
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
layeredPane.remove(animationPanel);
|
||||
}
|
||||
@@ -516,6 +533,7 @@ public abstract class Animation {
|
||||
animationPanel.setImage(overPanel);
|
||||
|
||||
new Animation(200, delay) {
|
||||
@Override
|
||||
protected void start() {
|
||||
synchronized (enlargeLock) {
|
||||
// Cancel if the panel is no longer delayed or already
|
||||
@@ -535,6 +553,7 @@ public abstract class Animation {
|
||||
animationPanel.setTappedAngle(overPanel.getTappedAngle());
|
||||
try {
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
layeredPane.add(animationPanel);
|
||||
layeredPane.setLayer(animationPanel, JLayeredPane.DRAG_LAYER);
|
||||
@@ -545,6 +564,7 @@ public abstract class Animation {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void update(final float percentage) {
|
||||
synchronized (enlargeLock) {
|
||||
if (enlargedAnimationPanel != animationPanel) {
|
||||
|
||||
@@ -92,6 +92,7 @@ public class GlowText extends JLabel {
|
||||
*
|
||||
* @return a {@link java.awt.Dimension} object.
|
||||
*/
|
||||
@Override
|
||||
public final Dimension getPreferredSize() {
|
||||
Dimension size = super.getPreferredSize();
|
||||
size.width += glowSize;
|
||||
@@ -100,11 +101,13 @@ public class GlowText extends JLabel {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void setText(final String text) {
|
||||
super.setText(text);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void paint(final Graphics g) {
|
||||
if (getText().length() == 0) {
|
||||
return;
|
||||
|
||||
@@ -190,14 +190,17 @@ public class UI {
|
||||
editorPane.setEditorKit(new HTMLEditorKit() {
|
||||
private static final long serialVersionUID = -562969765076450440L;
|
||||
|
||||
@Override
|
||||
public ViewFactory getViewFactory() {
|
||||
return new HTMLFactory() {
|
||||
@Override
|
||||
public View create(final Element elem) {
|
||||
Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
|
||||
if (o instanceof HTML.Tag) {
|
||||
HTML.Tag kind = (HTML.Tag) o;
|
||||
if (kind == HTML.Tag.IMG) {
|
||||
return new ImageView(elem) {
|
||||
@Override
|
||||
public URL getImageURL() {
|
||||
URL url = super.getImageURL();
|
||||
// Put an image into the cache to be
|
||||
@@ -236,6 +239,7 @@ public class UI {
|
||||
viewport.setLayout(new ViewportLayout() {
|
||||
private static final long serialVersionUID = -4436977380450713628L;
|
||||
|
||||
@Override
|
||||
public void layoutContainer(final Container parent) {
|
||||
viewport.setViewPosition(new Point(0, 0));
|
||||
Dimension viewportSize = viewport.getSize();
|
||||
|
||||
@@ -160,6 +160,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
/**
|
||||
* Does nothing.
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
@@ -169,6 +170,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the num phases
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getNumPhases()
|
||||
*/
|
||||
@Override
|
||||
public final int getNumPhases() {
|
||||
return this.numPhases;
|
||||
}
|
||||
@@ -179,6 +181,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the min update interval sec
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getMinUpdateIntervalSec()
|
||||
*/
|
||||
@Override
|
||||
public final float getMinUpdateIntervalSec() {
|
||||
return this.minUIUpdateIntervalSec;
|
||||
}
|
||||
@@ -189,6 +192,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the current phase
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getCurrentPhase()
|
||||
*/
|
||||
@Override
|
||||
public final int getCurrentPhase() {
|
||||
return this.currentPhase;
|
||||
}
|
||||
@@ -199,6 +203,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the units completed so far this phase
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getUnitsCompletedSoFarThisPhase()
|
||||
*/
|
||||
@Override
|
||||
public final long getUnitsCompletedSoFarThisPhase() {
|
||||
return this.unitsCompletedSoFarThisPhase;
|
||||
}
|
||||
@@ -209,6 +214,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the total units this phase
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getTotalUnitsThisPhase()
|
||||
*/
|
||||
@Override
|
||||
public final long getTotalUnitsThisPhase() {
|
||||
return this.totalUnitsThisPhase;
|
||||
}
|
||||
@@ -219,6 +225,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the last ui update time
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getLastUIUpdateTime()
|
||||
*/
|
||||
@Override
|
||||
public final long getLastUIUpdateTime() {
|
||||
return this.lastUIUpdateTime;
|
||||
}
|
||||
@@ -229,6 +236,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the phase one start time
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getPhaseOneStartTime()
|
||||
*/
|
||||
@Override
|
||||
public final long getPhaseOneStartTime() {
|
||||
return this.phaseOneStartTime;
|
||||
}
|
||||
@@ -239,6 +247,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the current phase start time
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getCurrentPhaseStartTime()
|
||||
*/
|
||||
@Override
|
||||
public final long getCurrentPhaseStartTime() {
|
||||
return this.currentPhaseStartTime;
|
||||
}
|
||||
@@ -250,6 +259,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* the new min update interval sec
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#setMinUpdateIntervalSec(float)
|
||||
*/
|
||||
@Override
|
||||
public final void setMinUpdateIntervalSec(final float value) {
|
||||
this.minUIUpdateIntervalSec = value;
|
||||
}
|
||||
@@ -261,6 +271,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* the new total units this phase
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#setTotalUnitsThisPhase(long)
|
||||
*/
|
||||
@Override
|
||||
public void setTotalUnitsThisPhase(final long value) {
|
||||
this.totalUnitsThisPhase = value;
|
||||
}
|
||||
@@ -271,6 +282,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the percent complete of this phase as string
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getPercentCompleteOfThisPhaseAsString()
|
||||
*/
|
||||
@Override
|
||||
public final String getPercentCompleteOfThisPhaseAsString() {
|
||||
|
||||
Float percent = getPercentCompleteOfThisPhaseAsFloat();
|
||||
@@ -288,6 +300,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the total percent complete as string
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getTotalPercentCompleteAsString()
|
||||
*/
|
||||
@Override
|
||||
public final String getTotalPercentCompleteAsString() {
|
||||
Float percent = getTotalPercentCompleteAsFloat();
|
||||
|
||||
@@ -317,6 +330,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the relative eta as string
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getRelativeETAAsString(boolean)
|
||||
*/
|
||||
@Override
|
||||
public final String getRelativeETAAsString(final boolean thisPhaseOnly) {
|
||||
|
||||
Integer etaSec = getRelativeETASec(thisPhaseOnly);
|
||||
@@ -367,6 +381,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the absolute eta as local time string
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getAbsoluteETAAsLocalTimeString(boolean)
|
||||
*/
|
||||
@Override
|
||||
public final String getAbsoluteETAAsLocalTimeString(final boolean thisPhaseOnly) {
|
||||
Long etaTime = getAbsoluteETATime(thisPhaseOnly);
|
||||
|
||||
@@ -384,6 +399,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* the num units
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#incrementUnitsCompletedThisPhase(long)
|
||||
*/
|
||||
@Override
|
||||
public void incrementUnitsCompletedThisPhase(final long numUnits) {
|
||||
this.unitsCompletedSoFarThisPhase += numUnits;
|
||||
}
|
||||
@@ -392,6 +408,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* Subclasses must call this immediately after updating the UI, to preserve
|
||||
* the integrity of the shouldUpdateUI method.
|
||||
*/
|
||||
@Override
|
||||
public final void justUpdatedUI() {
|
||||
this.lastUIUpdateTime = new Date().getTime() / 1000;
|
||||
}
|
||||
@@ -402,6 +419,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return true, if successful
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#shouldUpdateUI()
|
||||
*/
|
||||
@Override
|
||||
public final boolean shouldUpdateUI() {
|
||||
|
||||
doctorStartTimes();
|
||||
@@ -418,6 +436,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* the total units next phase
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#markCurrentPhaseAsComplete(long)
|
||||
*/
|
||||
@Override
|
||||
public final void markCurrentPhaseAsComplete(final long totalUnitsNextPhase) {
|
||||
|
||||
if ((this.currentPhase > this.numPhases)) {
|
||||
@@ -464,6 +483,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* the message
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#sendMessage(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public final void sendMessage(final String message) {
|
||||
}
|
||||
|
||||
@@ -474,6 +494,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* the new current phase as exponential
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#setCurrentPhaseAsExponential(float)
|
||||
*/
|
||||
@Override
|
||||
public final void setCurrentPhaseAsExponential(final float value) {
|
||||
this.currentPhaseExponent = value;
|
||||
}
|
||||
@@ -484,6 +505,7 @@ public class BaseProgressMonitor implements BraidsProgressMonitor {
|
||||
* @return the current phase exponent
|
||||
* @see net.slightlymagic.braids.BraidsProgressMonitor#getCurrentPhaseExponent()
|
||||
*/
|
||||
@Override
|
||||
public final float getCurrentPhaseExponent() {
|
||||
return this.currentPhaseExponent;
|
||||
}
|
||||
|
||||
@@ -432,6 +432,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
||||
*
|
||||
* @return a {@link java.util.Iterator} object.
|
||||
*/
|
||||
@Override
|
||||
public final Iterator<PropertyElement> iterator() {
|
||||
return iterator("");
|
||||
};
|
||||
@@ -464,6 +465,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
||||
// After this call, the next element is determined, or the child
|
||||
// iterator has next
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
if (next != null) {
|
||||
return true;
|
||||
@@ -492,18 +494,22 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
||||
}
|
||||
next = new PropertyElement() {
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return prefix + parts[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getType() {
|
||||
return cls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final String value) {
|
||||
}
|
||||
};
|
||||
@@ -513,6 +519,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyElement next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
@@ -525,6 +532,7 @@ public class TreeProperties implements Iterable<PropertyElement> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public class FileType implements PropertyType<File> {
|
||||
*
|
||||
* @return a {@link java.lang.String} object.
|
||||
*/
|
||||
@Override
|
||||
public final String getSuffix() {
|
||||
return SUFFIX;
|
||||
}
|
||||
@@ -55,11 +56,13 @@ public class FileType implements PropertyType<File> {
|
||||
*
|
||||
* @return a {@link java.lang.Class} object.
|
||||
*/
|
||||
@Override
|
||||
public final Class<File> getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final File toObject(final TreeProperties p, final String s) {
|
||||
String path = getPath(s);
|
||||
File f = new File(path);
|
||||
|
||||
Reference in New Issue
Block a user