|
|
|
@ -49,23 +49,28 @@ public class GUIPaintUtils {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 正常状态填充 |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* @param isAuthorityEdited 是否权限编辑 |
|
|
|
|
* @param isPressedPainted 是否按压画 |
|
|
|
|
* @param isPressedPainted 是否按压画 |
|
|
|
|
*/ |
|
|
|
|
public static final void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { |
|
|
|
|
fillNormal(g2d, x, y, width, height, isRound, rectDirection, isAuthorityEdited, isPressedPainted, UIConstants.ATTRIBUTE_NORMAL); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static final void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted, Color color) { |
|
|
|
|
GradientPaint gp; |
|
|
|
|
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) { |
|
|
|
|
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE); |
|
|
|
|
} else if (isPressedPainted) { |
|
|
|
|
gp = new GradientPaint(1, 1, UIConstants.ATTRIBUTE_NORMAL, 1, height - 1, UIConstants.ATTRIBUTE_NORMAL); |
|
|
|
|
}else{ |
|
|
|
|
gp = new GradientPaint(1, 1, color, 1, height - 1, color); |
|
|
|
|
} else { |
|
|
|
|
gp = new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, height - 1, UIConstants.SHADOW_GREY); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -74,15 +79,16 @@ public class GUIPaintUtils {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 鼠标悬停状态填充 |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* @param isAuthorityEdited 是否权限编辑 |
|
|
|
|
* @param isPressedPainted 是否按压画 |
|
|
|
|
* @param isPressedPainted 是否按压画 |
|
|
|
|
*/ |
|
|
|
|
public static final void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { |
|
|
|
|
fillRollOver(g2d, x, y, width, height, isRound, rectDirection, isAuthorityEdited, isPressedPainted, null); |
|
|
|
@ -104,15 +110,15 @@ public class GUIPaintUtils {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 按压状态填充 |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* @param isAuthorityEdited 是否权限编辑 |
|
|
|
|
* |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* @param isAuthorityEdited 是否权限编辑 |
|
|
|
|
*/ |
|
|
|
|
public static final void fillPressed(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) { |
|
|
|
|
fillPressed(g2d, x, y, width, height, isRound, rectDirection, isAuthorityEdited, null); |
|
|
|
@ -147,17 +153,19 @@ public class GUIPaintUtils {
|
|
|
|
|
|
|
|
|
|
g2d.setColor(oldColor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 自定义画笔填充 |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* @param paint 画笔 |
|
|
|
|
* @param arc 圆角尺寸 |
|
|
|
|
* |
|
|
|
|
* @param g2d 图形对象 |
|
|
|
|
* @param x x坐标 |
|
|
|
|
* @param y y坐标 |
|
|
|
|
* @param width 宽度 |
|
|
|
|
* @param height 高度 |
|
|
|
|
* @param isRound 是否圆角 |
|
|
|
|
* @param rectDirection 矩形方向 |
|
|
|
|
* @param paint 画笔 |
|
|
|
|
* @param arc 圆角尺寸 |
|
|
|
|
*/ |
|
|
|
|
public static final void fillPaint(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, Paint paint, int arc) { |
|
|
|
|
Paint oldPaint = g2d.getPaint(); |
|
|
|
@ -188,9 +196,9 @@ public class GUIPaintUtils {
|
|
|
|
|
|
|
|
|
|
public static final void paintBorderShadow(Graphics2D g2, int shadowWidth, Shape shape, Color outColor, Color inColor) { |
|
|
|
|
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
|
g2.setColor(outColor); |
|
|
|
|
g2.setStroke(new BasicStroke(shadowWidth)); |
|
|
|
|
g2.draw(shape); |
|
|
|
|
g2.setColor(outColor); |
|
|
|
|
g2.setStroke(new BasicStroke(shadowWidth)); |
|
|
|
|
g2.draw(shape); |
|
|
|
|
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|