Browse Source

Merge pull request #4375 in DESIGN/design from feature/10.0 to research/10.0

* commit '6093fa0f2df616827e1dc75b37129a8de77a10f9':
  CHART-18965 自定义html框优化
  REPORT-52843 && REPORT-52844 组件复用-合入主版本-read和clicked都是false时,点击提示的组件复用蓝字,弹出新手引导,关闭引导后,弹出了已合入主版本的提示;   组件复用-合入主版本-鼠标悬浮工具栏套用组件时,tooltip显示“套用组件”,交互文档以及和交互确认了下,应该是“复用组件”
research/10.0
superman 4 years ago
parent
commit
f7fedf2782
  1. 5
      designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  3. 47
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java
  5. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  6. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

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

@ -18,7 +18,7 @@ public class ComponentReuseNotifyUtil {
} }
public static void enterWidgetLibExtraAction() { public static void enterWidgetLibExtraAction(boolean needValidRead) {
if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) { if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) {
return; return;
} }
@ -28,11 +28,12 @@ public class ComponentReuseNotifyUtil {
return COMPONENT_SNAP_CHAT_KEY; return COMPONENT_SNAP_CHAT_KEY;
} }
}); });
if (snapChat.hasRead()) { if (snapChat.hasRead() && needValidRead) {
DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Component_Reuse_Merge_Prompt")); DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Component_Reuse_Merge_Prompt"));
} }
ComponentReuseNotificationInfo.getInstance().setClickedWidgetLib(true); ComponentReuseNotificationInfo.getInstance().setClickedWidgetLib(true);
DesignerEnvManager.getEnvManager().saveXMLFile(); DesignerEnvManager.getEnvManager().saveXMLFile();
} }
} }

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

@ -313,7 +313,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
new ActionListener() { new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); ComponentReuseNotifyUtil.enterWidgetLibExtraAction(true);
} }
}); });
// 权限编辑 // 权限编辑

47
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java

@ -11,9 +11,9 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.plugin.chart.base.VanChartHtmlLabel;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
@ -32,7 +32,7 @@ import java.awt.event.ActionListener;
/** /**
* Created by Mitisky on 16/2/19. * Created by Mitisky on 16/2/19.
*/ */
public class VanChartHtmlLabelPane extends JPanel{ public class VanChartHtmlLabelPane extends JPanel {
private static final long serialVersionUID = -5512128966013558611L; private static final long serialVersionUID = -5512128966013558611L;
private static final int JS_HEIGHT = 100; private static final int JS_HEIGHT = 100;
@ -47,7 +47,9 @@ public class VanChartHtmlLabelPane extends JPanel{
private VanChartStylePane parent; private VanChartStylePane parent;
public void setCustomFormatterText(String text){ private JPanel widthAndHeightPane;
public void setCustomFormatterText(String text) {
contentTextArea.setText(text); contentTextArea.setText(text);
} }
@ -56,24 +58,28 @@ public class VanChartHtmlLabelPane extends JPanel{
} }
public VanChartHtmlLabelPane() { public VanChartHtmlLabelPane() {
useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); useHtml = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Html"));
UIComponentUtils.setLineWrap(useHtml); UIComponentUtils.setLineWrap(useHtml);
JPanel widthAndHeightPane = createWidthAndHeightPane(); useHtml.addChangeListener(e -> checkWidthAndHeightPane());
widthAndHeightPane = createWidthAndHeightPane();
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createJSContentPane()}, new Component[]{createJSContentPane()},
new Component[]{useHtml}, new Component[]{useHtml},
new Component[]{widthAndHeightPane} new Component[]{null, null},
}; };
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.CENTER); this.add(contentPane, BorderLayout.NORTH);
if (widthAndHeightPane != null) {
this.add(widthAndHeightPane, BorderLayout.CENTER);
}
} }
private JComponent createJSContentPane() { private JComponent createJSContentPane() {
@ -112,7 +118,7 @@ public class VanChartHtmlLabelPane extends JPanel{
ac.setTriggerKey(KeyStroke.getKeyStroke(shortCuts.replace("+", "pressed"))); ac.setTriggerKey(KeyStroke.getKeyStroke(shortCuts.replace("+", "pressed")));
ac.install(contentTextArea); ac.install(contentTextArea);
return new UIScrollPane(contentTextArea){ return new UIScrollPane(contentTextArea) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, JS_HEIGHT); return new Dimension(super.getPreferredSize().width, JS_HEIGHT);
@ -121,15 +127,15 @@ public class VanChartHtmlLabelPane extends JPanel{
} }
private void fireJSChange() { private void fireJSChange() {
if(parent != null){ if (parent != null) {
parent.attributeChanged(); parent.attributeChanged();
} }
} }
protected JPanel createWidthAndHeightPane() { protected JPanel createWidthAndHeightPane() {
isCustomWidth = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Width")); isCustomWidth = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Width"));
customWidth = new UITextField(6); customWidth = new UITextField(6);
isCustomHeight = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Height")); isCustomHeight = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Height"));
customHeight = new UITextField(6); customHeight = new UITextField(6);
isCustomWidth.addActionListener(new ActionListener() { isCustomWidth.addActionListener(new ActionListener() {
@ -147,13 +153,13 @@ public class VanChartHtmlLabelPane extends JPanel{
}); });
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f }; double[] columnSize = {p, f};
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomWidth, customWidth},
new Component[]{isCustomHeight, customHeight}, new Component[]{isCustomHeight, customHeight},
new Component[] {null, null} new Component[]{null, null}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
@ -171,8 +177,14 @@ public class VanChartHtmlLabelPane extends JPanel{
checkWidth(); checkWidth();
} }
public void populate(VanChartHtmlLabel htmlLabel){ private void checkWidthAndHeightPane() {
if(htmlLabel == null){ if (widthAndHeightPane != null) {
widthAndHeightPane.setVisible(useHtml.isSelected());
}
}
public void populate(VanChartHtmlLabel htmlLabel) {
if (htmlLabel == null) {
return; return;
} }
setCustomFormatterText(htmlLabel.getCustomText()); setCustomFormatterText(htmlLabel.getCustomText());
@ -186,10 +198,11 @@ public class VanChartHtmlLabelPane extends JPanel{
isCustomHeight.setSelected(htmlLabel.isCustomHeight()); isCustomHeight.setSelected(htmlLabel.isCustomHeight());
customHeight.setText(htmlLabel.getHeight()); customHeight.setText(htmlLabel.getHeight());
checkBoxUse(); checkBoxUse();
checkWidthAndHeightPane();
} }
public void update(VanChartHtmlLabel htmlLabel) { public void update(VanChartHtmlLabel htmlLabel) {
if(htmlLabel == null){ if (htmlLabel == null) {
return; return;
} }
htmlLabel.setCustomText(contentTextArea.getText()); htmlLabel.setCustomText(contentTextArea.getText());

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java

@ -12,7 +12,7 @@ public class VanChartHtmlLabelPaneWithOutWidthAndHeight extends VanChartHtmlLabe
private static final long serialVersionUID = -9213286452724939880L; private static final long serialVersionUID = -9213286452724939880L;
protected JPanel createWidthAndHeightPane() { protected JPanel createWidthAndHeightPane() {
return new JPanel(); return null;
} }
protected void populateWidthAndHeight(VanChartHtmlLabel htmlLabel) { protected void populateWidthAndHeight(VanChartHtmlLabel htmlLabel) {

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

@ -277,7 +277,7 @@ public class FormParaWidgetPane extends JPanel {
jPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); jPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
jPanel.add(uiLabel, BorderLayout.NORTH); jPanel.add(uiLabel, BorderLayout.NORTH);
jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")), BorderLayout.CENTER); jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")), BorderLayout.CENTER);
jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")); jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Share_Component"));
return jPanel; return jPanel;
} }

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

@ -108,7 +108,7 @@ public class FormWidgetDetailPane extends FormDockView{
public void enterWidgetLib() { public void enterWidgetLib() {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
headGroup.setSelectedIndex(ONLINE_TAB); headGroup.setSelectedIndex(ONLINE_TAB);
ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); ComponentReuseNotifyUtil.enterWidgetLibExtraAction(false);
} }
/** /**

Loading…
Cancel
Save