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