diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index f2b1e8e5b3..bce63d6429 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -50,6 +50,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -74,7 +75,7 @@ public abstract class DesignTableDataManager { private static java.util.Map dsNameChangedMap = new HashMap(); private static List globalDsListeners = new ArrayList<>(); - private static Map> dsListenersMap = new HashMap>(); + private static Map> dsListenersMap = new ConcurrentHashMap<>(); public static String NO_PARAMETER = "no_paramater_pane"; @@ -96,8 +97,8 @@ public abstract class DesignTableDataManager { */ private static void fireDsChanged() { fireDsChanged(globalDsListeners); - for (Entry> listenerEntry : dsListenersMap.entrySet()) { - List dsListeners = listenerEntry.getValue(); + for (Iterator>> entryIterator = dsListenersMap.entrySet().iterator(); entryIterator.hasNext();) { + List dsListeners = entryIterator.next().getValue(); fireDsChanged(dsListeners); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 5e8199d953..683b38e016 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -8,7 +8,7 @@ import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ipasswordfield.UIPassWordField; +import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -24,8 +24,18 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -108,7 +118,7 @@ public class JDBCDefPane extends JPanel { urlTextField = new UITextField(15); userNameTextField = new UITextField(15); userNameTextField.setName(USER_NAME); - passwordTextField = new UIPassWordField(15); + passwordTextField = new UIPasswordFieldWithFixedLength(15); dbtypeButton = new UIButton("."); dbtypeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL")); dbtypeButton.addActionListener(dbtypeButtonActionListener); diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index e4ab990337..69aee1b50e 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -17,14 +17,31 @@ import com.fr.file.FILE; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; -import com.fr.stable.ProductConstants; import com.fr.third.javax.annotation.Nonnull; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.ButtonModel; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.SwingConstants; import javax.swing.plaf.basic.BasicMenuItemUI; -import java.awt.*; +import java.awt.AWTEvent; +import java.awt.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; import java.awt.event.AWTEventListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -171,6 +188,8 @@ public class MutilTempalteTabPane extends JComponent { private UIMenuItem initCloseOther() { UIMenuItem closeOther = new UIMenuItem(Toolkit.i18nText("Fine-Design_Basic_FS_Close_Other_Templates")); + // Yvan: 英文下文本显示不全,后续发现如果将模板名设置的比较短,其它语言也会出现显示不全的问题,所以设置一下文本水平居中 + closeOther.setHorizontalAlignment(SwingConstants.CENTER); setListDownItemPreferredSize(closeOther); closeOther.addActionListener(new ActionListener() { @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java new file mode 100644 index 0000000000..c1cb98ca3d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java @@ -0,0 +1,106 @@ +package com.fr.design.gui.ipasswordfield; + +import com.fr.stable.StringUtils; +import org.jetbrains.annotations.NotNull; + +import javax.swing.text.Document; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020-08-11 + * 有固定长度的"*"回显的密码框,避免泄露密码长度 + */ +public class UIPasswordFieldWithFixedLength extends UIPassWordField { + /** + * 展示密码,为固定8位长度的特殊字符"*"组成 + */ + private static final String DISPLAY_PASSWORD = "********"; + + /** + * 实际密码 + */ + private String realPassword; + + /** + * 用于判断是否清空密码 + */ + private boolean clearPassword; + + public UIPasswordFieldWithFixedLength() { + this(null, null, 0); + } + + public UIPasswordFieldWithFixedLength(String text) { + this(null, text, 0); + } + + public UIPasswordFieldWithFixedLength(int columns) { + this(null, null, columns); + } + + public UIPasswordFieldWithFixedLength(String text, int columns) { + this(null, text, columns); + } + + public UIPasswordFieldWithFixedLength(Document doc, String txt, int columns) { + super(doc, txt, columns); + initRealPassword(txt); + } + + /** + * 为realPassword赋初值并添加一个鼠标单击事件 + */ + public void initRealPassword(String text) { + this.realPassword = text == null ? StringUtils.EMPTY : text; + this.clearPassword = true; + addShowFixedLengthPasswordListener(); + } + + /** + * 当鼠标点击密码框,第一次做出键入动作时,清空显示密码与实际密码,用户需要重新输入密码 + */ + private void addShowFixedLengthPasswordListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + UIPasswordFieldWithFixedLength.this.clearPassword = true; + } + }); + this.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + if (clearPassword) { + UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); + UIPasswordFieldWithFixedLength.this.clearPassword = false; + UIPasswordFieldWithFixedLength.this.updateUI(); + } + } + }); + } + + @Override + public void setText(@NotNull String t) { + this.realPassword = t; + // 看到代码中有些场景是将密码置为空字符串的,所以在这里加个判断 + if (StringUtils.isEmpty(t)) { + super.setText(t); + } else { + super.setText(DISPLAY_PASSWORD); + } + } + + @Override + public char[] getPassword() { + //如果用户刚清空密码框,并输入了新密码,则返回输入内容,否则返回realPassword + String text = new String(super.getPassword()); + if (!StringUtils.isEmpty(text) && StringUtils.isEmpty(realPassword)) { + return text.toCharArray(); + } + return realPassword.toCharArray(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 5881132b39..f3e8c4ebd2 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -146,6 +146,7 @@ public class DesignModuleFactory { try { return (ParameterDesignerProvider) instance.formParaDesigner.newInstance(); } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error("error in form para designer"); } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java index 6e3e688c8b..4f291c6398 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java @@ -30,23 +30,27 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs iniListener(); } - private void iniListener(){ + protected void iniListener(){ if(shouldResponseChangeListener()){ this.addSelectChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if(uiObserverListener == null){ - return; - } - if (globalNameListener != null && shouldResponseNameListener()){ - globalNameListener.setGlobalName(newColorSelectBoxName); - } - uiObserverListener.doChange(); + attributeChange(); } }); } } + protected void attributeChange() { + if(uiObserverListener == null){ + return; + } + if (globalNameListener != null && shouldResponseNameListener()){ + globalNameListener.setGlobalName(newColorSelectBoxName); + } + uiObserverListener.doChange(); + } + /** * 初始化下拉面板 * @param preferredWidth 面板大小 diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 37c4cd41a1..54cfddc8d3 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -13,6 +13,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; +import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; @@ -26,7 +27,17 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.exception.WorkspaceAuthException; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -96,7 +107,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * 密码 */ - private UIPassWordField passwordInput = new UIPassWordField(); + private UIPassWordField passwordInput = new UIPasswordFieldWithFixedLength(); /** * 是否记住密码 */ @@ -108,7 +119,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * https密钥 */ - private UIPassWordField certSecretKeyInput = new UIPassWordField(); + private UIPassWordField certSecretKeyInput = new UIPasswordFieldWithFixedLength(); /** * 选择证书文件按钮 */ @@ -460,7 +471,9 @@ public class RemoteEnvPane extends BasicBeanPane { } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage() , e); } - textField.setText(name); + if (StringUtils.isEmpty(textField.getText())) { + textField.setText(name); + } } }.execute(); } diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png new file mode 100644 index 0000000000..3a22b64a60 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png new file mode 100644 index 0000000000..3041f446bb Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh.png similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/reportcolumns/col.png rename to designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh.png diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh_TW.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh_TW.png new file mode 100644 index 0000000000..1ce2bb297b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh_TW.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png new file mode 100644 index 0000000000..83480d4295 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ko_KR.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ko_KR.png new file mode 100644 index 0000000000..e10509a1f3 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ko_KR.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh.png similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/reportcolumns/row.png rename to designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh.png diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png new file mode 100644 index 0000000000..935d1059d5 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png differ diff --git a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java index b7974fb6e9..589028ae52 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java @@ -63,6 +63,8 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent private AutoProgressBar connectionBar; private SwingWorker worker; + private static final String MESSAGE = Toolkit.i18nText("Fine-Design_Chart_Auto_No_Match"); + public AutoChartTypePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); initButtonGroup(); @@ -226,6 +228,9 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent chartResultModel.addElement(autoChartIcon); } chartViewList.setSelectedIndex(0); + } else { + FineJOptionPane.showMessageDialog(AutoChartTypePane.this, MESSAGE, + Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE, UIManager.getIcon("OptionPane.informationIcon")); } } catch (Exception e) { if (!(e instanceof CancellationException)) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java b/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java index 16e13db70b..3ae8f0b848 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java @@ -1,12 +1,12 @@ package com.fr.design.chart; +import com.fr.base.ScreenResolution; import com.fr.base.chart.BaseChartPainter; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.result.WebChartIDInfo; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.script.Calculator; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLable; @@ -79,7 +79,8 @@ public class ChartIcon implements Icon, XMLable { BaseChartPainter chartPainter = getChartPainter(); - int resolution = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); + //插入图表的宽度是固定的,resolution直接获取屏幕分辨率,resolution现在只会影响到老图表 + int resolution = ScreenResolution.getScreenResolution(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); diff --git a/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java b/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java index c30679e0ee..c504a50644 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java +++ b/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java @@ -102,22 +102,22 @@ public class AutoTypeCalculate { } private static boolean isNumberData(List values) { - for (String value : values) { - if (!isNumberData(value)) { - return false; + for (Pattern pattern : dataPatterns) { + if (isNumberData(values, pattern)) { + return true; } } - return true; + return false; } - private static boolean isNumberData(String value) { - for (Pattern pattern : dataPatterns) { + private static boolean isNumberData(List values, Pattern pattern) { + for (String value : values) { Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; + if (!matcher.matches()) { + return false; } } - return false; + return true; } private static List calculateField(String tableName, List columns) { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index e93900ea6f..e4e27b7f49 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -1,19 +1,18 @@ package com.fr.design.chartx.component; import com.fr.data.util.function.AbstractDataFunction; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chartx.component.correlation.AbstractCorrelationPane; import com.fr.design.chartx.component.correlation.CalculateComboBoxEditorComponent; import com.fr.design.chartx.component.correlation.FieldEditorComponentWrapper; import com.fr.design.chartx.component.correlation.UIComboBoxEditorComponent; import com.fr.design.chartx.component.correlation.UITextFieldEditorComponent; -import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.chartx.data.DataLayoutHelper; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import com.fr.extended.chart.UIComboBoxWithNone; @@ -22,19 +21,25 @@ import com.fr.stable.StringUtils; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.util.ArrayList; -import java.util.List; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; /** * Created by shine on 2018/9/12. * 系列名使用字段名or字段值的抽象的pane 支持多种属性结构的存取 */ -public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane { +public abstract class AbstractCustomFieldComboBoxPane extends BasicBeanPane { + + private UIButtonGroup nameOrValue; + private JPanel cardPane; + private CardLayout cardLayout; private AbstractUseFieldValuePane useFieldValuePane; @@ -42,73 +47,43 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< private List fieldList = new ArrayList(); - @Override - protected void initLayout() { - this.setLayout(new BorderLayout(0, 6)); - JPanel northPane = new JPanel(new BorderLayout()); - northPane.add(jcb, BorderLayout.CENTER); - UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); - label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, 20)); - northPane.add(label, BorderLayout.WEST); - this.add(northPane, BorderLayout.NORTH); - this.add(cardPane, BorderLayout.CENTER); - } + public AbstractCustomFieldComboBoxPane() { - @Override - protected List> initPaneList() { useFieldValuePane = createUseFieldValuePane(); customFieldNamePane = createCustomFieldNamePane(); - List> list = new ArrayList>(); - list.add(useFieldValuePane); - list.add(paneWrapper()); - return list; - } - private FurtherBasicBeanPane paneWrapper() { - FurtherBasicBeanPane pane = new FurtherBasicBeanPane() { + nameOrValue = new UIButtonGroup( + new String[]{useFieldValuePane.title4PopupWindow(), customFieldNamePane.title4PopupWindow()}, + new Boolean[]{false, true}); + nameOrValue.setSelectedItem(false); + nameOrValue.addChangeListener(new ChangeListener() { @Override - public String title4PopupWindow() { - return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + public void stateChanged(ChangeEvent e) { + checkCardPane(); } + }); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"), nameOrValue); - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public void reset() { - } + cardLayout = new CardLayout(); + cardPane = new JPanel(cardLayout); + cardPane.add(useFieldValuePane, useFieldValuePane.title4PopupWindow()); + cardPane.add(customFieldNamePane, customFieldNamePane.title4PopupWindow()); - @Override - public void populateBean(Object ob) { - } - - @Override - public Object updateBean() { - return null; - } - }; - pane.setLayout(new BorderLayout(0, 6)); - pane.add(customFieldNamePane, BorderLayout.CENTER); - return pane; + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); + this.add(cardPane, BorderLayout.CENTER); } protected abstract AbstractUseFieldValuePane createUseFieldValuePane(); protected abstract AbstractCustomFieldNamePane createCustomFieldNamePane(); - @Override - protected String title4PopupWindow() { - return StringUtils.EMPTY; - } - protected boolean valueComboBoxHasNone() { return false; } public void checkBoxUse(boolean hasUse) { - jcb.setEnabled(hasUse); + nameOrValue.setEnabled(hasUse); useFieldValuePane.checkBoxUse(hasUse); } @@ -122,6 +97,19 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< fieldList = columnNameList; } + private void checkCardPane() { + cardLayout.show(cardPane, nameOrValue.getSelectedItem() ? customFieldNamePane.title4PopupWindow() : useFieldValuePane.title4PopupWindow()); + } + + protected void populateNameOrValue(boolean b) { + nameOrValue.setSelectedItem(b); + checkCardPane(); + } + + protected boolean updateNameOrValue() { + return nameOrValue.getSelectedItem(); + } + protected void populateCustomFieldNamePane(T t) { customFieldNamePane.populateBean(t); } @@ -138,6 +126,16 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< useFieldValuePane.updateBean(t); } + @Override + public T updateBean() { + return null; + } + + @Override + protected String title4PopupWindow() { + return null; + } + protected abstract class AbstractUseFieldValuePane extends FurtherBasicBeanPane { private UIComboBox series; private UIComboBox value; @@ -169,11 +167,7 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), function}, }; - double p = TableLayout.PREFERRED; - double[] columnSize = {78, 122}; - double[] rowSize = {p, p, p}; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = DataLayoutHelper.createDataLayoutPane(components); this.setLayout(new BorderLayout(0, 6)); this.add(panel, BorderLayout.CENTER); @@ -258,5 +252,10 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< protected Object[] createLine() { return new String[]{StringUtils.EMPTY, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Chart_Use_None")}; } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + } } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java index 4372cf0db1..e38b3965d4 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java @@ -27,23 +27,21 @@ public class SeriesValueFieldComboBoxPane extends AbstractCustomFieldComboBoxPan @Override public void populateBean(SeriesValueCorrelationDefinition ob) { + populateNameOrValue(ob.isCustomFieldValue()); if (ob.isCustomFieldValue()) { populateCustomFieldNamePane(ob); - jcb.setSelectedIndex(1); } else { populateUseFieldValuePane(ob); - jcb.setSelectedIndex(0); } } @Override public void updateBean(SeriesValueCorrelationDefinition ob) { - if (jcb.getSelectedIndex() == 0) { - ob.setCustomFieldValue(false); - updateUseFieldValuePane(ob); - } else { - ob.setCustomFieldValue(true); + ob.setCustomFieldValue(updateNameOrValue()); + if (ob.isCustomFieldValue()) { updateCustomFieldNamePane(ob); + } else { + updateUseFieldValuePane(ob); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java b/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java new file mode 100644 index 0000000000..98ae28085c --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java @@ -0,0 +1,69 @@ +package com.fr.design.chartx.data; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.Component; +import java.util.Arrays; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2020/7/22 + */ +public class DataLayoutHelper { + + public static int WIDTH = 150; + public static int LABEL_HEIGHT = 20; + public static int LABEL_WIDTH = 65; + + public static int LEFT_GAP = 15; + public static int RIGHT_GAP = 10; + + public static void setWIDTH(int WIDTH) { + DataLayoutHelper.WIDTH = WIDTH; + } + + public static void setLabelHeight(int labelHeight) { + LABEL_HEIGHT = labelHeight; + } + + public static void setLabelWidth(int labelWidth) { + LABEL_WIDTH = labelWidth; + } + + public static void setLeftGap(int leftGap) { + LEFT_GAP = leftGap; + } + + public static void setRightGap(int rightGap) { + RIGHT_GAP = rightGap; + } + + public static JPanel createDataLayoutPane(Component[][] components) { + int len = components.length; + double p = TableLayout.PREFERRED; + double[] columnSize = {DataLayoutHelper.LABEL_WIDTH, DataLayoutHelper.WIDTH}; + double[] rowSize = new double[len]; + Arrays.fill(rowSize, p); + + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + } + + public static JPanel createDataLayoutPane(String label, Component component) { + Component[][] components = new Component[][]{ + new Component[]{new UILabel(label, SwingConstants.LEFT), component} + }; + + return createDataLayoutPane(components); + } + + public static void addNormalBorder(JComponent component) { + component.setBorder(BorderFactory.createEmptyBorder(0, DataLayoutHelper.LEFT_GAP, 0, DataLayoutHelper.RIGHT_GAP)); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java index 09393918a5..53c1cde759 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java @@ -1,18 +1,15 @@ package com.fr.design.chartx.data.map; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.util.Arrays; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -67,8 +64,10 @@ public abstract class AbstractAreaLngLatPane extends JPanel { locationType.setSelectedIndex(0); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("FR-Plugin_Design_Geographic_Location"), locationType); + this.setLayout(new BorderLayout(0, 6)); - this.add(locationType, BorderLayout.NORTH); + this.add(northPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } @@ -103,12 +102,8 @@ public abstract class AbstractAreaLngLatPane extends JPanel { for (int i = 0; i < len; i++) { components[i] = new Component[]{new UILabel(labels[i], SwingConstants.LEFT), fieldComponents[i]}; } - double p = TableLayout.PREFERRED; - double[] columnSize = {ChartDataPane.LABEL_WIDTH, 122}; - double[] rowSize = new double[len]; - Arrays.fill(rowSize, p); - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6); + return DataLayoutHelper.createDataLayoutPane(components); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java index fd4790d57d..148bcd7ca2 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -38,6 +38,7 @@ public class MapChartDataPane extends AbstractChartDataPane { this.setLayout(new BorderLayout()); this.add(cellDataFieldsPane, BorderLayout.CENTER); + DataLayoutHelper.addNormalBorder(this); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index cfb9a2c18a..3df0d3d6d5 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -3,25 +3,20 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.DataSetDefinition; import com.fr.data.impl.NameTableData; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; -import com.fr.design.utils.gui.UIComponentUtils; -import java.util.List; +import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Dimension; +import java.util.List; /** * Created by shine on 2019/5/21. */ public class DataSetPane extends FurtherBasicBeanPane { - private static final int TABLE_DATA_LABEL_LINE_WRAP_WIDTH = 65; - private static final int TABLE_DATA_PANE_WIDTH = 246; private DatabaseTableDataPane tableDataPane; @@ -32,24 +27,27 @@ public class DataSetPane extends FurtherBasicBeanPane { } private void initComps(AbstractDataSetFieldsPane dataSetFieldsPane) { - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data")); - UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH); - UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH); - - tableDataPane = new DatabaseTableDataPane(label) { + tableDataPane = new DatabaseTableDataPane(null) { @Override protected void userEvent() { refreshBoxListAndTableName(); checkBoxUse(); } + + @Override + protected void setBorder() { + } + }; - tableDataPane.setPreferredSize(new Dimension(TABLE_DATA_PANE_WIDTH, tableDataPane.getPreferredSize().height)); + this.dataSetFieldsPane = dataSetFieldsPane; - this.setLayout(new BorderLayout()); - this.add(tableDataPane, BorderLayout.NORTH); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Table_Data"), tableDataPane); + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); this.add(dataSetFieldsPane, BorderLayout.CENTER); + DataLayoutHelper.addNormalBorder(this); checkBoxUse(); } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java index dc4dfc65ad..06ed06649b 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java @@ -3,28 +3,22 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; -import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.frpane.UIComboBoxPane; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.utils.gui.UIComponentUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; -import java.awt.BorderLayout; /** * Created by shine on 2019/5/21. */ public class SingleDataPane extends BasicBeanPane { - private static final int TABLE_DATA_LABEL_LINE_WIDTH = 81; - private UIComboBoxPane comboBoxPane; private DataSetPane dataSetPane; @@ -50,18 +44,12 @@ public class SingleDataPane extends BasicBeanPane { } protected void initLayout() { - this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE, 6)); - JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0)); + this.setLayout(new BorderLayout(0, 6)); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Data_Source"), jcb); + DataLayoutHelper.addNormalBorder(northPane); - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Data_Source")); - UIComponentUtils.setPreferedWidth(label, TABLE_DATA_LABEL_LINE_WIDTH); - northPane.add(label,BorderLayout.WEST); - northPane.add(jcb, BorderLayout.CENTER); - - northPane.setBorder(BorderFactory.createEmptyBorder(5,24,0,15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - } @Override diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java index 108d4b605e..119d73bda6 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java @@ -27,21 +27,19 @@ public class ExtendedCustomFieldComboBoxPane extends AbstractCustomFieldComboBox public void populateBean(AbstractDataConfig ob) { if (ob.isCustomName()) { populateCustomFieldNamePane(ob); - jcb.setSelectedIndex(1); } else { populateUseFieldValuePane(ob); - jcb.setSelectedIndex(0); } + populateNameOrValue(ob.isCustomName()); } @Override public void updateBean(AbstractDataConfig ob) { - if (jcb.getSelectedIndex() == 0) { - ob.setCustomName(false); - updateUseFieldValuePane(ob); - } else { - ob.setCustomName(true); + ob.setCustomName(updateNameOrValue()); + if (ob.isCustomName()) { updateCustomFieldNamePane(ob); + } else { + updateUseFieldValuePane(ob); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index 49ed070239..885931cb93 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -29,6 +29,7 @@ import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartZoom; +import com.fr.plugin.chart.gantt.attr.AttrGanttLabel; import com.fr.plugin.chart.map.line.condition.AttrLineEffect; import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; import com.fr.plugin.chart.vanchart.VanChart; @@ -436,6 +437,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { conditionAttr.remove(AttrEffect.class); conditionAttr.remove(AttrLineEffect.class); conditionAttr.remove(AttrFloatColor.class); + conditionAttr.remove(AttrGanttLabel.class); VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class); if (attrMarker != null && !attrMarker.isCommon()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java index 408480a791..d3ed1ab7a5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java @@ -4,7 +4,7 @@ package com.fr.van.chart.designer.other.condition.item; import com.fr.chart.chartattr.Plot; import com.fr.design.condition.ConditionAttributesPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.van.chart.map.line.VanChartLineMapPlotTooltipPane; +import com.fr.van.chart.map.line.VanChartLineMapPlotTooltipNoCheckPane; /** * Created by hufan on 2016/12/23. @@ -16,6 +16,6 @@ public class VanChartLineMapTooltipConditionPane extends VanChartTooltipConditio } protected VanChartPlotTooltipPane createTooltipContentsPane() { - return new VanChartLineMapPlotTooltipPane(getPlot(), null); + return new VanChartLineMapPlotTooltipNoCheckPane(getPlot(), null); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java index 42428c6317..24a5d45fe9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java @@ -12,6 +12,7 @@ import com.fr.plugin.chart.gantt.attr.AttrGanttLabel; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltip; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; import com.fr.plugin.chart.type.ConditionKeyType; +import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; @@ -40,16 +41,18 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { protected void addBasicAction() { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); - classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot)); - classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot){ + if (!PlotFactory.largeDataModel(plot)) { + classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot)); + } + classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot) { @Override protected VanChartPlotTooltipPane createTooltipContentsPane() { - return new VanChartPlotTooltipNoCheckPane(getPlot(), null){ + return new VanChartPlotTooltipNoCheckPane(getPlot(), null) { @Override protected AttrTooltip getAttrTooltip() { AttrGanttTooltip attrGanttTooltip = new AttrGanttTooltip(); - ((AttrGanttTooltipContent)attrGanttTooltip.getContent()).getDurationFormat().setEnable(true); + ((AttrGanttTooltipContent) attrGanttTooltip.getContent()).getDurationFormat().setEnable(true); return attrGanttTooltip; } }; @@ -65,7 +68,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { @Override protected ChartConditionPane createListConditionPane() { - return new ChartConditionPane(){ + return new ChartConditionPane() { @Override protected ConditionKeyType[] conditionKeyTypes() { return ConditionKeyType.Gantt_CONDITION_KEY_TYPES; @@ -75,6 +78,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { /** * 返回图表class对象 + * * @return class对象 */ public Class class4Correspond() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java index c17d97692c..c89dff0392 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java @@ -44,7 +44,8 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { Component[][] components = new Component[][]{ new Component[]{createGanntStylePane()}, new Component[]{createLinkLinePane()}, - new Component[]{createMarkerPane()} + new Component[]{createMarkerPane()}, + new Component[]{createLargeDataModelPane()} }; contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); @@ -58,6 +59,10 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { return ganntStylePane; } + protected void checkCompsEnabledWithLarge(Plot plot) { + + } + private JPanel createLinkLinePane(){ lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); colorSelect = new ColorSelectBoxWithOutTransparent(100); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java new file mode 100644 index 0000000000..88b72c5709 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java @@ -0,0 +1,36 @@ +package com.fr.van.chart.map.line; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import java.awt.BorderLayout; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-08-20 + */ +public class VanChartLineMapPlotTooltipNoCheckPane extends VanChartLineMapPlotTooltipPane { + + public VanChartLineMapPlotTooltipNoCheckPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void addComponents(Plot plot) { + isTooltipShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip")); + tooltipPane = createTooltipPane(plot); + + this.setLayout(new BorderLayout()); + this.add(tooltipPane, BorderLayout.CENTER); + } + + @Override + public void populate(AttrTooltip attr) { + super.populate(attr); + isTooltipShow.setSelected(true); + tooltipPane.setEnabled(isTooltipShow.isSelected()); + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java index 637279bf28..c0b6cd400a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java @@ -133,13 +133,13 @@ public class AddingModel { Rectangle rect = ComponentUtils.getRelativeBounds(container); if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { added = container.getLayoutAdapter().addBean(creator, - x + designer.getArea().getHorizontalValue(), - y + designer.getArea().getVerticalValue()); + x + designer.getHorizontalScaleValue(), + y + designer.getVerticalScaleValue() ); return added; } added = container.getLayoutAdapter().addBean(creator, - x + designer.getArea().getHorizontalValue() - rect.x, - y + designer.getArea().getVerticalValue() - rect.y); + x + designer.getHorizontalScaleValue() - rect.x, + y + designer.getVerticalScaleValue() - rect.y); return added; } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7c852f2820..b98c2a952d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -433,7 +433,11 @@ public class XWAbsoluteLayout extends XLayoutContainer { @Override public XLayoutContainer getTopLayout() { - XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); + XLayoutContainer parentXLayoutContainer = XCreatorUtils.getParentXLayoutContainer(this); + if (parentXLayoutContainer == null) { + return this; + } + XLayoutContainer xTopLayout = parentXLayoutContainer.getTopLayout(); if (xTopLayout != null && !xTopLayout.isEditable()) { return xTopLayout; } else { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java index 6909207c35..7718e266f2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java @@ -86,7 +86,6 @@ public class XCardAddButton extends XButton { @Override public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){ FormDesigner designer = editingMouseListener.getDesigner(); - designer.fireTargetModified(); // addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取 if(cardLayout == null && tagLayout ==null ){ @@ -112,6 +111,8 @@ public class XCardAddButton extends XButton { showNewTab(editingMouseListener,index); tagLayout.setTabsAndAdjust(); LayoutUtils.layoutRootContainer(designer.getRootComponent()); + + designer.fireTargetModified(); } @Override diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index dc8bb90801..49f246256c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -143,7 +143,7 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { fitLayout.setInitialBackground(layout.getTemplateStyle().getTabDefaultBackground()); fitLayout.setCustomStyle(true); } - tabFitLayout.setxCardSwitchButton((XCardSwitchButton)this.getComponent(0)); + tabFitLayout.setxCardSwitchButton((XCardSwitchButton)this.getComponent(index)); tabFitLayout.checkButonType(); tabFitLayout.setBackupParent(cardLayout); cardLayout.add(tabFitLayout, widgetName); diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 85ec9474db..46377b1adf 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -17,6 +17,9 @@ public class FormDesignerUtils { * @return */ public static boolean isAppRelayout(FormDesigner designer) { + if (!designer.getRootComponent().acceptType(WFitLayout.class)) { + return false; + } return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 3754e5109e..183c0b08c6 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -11,7 +11,13 @@ import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.StateModel; -import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.XChartEditor; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XEditorHolder; +import com.fr.design.designer.creator.XElementCase; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.form.util.XCreatorConstants; @@ -22,14 +28,20 @@ import com.fr.design.icon.IconPathConstants; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.LayoutUtils; - import com.fr.share.ShareConstants; import com.fr.stable.Constants; - import com.fr.stable.StringUtils; -import javax.swing.*; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPopupMenu; +import javax.swing.JWindow; +import javax.swing.SwingUtilities; import javax.swing.event.MouseInputAdapter; -import java.awt.*; +import java.awt.Color; +import java.awt.Container; +import java.awt.Cursor; +import java.awt.Rectangle; import java.awt.event.MouseEvent; /** @@ -165,10 +177,13 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.isDrawLineMode()) { designer.updateDrawLineMode(e); } else { + int relativeX = Math.max(0, designer.getRelativeX(e.getX())); + int relativeY = Math.max(0, designer.getRelativeY(e.getY())); + if (selectionModel.hasSelectionComponent() && selectionModel.getSelection().getRelativeBounds().contains( - designer.getArea().getHorizontalValue() + e.getX(), - designer.getArea().getVerticalValue() + e.getY())) { + designer.getHorizontalScaleValue() + relativeX, + designer.getVerticalScaleValue() + relativeY)) { lastPressEvent = e; lastXCreator = selectionModel.getSelection().getSelectedCreator(); } else { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index 68ea5c2b87..26547229bb 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -409,8 +409,8 @@ public class FormDesignerUI extends ComponentUI { clipg = g.create( -designer.getHorizontalScaleValue(), -designer.getVerticalScaleValue() + designer.getParaHeight(), - (int) ((parent.getSize().width + designer.getArea().getHorizontalValue()) / designer.getScale()), - (int) ((parent.getSize().height + designer.getArea().getVerticalValue()) / designer.getScale())); + parent.getSize().width + designer.getHorizontalScaleValue(), + parent.getSize().height + designer.getVerticalScaleValue()); designer.paintContent(clipg); paintWatermark((Graphics2D) clipg); @@ -435,8 +435,8 @@ public class FormDesignerUI extends ComponentUI { Graphics clipg1; clipg1 = g.create(-designer.getHorizontalScaleValue(), -designer.getVerticalScaleValue(), - (int) ((parent.getSize().width + designer.getArea().getHorizontalValue()) / designer.getScale()), - (int) ((designer.getParaHeight() + designer.getArea().getVerticalValue()) / designer.getScale())); + parent.getSize().width + designer.getHorizontalScaleValue(), + designer.getParaHeight() + designer.getVerticalScaleValue()); designer.paintPara(clipg1); clipg1.dispose(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index 5919985d59..9b0bc18b3b 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -19,6 +19,7 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane; import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; +import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingPane; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; @@ -34,6 +35,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; private MobileBookMarkUsePane mobileBookMarkUsePane; + private MobileTabCommonSettingPane mobileTabCommonSettingPane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -73,6 +75,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { mobileBookMarkUsePane = new MobileBookMarkUsePane(); innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER); } + mobileTabCommonSettingPane = new MobileTabCommonSettingPane(); + innerAdvancePane.add(mobileTabCommonSettingPane, BorderLayout.SOUTH); innerAdvancePane.add(marginPane, BorderLayout.NORTH); UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane); @@ -88,7 +92,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { @Override public void populate(FormDesigner designer) { WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); - templateStyleEditor.setValue((wCardTagLayout).getMobileTemplateStyle()); + MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle(); + templateStyleEditor.setValue(mobileTemplateStyle); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); @@ -101,6 +106,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.populate(xCreator); } + if (mobileTabCommonSettingPane != null) { + mobileTabCommonSettingPane.populate(mobileTemplateStyle); + } } @Override @@ -117,5 +125,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); } + if (mobileTabCommonSettingPane != null) { + mobileTabCommonSettingPane.update(wCardTagLayout.getMobileTemplateStyle()); + } } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java new file mode 100644 index 0000000000..cf4923aed3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -0,0 +1,203 @@ +package com.fr.design.widget.ui.designer.mobile.component; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.designer.beans.events.DesignerEvent; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.ModeButtonGroup; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JComponent; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class MobileTabCommonSettingPane extends BasicPane { + + private UICheckBox showTabTitleCheck; + private UICheckBox tabSlideCheck; + private UICheckBox showTabDotIndicatorCheck; + private ModeButtonGroup buttonGroup; + private NewColorSelectBox initDotColorBox; + private NewColorSelectBox selectDotColorBox; + + public MobileTabCommonSettingPane() { + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + this.showTabTitleCheck = new UICheckBox( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Show_Title"), true) { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; + this.tabSlideCheck = new UICheckBox( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Slide"), true) { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; + this.showTabDotIndicatorCheck = new UICheckBox( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Show_Indicator"), true) { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; + + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Show_Indicator_type")); + JPanel dotIndicatorShowTypePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + addIndicatorShowTypeButton(dotIndicatorShowTypePane); + + UILabel initColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill")); + UILabel selectColor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Fill")); + initDotColorBox = new NewColorSelectBox(0){ + @Override + protected void iniListener() { + } + + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + this.attributeChange(); + } + }; + selectDotColorBox = new NewColorSelectBox(0){ + @Override + protected void iniListener() { + } + + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + this.attributeChange(); + } + }; + JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + JPanel selectDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectColor, selectDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + + double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; + double[] columnSize = {TableLayout.FILL}; + int[][] rowCount = {{1}, {1}, {1}}; + double[] verticalGaps = {10, 10, 10}; + double[] dotSettingColumnSize = {TableLayout.PREFERRED, TableLayout.FILL}; + + Component[][] components = new Component[][]{ + new Component[]{this.showTabTitleCheck}, + new Component[]{this.tabSlideCheck}, + new Component[]{this.showTabDotIndicatorCheck} + }; + + JPanel tabBaseConfigPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, + IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + tabBaseConfigPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); + + JPanel dotIndicatorSettingPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{ + {label, dotIndicatorShowTypePane}, + {initColorLabel, initDotColorPane}, + {selectColor, selectDotColorPane}}, rowSize, dotSettingColumnSize, 0, verticalGaps); + dotIndicatorSettingPanel.setBorder( + BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1, 0) + ); + + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(tabBaseConfigPane, BorderLayout.NORTH); + jPanel.add(dotIndicatorSettingPanel, BorderLayout.CENTER); + + this.add(jPanel, BorderLayout.CENTER); + + showTabDotIndicatorCheck.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + dotIndicatorSettingPanel.setVisible(showTabDotIndicatorCheck.isSelected()); + } + }); + } + + public void populate(MobileTemplateStyle mobileTemplateStyle) { + this.showTabTitleCheck.setSelected(mobileTemplateStyle.isShowTabTitle()); + this.showTabDotIndicatorCheck.setSelected(mobileTemplateStyle.isShowDotIndicator()); + this.tabSlideCheck.setSelected(mobileTemplateStyle.canSlide()); + Color initDotColor = mobileTemplateStyle.getIndicatorInitialColor(); + Color selectDotColor = mobileTemplateStyle.getIndicatorSelectColor(); + int dotIndicatorShowType = mobileTemplateStyle.getDotIndicatorShowType(); + this.populateColorBox(initDotColorBox, initDotColor, MobileTemplateStyle.DEFAULT_INITIAL_DOT_COLOR); + this.populateColorBox(selectDotColorBox, selectDotColor, MobileTemplateStyle.DEFAULT_SELECT_DOT_COLOR); + if (dotIndicatorShowType != buttonGroup.getCurrentSelected()) { + this.buttonGroup.setSelectButton(dotIndicatorShowType); + } + } + + public void update(MobileTemplateStyle mobileTemplateStyle) { + mobileTemplateStyle.setShowTabTitle(showTabTitleCheck.isSelected()); + mobileTemplateStyle.setShowDotIndicator(showTabDotIndicatorCheck.isSelected()); + mobileTemplateStyle.setCanSlide(tabSlideCheck.isSelected()); + mobileTemplateStyle.setIndicatorInitialColor(initDotColorBox.getSelectObject()); + mobileTemplateStyle.setIndicatorSelectColor(selectDotColorBox.getSelectObject()); + mobileTemplateStyle.setDotIndicatorShowType(buttonGroup.getCurrentSelected()); + WidgetPropertyPane.getInstance().getEditingFormDesigner().getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); + } + + @Override + protected String title4PopupWindow() { + return "MobileTabCommonSettingPane"; + } + + private void addIndicatorShowTypeButton(JPanel dotIndicatorShowTypePane) { + UIRadioButton holderPlaceButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_Tab_Holder_Place")); + holderPlaceButton.setSelected(true); + UIRadioButton floatButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Float")); + dotIndicatorShowTypePane.add(holderPlaceButton); + dotIndicatorShowTypePane.add(floatButton); + dotIndicatorShowTypePane.setBorder( + BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L1, 0, 0) + ); + buttonGroup = new ModeButtonGroup<>(); + buttonGroup.put(MobileTemplateStyle.TYPE_PLACEHOLDER_DOT_INDICATOR, holderPlaceButton); + buttonGroup.put(MobileTemplateStyle.TYPE_FLOAT_DOT_INDICATOR, floatButton); + } + + private void populateColorBox(NewColorSelectBox colorBox, Color color, Color defaultColor) { + if (color == null) { + color = defaultColor; + } + if (color != colorBox.getSelectObject()) { + colorBox.setSelectObject(color); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 84ae83838b..66fed7afe2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -119,7 +119,8 @@ public class ReportComponentComposite extends JComponent implements RemoveListen templateStateList.add(null); } centerCardPane.editingComponet.setSelection(centerCardPane.editingComponet.getDefaultSelectElement()); - jSliderContainer = JFormSliderPane.getInstance(); + // Yvan: REPORT-37950 普通报表-多sheet-报表块缩放失效 + //jSliderContainer = JFormSliderPane.getInstance(); } if (centerCardPane.editingComponet.elementCasePane == null) { diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index e62a5772cd..af41fd0884 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -95,7 +95,8 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus setComponentBg(this); paraDesignEditor = DesignModuleFactory.getFormParaDesigner(); if (paraDesignEditor == null) { - return; + // 为空时 设置默认值 + paraDesignEditor = new FormParaDesigner(); } paraDesignEditor.initWidgetToolbarPane(); diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index b99f648aed..f65ae11f85 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -44,6 +44,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName(); private static final String WIN_VM_OPTIONS_PATH = StableUtils.pathJoin(BIN_HOME, "designer.vmoptions"); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; + private static final String WIN_SERVER_PATH = "../server/lib"; static { try { @@ -110,7 +111,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { if (isInstallVersion()) { String[] options = super.getJvmOptions(); // win下环境变量 存在错误的设置会导致问题 直接读vmoptions - if (SupportOSImpl.VM_OPTIONS_ADAPTER.support()) { + if (SupportOSImpl.VM_OPTIONS_ADAPTER.support() && !getClassPath().contains(WIN_SERVER_PATH)) { List optionList = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new FileReader(new File(WIN_VM_OPTIONS_PATH)))) { String option = null;