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 f2b1e8e5b..bce63d642 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/style/color/NewColorSelectBox.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java index 6e3e688c8..4f291c639 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 37c4cd41a..bc32385b7 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -460,7 +460,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-chart/src/main/java/com/fr/design/chart/ChartIcon.java b/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java index 16e13db70..3ae8f0b84 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-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 dc8bb9080..49f246256 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/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index 5919985d5..9b0bc18b3 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 000000000..cf4923aed --- /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/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index b99f648ae..f65ae11f8 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;