|
|
|
@ -337,41 +337,42 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
|
|
|
|
|
null, |
|
|
|
|
this |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层
|
|
|
|
|
if (!isRightClickPopupMenuVisible() && (isMouseEnter || downloading)) { |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
Composite oldComposite = g2d.getComposite(); |
|
|
|
|
//画白色的编辑层
|
|
|
|
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 20 / 100.0F)); |
|
|
|
|
g2d.setColor(COVER_COLOR); |
|
|
|
|
g2d.fillRect(x, y, w, h); |
|
|
|
|
g2d.setComposite(oldComposite); |
|
|
|
|
//画编辑按钮图标
|
|
|
|
|
BufferedImage image = (process > 0 || downloading) ? WIDGET_DOWNLOADING_ICON : WIDGET_DOWNLOAD_ICON; |
|
|
|
|
g2d.drawImage( |
|
|
|
|
image, |
|
|
|
|
(x + w / 2 - 12), |
|
|
|
|
(y + h / 2 - 16), |
|
|
|
|
image.getWidth(), |
|
|
|
|
image.getHeight(), |
|
|
|
|
null, |
|
|
|
|
this |
|
|
|
|
); |
|
|
|
|
Stroke oldStroke = g2d.getStroke(); |
|
|
|
|
g2d.setStroke(XCreatorConstants.STROKE); |
|
|
|
|
g2d.setColor(Color.decode("#419BF9")); |
|
|
|
|
double arcAngle = downloading ? (36 + 360 * 0.9 * process) : 0.0; |
|
|
|
|
g2d.drawArc(x + w / 2 - 12, y + h / 2 - 16, 24, 24, 90, -(int) arcAngle); |
|
|
|
|
g2d.setColor(Color.WHITE); |
|
|
|
|
g2d.setStroke(oldStroke); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层
|
|
|
|
|
if (!isRightClickPopupMenuVisible() && (isMouseEnter || downloading)) { |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
Composite oldComposite = g2d.getComposite(); |
|
|
|
|
//画白色的编辑层
|
|
|
|
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 20 / 100.0F)); |
|
|
|
|
g2d.setColor(COVER_COLOR); |
|
|
|
|
g2d.fillRect(x, y, w, h); |
|
|
|
|
g2d.setComposite(oldComposite); |
|
|
|
|
//画编辑按钮图标
|
|
|
|
|
BufferedImage image = (process > 0 || downloading) ? WIDGET_DOWNLOADING_ICON : WIDGET_DOWNLOAD_ICON; |
|
|
|
|
g2d.drawImage( |
|
|
|
|
image, |
|
|
|
|
(x + w / 2 - 12), |
|
|
|
|
(y + h / 2 - 16), |
|
|
|
|
image.getWidth(), |
|
|
|
|
image.getHeight(), |
|
|
|
|
null, |
|
|
|
|
this |
|
|
|
|
); |
|
|
|
|
Stroke oldStroke = g2d.getStroke(); |
|
|
|
|
g2d.setStroke(XCreatorConstants.STROKE); |
|
|
|
|
g2d.setColor(Color.decode("#419BF9")); |
|
|
|
|
double arcAngle = downloading ? (36 + 360 * 0.9 * process) : 0.0; |
|
|
|
|
g2d.drawArc(x + w / 2 - 12, y + h / 2 - 16, 24, 24, 90, -(int) arcAngle); |
|
|
|
|
g2d.setColor(Color.WHITE); |
|
|
|
|
g2d.setStroke(oldStroke); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean isUnusable = !getWidget().isCompatibleWithCurrentEnv(); |
|
|
|
|
if (isUnusable) { |
|
|
|
|
paintUnusableMask((Graphics2D) g); |
|
|
|
|
boolean isUnusable = !getWidget().isCompatibleWithCurrentEnv(); |
|
|
|
|
if (isUnusable) { |
|
|
|
|
paintUnusableMask((Graphics2D) g); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.parentPane != null) { |
|
|
|
|
this.parentPane.refreshShowPaneUI(); |
|
|
|
|
} |
|
|
|
|