diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/window/ChoiceWindow.java')
-rwxr-xr-x[-rw-r--r--] | src/com/fourisland/fourpuzzle/window/ChoiceWindow.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java b/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java index bf7391e..40fff30 100644..100755 --- a/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java +++ b/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java | |||
@@ -73,7 +73,7 @@ public class ChoiceWindow { | |||
73 | Graphics2D g2 = cacheBase.createGraphics(); | 73 | Graphics2D g2 = cacheBase.createGraphics(); |
74 | 74 | ||
75 | g2.drawImage(SystemGraphic.getMessageBackground(), 1, 1, TopLeft.getWidth()+getWidth()+TopRight.getWidth()-2, TopLeft.getHeight()+getHeight()+BottomLeft.getHeight()-2, null); | 75 | g2.drawImage(SystemGraphic.getMessageBackground(), 1, 1, TopLeft.getWidth()+getWidth()+TopRight.getWidth()-2, TopLeft.getHeight()+getHeight()+BottomLeft.getHeight()-2, null); |
76 | g2.drawImage(Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(temp.getSource(), new TransparentPixelFilter(-25600))), 0, 0, null); | 76 | g2.drawImage(Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(temp.getSource(), new TransparentPixelFilter(SystemGraphic.getTransparentColor().getRGB()))), 0, 0, null); |
77 | g2.setFont(g2.getFont().deriveFont(Font.BOLD)); | 77 | g2.setFont(g2.getFont().deriveFont(Font.BOLD)); |
78 | 78 | ||
79 | int ty = TopLeft.getHeight()+g2.getFontMetrics().getHeight()-SPACER; | 79 | int ty = TopLeft.getHeight()+g2.getFontMetrics().getHeight()-SPACER; |
@@ -86,10 +86,6 @@ public class ChoiceWindow { | |||
86 | tx += ((width/2)-(g2.getFontMetrics().stringWidth(choice)/2)); | 86 | tx += ((width/2)-(g2.getFontMetrics().stringWidth(choice)/2)); |
87 | } | 87 | } |
88 | 88 | ||
89 | /* TODO The following code paints the text onto the window. However, | ||
90 | * when it paints the lowercase 'y', the tail is white, not the | ||
91 | * correct gradient. */ | ||
92 | |||
93 | g2.setPaint(new TexturePaint(SystemGraphic.getTextColor(), new Rectangle(tx, ty, g2.getFontMetrics().stringWidth(choice),g2.getFontMetrics().getHeight()))); | 89 | g2.setPaint(new TexturePaint(SystemGraphic.getTextColor(), new Rectangle(tx, ty, g2.getFontMetrics().stringWidth(choice),g2.getFontMetrics().getHeight()))); |
94 | g2.drawString(choice, tx, ty); | 90 | g2.drawString(choice, tx, ty); |
95 | 91 | ||
@@ -113,5 +109,21 @@ public class ChoiceWindow { | |||
113 | { | 109 | { |
114 | return height; | 110 | return height; |
115 | } | 111 | } |
112 | |||
113 | int selected = 0; | ||
114 | public void moveUp() | ||
115 | { | ||
116 | selected--; | ||
117 | } | ||
118 | |||
119 | public void moveDown() | ||
120 | { | ||
121 | selected++; | ||
122 | } | ||
123 | |||
124 | public String getSelected() | ||
125 | { | ||
126 | return choices.get(selected); | ||
127 | } | ||
116 | 128 | ||
117 | } | 129 | } |