Browse Source

Pull request #6279: REPORT-60942 REPORT-61125 REPORT-61207 REPORT-61177 bug fixed

Merge in DESIGN/design from ~TOMMY/design:release/11.0 to release/11.0

* commit 'c111cea5900927c01a526df4d5658ed6c603684d':
  REPORT-61177 解决引导页弹窗展示变成半透明的问题
  REPORT-61207 行间距减小,放在window上文字截断
  REPORT-60942 加载图视觉更新
  REPORT-61125 交互优化更新
  REPORT-60942 引导页视觉更新
bugfix/11.0
Tommy 3 years ago
parent
commit
e861bc7f93
  1. 5
      designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java
  3. 19
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingGlassPane.java
  4. 98
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingPane.java
  5. 8
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideManageDialog.java
  6. 28
      designer-base/src/main/java/com/fr/design/mainframe/guide/ui/ImagePanel.java
  7. BIN
      designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.png
  8. 18
      designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg
  9. BIN
      designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.png
  10. 24
      designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg
  11. BIN
      designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.png
  12. 30
      designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg
  13. 21
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java
  14. 24
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java
  15. 39
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java
  16. 44
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java
  17. 12
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java
  18. 2
      designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java

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

@ -40,7 +40,6 @@ public class GuideView extends JDialog {
this.setSize(window.getSize());
this.setLayout(FRGUIPaneFactory.createBorderLayout());
setBg();
this.setGlassPane(new GuideLoadingGlassPane());
DesignerContext.getDesignerFrame().addWindowListener(new WindowAdapter() {
@Override
@ -106,12 +105,16 @@ public class GuideView extends JDialog {
}
public void showLoading() {
this.setGlassPane(GuideLoadingGlassPane.getInstance());
GuideLoadingGlassPane.getInstance().startLoading();
updateGuideViewLocation();
this.setVisible(true);
this.invalidate();
this.getGlassPane().setVisible(true);
}
public void hideLoading() {
GuideLoadingGlassPane.getInstance().stopLoading();
this.getGlassPane().setVisible(false);
repaint();
SwingUtilities.invokeLater(new Runnable() {

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

@ -78,7 +78,7 @@ public class GuideCompleteDialog extends JDialog {
title.setForeground(FONT_COLOR);
textArea = new UITextPane();
changeLineSpacing(textArea, 0.19f,false);
changeLineSpacing(textArea, 0.15f,false);
textArea.setEnabled(false);
textArea.setOpaque(false);
textArea.setFont(CONTENT_FONT);

19
designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingGlassPane.java

@ -9,11 +9,11 @@ import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
public class GuideLoadingGlassPane extends JPanel {
private static final String loadingImagePath = "/com/fr/design/mainframe/guide/loading.gif";
private static GuideLoadingGlassPane loadingPane;
public static GuideLoadingGlassPane getInstance() {
@ -32,16 +32,15 @@ public class GuideLoadingGlassPane extends JPanel {
public void initComponent() {
JPanel loadingView = FRGUIPaneFactory.createBorderLayout_S_Pane();
loadingView.setOpaque(false);
loadingView.setPreferredSize(new Dimension(130, 120));
loadingView.setPreferredSize(new Dimension(150, 90));
JPanel imageContainer = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
imageContainer.setOpaque(false);
ImagePanel imagePanel = new ImagePanel(loadingImagePath);
imagePanel.setOpaque(false);
imagePanel.setPreferredSize(new Dimension(84, 84));
imageContainer.add(imagePanel);
imageContainer.add(GuideLoadingPane.getInstance());
UILabel hintLabel = new UILabel(Toolkit.i18nText("Fine-Design_Guide_Loading_Wait"));
hintLabel.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 14));
hintLabel.setHorizontalAlignment(SwingConstants.CENTER);
hintLabel.setForeground(Color.WHITE);
@ -50,4 +49,12 @@ public class GuideLoadingGlassPane extends JPanel {
this.add(loadingView, new GridBagConstraints());
}
public void startLoading() {
GuideLoadingPane.getInstance().start();
}
public void stopLoading() {
GuideLoadingPane.getInstance().stop();
}
}

98
designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingPane.java

@ -0,0 +1,98 @@
package com.fr.design.mainframe.guide.ui;
import javax.swing.JPanel;
import javax.swing.Timer;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by kerry on 2020-10-23
*/
public class GuideLoadingPane extends JPanel {
private static final BasicStroke STROKE = new BasicStroke(4);
private static final int FPS = 30;
private static final int START_ANGLE = 90;
private static GuideLoadingPane imagePanel;
private Image image;
private int angle;
private Timer timer;
public static GuideLoadingPane getInstance() {
if (imagePanel == null) {
imagePanel = new GuideLoadingPane();
}
return imagePanel;
}
public GuideLoadingPane() {
this.setOpaque(false);
this.setPreferredSize(new Dimension(50, 50));
timer = new Timer(1000 / FPS, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
repaint();
angle -= 180 / FPS; // 5 degrees per 100 ms = 50 degrees/second
if (angle > -270) {
angle += 2 * 360;
}
}
});
}
public void start() {
angle = START_ANGLE;
timer.start();
}
public void stop() {
timer.stop();
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Composite oldComposite = g2.getComposite();
Stroke oldStroke = g2.getStroke();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER));
int d = Math.min(getWidth(), getHeight());
int r = d / 2;
Point circlePoint = new Point(getWidth() / 2, getHeight() / 2);
g2.setColor(Color.WHITE);
g2.fillOval(circlePoint.x - r, circlePoint.y - r, d, d);
g2.setColor(Color.BLACK);
int waitCircleD = d / 10;
int waitCircleR = waitCircleD / 2;
g2.fillOval(circlePoint.x - r / 3 - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD);
g2.fillOval(circlePoint.x - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD);
g2.fillOval(circlePoint.x + r / 3 - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD);
g2.setStroke(STROKE);
g2.setColor(Color.decode("#419BF9"));
int lineWidth = (int) STROKE.getLineWidth();
g2.drawArc(circlePoint.x - r + lineWidth / 2 , circlePoint.y - r + lineWidth / 2, d - lineWidth, d - lineWidth, angle, -90);
g2.setStroke(oldStroke);
g2.setComposite(oldComposite);
}
}

8
designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideManageDialog.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.guide.ui;
import com.fr.base.svg.IconUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
@ -14,7 +15,6 @@ import com.fr.design.mainframe.guide.base.GuideManager;
import com.fr.design.mainframe.guide.base.GuideVersion;
import com.fr.design.mainframe.guide.collect.GuideCollector;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
@ -31,9 +31,9 @@ import java.awt.event.ActionListener;
public class GuideManageDialog extends JDialog {
private static final int DEFAULT_HEIGHT = 400;
private static final int DEFAULT_WIDTH = 600;
private static final Icon GROUP_COMPLETE_NONE = IOUtils.readIcon("/com/fr/design/mainframe/guide/complete_none.png");
private static final Icon GROUP_COMPLETE_SOME = IOUtils.readIcon("/com/fr/design/mainframe/guide/complete_some.png");
private static final Icon GROUP_COMPLETE_ALL = IOUtils.readIcon("/com/fr/design/mainframe/guide/complete_all.png");
private static final Icon GROUP_COMPLETE_NONE = IconUtils.readIcon("/com/fr/design/mainframe/guide/complete_none.svg");
private static final Icon GROUP_COMPLETE_SOME = IconUtils.readIcon("/com/fr/design/mainframe/guide/complete_some.svg");
private static final Icon GROUP_COMPLETE_ALL = IconUtils.readIcon("/com/fr/design/mainframe/guide/complete_all.svg");
private static final Color BORDER_COLOR = new Color(224, 224, 225);
private static final Color UNCOMPLETE_FONT_COLOR = new Color(51, 51, 52);
private static final Color COMPLETE_FONT_COLOR = new Color(51,51,52,128);

28
designer-base/src/main/java/com/fr/design/mainframe/guide/ui/ImagePanel.java

@ -1,28 +0,0 @@
package com.fr.design.mainframe.guide.ui;
import javax.swing.JPanel;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
/**
* Created by kerry on 2020-10-23
*/
public class ImagePanel extends JPanel {
private Image image;
public ImagePanel(String imagePath) {
image = Toolkit.getDefaultToolkit().createImage(ImagePanel.class
.getResource(imagePath));
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (image != null) {
g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
}
}
}

BIN
designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

18
designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 7备份 4</title>
<defs>
<filter id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.254902 0 0 0 0 0.607843 0 0 0 0 0.976471 0 0 0 1.000000 0"></feColorMatrix>
</filter>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-7备份-4" transform="translate(-452.000000, -294.000000)" filter="url(#filter-1)">
<g transform="translate(452.000000, 294.000000)" id="icon_QuestionIcon_normal备份-9">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<path d="M8,0.25 C10.1399118,0.25 12.0774083,1.11754994 13.4799292,2.52007081 C14.8824501,3.92259169 15.75,5.86008824 15.75,8 C15.75,10.1399118 14.8824501,12.0774083 13.4799292,13.4799292 C12.0774083,14.8824501 10.1399118,15.75 8,15.75 C5.86008824,15.75 3.92259169,14.8824501 2.52007081,13.4799292 C1.11754994,12.0774083 0.25,10.1399118 0.25,8 C0.25,5.86008824 1.11754994,3.92259169 2.52007081,2.52007081 C3.92259169,1.11754994 5.86008824,0.25 8,0.25 Z" id="Fill-3" stroke-opacity="0.496167163" stroke="#419BF9" stroke-width="0.5"></path>
<path d="M14.5,8 C14.5,9.79476471 13.7723707,11.4197578 12.5960643,12.5960643 C11.4197578,13.7723707 9.79476471,14.5 8,14.5 C6.20523529,14.5 4.58024219,13.7723707 3.40393574,12.5960643 C2.22762929,11.4197578 1.5,9.79476471 1.5,8 C1.5,7.70052513 1.5202589,7.4057771 1.55948076,7.11705169 L7.49405002,11.7381593 L12.7897165,3.60605749 C13.8517066,4.7630672 14.5,6.30590319 14.5,8 Z M8,1.5 C9.67636009,1.5 11.2046101,2.13478954 12.3574752,3.17706357 L6.80926645,9.1207825 L1.6022332,6.8455736 C1.84106679,5.51344393 2.4858429,4.32202858 3.40393574,3.40393574 C4.58024219,2.22762929 6.20523529,1.5 8,1.5 Z" id="形状结合" stroke="#419BF9" fill="#419BF9"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

24
designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 7备份 5</title>
<defs>
<filter id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.254902 0 0 0 0 0.607843 0 0 0 0 0.976471 0 0 0 1.000000 0"></feColorMatrix>
</filter>
<path d="M14,7 C14,10.8656471 10.8656471,14 7,14 C3.13435294,14 0,10.8656471 0,7 C0,3.13435294 3.13435294,0 7,0 C10.8656471,0 14,3.13435294 14,7 Z" id="path-2"></path>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-7备份-5" transform="translate(-452.000000, -550.000000)" filter="url(#filter-1)">
<g transform="translate(452.000000, 550.000000)" id="icon_QuestionIcon_normal备份-9">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<path d="M8,0.25 C10.1399118,0.25 12.0774083,1.11754994 13.4799292,2.52007081 C14.8824501,3.92259169 15.75,5.86008824 15.75,8 C15.75,10.1399118 14.8824501,12.0774083 13.4799292,13.4799292 C12.0774083,14.8824501 10.1399118,15.75 8,15.75 C5.86008824,15.75 3.92259169,14.8824501 2.52007081,13.4799292 C1.11754994,12.0774083 0.25,10.1399118 0.25,8 C0.25,5.86008824 1.11754994,3.92259169 2.52007081,2.52007081 C3.92259169,1.11754994 5.86008824,0.25 8,0.25 Z" id="Fill-3" stroke-opacity="0.495982777" stroke="#419BF9" stroke-width="0.5"></path>
<g id="路径-3" transform="translate(1.000000, 1.000000)">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<path stroke="#419BF9" d="M7,0.5 C8.79476471,0.5 10.4197578,1.22762929 11.5960643,2.40393574 C12.7723707,3.58024219 13.5,5.20523529 13.5,7 C13.5,8.79476471 12.7723707,10.4197578 11.5960643,11.5960643 C10.4197578,12.7723707 8.79476471,13.5 7,13.5 C5.20523529,13.5 3.58024219,12.7723707 2.40393574,11.5960643 C1.22762929,10.4197578 0.5,8.79476471 0.5,7 C0.5,5.20523529 1.22762929,3.58024219 2.40393574,2.40393574 C3.58024219,1.22762929 5.20523529,0.5 7,0.5 Z"></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

30
designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 7备份 4</title>
<defs>
<filter id="filter-1">
<feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 0.254902 0 0 0 0 0.607843 0 0 0 0 0.976471 0 0 0 1.000000 0"></feColorMatrix>
</filter>
<path d="M14,7 C14,10.8656471 10.8656471,14 7,14 C3.13435294,14 0,10.8656471 0,7 C0,3.13435294 3.13435294,0 7,0 C10.8656471,0 14,3.13435294 14,7 Z" id="path-2"></path>
<path d="M14,7 C14,10.8656471 10.8656471,14 7,14 C3.13435294,14 0,10.8656471 0,7 C0,3.13435294 3.13435294,0 7,0 C10.8656471,0 14,3.13435294 14,7 Z" id="path-4"></path>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组-7备份-4" transform="translate(-452.000000, -422.000000)" filter="url(#filter-1)">
<g transform="translate(452.000000, 422.000000)" id="icon_QuestionIcon_normal备份-9">
<rect id="矩形" x="0" y="0" width="16" height="16"></rect>
<path d="M8,0.25 C10.1399118,0.25 12.0774083,1.11754994 13.4799292,2.52007081 C14.8824501,3.92259169 15.75,5.86008824 15.75,8 C15.75,10.1399118 14.8824501,12.0774083 13.4799292,13.4799292 C12.0774083,14.8824501 10.1399118,15.75 8,15.75 C5.86008824,15.75 3.92259169,14.8824501 2.52007081,13.4799292 C1.11754994,12.0774083 0.25,10.1399118 0.25,8 C0.25,5.86008824 1.11754994,3.92259169 2.52007081,2.52007081 C3.92259169,1.11754994 5.86008824,0.25 8,0.25 Z" id="Fill-3" stroke-opacity="0.495982777" stroke="#419BF9" stroke-width="0.5"></path>
<g id="路径-3" transform="translate(1.000000, 1.000000)">
<mask id="mask-3" fill="white">
<use xlink:href="#path-2"></use>
</mask>
<g id="蒙版"></g>
<path d="M1.65086071,7.57759105 C2.92986055,6.74807704 4.30432707,6.33332003 5.77426028,6.33332003 C7.97916009,6.33332003 9.68111352,9.69885717 13.7949191,7.57759105 C16.5374562,6.16341363 14.5988699,9.08198996 7.97916009,16.33332 L2.03321526,13.4433732 L0,8.39748929 L1.65086071,7.57759105 Z" fill="#419BF9" mask="url(#mask-3)"></path>
<mask id="mask-5" fill="white">
<use xlink:href="#path-4"></use>
</mask>
<path stroke="#419BF9" d="M7,0.5 C8.79476471,0.5 10.4197578,1.22762929 11.5960643,2.40393574 C12.7723707,3.58024219 13.5,5.20523529 13.5,7 C13.5,8.79476471 12.7723707,10.4197578 11.5960643,11.5960643 C10.4197578,12.7723707 8.79476471,13.5 7,13.5 C5.20523529,13.5 3.58024219,12.7723707 2.40393574,11.5960643 C1.22762929,10.4197578 0.5,8.79476471 0.5,7 C0.5,5.20523529 1.22762929,3.58024219 2.40393574,2.40393574 C3.58024219,1.22762929 5.20523529,0.5 7,0.5 Z"></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

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

@ -31,6 +31,7 @@ import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.BorderLayout;
@ -231,7 +232,7 @@ public class GuideCreateUtils {
int returnVal = FineJOptionPane.showConfirmDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Guide_Option_Confirm_Not_Login"),
Toolkit.i18nText("Fine-Design_Basic_Confirm"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) {
@ -243,16 +244,16 @@ public class GuideCreateUtils {
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Guide_Option_Warning_Need_Network"),
Toolkit.i18nText("Fine-Design_Basic_Confirm"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE);
}
public static void showNoFileAuthAlert() {
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
JOptionPane.INFORMATION_MESSAGE
Toolkit.i18nText("Fine-Design_Guide_Option_Warning_No_Directory_Auth"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE
);
}
@ -292,4 +293,14 @@ public class GuideCreateUtils {
return dialog;
}
public static JScrollPane getParentScrollPane(Component component) {
if (component.getParent() == null) {
return null;
}
if (component.getParent() instanceof JScrollPane) {
return (JScrollPane) component.getParent();
}
return getParentScrollPane(component.getParent());
}
}

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

@ -35,10 +35,9 @@ public class ChangeLayoutComponentGuide {
public static Guide createGuide() {
GuideScene scene = createScene();
scene.nextScene(createScene2())
.nextScene(createScene3())
.nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene())
.nextScene(createScene4())
.nextScene(createScene5());
.nextScene(createScene3())
.nextScene(createScene4());
Guide guide = GuideBuilder.newInstance()
.setID(GuideIds.Guide.F001002)
@ -83,21 +82,6 @@ public class ChangeLayoutComponentGuide {
}
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();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
@ -117,7 +101,7 @@ public class ChangeLayoutComponentGuide {
return scene;
}
private static GuideScene createScene4() {
private static GuideScene createScene3() {
DragScene scene = new DragScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override
@ -158,7 +142,7 @@ public class ChangeLayoutComponentGuide {
return scene;
}
private static GuideScene createScene5() {
private static GuideScene createScene4() {
DisplayScene scene = new DisplayScene();
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() {
@Override

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

@ -1,18 +1,24 @@
package com.fr.design.mainframe.guide.creator.layout;
import com.fr.base.theme.FormTheme;
import com.fr.base.theme.FormThemeConfig;
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.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
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.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;
@ -24,6 +30,7 @@ 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.mainframe.theme.AsyncThemeFetcher;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.widget.ui.designer.NewFormPane;
import com.fr.design.widget.ui.designer.PredefinedLayoutPane;
@ -47,6 +54,7 @@ public class UseLayoutAndComponentGuide {
private static final String RESOURCE_PATH = "/com/fr/report/guide/component";
private static UIHeadMenu fileHeadMenu;
private static NewFormPane newFormPane;
private static String defaultThemeName;
public static Guide createGuide() {
GuideScene scene = createScene();
@ -71,9 +79,23 @@ public class UseLayoutAndComponentGuide {
@Override
public boolean prepared() {
preloadShareComponent();
Component component = ComponentUtils.findComponentByName(NorthRegionContainerPane.getInstance(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File"));
fileHeadMenu = ((UIHeadMenu) component);
return true;
List<String> themeNames = FormThemeConfig.getInstance().getThemeNames();
if (themeNames.size() > 0) {
defaultThemeName = themeNames.get(Math.max(themeNames.size() - 2, 0));
AsyncThemeFetcher asyncThemeFetcher = new AsyncThemeFetcher<>(1, FormThemeConfig.getInstance());
asyncThemeFetcher.submit(defaultThemeName, new AsyncThemeFetcher.AsyncThemeFetchCallbackAdapter<FormTheme>(){
@Override
public void afterCachedFetch(FormTheme theme) {
Component component = ComponentUtils.findComponentByName(NorthRegionContainerPane.getInstance(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File"));
fileHeadMenu = ((UIHeadMenu) component);
asyncThemeFetcher.shutdown();
GuideManager.getInstance().getCurrentGuide().start();
}
});
} else {
GuideManager.getInstance().getCurrentGuide().terminate();
}
return false;
}
@Override
@ -134,7 +156,7 @@ public class UseLayoutAndComponentGuide {
scene.showScene();
GuideCreateUtils.TIMER.purge();
}
}, 100);
}, 300);
return false;
}
});
@ -176,6 +198,15 @@ public class UseLayoutAndComponentGuide {
public boolean onComplete() {
newFormPane.createLayoutForm();
newFormPane.getWindow().dispose();
FormTheme defaultTheme = FormThemeConfig.getInstance().cachedFetch(defaultThemeName);
if (defaultTheme != null) {
JTemplate newTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
if (newTemplate instanceof JForm) {
JForm jForm = (JForm) newTemplate;
jForm.setTemplateTheme(defaultTheme);
}
}
return true;
}
});

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

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

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

@ -28,6 +28,7 @@ import com.fr.design.mainframe.theme.TemplateThemeGridPagesPane;
import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog;
import com.fr.design.utils.ComponentUtils;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import java.awt.Component;
import java.util.List;
@ -35,7 +36,6 @@ import java.util.TimerTask;
public class ThemeToggleGuide {
private static final int PAGE_THEME_COUNT = 9;
private static final int DEFAULT_THEME_INDEX = 4;
private static TemplateThemeUsingDialog themeDialog;
private static String TARGET_XCREATOR_NAME = "chart00";
private static String filePath;
@ -64,11 +64,11 @@ public class ThemeToggleGuide {
@Override
public boolean prepared() {
List<String> themeNames = FormThemeConfig.getInstance().getThemeNames();
themeLoadCount = Math.min(themeNames.size(), PAGE_THEME_COUNT);
themeLoadCount = themeNames.size();
if (themeLoadCount == 0) {
GuideManager.getInstance().getCurrentGuide().terminate();
}
selectedThemeIndex = Math.min(themeLoadCount - 1, DEFAULT_THEME_INDEX);
selectedThemeIndex = Math.max(themeLoadCount - 5, 0);
int lazyCount = themeLoadCount;
AsyncThemeFetcher asyncThemeFetcher = new AsyncThemeFetcher<>(PAGE_THEME_COUNT, FormThemeConfig.getInstance());
for (int index = 0; index < lazyCount; index++) {
@ -141,7 +141,7 @@ public class ThemeToggleGuide {
scene.showScene();
GuideCreateUtils.TIMER.purge();
}
},100);
},300);
return false;
}
});
@ -230,7 +230,11 @@ public class ThemeToggleGuide {
if (themeDialog == null) {
themeDialog = new TemplateThemeUsingDialog();
}
String name = FormThemeConfig.getInstance().getThemeNames().get(selectedThemeIndex);
Component component = ComponentUtils.findComponentByName(themeDialog.getContentPane(), name);
JScrollPane scrollPane = GuideCreateUtils.getParentScrollPane(component);
GuideCreateUtils.showDialogWithoutModal(themeDialog);
scrollPane.getVerticalScrollBar().setValue(component.getY());
}
private static void closeTemplateThemeUsingDialog() {

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

@ -58,6 +58,6 @@ public class GuideEntryHint {
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);
return new Point(point.x - 187,point.y + size.height + 5);
}
}

Loading…
Cancel
Save