|
|
|
@ -43,6 +43,7 @@ import javax.swing.JPopupMenu;
|
|
|
|
|
import javax.swing.JScrollPane; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Point; |
|
|
|
|
import java.awt.event.ContainerAdapter; |
|
|
|
|
import java.awt.event.ContainerEvent; |
|
|
|
@ -62,7 +63,6 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
.nextScene(createScene3()) |
|
|
|
|
.nextScene(createScene4()) |
|
|
|
|
.nextScene(createScene5()) |
|
|
|
|
.nextScene(createScene6()) |
|
|
|
|
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene()); |
|
|
|
|
|
|
|
|
|
Guide guide = GuideBuilder.newInstance() |
|
|
|
@ -93,7 +93,7 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
} |
|
|
|
|
boolean loadWidgetSuccess = OnlineWidgetRepoPane.loadWidgets(); |
|
|
|
|
if (loadWidgetSuccess) { |
|
|
|
|
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "layout_recommend", ".frm"); |
|
|
|
|
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "download_theme", ".frm"); |
|
|
|
|
if (filePath == null) { |
|
|
|
|
GuideCreateUtils.showNoFileAuthAlert(); |
|
|
|
|
GuideManager.getInstance().getCurrentGuide().terminate(); |
|
|
|
@ -189,7 +189,7 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
if (onlineWidgetPackageBlock == null) { |
|
|
|
|
GuideManager.getInstance().getCurrentGuide().terminate(); |
|
|
|
|
} else { |
|
|
|
|
JScrollPane scrollPane = getParentScrollPane(onlineWidgetPackageBlock); |
|
|
|
|
JScrollPane scrollPane = GuideCreateUtils.getParentScrollPane(onlineWidgetPackageBlock); |
|
|
|
|
scrollPane.getVerticalScrollBar().setValue(onlineWidgetPackageBlock.getY()); |
|
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
|
@Override |
|
|
|
@ -207,24 +207,6 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static GuideScene createScene3() { |
|
|
|
|
DisplayScene scene = new DisplayScene(); |
|
|
|
|
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { |
|
|
|
|
@Override |
|
|
|
|
public boolean prepared() { |
|
|
|
|
scene.addTarget(onlineWidgetPackageBlock); |
|
|
|
|
JPopupMenu popupMenu = onlineWidgetPackageBlock.getRightClickPopupMenu(); |
|
|
|
|
Point location = getPopupMenuLocation(); |
|
|
|
|
scene.addCustomTarget( |
|
|
|
|
GuideCreateUtils.createTarget(popupMenu), |
|
|
|
|
GuideCreateUtils.getRelativeBounds(popupMenu, onlineWidgetPackageBlock, location.x, location.y) |
|
|
|
|
); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return scene; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static GuideScene createScene4() { |
|
|
|
|
ClickScene scene = new ClickScene(); |
|
|
|
|
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { |
|
|
|
|
@Override |
|
|
|
@ -260,7 +242,7 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
return scene; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static GuideScene createScene5() { |
|
|
|
|
private static GuideScene createScene4() { |
|
|
|
|
DisplayScene scene = new DisplayScene(); |
|
|
|
|
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { |
|
|
|
|
@Override |
|
|
|
@ -279,7 +261,7 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
return scene; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static GuideScene createScene6() { |
|
|
|
|
private static GuideScene createScene5() { |
|
|
|
|
ClickScene scene = new ClickScene(); |
|
|
|
|
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { |
|
|
|
|
@Override |
|
|
|
@ -305,7 +287,8 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
|
|
|
|
|
private static Point getPopupMenuLocation() { |
|
|
|
|
JPopupMenu popupMenu = onlineWidgetPackageBlock.getRightClickPopupMenu(); |
|
|
|
|
return new Point((onlineWidgetPackageBlock.getWidth() - popupMenu.getWidth()) / 2, (onlineWidgetPackageBlock.getHeight()- popupMenu.getHeight()) / 2); |
|
|
|
|
Dimension preferredSize = popupMenu.getPreferredSize(); |
|
|
|
|
return new Point((onlineWidgetPackageBlock.getWidth() - preferredSize.width) / 2, (onlineWidgetPackageBlock.getHeight()- preferredSize.height) / 2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void closeConfirmDialog() { |
|
|
|
@ -313,15 +296,4 @@ public class DownloadComponentPackageGuide {
|
|
|
|
|
themeConfirmDialog.dispose(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static JScrollPane getParentScrollPane(Component component) { |
|
|
|
|
if (component.getParent() == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
if (component.getParent() instanceof JScrollPane) { |
|
|
|
|
return (JScrollPane) component.getParent(); |
|
|
|
|
} |
|
|
|
|
return getParentScrollPane(component.getParent()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|