diff --git a/forge-gui/src/main/java/forge/gui/match/controllers/CDetail.java b/forge-gui/src/main/java/forge/gui/match/controllers/CDetail.java
index 9b66e095972..e49fa31e3ea 100644
--- a/forge-gui/src/main/java/forge/gui/match/controllers/CDetail.java
+++ b/forge-gui/src/main/java/forge/gui/match/controllers/CDetail.java
@@ -45,7 +45,6 @@ public enum CDetail implements ICDoc {
* @param c Card object
*/
public void showCard(final Card c) {
-
view.getLblFlipcard().setVisible(c != null && (c.isDoubleFaced() || c.isFlipCard() || c.isFaceDown() && Singletons.getControl().mayShowCard(c)));
view.getPnlDetail().setCard(c);
if( view.getParentCell() != null)
diff --git a/forge-gui/src/main/java/forge/gui/match/controllers/CPicture.java b/forge-gui/src/main/java/forge/gui/match/controllers/CPicture.java
index 530c0313b39..8f6ccc30d85 100644
--- a/forge-gui/src/main/java/forge/gui/match/controllers/CPicture.java
+++ b/forge-gui/src/main/java/forge/gui/match/controllers/CPicture.java
@@ -16,6 +16,7 @@
* along with this program. If not, see
- * Can be used to display images associated with a {@code Card} or
+ * Can be used to display images associated with a {@code Card} or
* {@code InventoryItem} in {@code CardPicturePanel}.
*
* Can also be used to display details associated with a {@code Card}.
@@ -47,7 +48,7 @@ import forge.item.InventoryItem;
*/
public enum CPicture implements ICDoc {
SINGLETON_INSTANCE;
-
+
// For brevity, local shortcuts to singletons & child controls...
private final VPicture view = VPicture.SINGLETON_INSTANCE;
private final CardPicturePanel picturePanel = this.view.getPnlPicture();
@@ -61,25 +62,25 @@ public enum CPicture implements ICDoc {
* Shows card details and/or picture in sidebar cardview tabber.
*
*/
- public void showCard(final Card c, boolean showFlipped) {
+ public void showCard(final Card c, boolean showFlipped) {
if (null == c) {
return;
}
- currentCard = c;
+ currentCard = c;
displayedState = c.getCurState();
flipIndicator.setVisible(isCurrentCardFlippable());
- picturePanel.setCard(c);
- if (showFlipped && isCurrentCardFlippable()) {
- flipCard();
+ picturePanel.setCard(c);
+ if (showFlipped && isCurrentCardFlippable()) {
+ flipCard();
}
}
-
+
/**
- * Displays image associated with either a {@code Card}
+ * Displays image associated with either a {@code Card}
* or {@code InventoryItem} instance.
*/
- public void showImage(final InventoryItem item) {
+ public void showImage(final InventoryItem item) {
if (item instanceof IPaperCard) {
IPaperCard paperCard = ((IPaperCard)item);
Card c = Card.getCardForUi(paperCard);
@@ -108,7 +109,7 @@ public enum CPicture implements ICDoc {
setMouseWheelListener();
setMouseButtonListener();
}
-
+
/**
* Adds a mouse button listener to CardPicturePanel.
*
@@ -209,7 +209,7 @@ public enum CPicture implements ICDoc { * trigger any significant functionality but potentially this could cause * unforeseen consequences. Recommend that a read-only mechanism is implemented * to get card details for a given {@code CardCharacteristicName} state that does - * not require temporarily setting state of {@code Card} instance. + * not require temporarily setting state of {@code Card} instance. */ private void setCardDetailPanel() { CardCharacteristicName temp = currentCard.getCurState(); @@ -217,21 +217,19 @@ public enum CPicture implements ICDoc { CDetail.SINGLETON_INSTANCE.showCard(currentCard); currentCard.setState(temp); } - + private boolean isCurrentCardFlippable() { - boolean isFlippableMorph = + boolean isFlippableMorph = currentCard.isFaceDown() && isAuthorizedToViewFaceDownCard(currentCard); - return (currentCard != null) & + return (currentCard != null) & (currentCard.isDoubleFaced() || currentCard.isFlipCard() || isFlippableMorph); } - - /** * Card characteristic state machine. *
* Given a card and a state in terms of {@code CardCharacteristicName} this - * will determine whether there is a valid alternate {@code CardCharacteristicName} + * will determine whether there is a valid alternate {@code CardCharacteristicName} * state for that card. * * @param card the {@code Card} @@ -239,10 +237,9 @@ public enum CPicture implements ICDoc { * @return the alternate {@code CardCharacteristicName} state or default if not applicable */ public static CardCharacteristicName getAlternateState(final Card card, CardCharacteristicName currentState) { - // Default. Most cards will only ever have an "Original" state represented by a single image. CardCharacteristicName alternateState = CardCharacteristicName.Original; - + if (card.isDoubleFaced()) { if (currentState == CardCharacteristicName.Original) { alternateState = CardCharacteristicName.Transformed; @@ -265,11 +262,11 @@ public enum CPicture implements ICDoc { return alternateState; } - + /** * Prevents player from identifying opponent's face-down card. */ public static boolean isAuthorizedToViewFaceDownCard(Card card) { return Singletons.getControl().mayShowCard(card); - } + } }