diff options
Diffstat (limited to 'src/cppcheckplus/toolbar/MyToolBarRoverButton.java')
-rw-r--r-- | src/cppcheckplus/toolbar/MyToolBarRoverButton.java | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/cppcheckplus/toolbar/MyToolBarRoverButton.java b/src/cppcheckplus/toolbar/MyToolBarRoverButton.java index 9ab1dc8..79069f5 100644 --- a/src/cppcheckplus/toolbar/MyToolBarRoverButton.java +++ b/src/cppcheckplus/toolbar/MyToolBarRoverButton.java | |||
@@ -1,36 +1,30 @@ | |||
1 | |||
2 | package cppcheckplus.toolbar; | 1 | package cppcheckplus.toolbar; |
3 | 2 | ||
3 | import cppcheckplus.control.MyContorlUtil; | ||
4 | import java.awt.Color; | 4 | import java.awt.Color; |
5 | import javax.swing.Icon; | 5 | import javax.swing.Icon; |
6 | import javax.swing.ImageIcon; | 6 | import javax.swing.ImageIcon; |
7 | 7 | ||
8 | import cppcheckplus.control.MyContorlUtil; | ||
9 | |||
10 | 8 | ||
11 | public class MyToolBarRoverButton extends MyToolBarButton | 9 | public class MyToolBarRoverButton extends MyToolBarButton { |
12 | { | 10 | private Color roverDyeColor; |
13 | private Color roverDyeColor; | ||
14 | 11 | ||
15 | public MyToolBarRoverButton() | 12 | public MyToolBarRoverButton() { |
16 | { | 13 | roverDyeColor = new Color(86, 146, 61); |
17 | roverDyeColor = new Color(86, 146, 61); | 14 | } |
18 | } | ||
19 | 15 | ||
20 | public void setIcon(Icon icon) | 16 | public void setIcon(Icon icon) { |
21 | { | 17 | super.setIcon(icon); |
22 | super.setIcon(icon); | 18 | if (icon == null) { |
23 | if (icon == null) | 19 | setPressedIcon(null); |
24 | { | 20 | setRolloverIcon(null); |
25 | setPressedIcon(null); | 21 | } else { |
26 | setRolloverIcon(null); | 22 | java.awt.Image image = MyContorlUtil.iconToImage(icon); |
27 | } else | 23 | Icon roverIcon = MyContorlUtil.createDyedIcon(new ImageIcon(image), |
28 | { | 24 | roverDyeColor); |
29 | java.awt.Image image = MyContorlUtil.iconToImage(icon); | 25 | Icon pressedIcon = MyContorlUtil.createMovedIcon(roverIcon); |
30 | Icon roverIcon = MyContorlUtil.createDyedIcon(new ImageIcon(image), roverDyeColor); | 26 | setRolloverIcon(roverIcon); |
31 | Icon pressedIcon = MyContorlUtil.createMovedIcon(roverIcon); | 27 | setPressedIcon(pressedIcon); |
32 | setRolloverIcon(roverIcon); | 28 | } |
33 | setPressedIcon(pressedIcon); | 29 | } |
34 | } | ||
35 | } | ||
36 | } | 30 | } |