Browse Source

REPORT-59858 引导页场景开发

research/11.0
kuangshuai 3 years ago
parent
commit
3c26616dbe
  1. 1
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 1
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  3. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java
  4. 4
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  5. 60
      designer-base/src/main/java/com/fr/design/utils/ComponentUtils.java
  6. 15
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  7. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  8. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  9. 11
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  10. 28
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  11. 19
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java
  12. 20
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
  13. 15
      designer-realize/src/main/java/com/fr/design/mainframe/guide/GuideIds.java
  14. 30
      designer-realize/src/main/java/com/fr/design/mainframe/guide/GuideRegister.java
  15. 118
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java
  16. 63
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideSceneHelper.java
  17. 133
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java
  18. 242
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java
  19. 22
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java
  20. 237
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java
  21. 3
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

1
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1439,6 +1439,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
};
button.setToolTipText(getTemplateTheme().getName());
button.setText(getTemplateTheme().getName());
button.setName(getTemplateTheme().getName());
button.setAlignmentX(SwingConstants.LEFT);
button.set4ToolbarButton();
button.setEnabled(true);

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

@ -64,6 +64,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
TemplateThemeConfig<T> config,
TemplateThemeProfilePane<T> profilePane) {
this.name = name;
this.setName(name);
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config;
this.profilePane = profilePane;

5
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java

@ -25,8 +25,8 @@ import java.awt.event.ActionListener;
* @version 1.0
* Created by Starryi on 2021/8/13
*/
public class
TemplateThemeUsingDialog<T extends TemplateTheme> extends TemplateThemeDialog {
public class TemplateThemeUsingDialog<T extends TemplateTheme> extends TemplateThemeDialog {
public static final String COMPLETE_BUTTON = "theme_button_complete";
public static final int CONTENT_WIDTH = TemplateThemeListPane.CONTENT_WIDTH + 42;
public static final int CONTENT_HEIGHT = TemplateThemeListPane.CONTENT_HEIGHT + 23;
@ -94,6 +94,7 @@ TemplateThemeUsingDialog<T extends TemplateTheme> extends TemplateThemeDialog {
private UIButton createCompleteButton() {
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Using_Dialog_Complete"));
button.setName(COMPLETE_BUTTON);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

4
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -467,6 +467,10 @@ public abstract class ToolBarMenuDock {
return new UILabel();
}
public Component createGuideEntryPane() {
return new UILabel();
}
public Component createNotificationCenterPane(){
return new UILabel();
}

60
designer-base/src/main/java/com/fr/design/utils/ComponentUtils.java

@ -1,11 +1,13 @@
package com.fr.design.utils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
/**
* 工具类提供常用的工具方法
@ -151,4 +153,62 @@ public class ComponentUtils {
}
return false;
}
public static Component findComponentByName(Component container, String componentName) {
Component target = null;
if (container instanceof Container) {
for (Component component: ((Container)container).getComponents()) {
if (componentName.equals(component.getName())) {
return component;
}
if (component instanceof JRootPane) {
JRootPane nestedJRootPane = (JRootPane)component;
target = findComponentByName(nestedJRootPane.getContentPane(), componentName);
} else if (component instanceof Container){
target = findComponentByName( component, componentName);
}
if (target != null) {
return target;
}
}
}
return null;
}
public static Component findComponentByClass(Component container, Class clazz) {
Component target = null;
if (container instanceof Container) {
for (Component component: ((Container)container).getComponents()) {
if (clazz.isInstance(component)) {
return component;
}
if (component instanceof JRootPane) {
JRootPane nestedJRootPane = (JRootPane)component;
target = findComponentByClass(nestedJRootPane.getContentPane(), clazz);
} else if (component instanceof Container){
target = findComponentByClass(component, clazz);
}
if (target != null) {
return target;
}
}
}
return null;
}
public static List<Component> findComponentsByClass(Component container, Class clazz) {
List<Component> components= new ArrayList<>();
if (container instanceof Container) {
for (Component component: ((Container)container).getComponents()) {
if (clazz.isInstance(component)) {
components.add(component);
continue;
}
if (component instanceof Container){
components.addAll(findComponentsByClass(component, clazz));
}
}
}
return components;
}
}

15
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -72,6 +72,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
private static final double SLIDER_MIN = 10.0;
private static final String SCALE_PLUS_COMMAND = "scale_plus";
private static final String SCALE_MINUS_COMMAND = "scale_minus";
public static final String FIX_LAYOUT_SWITCH_BUTTON = "fix_layout_switch_button";
public static final double DEFAULT_SLIDER = 100.0;
private static final int ROTATIONS = 50;
private static final int SHOWVALMAX = 400;
@ -183,6 +184,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
private UIButton createFixLayoutSwitchButton(){
UIButton button = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_No_Fix_Layout"));
button.setIcon(IOUtils.readIcon("/com/fr/base/images/share/filter_combo.png"));
button.setName(FIX_LAYOUT_SWITCH_BUTTON);
button.setUI(new UIButtonUI(){
@Override
protected void paintBorder(Graphics g, UIButton b) {
@ -197,15 +199,16 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
}
});
button.setHorizontalTextPosition(SwingConstants.LEFT);
UIPopupMenu popupMenu = new UIPopupMenu();
popupMenu.setPreferredSize(new Dimension(180, 59));
popupMenu.setOnlyText(true);
popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER);
popupMenu.add(new PopupMenuItem(new Switch2NoFixLayoutAction()));
popupMenu.add(new PopupMenuItem(new Switch2FixLayoutAction()));
button.setComponentPopupMenu(popupMenu);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
UIPopupMenu popupMenu = new UIPopupMenu();
popupMenu.setPreferredSize(new Dimension(180, 59));
popupMenu.setOnlyText(true);
popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER);
popupMenu.add(new PopupMenuItem(new Switch2NoFixLayoutAction()));
popupMenu.add(new PopupMenuItem(new Switch2FixLayoutAction()));
GUICoreUtils.showPopupMenu(popupMenu, fixLayoutSwitchButton, 0, -59);
}
});

2
designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -79,7 +79,7 @@ public class FormCreatorDropTarget extends DropTarget {
this.tabDragInner = new TabDragInner(designer);
}
private void adding(int x, int y) {
public void adding(int x, int y) {
// 当前鼠标所在的组件
XCreator hoveredComponent = designer.getComponentAt(x, y);
// 获取该组件所在的焦点容器

4
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1120,6 +1120,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
return addingModel;
}
public void setAddingModel(AddingModel addingModel) {
this.addingModel = addingModel;
}
public XCreator getComponentAt(MouseEvent e) {
return getComponentAt(e.getX(), e.getY());
}

11
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -36,6 +36,7 @@ public class FormWidgetDetailPane extends FormDockView{
private JPanel centerPane;
private UIHeadGroup headGroup;
private List<BasicPane> paneList;
private CardLayout cardLayout;
private boolean isEmptyPane = false;
@ -86,7 +87,7 @@ public class FormWidgetDetailPane extends FormDockView{
initPaneList();
this.setBorder(null);
final CardLayout cardLayout = new CardLayout();
cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout);
String[] paneNames = new String[paneList.size()];
for (int i = 0; i < paneList.size(); i++) {
@ -137,6 +138,14 @@ public class FormWidgetDetailPane extends FormDockView{
this.add(panel, BorderLayout.CENTER);
}
public void switch2Local() {
cardLayout.show(centerPane, paneList.get(0).getTitle());
}
public void swich2Online() {
cardLayout.show(centerPane, paneList.get(1).getTitle());
}
private UILabel tipLabel(String text) {
UILabel tipLabel = new UILabel(text);
tipLabel.setHorizontalAlignment(SwingConstants.CENTER);

28
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -195,30 +195,36 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
hidePreview();
ComponentCollector.getInstance().collectPopupJump();
Object source = e.getSource();
Widget creatorSource;
String shareId;
if (source instanceof LocalWidgetBlock) {
LocalWidgetBlock no = (LocalWidgetBlock) e.getSource();
if (no == null) {
return;
}
shareId = no.getBindInfo().getId();
creatorSource = getGroup().getElCaseEditorById(shareId);
if (creatorSource == null) {
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
XCreator xCreator= transformXCreator(no);
if (xCreator == null) {
return;
}
creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480
String suitableTemplateThemeName = no.getWidget().getSuitableTemplateThemeName();
XCreator xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, no.getBindInfo());
WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
lastPressEvent = null;
this.setBorder(null);
}
}
public XCreator transformXCreator(LocalWidgetBlock block) {
String shareId = block.getBindInfo().getId();
Widget creatorSource = getGroup().getElCaseEditorById(shareId);
if (creatorSource == null) {
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
return null;
}
creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480
String suitableTemplateThemeName = block.getWidget().getSuitableTemplateThemeName();
XCreator xCreator = ShareComponentUtils.createThemedXCreator(creatorSource, suitableTemplateThemeName, shareId, block.getBindInfo());
return xCreator;
}
@Override
public void paint(Graphics g) {
super.paint(g);

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

@ -21,7 +21,7 @@ import java.io.InputStream;
public class InstallComponentHelper {
private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components";
private static final String[] PRE_INSTALL_COMPONENTS = new String[]{
public static final String[] PRE_INSTALL_COMPONENTS = new String[]{
"单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu",
"分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu",
"红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu",
@ -45,6 +45,23 @@ public class InstallComponentHelper {
}
public static String[] installPreComponent(int count) {
count = Math.max(Math.min(count, PRE_INSTALL_COMPONENTS.length), 0);
String[] installNames = new String[count];
for (int index = 0; index < count; index ++) {
try {
String componentPath = PRE_INSTALL_COMPONENTS[index];
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);
installNames[index] = componentPath;
} catch (Exception e) {
FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e);
}
}
return installNames;
}
private static boolean needPreInstallComponent() {
try {
//老用户或者组件库里已有组件,不预装组件

20
designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java

@ -54,14 +54,10 @@ public class NewFormPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(createModuleListPane(), BorderLayout.WEST);
this.add(createTemplateManagePane(), BorderLayout.CENTER);
initWindow();
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_New_Template");
}
public void showWindow() {
private void initWindow() {
dialog = new UIDialog(DesignerContext.getDesignerFrame(), this) {
@Override
public void checkValid() throws Exception {
@ -85,6 +81,18 @@ public class NewFormPane extends BasicPane {
dialog.setSize(new Dimension(900, 600));
GUICoreUtils.centerWindow(dialog);
dialog.setResizable(false);
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_New_Template");
}
public UIDialog getWindow() {
return dialog;
}
public void showWindow() {
dialog.setVisible(true);
}

15
designer-realize/src/main/java/com/fr/design/mainframe/guide/GuideIds.java

@ -0,0 +1,15 @@
package com.fr.design.mainframe.guide;
public class GuideIds {
public static class GuideGroup {
public static final String F01 = "F01";
public static final String F02 = "F02";
}
public static class Guide {
public static final String F001001 = "F001001";
public static final String F001002 = "F001002";
public static final String F002001 = "F002001";
public static final String F002002 = "F002002";
}
}

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

@ -0,0 +1,30 @@
package com.fr.design.mainframe.guide;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.guide.base.GuideGroup;
import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.collect.GuideCollector;
import com.fr.design.mainframe.guide.creator.layout.ChangeLayoutComponentGuide;
import com.fr.design.mainframe.guide.creator.layout.UseLayoutAndComponentGuide;
import com.fr.design.mainframe.guide.creator.theme.DownloadComponentPackageGuide;
import com.fr.design.mainframe.guide.creator.theme.ThemeToggleGuide;
public class GuideRegister {
public static void register() {
GuideCollector.getInstance().loadFromFile();
registerGroup();
registerGuide();
}
private static void registerGroup() {
GuideManager.getInstance().addGuideGroup(new GuideGroup(GuideIds.GuideGroup.F01, Toolkit.i18nText("Fine-Design_Guide_Group_F01_Name")));
GuideManager.getInstance().addGuideGroup(new GuideGroup(GuideIds.GuideGroup.F02, Toolkit.i18nText("Fine-Design_Guide_Group_F02_Name")));
}
private static void registerGuide() {
GuideManager.getInstance().addGuide(GuideIds.GuideGroup.F01, UseLayoutAndComponentGuide.createGuide());
GuideManager.getInstance().addGuide(GuideIds.GuideGroup.F01, ChangeLayoutComponentGuide.createGuide());
GuideManager.getInstance().addGuide(GuideIds.GuideGroup.F02, ThemeToggleGuide.createGuide());
GuideManager.getInstance().addGuide(GuideIds.GuideGroup.F02, DownloadComponentPackageGuide.createGuide());
}
}

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

@ -0,0 +1,118 @@
package com.fr.design.mainframe.guide.creator;
import com.fr.design.designer.beans.models.AddingModel;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XOccupiedLayout;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormCreatorDropTarget;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.utils.ScreenImage;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.io.utils.ResourceIOUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import sun.java2d.xr.XcbRequestCounter;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.util.UUID;
public class GuideCreateUtils {
public static FormDesigner getFormDesigner() {
JForm jForm = (JForm) DesignerContext.getDesignerFrame().getSelectedJTemplate();
FormDesigner designer = jForm.getFormDesign();
return designer;
}
public static Rectangle getXCreatorBoundsRelative2FormDesigner(XCreator xCreator) {
FormDesigner designer = getFormDesigner();
Point point = SwingUtilities.convertPoint(xCreator, 0, 0, designer.getRootComponent());
return new Rectangle(point.x + designer.getPaintX(), point.y + designer.getPaintY(), xCreator.getWidth(), xCreator.getHeight());
}
public static XCreator getXCreatorFormDesigner(String name) {
FormDesigner designer = getFormDesigner();
XLayoutContainer rootComponent = designer.getRootComponent();
return findXCreator(rootComponent, name);
}
public static XCreator findXCreator(XLayoutContainer container, String name) {
if (StringUtils.equals(container.toData().getWidgetName(), name)) {
return container;
}
for (Component component : container.getComponents()) {
if (component instanceof XLayoutContainer) {
XCreator xCreator = findXCreator((XLayoutContainer) component, name);
if (xCreator != null) {
return xCreator;
}
} else if (component instanceof XCreator) {
XCreator xCreator = (XCreator) component;
if (StringUtils.equals(xCreator.toData().getWidgetName(), name)) {
return xCreator;
}
}
}
return null;
}
public static void addXCreatorToXLayoutContainer(XCreator xCreator, XLayoutContainer xLayoutContainer, boolean isDragComponent) {
if (xCreator == null) {
return;
}
FormDesigner designer = GuideCreateUtils.getFormDesigner();
designer.getSelectionModel().selectACreator(xLayoutContainer);
if (isDragComponent) {
designer.setAddingModel(new AddingModel(xCreator, 0,0));
designer.setDropTarget(new FormCreatorDropTarget(designer));
designer.repaint();
} else {
designer.startDraggingBean(xCreator);
}
FormCreatorDropTarget dropTarget = (FormCreatorDropTarget) designer.getDropTarget();
dropTarget.adding(xLayoutContainer.getX(), xLayoutContainer.getY());
designer.getSelectionModel().selectACreator(xCreator);
}
public static UILabel createModalTarget(JComponent component) {
ImageIcon ic = new ImageIcon(ScreenImage.createImageWithModal(component));
return new UILabel(ic);
}
public static Rectangle getPopupMenuBounds(JPopupMenu popupMenu, Component parent, int x, int y) {
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());
}
public static String openGuideFile(String sourcePath, String fileName, String suffix) {
String fileWorkPath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, UUID.randomUUID().toString() + suffix);
InputStream inputStream = GuideCreateUtils.class.getResourceAsStream(StableUtils.pathJoin(sourcePath, fileName + suffix));
byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream);
WorkContext.getWorkResource().write(fileWorkPath, data);
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(fileWorkPath, false)));
return fileWorkPath;
}
public static void deleteGuideFile(String filePath) {
WorkContext.getWorkResource().delete(filePath);
}
}

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

@ -0,0 +1,63 @@
package com.fr.design.mainframe.guide.creator;
import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.gui.ibutton.UIPreviewButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.CenterRegionContainerPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.scene.ClickScene;
import com.fr.design.mainframe.guide.scene.DisplayScene;
import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.utils.ComponentUtils;
import java.awt.Window;
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() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
FormDesigner formDesigner = GuideCreateUtils.getFormDesigner();
scene.addTarget(formDesigner, GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(formDesigner.getRootComponent()));
return true;
}
});
return scene;
}
public static GuideScene createPreviewClickScene() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addClickTarget(ComponentUtils.findComponentByClass(CenterRegionContainerPane.getInstance(), UIPreviewButton.class), ClickScene.ClickType.LEFT);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_Base_Click_Preview"), null, GuideTip.Direction.BOTTOM, 0.5f, 0.2f);
return true;
}
@Override
public void onComplete() {
GuideManager.getInstance().getCurrentGuide().getGuideView().dismissGuide();
WebPreviewUtils.preview(DesignerContext.getDesignerFrame().getSelectedJTemplate());
}
});
return scene;
}
}

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

@ -0,0 +1,133 @@
package com.fr.design.mainframe.guide.creator.layout;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.CenterRegionContainerPane;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.guide.GuideIds;
import com.fr.design.mainframe.guide.base.Guide;
import com.fr.design.mainframe.guide.base.GuideBuilder;
import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor;
import com.fr.design.mainframe.guide.creator.GuideCreateUtils;
import com.fr.design.mainframe.guide.creator.GuideSceneHelper;
import com.fr.design.mainframe.guide.scene.ClickScene;
import com.fr.design.mainframe.guide.scene.DisplayScene;
import com.fr.design.mainframe.guide.scene.DragScene;
import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.utils.ComponentUtils;
import java.awt.Rectangle;
public class ChangeLayoutComponentGuide {
private static UIButton switchButton;
private static String filePath;
public static Guide createGuide() {
GuideScene scene = createScene();
scene.nextScene(createScene2())
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(createScene3())
.nextScene(createScene4())
.nextScene(GuideSceneHelper.createPreviewClickScene());
Guide guide = GuideBuilder.newInstance()
.setID(GuideIds.Guide.F001002)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Description"))
.addScene(scene)
.registerLifecycle(new GuideLifecycleAdaptor() {
@Override
public boolean prepared() {
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "layout_recommend", ".frm");
return true;
}
@Override
public void onEnd() {
GuideCreateUtils.deleteGuideFile(filePath);
}
})
.getGuide();
return guide;
}
private static GuideScene createScene() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
switchButton = (UIButton) ComponentUtils.findComponentByName(CenterRegionContainerPane.getInstance(), FormArea.FIX_LAYOUT_SWITCH_BUTTON);
scene.addClickTarget(switchButton, ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Tip_Click_No_Fix_Layout"), GuideTip.Direction.TOP);
return true;
}
});
return scene;
}
private static GuideScene createScene2() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addCustomTarget(
GuideCreateUtils.createModalTarget(switchButton.getComponentPopupMenu()),
GuideCreateUtils.getPopupMenuBounds(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);
switchButton.getComponentPopupMenu().setVisible(false);
return true;
}
});
return scene;
}
private static GuideScene createScene3() {
DragScene scene = new DragScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getXCreatorFormDesigner("absolute0")), DragScene.DragType.FROM);
scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getXCreatorFormDesigner("absolute1")), DragScene.DragType.TO);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001002_Tip_Drag"), GuideTip.Direction.TOP);
return super.prepared();
}
@Override
public void onComplete() {
FormDesigner formDesigner = GuideCreateUtils.getFormDesigner();
XCreator from = GuideCreateUtils.getXCreatorFormDesigner("absolute0");
XLayoutContainer to = (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("absolute1");
formDesigner.getSelectionModel().removeCreator(from, from.getWidth(), from.getHeight());
formDesigner.getSelectionModel().removeCreator(to, to.getWidth(),to.getHeight());
GuideCreateUtils.addXCreatorToXLayoutContainer(from, (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("box1"), true);
GuideCreateUtils.addXCreatorToXLayoutContainer(to, (XLayoutContainer) GuideCreateUtils.getXCreatorFormDesigner("box0"), true);
}
});
return scene;
}
private static GuideScene createScene4() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
Rectangle rootBounds = GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getFormDesigner().getRootComponent());
Rectangle bound3 = GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(GuideCreateUtils.getXCreatorFormDesigner("absolute2"));
Rectangle targetBounds = new Rectangle(rootBounds.x, rootBounds.y, rootBounds.width, bound3.y - rootBounds.y);
scene.addTarget(GuideCreateUtils.getFormDesigner(), targetBounds);
return true;
}
});
return scene;
}
}

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

@ -0,0 +1,242 @@
package com.fr.design.mainframe.guide.creator.layout;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XOccupiedLayout;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.imenu.UIHeadMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.NorthRegionContainerPane;
import com.fr.design.mainframe.guide.GuideIds;
import com.fr.design.mainframe.guide.base.Guide;
import com.fr.design.mainframe.guide.base.GuideBuilder;
import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor;
import com.fr.design.mainframe.guide.creator.GuideCreateUtils;
import com.fr.design.mainframe.guide.creator.GuideSceneHelper;
import com.fr.design.mainframe.guide.scene.ClickScene;
import com.fr.design.mainframe.guide.scene.DisplayScene;
import com.fr.design.mainframe.guide.scene.DragScene;
import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.mainframe.share.ui.block.LocalWidgetBlock;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
import com.fr.design.mainframe.share.util.InstallComponentHelper;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.widget.ui.designer.NewFormPane;
import com.fr.design.widget.ui.designer.PredefinedLayoutPane;
import com.fr.form.share.Group;
import com.fr.form.share.group.DefaultShareGroup;
import com.fr.form.share.group.DefaultShareGroupManager;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
public class UseLayoutAndComponentGuide {
private static UIHeadMenu fileHeadMenu;
private static NewFormPane newFormPane;
private static int autoInstallComponentCount;
private static String[] autoInstallComponentNames;
public static Guide createGuide() {
GuideScene scene = createScene();
scene.nextScene(createScene2())
.nextScene(createScene3())
.nextScene(createScene4())
.nextScene(createScene5())
.nextScene(createScene6("box0",0))
.nextScene(createScene6("box1",1))
.nextScene(createScene6("box2",2))
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(GuideSceneHelper.createPreviewClickScene());
Guide guide = GuideBuilder.newInstance()
.setID(GuideIds.Guide.F001001)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Description"))
.addScene(scene)
.registerLifecycle(new GuideLifecycleAdaptor() {
@Override
public boolean prepared() {
preloadShareComponent();
Component component = ComponentUtils.findComponentByName(NorthRegionContainerPane.getInstance(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File"));
fileHeadMenu = ((UIHeadMenu) component);
fileHeadMenu.setSelected(true);
fileHeadMenu.getPopupMenu().show(fileHeadMenu, 0, fileHeadMenu.getHeight());
return true;
}
@Override
public void onEnd() {
fileHeadMenu.setSelected(false);
fileHeadMenu.getPopupMenu().setVisible(false);
if (newFormPane != null) {
newFormPane.getWindow().dispose();
}
removeAutoInstalledComponent();
}
})
.getGuide();
return guide;
}
public static GuideScene createScene() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addClickTarget(fileHeadMenu.getMenuComponent(2), ClickScene.ClickType.LEFT);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Tip_New_Form"), GuideTip.Direction.BOTTOM);
scene.showScene();
return true;
}
@Override
public void onComplete() {
fileHeadMenu.setSelected(false);
fileHeadMenu.getPopupMenu().setVisible(false);
newFormPane = new NewFormPane();
newFormPane.getWindow().setModal(false);
newFormPane.showWindow();
}
});
return scene;
}
public static GuideScene createScene2() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addTarget(newFormPane.getWindow());
return true;
}
});
return scene;
}
public static GuideScene createScene3() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
List<Component> componentList = ComponentUtils.findComponentsByClass(newFormPane.getWindow().getContentPane(), PredefinedLayoutPane.class);
if (componentList.get(1) != null) {
PredefinedLayoutPane layoutPane = (PredefinedLayoutPane) componentList.get(1);
scene.addClickTarget(layoutPane, ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Tip_Select_Layout"), GuideTip.Direction.RIGHT);
}
return super.prepared();
}
});
return scene;
}
public static GuideScene createScene4() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
Component component = ComponentUtils.findComponentByName(newFormPane.getWindow().getContentPane(), UIDialog.OK_BUTTON);
if (component != null) {
scene.addClickTarget(component, ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Tip_Click_Confirm"), GuideTip.Direction.TOP);
}
return super.prepared();
}
@Override
public void onComplete() {
newFormPane.getWindow().dispose();
}
});
return scene;
}
public static GuideScene createScene5() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
FormWidgetDetailPane.getInstance().switch2Local();
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
FormDesigner formDesigner = GuideCreateUtils.getFormDesigner();
scene.addTarget(formDesigner, GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(formDesigner.getRootComponent()));
return true;
}
});
return scene;
}
public static GuideScene createScene6(String name, int blockIndex) {
DragScene scene = new DragScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addDragTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(getXOccupiedLayout(name)), DragScene.DragType.TO);
scene.addDragTarget(getLocalWidgetBlock(blockIndex), DragScene.DragType.FROM);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F001001_Tip_Drag"), GuideTip.Direction.LEFT);
return super.prepared();
}
@Override
public void onComplete() {
LocalWidgetBlock block = getLocalWidgetBlock(blockIndex);
XCreator xCreator = block.transformXCreator(block);
XOccupiedLayout xOccupiedLayout = getXOccupiedLayout(name);
GuideCreateUtils.addXCreatorToXLayoutContainer(xCreator, xOccupiedLayout, false);
}
});
return scene;
}
private static XOccupiedLayout getXOccupiedLayout(String name) {
return (XOccupiedLayout) GuideCreateUtils.getXCreatorFormDesigner(name);
}
private static LocalWidgetBlock getLocalWidgetBlock(int index) {
return (LocalWidgetBlock) ComponentUtils.findComponentsByClass(LocalWidgetRepoPane.getInstance(), LocalWidgetBlock.class).get(index);
}
private static void preloadShareComponent() {
autoInstallComponentCount = 3;
try {
DefaultShareGroupManager.getInstance().refresh();
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();
LocalWidgetRepoPane.getInstance().refreshAllGroupPane();
}
} catch (Exception e) {
e.printStackTrace();
}
}
static private void removeAutoInstalledComponent() {
Group shareGroup = DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME);
if (shareGroup != null && autoInstallComponentNames != null) {
DefaultShareGroup defaultShareGroup = (DefaultShareGroup) shareGroup;
List<String> installedList = new ArrayList<>();
for (String componentName : autoInstallComponentNames) {
if (componentName != null) {
String uuid = componentName.split("\\.")[1];
installedList.add(uuid);
}
}
defaultShareGroup.unInstallSelect(installedList);
LocalWidgetRepoPane.getInstance().refreshAllGroupPane();
}
}
}

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

@ -0,0 +1,22 @@
package com.fr.design.mainframe.guide.creator.theme;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.guide.GuideIds;
import com.fr.design.mainframe.guide.base.Guide;
import com.fr.design.mainframe.guide.base.GuideBuilder;
import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor;
public class DownloadComponentPackageGuide {
public static Guide createGuide() {
Guide guide = GuideBuilder.newInstance()
.setID(GuideIds.Guide.F002002)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F002002_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F002002_Description"))
.registerLifecycle(new GuideLifecycleAdaptor() {
})
.getGuide();
return guide;
}
}

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

@ -0,0 +1,237 @@
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.TemplateTheme;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.style.FollowingThemePane;
import com.fr.design.i18n.Toolkit;
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.FormDesigner;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.guide.GuideIds;
import com.fr.design.mainframe.guide.base.Guide;
import com.fr.design.mainframe.guide.base.GuideBuilder;
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.GuideSceneHelper;
import com.fr.design.mainframe.guide.scene.ClickScene;
import com.fr.design.mainframe.guide.scene.DisplayScene;
import com.fr.design.mainframe.guide.scene.GuideScene;
import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
import com.fr.design.mainframe.guide.tip.BubbleTip;
import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.mainframe.theme.TemplateThemeBlock;
import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog;
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 java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Timer;
import java.util.TimerTask;
public class ThemeToggleGuide {
private static TemplateThemeUsingDialog<FormTheme> themeDialog;
private static String filePath;
public static Guide createGuide() {
GuideScene scene1 = createScene1();
scene1.nextScene(createScene2())
.nextScene(createScene3())
.nextScene(createScene4())
.nextScene(createScene5())
.nextScene(createScene6())
.nextScene(GuideSceneHelper.createPreviewClickScene());
Guide guide = GuideBuilder.newInstance()
.setID(GuideIds.Guide.F002001)
.setName(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Name"))
.setDescription(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Description"))
.addScene(scene1)
.registerLifecycle(new GuideLifecycleAdaptor() {
@Override
public boolean prepared() {
filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "toggle_theme", ".frm");
return true;
}
@Override
public void onEnd() {
GuideCreateUtils.deleteGuideFile(filePath);
}
})
.getGuide();
return guide;
}
private static GuideScene createScene1() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
TemplateTheme templateTheme = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme();
Component component = ComponentUtils.findComponentByName(CenterRegionContainerPane.getInstance(), templateTheme.getName());
scene.addClickTarget(component, ClickScene.ClickType.LEFT);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Click_Template_Theme"), GuideTip.Direction.BOTTOM);
return true;
}
@Override
public void onComplete() {
showTemplateThemeUsingDialog();
}
});
return scene;
}
private static GuideScene createScene2() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
new Timer().schedule(new TimerTask() {
@Override
public void run() {
scene.addTarget(themeDialog);
scene.showScene();
}
},100);
return true;
}
public void onShow() {
GuideManager.getInstance().getCurrentGuide().getGuideView().toFront(); // brings to front without needing to setAlwaysOnTop
GuideManager.getInstance().getCurrentGuide().getGuideView().requestFocus();
}
@Override
public void onComplete() {
}
});
return scene;
}
private static GuideScene createScene3() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
String name = FormThemeConfig.getInstance().getThemeNames().get(4);
Component component = ComponentUtils.findComponentByName(themeDialog.getContentPane(), name);
if (component instanceof TemplateThemeBlock) {
scene.addClickTarget(component, ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Toggle_Theme"), BubbleTip.Direction.TOP);
}
return true;
}
@Override
public void onComplete() {
}
});
return scene;
}
private static GuideScene createScene4() {
ClickScene scene = new ClickScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
scene.addClickTarget(ComponentUtils.findComponentByName(themeDialog, TemplateThemeUsingDialog.COMPLETE_BUTTON), ClickScene.ClickType.LEFT, true);
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Click_Confirm"), BubbleTip.Direction.TOP);
return true;
}
});
return scene;
}
private static GuideScene createScene5() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
JForm jForm = (JForm) DesignerContext.getDesignerFrame().getSelectedJTemplate();
scene.addTarget(jForm.getFormDesign());
return true;
}
@Override
public void onShow() {
JForm jForm = (JForm) DesignerContext.getDesignerFrame().getSelectedJTemplate();
FormDesigner designer = jForm.getFormDesign();
XCreator xCreator = (XCreator) designer.getRootComponent().getComponent(0);
jForm.getFormDesign().getSelectionModel().reset();
jForm.getFormDesign().getSelectionModel().selectACreator(xCreator);
}
});
return scene;
}
private static GuideScene createScene6() {
ClickScene scene = new ClickScene();
final UIButtonGroup[] uiButtonGroup = new UIButtonGroup[1];
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
public boolean prepared() {
JForm jForm = (JForm) DesignerContext.getDesignerFrame().getSelectedJTemplate();
FormDesigner designer = jForm.getFormDesign();
XCreator xCreator = (XCreator) designer.getRootComponent().getComponent(0);
scene.addTarget(designer, GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(xCreator));
Component target2 = ComponentUtils.findComponentByClass(EastRegionContainerPane.getInstance(), FollowingThemePane.class);
target2 = ComponentUtils.findComponentByClass(target2, UIButtonGroup.class);
if (target2 != null) {
uiButtonGroup[0] = (UIButtonGroup) target2;
target2 = ((UIButtonGroup) target2).getButton(0);
scene.addClickTarget(target2, ClickScene.ClickType.LEFT);
scene.addBubbleTip(
Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Toggle_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Guide_Scene_F002001_Tip_Toggle_Follow_Theme_Description"),
GuideTip.Direction.BOTTOM,
0.5f,
0.8f
);
}
return true;
}
@Override
public void onComplete() {
if (uiButtonGroup[0] != null) {
uiButtonGroup[0].setSelectedIndex(0);
}
}
});
return scene;
}
private static void showTemplateThemeUsingDialog() {
if (themeDialog == null) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
themeDialog = new TemplateThemeUsingDialog<>(designerFrame, DesignerContext.getDesignerFrame().getSelectedJTemplate(), FormThemeConfig.getInstance());
themeDialog.setModal(false);
}
if (!themeDialog.isVisible()) {
themeDialog.setVisible(true);
}
themeDialog.requestFocus();
}
}

3
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -61,6 +61,8 @@ import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.form.FormElementCaseDesigner;
import com.fr.design.mainframe.form.FormReportComponentComposite;
import com.fr.design.mainframe.guide.GuideRegister;
import com.fr.design.mainframe.guide.collect.GuideCollector;
import com.fr.design.mainframe.loghandler.DesignerLogAppender;
import com.fr.design.mainframe.share.constants.ShareEntryKey;
import com.fr.design.mainframe.socketio.DesignerSocketIO;
@ -225,6 +227,7 @@ public class DesignerActivator extends Activator implements Prepare {
InformationCollector.getInstance().collectStartTime();
SharableManager.start();
GuideRegister.register();
}
private void createPluginListener() {

Loading…
Cancel
Save