Browse Source

REPORT-57813 更新最新两个场景跑通测试用例

research/11.0
kuangshuai 3 years ago
parent
commit
a6d299d3a6
  1. 13
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java
  2. 5
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideBuilder.java
  3. 6
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideGroup.java
  4. 4
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideManager.java
  5. 4
      designer-base/src/main/java/com/fr/design/mainframe/guide/collect/GuideCollector.java
  6. 35
      designer-base/src/main/java/com/fr/design/mainframe/guide/scene/AbstractGuideScene.java
  7. 6
      designer-base/src/main/java/com/fr/design/mainframe/guide/scene/DisplayScene.java
  8. 17
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/BubbleHintDialog.java
  9. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java
  10. 23
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java
  11. 57
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java
  12. 14
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideSceneHelper.java
  13. 70
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java
  14. 66
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java
  15. 52
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java
  16. 11
      designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryPane.java

13
designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java

@ -15,6 +15,7 @@ public class Guide {
private String id; private String id;
private String name; private String name;
private String description; private String description;
private String completeMessage;
private GuideState state; private GuideState state;
private GuideView guideView; private GuideView guideView;
private GuideLifecycle lifecycle; private GuideLifecycle lifecycle;
@ -32,7 +33,7 @@ public class Guide {
this.state = GuideState.NONE; this.state = GuideState.NONE;
} }
public String getID() { public String getId() {
return id; return id;
} }
@ -59,6 +60,14 @@ public class Guide {
return name; return name;
} }
public String getCompleteMessage() {
return completeMessage;
}
public void setCompleteMessage(String completeMessage) {
this.completeMessage = completeMessage;
}
public GuideState getState() { public GuideState getState() {
return state; return state;
} }
@ -149,11 +158,11 @@ public class Guide {
} }
public void end() { public void end() {
GuideManager.getInstance().setCurrentGuide(null);
guideView.dismissGuide(); guideView.dismissGuide();
if (lifecycle != null) { if (lifecycle != null) {
lifecycle.onEnd(); lifecycle.onEnd();
} }
GuideManager.getInstance().setCurrentGuide(null);
GuideManageDialog.getInstance().showDialog(); GuideManageDialog.getInstance().showDialog();
} }

5
designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideBuilder.java

@ -30,6 +30,11 @@ public class GuideBuilder {
return this; return this;
} }
public GuideBuilder setCompleteMessage(String message) {
guide.setCompleteMessage(message);
return this;
}
public GuideBuilder addScene(GuideScene scene) { public GuideBuilder addScene(GuideScene scene) {
guide.setScene(scene); guide.setScene(scene);
return this; return this;

6
designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideGroup.java

@ -14,10 +14,14 @@ public class GuideGroup {
guideList = new ArrayList<>(); guideList = new ArrayList<>();
} }
public String getID() { public String getId() {
return id; return id;
} }
public void setId(String id) {
this.id = id;
}
public String getName() { public String getName() {
return name; return name;
} }

4
designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideManager.java

@ -75,7 +75,7 @@ public class GuideManager {
public GuideGroup getGuideGroup(String groupId) { public GuideGroup getGuideGroup(String groupId) {
for (GuideVersion version : guideVersionList) { for (GuideVersion version : guideVersionList) {
for (GuideGroup group : version.getGuideGroupList()) { for (GuideGroup group : version.getGuideGroupList()) {
if (StringUtils.equals(groupId, group.getID())) { if (StringUtils.equals(groupId, group.getId())) {
return group; return group;
} }
} }
@ -87,7 +87,7 @@ public class GuideManager {
for (GuideVersion version : guideVersionList) { for (GuideVersion version : guideVersionList) {
for (GuideGroup group : version.getGuideGroupList()) { for (GuideGroup group : version.getGuideGroupList()) {
for (Guide guide : group.getGuideList()) { for (Guide guide : group.getGuideList()) {
if (StringUtils.equals(guideId, guide.getID())) { if (StringUtils.equals(guideId, guide.getId())) {
return guide; return guide;
} }
} }

4
designer-base/src/main/java/com/fr/design/mainframe/guide/collect/GuideCollector.java

@ -55,7 +55,7 @@ public class GuideCollector implements XMLable {
public void load() { public void load() {
for(Guide cacheGuide : cacheGuides) { for(Guide cacheGuide : cacheGuides) {
Guide guide = GuideManager.getInstance().getGuide(cacheGuide.getID()); Guide guide = GuideManager.getInstance().getGuide(cacheGuide.getId());
if (guide != null) { if (guide != null) {
guide.setComplete(cacheGuide.isComplete()); guide.setComplete(cacheGuide.isComplete());
} }
@ -139,7 +139,7 @@ public class GuideCollector implements XMLable {
writer.attr("showHint", showHint); writer.attr("showHint", showHint);
for(Guide guide : GuideManager.getInstance().getAllGuide()) { for(Guide guide : GuideManager.getInstance().getAllGuide()) {
writer.startTAG(GUIDE_XML); writer.startTAG(GUIDE_XML);
writer.attr("id", guide.getID()); writer.attr("id", guide.getId());
writer.attr("isComplete", guide.isComplete()); writer.attr("isComplete", guide.isComplete());
writer.end(); writer.end();
} }

35
designer-base/src/main/java/com/fr/design/mainframe/guide/scene/AbstractGuideScene.java

@ -72,9 +72,10 @@ public abstract class AbstractGuideScene extends JPanel implements GuideScene {
if (component instanceof JComponent) { if (component instanceof JComponent) {
JComponent jComponent = (JComponent) component; JComponent jComponent = (JComponent) component;
image = ScreenImage.createImage(jComponent); image = ScreenImage.createImage(jComponent);
} else if (component instanceof Window) {
image = ScreenImage.createImage(component);
} else { } else {
image = captureImage(component); image = captureImage(component);
showContainer();
} }
targetList.add(component); targetList.add(component);
highlightList.add(getTargetComponentWithImage(image, rectangle)); highlightList.add(getTargetComponentWithImage(image, rectangle));
@ -279,49 +280,46 @@ public abstract class AbstractGuideScene extends JPanel implements GuideScene {
@Override @Override
public void start() { public void start() {
clear(); clear();
showContainer();
if (lifecycle != null && !lifecycle.prepared()) { if (lifecycle != null && !lifecycle.prepared()) {
return; return;
} }
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
showScene(); showScene();
} }
});
}
@Override @Override
public void showScene() { public void showScene() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (container != null) { if (container != null) {
container.setContentPane(this); container.setContentPane(AbstractGuideScene.this);
this.setBounds(0, 0 , getSceneWidth(), getSceneWidth()); setBounds(0, 0 , getSceneWidth(), getSceneWidth());
// show target // show target
for (int index = highlightList.size() - 1; index >= 0; index--) { for (int index = highlightList.size() - 1; index >= 0; index--) {
this.add(highlightList.get(index)); add(highlightList.get(index));
} }
// show next button // show next button
if (nextButton != null) { if (nextButton != null) {
nextButton.setBounds((getSceneWidth() - 60) / 2, getSceneHeight() - 100, 60, 30); nextButton.setBounds((getSceneWidth() - 60) / 2, getSceneHeight() - 100, 60, 30);
this.add(nextButton); add(nextButton);
} }
container.revalidate(); container.revalidate();
container.repaint(); container.repaint();
} }
showContainer();
if (lifecycle != null) { if (lifecycle != null) {
lifecycle.onShow(); lifecycle.onShow();
} }
} }
});
}
@Override @Override
public void complete() { public void complete() {
container.getLayeredPane().remove(this); container.getLayeredPane().remove(this);
container.repaint(); container.repaint();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (lifecycle != null) { if (lifecycle != null) {
lifecycle.onComplete(); lifecycle.onComplete();
} }
@ -332,13 +330,18 @@ public abstract class AbstractGuideScene extends JPanel implements GuideScene {
if (nextScene instanceof AbstractGuideScene) { if (nextScene instanceof AbstractGuideScene) {
((AbstractGuideScene) nextScene).setContainer(container); ((AbstractGuideScene) nextScene).setContainer(container);
} }
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
nextScene.start(); nextScene.start();
}
});
} else { } else {
GuideManager.getInstance().getCurrentGuide().complete(); GuideManager.getInstance().getCurrentGuide().complete();
} }
}
});
} }
@Override @Override

6
designer-base/src/main/java/com/fr/design/mainframe/guide/scene/DisplayScene.java

@ -6,6 +6,7 @@ import java.util.TimerTask;
public class DisplayScene extends AbstractGuideScene { public class DisplayScene extends AbstractGuideScene {
private long delay; private long delay;
private static final long DEFAULT_DELAY = 1000; private static final long DEFAULT_DELAY = 1000;
private static Timer displayTimer = new Timer();
public DisplayScene() { public DisplayScene() {
this(DEFAULT_DELAY); this(DEFAULT_DELAY);
@ -24,10 +25,13 @@ public class DisplayScene extends AbstractGuideScene {
public void showScene() { public void showScene() {
super.showScene(); super.showScene();
// 实例化Timer类 // 实例化Timer类
new Timer().schedule(new TimerTask() { displayTimer.schedule(new TimerTask() {
@Override
public void run() { public void run() {
complete(); complete();
displayTimer.purge();
} }
}, delay); }, delay);
} }
} }

17
designer-base/src/main/java/com/fr/design/mainframe/guide/ui/BubbleHintDialog.java

@ -1,9 +1,12 @@
package com.fr.design.mainframe.guide.ui; package com.fr.design.mainframe.guide.ui;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.guide.collect.GuideCollector; import com.fr.design.mainframe.guide.collect.GuideCollector;
import javax.swing.JDialog; import javax.swing.JDialog;
import java.awt.Color; import java.awt.Color;
import java.awt.Point;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -11,6 +14,15 @@ import java.awt.event.ActionListener;
public class BubbleHintDialog extends JDialog { public class BubbleHintDialog extends JDialog {
private static final int DIALOG_WIDTH = 220; private static final int DIALOG_WIDTH = 220;
private static final int DIALOG_HEIGHT = 140; private static final int DIALOG_HEIGHT = 140;
private static BubbleHintDialog dialog;
public static BubbleHintDialog getInstance(){
if (dialog == null) {
dialog = new BubbleHintDialog(DesignerContext.getDesignerFrame());
}
return dialog;
}
public BubbleHintDialog(Window parent) { public BubbleHintDialog(Window parent) {
super(parent); super(parent);
setUndecorated(true); setUndecorated(true);
@ -27,4 +39,9 @@ public class BubbleHintDialog extends JDialog {
}); });
this.setContentPane(bubbleHint); this.setContentPane(bubbleHint);
} }
public void showDialog(Point location) {
dialog.setLocation(location);
dialog.setVisible(true);
}
} }

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java

@ -40,7 +40,7 @@ import java.util.List;
* @Author: Yuan.Wang * @Author: Yuan.Wang
* @Date: 2020/11/5 * @Date: 2020/11/5
*/ */
class GroupPane extends JPanel { public class GroupPane extends JPanel {
private static final Icon downIcon = IOUtils.readIcon("/com/fr/base/images/share/arrow_down.png"); private static final Icon downIcon = IOUtils.readIcon("/com/fr/base/images/share/arrow_down.png");
private static final Icon rightIcon = IOUtils.readIcon("/com/fr/base/images/share/arrow_right.png"); private static final Icon rightIcon = IOUtils.readIcon("/com/fr/base/images/share/arrow_right.png");
private static final int DEFAULT_HEIGHT = 24; private static final int DEFAULT_HEIGHT = 24;

23
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java

@ -21,7 +21,7 @@ import java.io.InputStream;
public class InstallComponentHelper { public class InstallComponentHelper {
private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components"; private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components";
public static final String[] PRE_INSTALL_COMPONENTS = new String[]{ private static final String[] PRE_INSTALL_COMPONENTS = new String[]{
"单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu", "单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu",
"分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu", "分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu",
"红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu", "红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu",
@ -32,34 +32,21 @@ public class InstallComponentHelper {
public static void installPreComponent() { public static void installPreComponent() {
if (needPreInstallComponent()) { if (needPreInstallComponent()) {
for (String componentPath : PRE_INSTALL_COMPONENTS) { installShareComponents(PRE_INSTALL_PATH, PRE_INSTALL_COMPONENTS);
try {
InputStream inputStream = InstallComponentHelper.class.getResourceAsStream(StableUtils.pathJoin(PRE_INSTALL_PATH, componentPath));
byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream);
WorkContext.getWorkResource().write(StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), componentPath), data);
} catch (Exception e) {
FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e);
}
}
} }
} }
public static String[] installPreComponent(int count) { public static void installShareComponents(String resourcePath, String[] components) {
count = Math.max(Math.min(count, PRE_INSTALL_COMPONENTS.length), 0); for (String componentPath : components) {
String[] installNames = new String[count];
for (int index = 0; index < count; index ++) {
try { try {
String componentPath = PRE_INSTALL_COMPONENTS[index]; InputStream inputStream = InstallComponentHelper.class.getResourceAsStream(StableUtils.pathJoin(resourcePath, componentPath));
InputStream inputStream = InstallComponentHelper.class.getResourceAsStream(StableUtils.pathJoin(PRE_INSTALL_PATH, componentPath));
byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream); byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream);
WorkContext.getWorkResource().write(StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), componentPath), data); WorkContext.getWorkResource().write(StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), componentPath), data);
installNames[index] = componentPath;
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e); FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e);
} }
} }
return installNames;
} }
private static boolean needPreInstallComponent() { private static boolean needPreInstallComponent() {

57
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java

@ -21,15 +21,18 @@ import com.fr.workspace.WorkContext;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Component; import java.awt.Component;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.io.InputStream; import java.io.InputStream;
import java.util.Timer;
import java.util.UUID; import java.util.UUID;
public class GuideCreateUtils { public class GuideCreateUtils {
private static final String FILE_PREFIX = "Guide_";
public static Timer TIMER = new Timer();
public static FormDesigner getFormDesigner() { public static FormDesigner getFormDesigner() {
JForm jForm = (JForm) DesignerContext.getDesignerFrame().getSelectedJTemplate(); JForm jForm = (JForm) DesignerContext.getDesignerFrame().getSelectedJTemplate();
FormDesigner designer = jForm.getFormDesign(); FormDesigner designer = jForm.getFormDesign();
@ -39,9 +42,37 @@ public class GuideCreateUtils {
public static Rectangle getXCreatorBoundsRelative2FormDesigner(XCreator xCreator) { public static Rectangle getXCreatorBoundsRelative2FormDesigner(XCreator xCreator) {
FormDesigner designer = getFormDesigner(); FormDesigner designer = getFormDesigner();
Point point = SwingUtilities.convertPoint(xCreator, 0, 0, designer.getRootComponent()); Point point = SwingUtilities.convertPoint(xCreator, 0, 0, designer.getRootComponent());
Rectangle bounds = new Rectangle(point.x + designer.getPaintX() - designer.getHorizontalScaleValue(), point.y + designer.getPaintY(), xCreator.getWidth(), xCreator.getHeight());
bounds.intersection(new Rectangle(point.x, point.y, designer.getWidth(), designer.getHeight()));
return bounds;
}
public static Rectangle getXCreatorBoundsRelative2FormDesigner(String widgetName) {
FormDesigner designer = getFormDesigner();
XCreator xCreator = getXCreatorFormDesigner(widgetName);
if (xCreator == null) {
return new Rectangle(0,0,0,0);
}
Point point = SwingUtilities.convertPoint(getXCreatorFormDesigner(widgetName), 0, 0, designer.getRootComponent());
return new Rectangle(point.x + designer.getPaintX() - designer.getHorizontalScaleValue(), point.y + designer.getPaintY(), xCreator.getWidth(), xCreator.getHeight()); return new Rectangle(point.x + designer.getPaintX() - designer.getHorizontalScaleValue(), point.y + designer.getPaintY(), xCreator.getWidth(), xCreator.getHeight());
} }
public static Rectangle getXCreatorBoundsRelative2GuideView(String widgetName) {
XCreator xCreator = getXCreatorFormDesigner(widgetName);
Point designerLocationToGuideView = SwingUtilities.convertPoint(getFormDesigner(),0,0, GuideManager.getInstance().getCurrentGuide().getGuideView().getRootPane());
if (xCreator == null) {
return new Rectangle(designerLocationToGuideView.x, designerLocationToGuideView.y ,0,0);
}
Rectangle boundsRelative2Designer = getXCreatorBoundsRelative2FormDesigner(xCreator);
return new Rectangle(
designerLocationToGuideView.x + boundsRelative2Designer.x,
designerLocationToGuideView.y + boundsRelative2Designer.y,
boundsRelative2Designer.width,
boundsRelative2Designer.height
);
}
public static XCreator getXCreatorFormDesigner(String name) { public static XCreator getXCreatorFormDesigner(String name) {
FormDesigner designer = getFormDesigner(); FormDesigner designer = getFormDesigner();
XLayoutContainer rootComponent = designer.getRootComponent(); XLayoutContainer rootComponent = designer.getRootComponent();
@ -49,6 +80,13 @@ public class GuideCreateUtils {
} }
public static void selectXCreatorByWidgetName(String widgetName) {
FormDesigner designer = GuideCreateUtils.getFormDesigner();
XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName);
designer.getSelectionModel().reset();
designer.getSelectionModel().selectACreator(xCreator);
}
public static XCreator findXCreator(XLayoutContainer container, String name) { public static XCreator findXCreator(XLayoutContainer container, String name) {
if (StringUtils.equals(container.toData().getWidgetName(), name)) { if (StringUtils.equals(container.toData().getWidgetName(), name)) {
return container; return container;
@ -95,13 +133,18 @@ public class GuideCreateUtils {
return new UILabel(ic); return new UILabel(ic);
} }
public static Rectangle getPopupMenuBounds(JPopupMenu popupMenu, Component parent, int x, int y) { public static UILabel createTarget(JComponent component) {
ImageIcon ic = new ImageIcon(ScreenImage.createImage(component));
return new UILabel(ic);
}
public static Rectangle getRelativeBounds(JComponent component, Component parent, int x, int y) {
Point point = SwingUtilities.convertPoint(parent,0,0, GuideManager.getInstance().getCurrentGuide().getGuideView().getRootPane()); Point point = SwingUtilities.convertPoint(parent,0,0, GuideManager.getInstance().getCurrentGuide().getGuideView().getRootPane());
return new Rectangle(point.x + x, point.y + y, popupMenu.getWidth(), popupMenu.getHeight()); return new Rectangle(point.x + x, point.y + y, component.getWidth(), component.getHeight());
} }
public static String openGuideFile(String sourcePath, String fileName, String suffix) { public static String openGuideFile(String sourcePath, String fileName, String suffix) {
String fileWorkPath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, UUID.randomUUID().toString() + suffix); String fileWorkPath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, FILE_PREFIX + UUID.randomUUID().toString() + suffix);
InputStream inputStream = GuideCreateUtils.class.getResourceAsStream(StableUtils.pathJoin(sourcePath, fileName + suffix)); InputStream inputStream = GuideCreateUtils.class.getResourceAsStream(StableUtils.pathJoin(sourcePath, fileName + suffix));
byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream); byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream);
WorkContext.getWorkResource().write(fileWorkPath, data); WorkContext.getWorkResource().write(fileWorkPath, data);
@ -113,9 +156,11 @@ public class GuideCreateUtils {
WorkContext.getWorkResource().delete(filePath); WorkContext.getWorkResource().delete(filePath);
} }
public static void openDialogWithoutModal(JDialog dialog) { public static void showDialogWithoutModal(JDialog dialog) {
dialog.setModal(false); dialog.setModal(false);
dialog.setVisible(true); dialog.setVisible(true);
} }
} }

14
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideSceneHelper.java

@ -19,18 +19,6 @@ import com.fr.design.utils.ComponentUtils;
import java.awt.Window; import java.awt.Window;
public class GuideSceneHelper { public class GuideSceneHelper {
public static GuideScene createWindowDisplayScene(Window window) {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addTarget(window);
return true;
}
});
return scene;
}
public static GuideScene createFormDesignerBodyDisplayScene() { public static GuideScene createFormDesignerBodyDisplayScene() {
DisplayScene scene = new DisplayScene(); DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@ -63,7 +51,7 @@ public class GuideSceneHelper {
return scene; return scene;
} }
public static GuideScene createSelectXCretorClickScene(String widgetName) { public static GuideScene createSelectXCreatorClickScene(String widgetName) {
ClickScene scene = new ClickScene(); ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override

70
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java

@ -20,24 +20,32 @@ import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor; import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.GuideTip; import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import javax.swing.SwingUtilities;
import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
public class ChangeLayoutComponentGuide { public class ChangeLayoutComponentGuide {
private static final String TARGET_FROM_NAME = "chart0";
private static final String TARGET_TO_NAME = "chart1";
private static UIButton switchButton; private static UIButton switchButton;
private static String filePath; private static String filePath;
public static Guide createGuide() { public static Guide createGuide() {
GuideScene scene = createScene(); GuideScene scene = createScene();
scene.nextScene(createScene2()) scene.nextScene(createScene2())
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(createScene3()) .nextScene(createScene3())
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(createScene4()) .nextScene(createScene4())
.nextScene(createScene5())
.nextScene(GuideSceneHelper.createPreviewClickScene()); .nextScene(GuideSceneHelper.createPreviewClickScene());
Guide guide = GuideBuilder.newInstance() Guide guide = GuideBuilder.newInstance()
.setID(GuideIds.Guide.F001002) .setID(GuideIds.Guide.F001002)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Name")) .setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Description")) .setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Description"))
.setCompleteMessage(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002Gui_Complete_Message"))
.addScene(scene) .addScene(scene)
.registerLifecycle(new GuideLifecycleAdaptor() { .registerLifecycle(new GuideLifecycleAdaptor() {
@Override @Override
@ -71,31 +79,65 @@ public class ChangeLayoutComponentGuide {
} }
private static GuideScene createScene2() { private static GuideScene createScene2() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addCustomTarget(
GuideCreateUtils.createTarget(switchButton.getComponentPopupMenu()),
GuideCreateUtils.getRelativeBounds(switchButton.getComponentPopupMenu(), switchButton,0, -switchButton.getComponentPopupMenu().getHeight())
);
return true;
}
});
return scene;
}
private static GuideScene createScene3() {
ClickScene scene = new ClickScene(); ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
switchButton.getComponentPopupMenu().setVisible(true);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
scene.addCustomTarget( scene.addCustomTarget(
GuideCreateUtils.createModalTarget(switchButton.getComponentPopupMenu()), GuideCreateUtils.createModalTarget(switchButton.getComponentPopupMenu()),
GuideCreateUtils.getPopupMenuBounds(switchButton.getComponentPopupMenu(), switchButton,0, -switchButton.getComponentPopupMenu().getHeight()) GuideCreateUtils.getRelativeBounds(switchButton.getComponentPopupMenu(), switchButton,0, -switchButton.getComponentPopupMenu().getHeight())
); );
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Tip_Select_Fix_layout"), null, GuideTip.Direction.RIGHT, 0.5f, 0.8f);
scene.addClickTarget(switchButton.getComponentPopupMenu().getComponent(1), ClickScene.ClickType.LEFT, true); scene.addClickTarget(switchButton.getComponentPopupMenu().getComponent(1), ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Tip_Select_Fix_layout"), null, GuideTip.Direction.RIGHT, 0.5f, 0.8f);
switchButton.getComponentPopupMenu().setVisible(false); switchButton.getComponentPopupMenu().setVisible(false);
return true; scene.showScene();
}
});
return false;
} }
}); });
return scene; return scene;
} }
private static GuideScene createScene3() { private static GuideScene createScene4() {
DragScene scene = new DragScene(); DragScene scene = new DragScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getXCreatorFormDesigner("absolute0")), DragScene.DragType.FROM); scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(TARGET_FROM_NAME), DragScene.DragType.FROM);
scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getXCreatorFormDesigner("absolute1")), DragScene.DragType.TO); scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(TARGET_TO_NAME), DragScene.DragType.TO);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Tip_Drag"), GuideTip.Direction.TOP);
Rectangle fromBounds = GuideCreateUtils.getXCreatorBoundsRelative2GuideView(TARGET_FROM_NAME);
Rectangle toBounds = GuideCreateUtils.getXCreatorBoundsRelative2GuideView(TARGET_TO_NAME);
Point lineArrowPoint1 = new Point(fromBounds.x + fromBounds.width / 2, fromBounds.y - 5);
Point lineArrowPoint2 = new Point(fromBounds.x + fromBounds.width / 2, fromBounds.y - 25);
Point lineArrowPoint3 = new Point(toBounds.x + toBounds.width / 2, toBounds.y - 25);
Point lineArrowPoint4 = new Point(toBounds.x + toBounds.width / 2, toBounds.y - 5);
scene.addLineArrow(lineArrowPoint1, lineArrowPoint2, lineArrowPoint3, lineArrowPoint4);
Point bubbleAnchor = new Point((lineArrowPoint2.x + lineArrowPoint3.x) / 2, lineArrowPoint2.y);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Tip_Drag"), null, GuideTip.Direction.TOP, bubbleAnchor, 0.5f);
return super.prepared(); return super.prepared();
} }
@ -103,8 +145,8 @@ public class ChangeLayoutComponentGuide {
public void onComplete() { public void onComplete() {
FormDesigner formDesigner = GuideCreateUtils.getFormDesigner(); FormDesigner formDesigner = GuideCreateUtils.getFormDesigner();
XCreator from = GuideCreateUtils.getXCreatorFormDesigner("absolute0"); XCreator from = GuideCreateUtils.getXCreatorFormDesigner(TARGET_FROM_NAME);
XLayoutContainer to = (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("absolute1"); XLayoutContainer to = (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner(TARGET_TO_NAME);
formDesigner.getSelectionModel().removeCreator(from, from.getWidth(), from.getHeight()); formDesigner.getSelectionModel().removeCreator(from, from.getWidth(), from.getHeight());
formDesigner.getSelectionModel().removeCreator(to, to.getWidth(),to.getHeight()); formDesigner.getSelectionModel().removeCreator(to, to.getWidth(),to.getHeight());
@ -116,15 +158,13 @@ public class ChangeLayoutComponentGuide {
return scene; return scene;
} }
private static GuideScene createScene4() { private static GuideScene createScene5() {
DisplayScene scene = new DisplayScene(); DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
Rectangle rootBounds = GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getFormDesigner().getRootComponent()); scene.addTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(TARGET_FROM_NAME));
Rectangle bound3 = GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getXCreatorFormDesigner("absolute2")); scene.addTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(TARGET_TO_NAME));
Rectangle targetBounds = new Rectangle(rootBounds.x, rootBounds.y, rootBounds.width, bound3.y - rootBounds.y);
scene.addTarget(GuideCreateUtils.getFormDesigner(), targetBounds);
return true; return true;
} }
}); });

66
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java

@ -30,15 +30,22 @@ import com.fr.design.widget.ui.designer.PredefinedLayoutPane;
import com.fr.form.share.Group; import com.fr.form.share.Group;
import com.fr.form.share.group.DefaultShareGroup; import com.fr.form.share.group.DefaultShareGroup;
import com.fr.form.share.group.DefaultShareGroupManager; import com.fr.form.share.group.DefaultShareGroupManager;
import com.fr.stable.StringUtils;
import java.awt.Component; import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.TimerTask;
public class UseLayoutAndComponentGuide { public class UseLayoutAndComponentGuide {
private static final String[] PRE_INSTALL_COMPONENTS = {
"大屏标题-酷炫蓝.25fcd194-d4db-406f-8a08-210f3c262870.reu",
"散点闪烁地图-酷炫蓝.5e17c2eb-5b18-4b6c-854a-5ffff7f6337a.reu",
"排名明细表.b4dab4f2-7b1a-4540-a2d4-65c3e080334e.reu"
};
private static final String RESOURCE_PATH = "/com/fr/report/guide/component";
private static UIHeadMenu fileHeadMenu; private static UIHeadMenu fileHeadMenu;
private static NewFormPane newFormPane; private static NewFormPane newFormPane;
private static int autoInstallComponentCount;
private static String[] autoInstallComponentNames;
public static Guide createGuide() { public static Guide createGuide() {
GuideScene scene = createScene(); GuideScene scene = createScene();
@ -46,9 +53,9 @@ public class UseLayoutAndComponentGuide {
.nextScene(createScene3()) .nextScene(createScene3())
.nextScene(createScene4()) .nextScene(createScene4())
.nextScene(createScene5()) .nextScene(createScene5())
.nextScene(createScene6("box0",0)) .nextScene(createScene6("box0","25fcd194-d4db-406f-8a08-210f3c262870"))
.nextScene(createScene6("box1",1)) .nextScene(createScene6("box1","5e17c2eb-5b18-4b6c-854a-5ffff7f6337a"))
.nextScene(createScene6("box2",2)) .nextScene(createScene6("box2","b4dab4f2-7b1a-4540-a2d4-65c3e080334e"))
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene()) .nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(GuideSceneHelper.createPreviewClickScene()); .nextScene(GuideSceneHelper.createPreviewClickScene());
@ -57,6 +64,7 @@ public class UseLayoutAndComponentGuide {
.setID(GuideIds.Guide.F001001) .setID(GuideIds.Guide.F001001)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Name")) .setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Description")) .setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Description"))
.setCompleteMessage(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Complete_Message"))
.addScene(scene) .addScene(scene)
.registerLifecycle(new GuideLifecycleAdaptor() { .registerLifecycle(new GuideLifecycleAdaptor() {
@Override @Override
@ -101,8 +109,7 @@ public class UseLayoutAndComponentGuide {
fileHeadMenu.getPopupMenu().setVisible(false); fileHeadMenu.getPopupMenu().setVisible(false);
newFormPane = new NewFormPane(); newFormPane = new NewFormPane();
newFormPane.getWindow().setModal(false); GuideCreateUtils.showDialogWithoutModal(newFormPane.getWindow());
newFormPane.showWindow();
} }
}); });
return scene; return scene;
@ -113,8 +120,16 @@ public class UseLayoutAndComponentGuide {
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
GuideCreateUtils.TIMER.schedule(new TimerTask() {
@Override
public void run() {
scene.addTarget(newFormPane.getWindow()); scene.addTarget(newFormPane.getWindow());
return true; scene.showScene();
GuideCreateUtils.TIMER.purge();
}
}, 300);
scene.addTarget(newFormPane.getWindow());
return false;
} }
}); });
return scene; return scene;
@ -175,20 +190,20 @@ public class UseLayoutAndComponentGuide {
return scene; return scene;
} }
public static GuideScene createScene6(String name, int blockIndex) { public static GuideScene createScene6(String name, String shareID) {
DragScene scene = new DragScene(); DragScene scene = new DragScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(getXOccupiedLayout(name)), DragScene.DragType.TO); scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(getXOccupiedLayout(name)), DragScene.DragType.TO);
scene.addDragTarget(getLocalWidgetBlock(blockIndex), DragScene.DragType.FROM); scene.addDragTarget(getLocalWidgetBlock(shareID), DragScene.DragType.FROM);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Tip_Drag"), GuideTip.Direction.LEFT); scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Tip_Drag"), GuideTip.Direction.LEFT);
return super.prepared(); return super.prepared();
} }
@Override @Override
public void onComplete() { public void onComplete() {
LocalWidgetBlock block = getLocalWidgetBlock(blockIndex); LocalWidgetBlock block = getLocalWidgetBlock(shareID);
XCreator xCreator = block.transformXCreator(block); XCreator xCreator = block.transformXCreator(block);
XOccupiedLayout xOccupiedLayout = getXOccupiedLayout(name); XOccupiedLayout xOccupiedLayout = getXOccupiedLayout(name);
GuideCreateUtils.addXCreatorToXLayoutContainer(xCreator, xOccupiedLayout, false); GuideCreateUtils.addXCreatorToXLayoutContainer(xCreator, xOccupiedLayout, false);
@ -201,25 +216,22 @@ public class UseLayoutAndComponentGuide {
return (XOccupiedLayout) GuideCreateUtils.getXCreatorFormDesigner(name); return (XOccupiedLayout) GuideCreateUtils.getXCreatorFormDesigner(name);
} }
private static LocalWidgetBlock getLocalWidgetBlock(int index) { private static LocalWidgetBlock getLocalWidgetBlock(String id) {
return (LocalWidgetBlock) ComponentUtils.findComponentsByClass(LocalWidgetRepoPane.getInstance(), LocalWidgetBlock.class).get(index); List<Component> widgetBlockList = ComponentUtils.findComponentsByClass(LocalWidgetRepoPane.getInstance(), LocalWidgetBlock.class);
for (Component component : widgetBlockList) {
LocalWidgetBlock localWidgetBlock = (LocalWidgetBlock) component;
if (StringUtils.equals(localWidgetBlock.getBindInfo().getId(), id)) {
return localWidgetBlock;
}
}
return null;
} }
private static void preloadShareComponent() { private static void preloadShareComponent() {
autoInstallComponentCount = 3;
try { try {
DefaultShareGroupManager.getInstance().refresh(); InstallComponentHelper.installShareComponents(RESOURCE_PATH, PRE_INSTALL_COMPONENTS);
Group shareGroup = DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME);
if (shareGroup != null) {
DefaultShareGroup defaultShareGroup = (DefaultShareGroup) shareGroup;
int currentWidgetCount = defaultShareGroup.getAllBindInfoList().length;
autoInstallComponentCount = autoInstallComponentCount - (Math.min(autoInstallComponentCount, currentWidgetCount));
}
if (autoInstallComponentCount > 0) {
autoInstallComponentNames = InstallComponentHelper.installPreComponent(autoInstallComponentCount);
DefaultShareGroupManager.getInstance().refresh(); DefaultShareGroupManager.getInstance().refresh();
LocalWidgetRepoPane.getInstance().refreshAllGroupPane(); LocalWidgetRepoPane.getInstance().refreshAllGroupPane();
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -227,15 +239,13 @@ public class UseLayoutAndComponentGuide {
static private void removeAutoInstalledComponent() { static private void removeAutoInstalledComponent() {
Group shareGroup = DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME); Group shareGroup = DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME);
if (shareGroup != null && autoInstallComponentNames != null) { if (shareGroup != null) {
DefaultShareGroup defaultShareGroup = (DefaultShareGroup) shareGroup; DefaultShareGroup defaultShareGroup = (DefaultShareGroup) shareGroup;
List<String> installedList = new ArrayList<>(); List<String> installedList = new ArrayList<>();
for (String componentName : autoInstallComponentNames) { for (String componentName : PRE_INSTALL_COMPONENTS) {
if (componentName != null) {
String uuid = componentName.split("\\.")[1]; String uuid = componentName.split("\\.")[1];
installedList.add(uuid); installedList.add(uuid);
} }
}
defaultShareGroup.unInstallSelect(installedList); defaultShareGroup.unInstallSelect(installedList);
LocalWidgetRepoPane.getInstance().refreshAllGroupPane(); LocalWidgetRepoPane.getInstance().refreshAllGroupPane();
} }

52
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.guide.creator.theme;
import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormTheme;
import com.fr.base.theme.FormThemeConfig; import com.fr.base.theme.FormThemeConfig;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.style.FollowingThemePane; import com.fr.design.gui.style.FollowingThemePane;
@ -12,13 +11,10 @@ import com.fr.design.mainframe.CenterRegionContainerPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.guide.GuideIds; import com.fr.design.mainframe.guide.GuideIds;
import com.fr.design.mainframe.guide.base.Guide; import com.fr.design.mainframe.guide.base.Guide;
import com.fr.design.mainframe.guide.base.GuideBuilder; import com.fr.design.mainframe.guide.base.GuideBuilder;
import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor; import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor;
import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.creator.GuideCreateUtils; import com.fr.design.mainframe.guide.creator.GuideCreateUtils;
import com.fr.design.mainframe.guide.creator.GuideSceneHelper; import com.fr.design.mainframe.guide.creator.GuideSceneHelper;
import com.fr.design.mainframe.guide.scene.ClickScene; import com.fr.design.mainframe.guide.scene.ClickScene;
@ -30,11 +26,6 @@ import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.mainframe.theme.TemplateThemeBlock; import com.fr.design.mainframe.theme.TemplateThemeBlock;
import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import com.teamdev.jxbrowser.internal.ui.ToolkitKey;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Component; import java.awt.Component;
@ -45,6 +36,7 @@ import java.util.TimerTask;
public class ThemeToggleGuide { public class ThemeToggleGuide {
private static TemplateThemeUsingDialog<FormTheme> themeDialog; private static TemplateThemeUsingDialog<FormTheme> themeDialog;
private static String TARGET_XCREATOR_NAME = "chart00";
private static String filePath; private static String filePath;
public static Guide createGuide() { public static Guide createGuide() {
@ -54,7 +46,7 @@ public class ThemeToggleGuide {
.nextScene(createScene3()) .nextScene(createScene3())
.nextScene(createScene4()) .nextScene(createScene4())
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene()) .nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(GuideSceneHelper.createSelectXCretorClickScene("chart00")) .nextScene(GuideSceneHelper.createSelectXCreatorClickScene(TARGET_XCREATOR_NAME))
.nextScene(createScene5()) .nextScene(createScene5())
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene()) .nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(GuideSceneHelper.createPreviewClickScene()); .nextScene(GuideSceneHelper.createPreviewClickScene());
@ -63,6 +55,7 @@ public class ThemeToggleGuide {
.setID(GuideIds.Guide.F002001) .setID(GuideIds.Guide.F002001)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Name")) .setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Description")) .setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Description"))
.setCompleteMessage(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Complete_Message"))
.addScene(scene1) .addScene(scene1)
.registerLifecycle(new GuideLifecycleAdaptor() { .registerLifecycle(new GuideLifecycleAdaptor() {
@Override @Override
@ -73,6 +66,7 @@ public class ThemeToggleGuide {
@Override @Override
public void onEnd() { public void onEnd() {
closeTemplateThemeUsingDialog();
GuideCreateUtils.deleteGuideFile(filePath); GuideCreateUtils.deleteGuideFile(filePath);
} }
}) })
@ -107,19 +101,15 @@ public class ThemeToggleGuide {
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
new Timer().schedule(new TimerTask() { GuideCreateUtils.TIMER.schedule(new TimerTask() {
@Override @Override
public void run() { public void run() {
scene.addTarget(themeDialog); scene.addTarget(themeDialog);
scene.showScene(); scene.showScene();
GuideCreateUtils.TIMER.purge();
} }
},100); },300);
return true; return false;
}
@Override
public void onComplete() {
} }
}); });
@ -139,10 +129,6 @@ public class ThemeToggleGuide {
} }
return true; return true;
} }
@Override
public void onComplete() {
}
}); });
return scene; return scene;
} }
@ -156,6 +142,11 @@ public class ThemeToggleGuide {
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Click_Confirm"), BubbleTip.Direction.TOP); scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Click_Confirm"), BubbleTip.Direction.TOP);
return true; return true;
} }
@Override
public void onComplete() {
GuideCreateUtils.selectXCreatorByWidgetName(TARGET_XCREATOR_NAME);
}
}); });
return scene; return scene;
} }
@ -166,7 +157,7 @@ public class ThemeToggleGuide {
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
new Timer().schedule(new TimerTask() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
public void run() { public void run() {
Component target2 = ComponentUtils.findComponentByClass(EastRegionContainerPane.getInstance(), FollowingThemePane.class); Component target2 = ComponentUtils.findComponentByClass(EastRegionContainerPane.getInstance(), FollowingThemePane.class);
@ -182,10 +173,10 @@ public class ThemeToggleGuide {
0.5f, 0.5f,
0.8f 0.8f
); );
scene.showScene();
} }
scene.showScene();
} }
},1000); });
return false; return false;
} }
@ -204,7 +195,14 @@ public class ThemeToggleGuide {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
themeDialog = new TemplateThemeUsingDialog<>(designerFrame, DesignerContext.getDesignerFrame().getSelectedJTemplate(), FormThemeConfig.getInstance()); themeDialog = new TemplateThemeUsingDialog<>(designerFrame, DesignerContext.getDesignerFrame().getSelectedJTemplate(), FormThemeConfig.getInstance());
} }
themeDialog.setModal(false); GuideCreateUtils.showDialogWithoutModal(themeDialog);
themeDialog.setVisible(true); }
private static void closeTemplateThemeUsingDialog() {
if (themeDialog != null) {
themeDialog.setVisible(false);
themeDialog.dispose();
themeDialog = null;
}
} }
} }

11
designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryPane.java

@ -55,13 +55,10 @@ public class GuideEntryPane extends BasicPane {
@Override @Override
public void ancestorAdded(AncestorEvent event) { public void ancestorAdded(AncestorEvent event) {
if (!GuideCollector.getInstance().isShowHint()) { if (!GuideCollector.getInstance().isShowHint()) {
BubbleHintDialog dialog = new BubbleHintDialog(DesignerContext.getDesignerFrame()); BubbleHintDialog dialog = BubbleHintDialog.getInstance();
Point point = new Point(0,0); Point point = getLocationOnScreen();
SwingUtilities.convertPointToScreen(point, GuideEntryPane.this); Dimension size = getSize();
Dimension size = GuideEntryPane.this.getSize(); dialog.showDialog(new Point(point.x - 187,point.y + size.height));
dialog.setLocationRelativeTo(GuideEntryPane.this);
dialog.setLocation(point.x - 187,point.y + size.height);
dialog.setVisible(true);
} }
} }

Loading…
Cancel
Save