Code cleanup

This commit is contained in:
drdev
2013-12-10 01:13:34 +00:00
parent 1837234650
commit d0b5e78f7a
2 changed files with 12 additions and 10 deletions

View File

@@ -83,17 +83,17 @@ public class CHand implements ICDoc {
final HandArea p = view.getHandArea(); final HandArea p = view.getHandArea();
VField vf = CMatchUI.SINGLETON_INSTANCE.getFieldViewFor(player); VField vf = CMatchUI.SINGLETON_INSTANCE.getFieldViewFor(player);
if ( null == vf ) if (vf == null) {
return; return;
}
final Rectangle rctLibraryLabel = vf.getDetailsPanel().getLblLibrary().getBounds(); final Rectangle rctLibraryLabel = vf.getDetailsPanel().getLblLibrary().getBounds();
final List<Card> cc = player.getZone(ZoneType.Hand).getCards(); final List<Card> cc = player.getZone(ZoneType.Hand).getCards();
// Animation starts from the library label and runs to the hand panel. // Animation starts from the library label and runs to the hand panel.
// This check prevents animation running if label hasn't been realized yet. // This check prevents animation running if label hasn't been realized yet.
if (rctLibraryLabel.isEmpty() ) { if (rctLibraryLabel.isEmpty()) {
return; return;
} }
/* || p.getWidth() <= 0 */
List<Card> tmp, diff; List<Card> tmp, diff;
tmp = new ArrayList<Card>(); tmp = new ArrayList<Card>();
@@ -104,7 +104,8 @@ public class CHand implements ICDoc {
diff.removeAll(cc); diff.removeAll(cc);
if (diff.size() == p.getCardPanels().size()) { if (diff.size() == p.getCardPanels().size()) {
p.clear(); p.clear();
} else { }
else {
for (final Card card : diff) { for (final Card card : diff) {
p.removeCardPanel(p.getCardPanel(card.getUniqueNumber())); p.removeCardPanel(p.getCardPanel(card.getUniqueNumber()));
} }
@@ -137,7 +138,8 @@ public class CHand implements ICDoc {
if (Singletons.getView().getFrame().isShowing()) { if (Singletons.getView().getFrame().isShowing()) {
Animation.moveCard(startX, startY, startWidth, endX, endY, endWidth, animationPanel, toPanel, Animation.moveCard(startX, startY, startWidth, endX, endY, endWidth, animationPanel, toPanel,
layeredPane, 500); layeredPane, 500);
} else { }
else {
Animation.moveCard(toPanel); Animation.moveCard(toPanel);
} }
} }