put yellow border on selectable cards

This commit is contained in:
Peter F. Patel-Schneider
2019-01-15 22:01:58 -05:00
parent 2f9fb96d29
commit 2cd86bfe1e
5 changed files with 33 additions and 2 deletions

View File

@@ -287,6 +287,8 @@ public class GuiChoose {
public static List<CardView> manipulateCardList(final CMatchUI gui, final String title, final Iterable<CardView> cards, final Iterable<CardView> manipulable,
final boolean toTop, final boolean toBottom, final boolean toAnywhere) {
System.out.print("MCL "); System.out.println(manipulable);
gui.setSelectables(manipulable);
final Callable<List<CardView>> callable = new Callable<List<CardView>>() {
@Override
public List<CardView> call() throws Exception {
@@ -299,6 +301,7 @@ public class GuiChoose {
};
final FutureTask<List<CardView>> ft = new FutureTask<List<CardView>>(callable);
FThreads.invokeInEdtAndWait(ft);
gui.clearSelectables();
try {
List<CardView> result = ft.get();
return result;

View File

@@ -273,7 +273,11 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
g2d.setColor(Color.magenta);
final int n2 = Math.max(1, Math.round(2 * cardWidth * CardPanel.SELECTED_BORDER_SIZE));
g2d.fillRoundRect(cardXOffset - n2, (cardYOffset - n2) + offset, cardWidth + (n2 * 2), cardHeight + (n2 * 2), cornerSize + n2, cornerSize + n2);
}
} else if (matchUI.isSelectable(getCard())) { // Yellow outline for selectable cards
g2d.setColor(Color.yellow);
final int n2 = Math.max(1, Math.round(2 * cardWidth * CardPanel.SELECTED_BORDER_SIZE));
g2d.fillRoundRect(cardXOffset - n2, (cardYOffset - n2) + offset, cardWidth + (n2 * 2), cardHeight + (n2 * 2), cornerSize + n2, cornerSize + n2);
}
// Green outline for hover
if (isSelected) {