Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
Yvan 4 years ago
parent
commit
8ca8309480
  1. 7
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  2. 20
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java
  3. 4
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  4. 5
      designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java
  5. 2
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java
  6. 13
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  7. 203
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java
  8. 3
      designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

7
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<String, String> dsNameChangedMap = new HashMap<String, String>();
private static List<ChangeListener> globalDsListeners = new ArrayList<>();
private static Map<String, List<ChangeListener>> dsListenersMap = new HashMap<String, List<ChangeListener>>();
private static Map<String, List<ChangeListener>> 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<String, List<ChangeListener>> listenerEntry : dsListenersMap.entrySet()) {
List<ChangeListener> dsListeners = listenerEntry.getValue();
for (Iterator<Entry<String, List<ChangeListener>>> entryIterator = dsListenersMap.entrySet().iterator(); entryIterator.hasNext();) {
List<ChangeListener> dsListeners = entryIterator.next().getValue();
fireDsChanged(dsListeners);
}
}

20
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java

@ -30,23 +30,27 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> 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 面板大小

4
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -460,7 +460,9 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage() , e);
}
textField.setText(name);
if (StringUtils.isEmpty(textField.getText())) {
textField.setText(name);
}
}
}.execute();
}

5
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();

2
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);

13
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());
}
}
}

203
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<Integer> 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);
}
}
}

3
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<String> optionList = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader(new File(WIN_VM_OPTIONS_PATH)))) {
String option = null;

Loading…
Cancel
Save