|
|
|
@ -72,22 +72,6 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane {
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createWidgetPane() { |
|
|
|
|
return new JPanel() { |
|
|
|
|
@Override |
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|
super.paint(g); |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
Composite oldComposite = g2d.getComposite(); |
|
|
|
|
AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); |
|
|
|
|
g2d.setComposite(composite); |
|
|
|
|
g2d.setColor(Color.DARK_GRAY); |
|
|
|
|
g2d.fillRect(0, 0, getWidth(), getHeight()); |
|
|
|
|
g2d.setComposite(oldComposite); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createContentPane(JPanel widgetPane) { |
|
|
|
|
JPanel panel = new JPanel() { |
|
|
|
|
@Override |
|
|
|
@ -114,7 +98,20 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane {
|
|
|
|
|
parentPane.resetWidgetDetailPane(packageId, getSharableWidgetProviders()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) { |
|
|
|
|
@Override |
|
|
|
|
public void paint(Graphics g) { |
|
|
|
|
Graphics2D g2d = (Graphics2D) g; |
|
|
|
|
Composite oldComposite = g2d.getComposite(); |
|
|
|
|
AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); |
|
|
|
|
g2d.setComposite(composite); |
|
|
|
|
g2d.setColor(Color.DARK_GRAY); |
|
|
|
|
g2d.fillRect(0, 0, getWidth(), getHeight()); |
|
|
|
|
g2d.setComposite(oldComposite); |
|
|
|
|
|
|
|
|
|
super.paint(g); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
panel.add(downloadProgressPane); |
|
|
|
|
panel.add(widgetPane, BorderLayout.CENTER); |
|
|
|
|
return panel; |
|
|
|
@ -125,10 +122,16 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane {
|
|
|
|
|
final com.fr.design.extra.Process<Double> downloadProcess = aDouble -> { |
|
|
|
|
OnlineDownloadPackagePane.this.process = 0.8 * aDouble; |
|
|
|
|
downloadProgressPane.updateProgress(process); |
|
|
|
|
if (downloadProgressPane != null) { |
|
|
|
|
downloadProgressPane.repaint(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
final com.fr.design.extra.Process<Double> installProcess = aDouble -> { |
|
|
|
|
OnlineDownloadPackagePane.this.process = 0.8 + 0.2 * aDouble; |
|
|
|
|
downloadProgressPane.updateProgress(process); |
|
|
|
|
if (downloadProgressPane != null) { |
|
|
|
|
downloadProgressPane.repaint(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
downloadProcess.process(0.0D); |
|
|
|
@ -220,6 +223,9 @@ public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane {
|
|
|
|
|
File file = new File(filePath); |
|
|
|
|
installProcess.process(0.0D); |
|
|
|
|
downloadProgressPane.changeState(); |
|
|
|
|
if (downloadProgressPane != null) { |
|
|
|
|
downloadProgressPane.repaint(); |
|
|
|
|
} |
|
|
|
|
InstallUtils.InstallResult result = null; |
|
|
|
|
try { |
|
|
|
|
if (file.exists()) { |
|
|
|
|