Browse Source

Pull request #6180: REPORT-60513 REPORT-60484 REPORT-60485 REPORT-60693 REPORT-60492 REPORT-60477 bug fixed

Merge in DESIGN/design from ~TOMMY/design:feature/x to feature/x

* commit 'b10a645f2f5e3a051b9d08c943b203bca94fedeb':
  REPORT-60489 主题面板引导长按滑动时候会有异常
  REPORT-60477 完成弹窗的按钮有重影,使用UIButton实现
  REPORT-60492 && REPORT-60480 解决window上不显示和错位问题
  REPORT-60693 开启引导的时候设计器窗口最大化
  REPORT-60485 解决引导页中模板保存点取消也显示完成弹窗
  REPORT-60484 解决切换工作目录会多次注册问题
  REPORT-60513 功能入口提示增加遮罩
research/11.0
Tommy 3 years ago
parent
commit
fd6718a53d
  1. 16
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/Guide.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideManager.java
  3. 57
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java
  4. 5
      designer-base/src/main/java/com/fr/design/mainframe/guide/scene/AbstractGuideScene.java
  5. 17
      designer-base/src/main/java/com/fr/design/mainframe/guide/scene/ClickScene.java
  6. 7
      designer-base/src/main/java/com/fr/design/mainframe/guide/scene/GuideSceneLifecycle.java
  7. 4
      designer-base/src/main/java/com/fr/design/mainframe/guide/scene/GuideSceneLifecycleAdaptor.java
  8. 47
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/BubbleHintDialog.java
  9. 31
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java
  10. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java
  11. 1
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeGridPagesDialog.java
  12. 1
      designer-realize/src/main/java/com/fr/design/mainframe/guide/GuideRegister.java
  13. 31
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideSceneHelper.java
  14. 3
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java
  15. 9
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java
  16. 9
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java
  17. 15
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java
  18. 63
      designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java
  19. 7
      designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryPane.java

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

@ -1,23 +1,21 @@
package com.fr.design.mainframe.guide.base; package com.fr.design.mainframe.guide.base;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.guide.collect.GuideCollector; import com.fr.design.mainframe.guide.collect.GuideCollector;
import com.fr.design.mainframe.guide.scene.GuideScene; import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.ui.GuideCompleteDialog; import com.fr.design.mainframe.guide.ui.GuideCompleteDialog;
import com.fr.design.mainframe.guide.ui.GuideManageDialog; import com.fr.design.mainframe.guide.ui.GuideManageDialog;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JFrame;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
public class Guide { public class Guide {
public enum GuideState {
NONE, DONE
}
private String id; private String id;
private String name; private String name;
private String description; private String description;
private String completeMessage; private String completeMessage;
private GuideState state;
private GuideView guideView; private GuideView guideView;
private GuideLifecycle lifecycle; private GuideLifecycle lifecycle;
private boolean isComplete; private boolean isComplete;
@ -31,7 +29,6 @@ public class Guide {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.description = description; this.description = description;
this.state = GuideState.NONE;
} }
public String getId() { public String getId() {
@ -69,14 +66,6 @@ public class Guide {
this.completeMessage = completeMessage; this.completeMessage = completeMessage;
} }
public GuideState getState() {
return state;
}
public void setState(GuideState state) {
this.state = state;
}
public void setGuideView(GuideView guideView) { public void setGuideView(GuideView guideView) {
this.guideView = guideView; this.guideView = guideView;
} }
@ -105,6 +94,7 @@ public class Guide {
* 开启引导流程 * 开启引导流程
*/ */
public void go() { public void go() {
DesignerContext.getDesignerFrame().setExtendedState(JFrame.MAXIMIZED_BOTH);
// 同时只能启动一个引导 // 同时只能启动一个引导
if (GuideManager.getInstance().getCurrentGuide() != null) { if (GuideManager.getInstance().getCurrentGuide() != null) {
return; return;

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

@ -106,4 +106,8 @@ public class GuideManager {
} }
GuideCollector.getInstance().saveInfo(); GuideCollector.getInstance().saveInfo();
} }
public void clearAll() {
guideVersionList.clear();
}
} }

57
designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java

@ -5,17 +5,15 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.guide.scene.AbstractGuideScene; import com.fr.design.mainframe.guide.scene.AbstractGuideScene;
import com.fr.design.mainframe.guide.scene.GuideScene; import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.ui.GuideLoadingGlassPane; import com.fr.design.mainframe.guide.ui.GuideLoadingGlassPane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Color; import java.awt.Color;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ComponentAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
public class GuideView extends JDialog { public class GuideView extends JDialog {
private static GuideView guideView; private static GuideView guideView;
@ -43,32 +41,19 @@ public class GuideView extends JDialog {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
setBg(); setBg();
this.setGlassPane(new GuideLoadingGlassPane()); this.setGlassPane(new GuideLoadingGlassPane());
} DesignerContext.getDesignerFrame().addWindowListener(new WindowAdapter() {
private WindowFocusListener windowFocusListener = new WindowFocusListener() {
@Override
public void windowGainedFocus(WindowEvent e) {
requestFocus();
setLocationRelativeTo(window);
}
@Override
public void windowLostFocus(WindowEvent e) {
}
};
private ComponentListener componentListener = new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
setLocationRelativeTo(window);
}
@Override @Override
public void componentMoved(ComponentEvent e) { public void windowDeiconified(WindowEvent e) {
setLocation(window.getLocation()); if (isVisible()) {
} updateGuideViewLocation();
}; // window 带透明的dialog在窗口最小化后再打开会不渲染,这边试了下重新设置visible可行
setVisible(false);
setVisible(true);
}
}
});
}
public GuideView(Window window, Guide guide) { public GuideView(Window window, Guide guide) {
this(window); this(window);
@ -98,11 +83,7 @@ public class GuideView extends JDialog {
} }
public void showGuide() { public void showGuide() {
window.addComponentListener(componentListener); updateGuideViewLocation();
window.addWindowFocusListener(windowFocusListener);
this.setLocationRelativeTo(window);
this.setSize(window.getSize());
this.setLocation(window.getLocation());
this.setVisible(true); this.setVisible(true);
if (scene != null) { if (scene != null) {
scene.start(); scene.start();
@ -112,8 +93,6 @@ public class GuideView extends JDialog {
} }
public void dismissGuide() { public void dismissGuide() {
window.removeComponentListener(componentListener);
window.removeWindowFocusListener(windowFocusListener);
this.getLayeredPane().removeAll(); this.getLayeredPane().removeAll();
revalidate(); revalidate();
repaint(); repaint();
@ -127,6 +106,7 @@ public class GuideView extends JDialog {
} }
public void showLoading() { public void showLoading() {
updateGuideViewLocation();
this.setVisible(true); this.setVisible(true);
this.getGlassPane().setVisible(true); this.getGlassPane().setVisible(true);
} }
@ -141,4 +121,9 @@ public class GuideView extends JDialog {
} }
}); });
} }
private void updateGuideViewLocation() {
GUICoreUtils.centerWindow(window, this);
this.setSize(getSize());
}
} }

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

@ -321,8 +321,9 @@ public abstract class AbstractGuideScene extends JPanel implements GuideScene {
public void complete() { public void complete() {
container.getLayeredPane().remove(this); container.getLayeredPane().remove(this);
container.repaint(); container.repaint();
if (lifecycle != null) {
lifecycle.onComplete(); if (lifecycle != null && !lifecycle.onComplete()) {
return;
} }
if (sceneFilter != null) { if (sceneFilter != null) {
nextScene = sceneFilter.getFilterScene(); nextScene = sceneFilter.getFilterScene();

17
designer-base/src/main/java/com/fr/design/mainframe/guide/scene/ClickScene.java

@ -88,6 +88,20 @@ public class ClickScene extends AbstractGuideScene{
redispatchMouseEvent(e, target); redispatchMouseEvent(e, target);
} }
} }
@Override
public void mouseEntered(MouseEvent e) {
if (isDispatch) {
redispatchMouseEvent(e, target);
}
}
@Override
public void mouseExited(MouseEvent e) {
if (isDispatch) {
redispatchMouseEvent(e, target);
}
}
}); });
} }
@ -99,10 +113,11 @@ public class ClickScene extends AbstractGuideScene{
@Override @Override
public void showScene() { public void showScene() {
super.showScene();
// 交互类的 scene 如果没有高亮内容块载,需要及时终止Guide,否则就没法去掉模态框影响到设计器主功能的使用了 // 交互类的 scene 如果没有高亮内容块载,需要及时终止Guide,否则就没法去掉模态框影响到设计器主功能的使用了
if (this.getComponentCount() == 0) { if (this.getComponentCount() == 0) {
GuideManager.getInstance().getCurrentGuide().terminate(); GuideManager.getInstance().getCurrentGuide().terminate();
} else {
super.showScene();
} }
} }
} }

7
designer-base/src/main/java/com/fr/design/mainframe/guide/scene/GuideSceneLifecycle.java

@ -4,7 +4,7 @@ public interface GuideSceneLifecycle {
/** /**
* 引导场景准备工作 * 引导场景准备工作
* scene 添加 target 应该在这个阶段处理 * scene 添加 target 应该在这个阶段处理
* @return * @return 返回true自动执行scene, 返回false需要手动触发
*/ */
boolean prepared(); boolean prepared();
@ -14,7 +14,8 @@ public interface GuideSceneLifecycle {
void onShow(); void onShow();
/** /**
* scene 完成后 * scene 交互完成后处理
* @return 返回true自动进入下一个scene返回false需要手动触发
*/ */
void onComplete(); boolean onComplete();
} }

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

@ -12,7 +12,7 @@ public abstract class GuideSceneLifecycleAdaptor implements GuideSceneLifecycle
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
return true;
} }
} }

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

@ -1,47 +0,0 @@
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 javax.swing.JDialog;
import java.awt.Color;
import java.awt.Point;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class BubbleHintDialog extends JDialog {
private static final int DIALOG_WIDTH = 220;
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) {
super(parent);
setUndecorated(true);
this.setBackground(new Color(0,0,0,0));
setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
BubbleHint bubbleHint = new BubbleHint();
bubbleHint.addConfirmAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
dispose();
GuideCollector.getInstance().setShowHint(true);
}
});
this.setContentPane(bubbleHint);
}
public void showDialog(Point location) {
dialog.setLocation(location);
dialog.setVisible(true);
}
}

31
designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java

@ -1,15 +1,17 @@
package com.fr.design.mainframe.guide.ui; package com.fr.design.mainframe.guide.ui;
import com.fr.design.gui.frpane.UITextPane; import com.fr.design.gui.frpane.UITextPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -20,6 +22,7 @@ import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics2D;
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;
@ -83,13 +86,15 @@ public class GuideCompleteDialog extends JDialog {
buttonContainer.setPreferredSize(new Dimension(190,38)); buttonContainer.setPreferredSize(new Dimension(190,38));
buttonContainer.setOpaque(false); buttonContainer.setOpaque(false);
JButton button = new JButton(Toolkit.i18nText("Fine-Design_Guide_Complete_End")); UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Guide_Complete_End")){
button.setPreferredSize(new Dimension(122, 38)); @Override
button.setBackground(BUTTON_BG_COLOR); public Dimension getPreferredSize() {
return new Dimension(122, 38);
}
};
button.setUI(confirmButtonUI);
button.setRoundBorder(true);
button.setForeground(Color.WHITE); button.setForeground(Color.WHITE);
button.setBorder(null);
button.setContentAreaFilled(false);
button.setOpaque(true);
button.addActionListener(new ActionListener() { button.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -114,4 +119,16 @@ public class GuideCompleteDialog extends JDialog {
repaint(); repaint();
this.setVisible(true); this.setVisible(true);
} }
private UIButtonUI confirmButtonUI = new UIButtonUI() {
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), BUTTON_BG_COLOR);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), BUTTON_BG_COLOR);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), BUTTON_BG_COLOR);
}
}
};
} }

2
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java

@ -51,6 +51,7 @@ import java.util.Set;
* Created by Starryi on 2021/10/9 * Created by Starryi on 2021/10/9
*/ */
public class TemplateThemeGridPagesPane extends JPanel { public class TemplateThemeGridPagesPane extends JPanel {
public static final String COMPLETE_BUTTON = "theme_button_complete";
private BreadcrumbBar breadcrumbBar; private BreadcrumbBar breadcrumbBar;
private JPanel contentPane; private JPanel contentPane;
private CardLayout cardLayout; private CardLayout cardLayout;
@ -176,6 +177,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
private UIButton createCompleteButton() { private UIButton createCompleteButton() {
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Complete")); UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Complete"));
button.setName(COMPLETE_BUTTON);
button.addActionListener(new ActionListener() { button.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

1
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeGridPagesDialog.java

@ -16,7 +16,6 @@ import javax.swing.JPanel;
* Created by Starryi on 2021/8/13 * Created by Starryi on 2021/8/13
*/ */
public class TemplateThemeGridPagesDialog extends TemplateThemeDialog implements TemplateThemeGridPagesPane.PageChangeListener { public class TemplateThemeGridPagesDialog extends TemplateThemeDialog implements TemplateThemeGridPagesPane.PageChangeListener {
public static final String COMPLETE_BUTTON = "theme_button_complete";
public static final int CONTENT_WIDTH = TemplateThemeGridPane.CONTENT_WIDTH + 40; public static final int CONTENT_WIDTH = TemplateThemeGridPane.CONTENT_WIDTH + 40;
public static final int CONTENT_HEIGHT = TemplateThemeGridPane.CONTENT_HEIGHT + 37; public static final int CONTENT_HEIGHT = TemplateThemeGridPane.CONTENT_HEIGHT + 37;

1
designer-realize/src/main/java/com/fr/design/mainframe/guide/GuideRegister.java

@ -12,6 +12,7 @@ import com.fr.design.mainframe.guide.creator.theme.ThemeToggleGuide;
public class GuideRegister { public class GuideRegister {
public static void register() { public static void register() {
GuideCollector.getInstance().loadFromFile(); GuideCollector.getInstance().loadFromFile();
GuideManager.getInstance().clearAll();
registerGroup(); registerGroup();
registerGuide(); registerGuide();
} }

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

@ -7,6 +7,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.CenterRegionContainerPane; import com.fr.design.mainframe.CenterRegionContainerPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.guide.base.GuideManager; import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.scene.ClickScene; import com.fr.design.mainframe.guide.scene.ClickScene;
import com.fr.design.mainframe.guide.scene.DisplayScene; import com.fr.design.mainframe.guide.scene.DisplayScene;
@ -15,6 +16,8 @@ import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.BubbleTip; import com.fr.design.mainframe.guide.tip.BubbleTip;
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 com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.design.worker.save.EmptyCallBackSaveWorker;
import java.awt.Window; import java.awt.Window;
@ -43,9 +46,28 @@ public class GuideSceneHelper {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
GuideManager.getInstance().getCurrentGuide().getGuideView().dismissGuide(); GuideManager.getInstance().getCurrentGuide().getGuideView().dismissGuide();
WebPreviewUtils.preview(DesignerContext.getDesignerFrame().getSelectedJTemplate()); JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate();
jt.stopEditing();
if (!jt.isSaved()) {
CallbackSaveWorker worker = jt.save2Env();
if (worker instanceof EmptyCallBackSaveWorker) {
GuideManager.getInstance().getCurrentGuide().terminate();
} else {
worker.addSuccessCallback(new Runnable() {
@Override
public void run() {
WebPreviewUtils.preview(jt);
GuideManager.getInstance().getCurrentGuide().complete();
}
});
}
worker.start(jt.getRuntimeId());
return false;
}
WebPreviewUtils.preview(jt);
return true;
} }
}); });
return scene; return scene;
@ -56,7 +78,6 @@ public class GuideSceneHelper {
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName); XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName);
scene.addClickTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(xCreator), ClickScene.ClickType.LEFT); scene.addClickTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(xCreator), ClickScene.ClickType.LEFT);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_Base_Tip_Select_Widget"), BubbleTip.Direction.BOTTOM); scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_Base_Tip_Select_Widget"), BubbleTip.Direction.BOTTOM);
@ -64,12 +85,12 @@ public class GuideSceneHelper {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
super.onComplete();
FormDesigner designer = GuideCreateUtils.getFormDesigner(); FormDesigner designer = GuideCreateUtils.getFormDesigner();
XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName); XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName);
designer.getSelectionModel().reset(); designer.getSelectionModel().reset();
designer.getSelectionModel().selectACreator(xCreator); designer.getSelectionModel().selectACreator(xCreator);
return true;
} }
}); });
return scene; return scene;

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

@ -141,7 +141,7 @@ public class ChangeLayoutComponentGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
FormDesigner formDesigner = GuideCreateUtils.getFormDesigner(); FormDesigner formDesigner = GuideCreateUtils.getFormDesigner();
XCreator from = GuideCreateUtils.getXCreatorFormDesigner(TARGET_FROM_NAME); XCreator from = GuideCreateUtils.getXCreatorFormDesigner(TARGET_FROM_NAME);
@ -152,6 +152,7 @@ public class ChangeLayoutComponentGuide {
GuideCreateUtils.addXCreatorToXLayoutContainer(from, (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("box1"), true); GuideCreateUtils.addXCreatorToXLayoutContainer(from, (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("box1"), true);
GuideCreateUtils.addXCreatorToXLayoutContainer(to, (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("box0"), true); GuideCreateUtils.addXCreatorToXLayoutContainer(to, (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("box0"), true);
return true;
} }
}); });
return scene; return scene;

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

@ -115,9 +115,10 @@ public class UseLayoutAndComponentGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
newFormPane = new NewFormPane(); newFormPane = new NewFormPane();
GuideCreateUtils.showDialogWithoutModal(newFormPane.getWindow()); GuideCreateUtils.showDialogWithoutModal(newFormPane.getWindow());
return true;
} }
}); });
return scene; return scene;
@ -174,9 +175,10 @@ public class UseLayoutAndComponentGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
newFormPane.createLayoutForm(); newFormPane.createLayoutForm();
newFormPane.getWindow().dispose(); newFormPane.getWindow().dispose();
return true;
} }
}); });
return scene; return scene;
@ -209,11 +211,12 @@ public class UseLayoutAndComponentGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
LocalWidgetBlock block = getLocalWidgetBlock(shareID); 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);
return true;
} }
}); });
return scene; return scene;

9
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java

@ -157,8 +157,9 @@ public class DownloadComponentPackageGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
FormWidgetDetailPane.getInstance().swich2Online(); FormWidgetDetailPane.getInstance().swich2Online();
return true;
} }
}); });
return scene; return scene;
@ -221,13 +222,14 @@ public class DownloadComponentPackageGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
downLoadTheme(); downLoadTheme();
themeConfirmDialog = GuideCreateUtils.showConfirmDialog( themeConfirmDialog = GuideCreateUtils.showConfirmDialog(
DesignerContext.getDesignerFrame(), DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Share_Apply_Suitable_Theme_Tip"), Toolkit.i18nText("Fine-Design_Share_Apply_Suitable_Theme_Tip"),
Toolkit.i18nText("Fine-Design_Basic_Confirm"), Toolkit.i18nText("Fine-Design_Basic_Confirm"),
FineJOptionPane.OK_CANCEL_OPTION); FineJOptionPane.OK_CANCEL_OPTION);
return true;
} }
}); });
return scene; return scene;
@ -264,12 +266,13 @@ public class DownloadComponentPackageGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
closeConfirmDialog(); closeConfirmDialog();
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig(); TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig();
TemplateTheme theme = config.cachedFetch(downloadThemeName); TemplateTheme theme = config.cachedFetch(downloadThemeName);
template.setTemplateTheme(theme); template.setTemplateTheme(theme);
return true;
} }
}); });
return scene; return scene;

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

@ -1,6 +1,5 @@
package com.fr.design.mainframe.guide.creator.theme; package com.fr.design.mainframe.guide.creator.theme;
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.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
@ -8,8 +7,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.style.FollowingThemePane; import com.fr.design.gui.style.FollowingThemePane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.CenterRegionContainerPane; import com.fr.design.mainframe.CenterRegionContainerPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EastRegionContainerPane;
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;
@ -24,6 +21,7 @@ import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.BubbleTip; import com.fr.design.mainframe.guide.tip.BubbleTip;
import com.fr.design.mainframe.guide.tip.GuideTip; 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.TemplateThemeGridPagesPane;
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;
@ -86,8 +84,9 @@ public class ThemeToggleGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
showTemplateThemeUsingDialog(); showTemplateThemeUsingDialog();
return true;
} }
}); });
@ -136,14 +135,15 @@ public class ThemeToggleGuide {
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override @Override
public boolean prepared() { public boolean prepared() {
scene.addClickTarget(ComponentUtils.findComponentByName(themeDialog, TemplateThemeUsingDialog.COMPLETE_BUTTON), ClickScene.ClickType.LEFT, true); scene.addClickTarget(ComponentUtils.findComponentByName(themeDialog, TemplateThemeGridPagesPane.COMPLETE_BUTTON), ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_Base_Tip_Click_Complete"), BubbleTip.Direction.TOP); scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_Base_Tip_Click_Complete"), BubbleTip.Direction.TOP);
return true; return true;
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
GuideCreateUtils.selectXCreatorByWidgetName(TARGET_XCREATOR_NAME); GuideCreateUtils.selectXCreatorByWidgetName(TARGET_XCREATOR_NAME);
return true;
} }
}); });
return scene; return scene;
@ -179,10 +179,11 @@ public class ThemeToggleGuide {
} }
@Override @Override
public void onComplete() { public boolean onComplete() {
if (uiButtonGroup[0] != null) { if (uiButtonGroup[0] != null) {
uiButtonGroup[0].setSelectedIndex(0); uiButtonGroup[0].setSelectedIndex(0);
} }
return true;
} }
}); });
return scene; return scene;

63
designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java

@ -0,0 +1,63 @@
package com.fr.design.mainframe.guide.entry;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.guide.base.GuideView;
import com.fr.design.mainframe.guide.collect.GuideCollector;
import com.fr.design.mainframe.guide.scene.AbstractGuideScene;
import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.ui.BubbleHint;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GuideEntryHint {
private static GuideEntryHint hint;
private GuideView guideView;
public static GuideEntryHint getInstance() {
if (hint == null) {
hint = new GuideEntryHint();
}
return hint;
}
public GuideEntryHint() {
AbstractGuideScene scene = new AbstractGuideScene(){};
BubbleHint bubbleHint = new BubbleHint();
guideView = new GuideView(DesignerContext.getDesignerFrame());
bubbleHint.addConfirmAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
GuideCollector.getInstance().setShowHint(true);
guideView.dismissGuide();
}
});
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addTarget(GuideEntryPane.getGuideEntryPane());
scene.addCustomTarget(bubbleHint, getBubbleLocation());
return true;
}
});
guideView.setScene(scene);
}
public void show() {
if (!guideView.isVisible()) {
guideView.showGuide();
}
}
private Point getBubbleLocation() {
Point point = SwingUtilities.convertPoint(GuideEntryPane.getGuideEntryPane(),0,0, guideView.getRootPane());
Dimension size = GuideEntryPane.getGuideEntryPane().getSize();
return new Point(point.x - 187,point.y + size.height);
}
}

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

@ -5,7 +5,6 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.guide.collect.GuideCollector; import com.fr.design.mainframe.guide.collect.GuideCollector;
import com.fr.design.mainframe.guide.ui.BubbleHintDialog;
import com.fr.design.mainframe.guide.ui.GuideManageDialog; import com.fr.design.mainframe.guide.ui.GuideManageDialog;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
@ -13,7 +12,6 @@ import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener; import javax.swing.event.AncestorListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -53,10 +51,7 @@ 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 = BubbleHintDialog.getInstance(); GuideEntryHint.getInstance().show();
Point point = getLocationOnScreen();
Dimension size = getSize();
dialog.showDialog(new Point(point.x - 187,point.y + size.height));
} }
} }

Loading…
Cancel
Save