918 |
} |
} |
919 |
|
|
920 |
/** |
/** |
921 |
|
* A button border that is only visible when the mouse pointer is within |
922 |
|
* the button's bounds. |
923 |
|
*/ |
924 |
|
public static class RolloverButtonBorder |
925 |
|
extends MetalBorders.ButtonBorder |
926 |
|
{ |
927 |
|
/** |
928 |
|
* Creates a new border instance. |
929 |
|
*/ |
930 |
|
public RolloverButtonBorder() |
931 |
|
{ |
932 |
|
} |
933 |
|
|
934 |
|
/** |
935 |
|
* Paints the border. |
936 |
|
* |
937 |
|
* @param c the component. |
938 |
|
* @param g the graphics device. |
939 |
|
* @param x the x-coordinate. |
940 |
|
* @param y the y-coordinate. |
941 |
|
* @param w the width. |
942 |
|
* @param h the height. |
943 |
|
*/ |
944 |
|
public void paintBorder(Component c, Graphics g, int x, int y, int w, |
945 |
|
int h) |
946 |
|
{ |
947 |
|
boolean mouseIsOver = false; |
948 |
|
if (c instanceof AbstractButton) |
949 |
|
{ |
950 |
|
ButtonModel bmodel = ((AbstractButton) c).getModel(); |
951 |
|
mouseIsOver = bmodel.isRollover(); |
952 |
|
} |
953 |
|
if (mouseIsOver) |
954 |
|
super.paintBorder(c, g, x, y, w, h); |
955 |
|
} |
956 |
|
} |
957 |
|
|
958 |
|
/** |
959 |
* This border is used in Toolbar buttons as inner border. |
* This border is used in Toolbar buttons as inner border. |
960 |
*/ |
*/ |
961 |
static class RolloverMarginBorder extends AbstractBorder |
static class RolloverMarginBorder extends AbstractBorder |