|
@@ -12,6 +12,7 @@ public class MenuButton {
|
|
|
|
|
|
|
|
private ArrayList<Color> colors;
|
|
private ArrayList<Color> colors;
|
|
|
private int x, y;
|
|
private int x, y;
|
|
|
|
|
+ private int xx,yy;
|
|
|
private boolean selected;
|
|
private boolean selected;
|
|
|
private Song song;
|
|
private Song song;
|
|
|
Color color;
|
|
Color color;
|
|
@@ -24,45 +25,45 @@ public class MenuButton {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public MenuButton(int x, int y, int xx, int yy, Color color, Song song){
|
|
|
|
|
+ this.x = x;
|
|
|
|
|
+ this.y = y;
|
|
|
|
|
+ this.color = color;
|
|
|
|
|
+ this.yy = yy;
|
|
|
|
|
+ this.xx = xx;
|
|
|
|
|
+ setSong(song);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public void draw(Graphics2D g2d){
|
|
public void draw(Graphics2D g2d){
|
|
|
|
|
|
|
|
|
|
|
|
|
if(selected){
|
|
if(selected){
|
|
|
|
|
+ g2d.setColor(color.darker().darker().darker().darker());
|
|
|
|
|
+ g2d.fillRect(x-10, y-10,xx+20,yy+20);
|
|
|
|
|
+ g2d.setColor(color.darker().darker());
|
|
|
|
|
+ g2d.fillRect(x-5, y-5,xx+10,yy+10);
|
|
|
g2d.setColor(color);
|
|
g2d.setColor(color);
|
|
|
- GeneralPath path = new GeneralPath();
|
|
|
|
|
- path.moveTo(320, 540);
|
|
|
|
|
- path.lineTo(320, 590);
|
|
|
|
|
- path.lineTo(385, 565);
|
|
|
|
|
-
|
|
|
|
|
- path.closePath();
|
|
|
|
|
- g2d.fill(path);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ g2d.fillRect(x,y,xx,yy);
|
|
|
g2d.setColor(Color.BLACK);
|
|
g2d.setColor(Color.BLACK);
|
|
|
- g2d.draw(path);
|
|
|
|
|
-
|
|
|
|
|
- g2d.setColor(color.darker().darker().darker().darker());
|
|
|
|
|
- g2d.fillRect(x-10, y-10,900,90);
|
|
|
|
|
|
|
+ g2d.drawRect(x-10, y-10, xx+20, yy+20);
|
|
|
|
|
+ g2d.drawRect(x-5, y-5, xx+10, yy+10);
|
|
|
|
|
+ g2d.drawRect(x, y, xx, yy);
|
|
|
}
|
|
}
|
|
|
- g2d.setColor(color.darker().darker());
|
|
|
|
|
- g2d.fillRect(x-5, y-5,890,80);
|
|
|
|
|
- g2d.setColor(color);
|
|
|
|
|
- g2d.fillRect(x,y,880,70);
|
|
|
|
|
-
|
|
|
|
|
- if(selected){
|
|
|
|
|
- g2d.setColor(Color.BLACK);
|
|
|
|
|
- g2d.drawRect(x-10, y-10, 900, 90);
|
|
|
|
|
- g2d.drawRect(x-5, y-5, 890, 80);
|
|
|
|
|
- g2d.drawRect(x, y, 880, 70);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ else{
|
|
|
|
|
+ g2d.setColor(color.darker().darker());
|
|
|
|
|
+ g2d.fillRect(x-5, y-5,890,80);
|
|
|
|
|
+ g2d.setColor(color);
|
|
|
|
|
+ g2d.fillRect(x,y,880,70);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//draw text
|
|
//draw text
|
|
|
g2d.setColor(Color.BLACK);
|
|
g2d.setColor(Color.BLACK);
|
|
|
Font textFont = new Font("OCR A Extended", Font.BOLD,60);
|
|
Font textFont = new Font("OCR A Extended", Font.BOLD,60);
|
|
|
g2d.setFont(textFont);
|
|
g2d.setFont(textFont);
|
|
|
- g2d.drawString(song.getTitle(), x+50, y+57);
|
|
|
|
|
|
|
+ if(selected)
|
|
|
|
|
+ g2d.drawString(song.getTitle(), x+50, y+63);
|
|
|
|
|
+ else
|
|
|
|
|
+ g2d.drawString(song.getTitle(), x+50, y+57);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|