Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~qinghui.liu/design into release/10.0

feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
ea8a0ff937
  1. 3
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 36
      designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java
  3. 39
      designer-base/src/main/java/com/fr/design/fun/ReportLengthUNITProvider.java
  4. 23
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java
  5. 42
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java
  6. 8
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java
  7. 67
      designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java
  8. 2
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  9. 2
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  10. 3
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java
  11. 2
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  12. 52
      designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java
  13. 32
      designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java
  14. 31
      designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java
  15. 31
      designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java
  16. 31
      designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java
  17. 11
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  18. 18
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  19. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  20. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png
  21. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png
  22. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png
  23. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/ring.png
  24. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/slot.png
  25. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/cuvette.png
  26. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/pointer.png
  27. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/pointer_180.png
  28. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/ring.png
  29. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/slot.png
  30. 4
      designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java
  31. 9
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  32. 6
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  33. 36
      designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java
  34. 34
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  35. 4
      designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java
  36. 7
      designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  37. 137
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java
  38. 69
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java
  39. 5
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  40. 169
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java
  41. 19
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java
  42. 50
      designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java
  43. 15
      designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java
  44. 53
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  45. 9
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  46. 26
      designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
  47. 4
      designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java
  48. 8
      designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java
  49. 8
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

3
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -28,6 +28,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
@ -575,7 +576,7 @@ public class PreferencePane extends BasicPane {
pageLengthComboBox = new UIComboBox(new String[]{i18nText("Fine-Design_Basic_Page_Setup_MM"), i18nText("Fine-Design_Report_Unit_CM"), i18nText("Fine-Design_Report_Unit_INCH")});
pageLengthComboBox.setPreferredSize(new Dimension(80, 20));
pageLengthComboBox.setMinimumSize(new Dimension(80, 20));
reportLengthComboBox = new UIComboBox(new String[]{i18nText("Fine-Design_Basic_Page_Setup_MM"), i18nText("Fine-Design_Report_Unit_CM"), i18nText("Fine-Design_Report_Unit_INCH"), i18nText("Fine-Design_Report_Unit_PT_Duplicate")});
reportLengthComboBox = new UIComboBox(UnitConvertUtil.getUnitItems());
reportLengthComboBox.setPreferredSize(new Dimension(80, 20));
reportLengthComboBox.setMinimumSize(new Dimension(80, 20));
UILabel pagelengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":");

36
designer-base/src/main/java/com/fr/design/fun/FormAdaptiveConfigUIProcessor.java

@ -0,0 +1,36 @@
package com.fr.design.fun;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.ShortCut;
import com.fr.stable.fun.mark.Immutable;
import javax.swing.JComponent;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
/**
* Created by kerry on 2020-04-09
* 临时接口后续自适应内置后删除
*/
public interface FormAdaptiveConfigUIProcessor extends Immutable {
String MARK_STRING = "FormAdaptiveConfigUIProcessor";
int CURRENT_LEVEL = 1;
/**
* 获取表单自适应配置菜单
* @return 表单自适应配置菜单
*/
ShortCut getConfigShortCut(JTemplate jTemplate);
/**
* 绘制自适应下报表块在表单界面中显示图片
* @param size 绘制尺寸
* @param elementCasePane 报表块内容对象
* @return 自适应下报表块在表单界面中显示的图片
*/
BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane);
}

39
designer-base/src/main/java/com/fr/design/fun/ReportLengthUNITProvider.java

@ -0,0 +1,39 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Mutable;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
public interface ReportLengthUNITProvider extends Mutable {
String MARK_STRING = "ReportLengthUNITProvider";
int CURRENT_LEVEL = 1;
/**
* 标尺单位显示字符
* @return 标尺单位字符
*/
String unitText();
/**
* 标尺单位类型(之前是将int类型的值直接保存在数据库里面的)
* @return 返回标尺单位类型
*/
int unitType();
/**
* UNIT转标尺单位值
* @param value UNIT
* @return 标尺单位值
*/
float unit2Value4Scale(UNIT value);
/**
* 标尺单位值转UNIT
* @param value 标尺单位值
* @return UNIT
*/
UNIT float2UNIT(float value);
}

23
designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java

@ -0,0 +1,23 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.FormAdaptiveConfigUIProcessor;
import com.fr.stable.fun.mark.API;
/**
* Created by kerry on 2020-04-09
*/
@API(level = FormAdaptiveConfigUIProcessor.CURRENT_LEVEL)
public abstract class AbstractFormAdaptiveConfigUIProcessor implements FormAdaptiveConfigUIProcessor {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

42
designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java

@ -0,0 +1,42 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
@API(level = ReportLengthUNITProvider.CURRENT_LEVEL)
public abstract class AbstractReportLengthUNITProvider extends AbstractProvider implements ReportLengthUNITProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String unitText() {
return StringUtils.EMPTY;
}
@Override
public int unitType() {
return 0;
}
@Override
public float unit2Value4Scale(UNIT value) {
return 0;
}
@Override
public UNIT float2UNIT(float value) {
return UNIT.ZERO;
}
}

8
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java

@ -360,6 +360,14 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
popup.setSelectedValue(map);
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
this.popup.setEnabled(enabled);
this.editor.setEnabled(enabled);
this.arrowButton.setEnabled(enabled);
}
/**
* 简单的测试demo
* @param args

67
designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java

@ -1,7 +1,10 @@
package com.fr.design.os.impl;
import com.fr.design.actions.help.AboutDialog;
import com.fr.design.actions.help.AboutPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.invoke.Reflect;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.os.support.OSBasedAction;
@ -21,25 +24,55 @@ public class MacOsAddListenerAction implements OSBasedAction {
public void execute(final Object... objects) {
try {
Class app = Class.forName("com.apple.eawt.Application");
Class handler = Class.forName("com.apple.eawt.QuitHandler");
Object instance = Proxy.newProxyInstance(handler.getClassLoader(), new Class[]{handler},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable {
if ("handleQuitRequestWith".equals(method.getName())) {
if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) {
DesignerContext.getDesignerFrame().exit();
} else {
DesignerExiter.getInstance().execute();
}
}
return null;
}
});
Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance);
Class quitHandler = Class.forName("com.apple.eawt.QuitHandler");
Object quitInstance = getProxy(quitHandler, "handleQuitRequestWith", new QuitAction());
Class aboutHandler = Class.forName("com.apple.eawt.AboutHandler");
Object aboutInstance = getProxy(aboutHandler, "handleAbout", new AboutAction());
Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", quitInstance)
.call("setAboutHandler", aboutInstance);
} catch (ClassNotFoundException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
private Object getProxy(Class clazz, final String methodName, final Action action) {
return Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable {
if (ComparatorUtils.equals(methodName, method.getName())) {
action.execute();
}
return null;
}
});
}
interface Action {
void execute();
}
private class QuitAction implements Action {
@Override
public void execute() {
if (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isShowing()) {
DesignerContext.getDesignerFrame().exit();
} else {
DesignerExiter.getInstance().execute();
}
}
}
private class AboutAction implements Action {
@Override
public void execute() {
AboutPane aboutPane = new AboutPane();
AboutDialog aboutDialog = new AboutDialog(DesignerContext.getDesignerFrame(), aboutPane);
aboutDialog.setVisible(true);
}
}
}

2
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -88,7 +88,7 @@ public enum SupportOSImpl implements SupportOS {
NON_GUARDIAN_START {
@Override
public boolean support() {
return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM;
return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM || OperatingSystem.isMacos();
}
},

2
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java

@ -102,4 +102,4 @@ public class ReportFitAttrAction extends JTemplateAction {
dialog.setVisible(true);
}
}
}

3
designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java

@ -118,6 +118,9 @@ public class BackgroundPane extends BasicPane {
*/
public void populate(Background background) {
BackgroundUIWrapper wrapper = getBackgroundUIWrapper(background);
if (wrapper == null) {
return;
}
int index = wrapper.getIndex();
BackgroundDetailPane quickPane = getTabItemPane(background, index);
quickPane.populate(background);

2
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java

@ -244,6 +244,7 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
*/
public void setStartValue(double startValue) {
startLabel.setValue(startValue);
p1.setX(startValue);
}
/**
@ -251,6 +252,7 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab
*/
public void setEndValue(double endValue) {
endLabel.setValue(endValue);
p2.setX(endValue);
}
/**

52
designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java

@ -0,0 +1,52 @@
package com.fr.design.unit;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.impl.CMReportLengthUNIT;
import com.fr.design.unit.impl.INCHReportLengthUNIT;
import com.fr.design.unit.impl.MMReportLengthUNIT;
import com.fr.design.unit.impl.PTReportLengthUNIT;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/**
* Created by kerry on 2020-04-09
*/
public class UnitConvertUtil {
private static List<ReportLengthUNITProvider> lengthUNITList = new ArrayList<ReportLengthUNITProvider>();
static {
lengthUNITList.add(new MMReportLengthUNIT());
lengthUNITList.add(new CMReportLengthUNIT());
lengthUNITList.add(new INCHReportLengthUNIT());
lengthUNITList.add(new PTReportLengthUNIT());
Set<ReportLengthUNITProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportLengthUNITProvider.MARK_STRING);
for (ReportLengthUNITProvider provider : providers) {
lengthUNITList.add(provider);
}
}
private UnitConvertUtil() {
}
public static ReportLengthUNITProvider parseLengthUNIT(int unitType) {
for (ReportLengthUNITProvider lengthUNIT : lengthUNITList) {
if (unitType == lengthUNIT.unitType()) {
return lengthUNIT;
}
}
return new MMReportLengthUNIT();
}
public static String[] getUnitItems() {
String[] unitItems = new String[lengthUNITList.size()];
for (int i = 0; i < lengthUNITList.size(); i++) {
unitItems[i] = lengthUNITList.get(i).unitText();
}
return unitItems;
}
}

32
designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java

@ -0,0 +1,32 @@
package com.fr.design.unit.impl;
import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants;
import com.fr.stable.unit.CM;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
public class CMReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override
public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM");
}
@Override
public int unitType() {
return Constants.UNIT_CM;
}
@Override
public float unit2Value4Scale(UNIT value) {
return value.toCMValue4Scale2();
}
@Override
public UNIT float2UNIT(float value) {
return new CM(value);
}
}

31
designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java

@ -0,0 +1,31 @@
package com.fr.design.unit.impl;
import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants;
import com.fr.stable.unit.INCH;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
public class INCHReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override
public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH");
}
@Override
public int unitType() {
return Constants.UNIT_INCH;
}
@Override
public float unit2Value4Scale(UNIT value) {
return value.toINCHValue4Scale3();
}
@Override
public UNIT float2UNIT(float value) {
return new INCH(value);
}
}

31
designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java

@ -0,0 +1,31 @@
package com.fr.design.unit.impl;
import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants;
import com.fr.stable.unit.MM;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
public class MMReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override
public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM");
}
@Override
public int unitType() {
return Constants.UNIT_MM;
}
@Override
public float unit2Value4Scale(UNIT value) {
return value.toMMValue4Scale2();
}
@Override
public UNIT float2UNIT(float value) {
return new MM(value);
}
}

31
designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java

@ -0,0 +1,31 @@
package com.fr.design.unit.impl;
import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants;
import com.fr.stable.unit.PT;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
public class PTReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override
public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate");
}
@Override
public int unitType() {
return Constants.UNIT_PT;
}
@Override
public float unit2Value4Scale(UNIT value) {
return value.toPTValue4Scale2();
}
@Override
public UNIT float2UNIT(float value) {
return new PT(value);
}
}

11
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -505,12 +505,21 @@ public class FILEChooserPane extends BasicPane {
if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) {
return fileName;
}
if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) {
if (!ComparatorUtils.equals(fileNameExtension, filterExtension) && !isMapping(fileNameExtension, filterExtension)) {
return fileName + filterExtension;
}
return fileNameWithOutExtension + filterExtension;
}
private boolean isMapping(String fromExtension, String toExtension){
if(FileExtension.CPTX.matchExtension(fromExtension)){
return FileExtension.CPT.matchExtension(toExtension);
}else if(FileExtension.CPT.matchExtension(fromExtension)){
return FileExtension.CPTX.matchExtension(toExtension);
}
return false;
}
private void doCancel() {
this.locationBtnPane.setPopDir(null);
dialogExit();

18
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -14,6 +14,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -60,6 +61,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private UIComboBox largeDataMode;
private UISpinner largeModeThresholdNumber;
protected UILabel chartAnimationLabel;
protected UIButtonGroup isChartAnimation;
//坐标轴翻转属性
@ -371,7 +373,17 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected JPanel createAnimationPane() {
isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"), isChartAnimation);
chartAnimationLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p,p};
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{chartAnimationLabel,isChartAnimation}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel);
}
@ -499,7 +511,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private void populateChartAnimate(Chart chart, Plot plot) {
if (plot.isSupportAnimate()) {
isChartAnimation.setSelectedIndex(chart.isJSDraw() ? 0 : 1);
isChartAnimation.setEnabled(!largeModel(plot));
boolean largeModel = largeModel(plot);
isChartAnimation.setEnabled(!largeModel);
chartAnimationLabel.setEnabled(!largeModel);
}
}

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -70,6 +70,7 @@ public class VanChartPlotLegendPane extends BasicPane {
//private LimitPane limitPane;
//高亮显示的按钮
private UILabel highlightLabel;
private UIButtonGroup<Boolean> highlightButton;
private JPanel highlightPane;
@ -318,7 +319,7 @@ public class VanChartPlotLegendPane extends BasicPane {
private JPanel createHighlightPane(){
highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
highlightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
@ -326,7 +327,7 @@ public class VanChartPlotLegendPane extends BasicPane {
double[] rowSize = {p,p};
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")),highlightButton}
new Component[]{highlightLabel, highlightButton}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
}
@ -429,7 +430,9 @@ public class VanChartPlotLegendPane extends BasicPane {
//limitPane.populateBean(legend.getLimitAttribute());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
highlightButton.setEnabled(!PlotFactory.largeDataModel(plot));
boolean largeDataModel = PlotFactory.largeDataModel(plot);
highlightButton.setEnabled(!largeDataModel);
highlightLabel.setEnabled(!largeDataModel);
}
}

BIN
designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 574 B

BIN
designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/ring.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/slot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/gauge/images/cuvette.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 574 B

BIN
designer-chart/src/main/resources/com/fr/van/chart/gauge/images/pointer.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/gauge/images/pointer_180.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/gauge/images/ring.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/gauge/images/slot.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

4
designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java

@ -82,13 +82,13 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
if (changeSize) {
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();
}
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent());
//改变布局为自适应布局,只在移动端属性设置保存后改变一次
boolean changeLayout = !oldAdaptive && formMobileAttr.isAdaptivePropertyAutoMatch();
if (changeLayout) {
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent());
doChangeBodyLayout();
WidgetPropertyPane.getInstance().refreshDockingView();
}
WidgetPropertyPane.getInstance().refreshDockingView();
jf.fireTargetModified();
}
});

9
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -514,13 +514,4 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
public boolean isSupportShared() {
return true;
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) {
return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)};
} else {
return super.getWidgetPropertyUIProviders();
}
}
}

6
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -593,11 +593,7 @@ public class XWTabFitLayout extends XWFitLayout {
*/
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) {
return new WidgetPropertyUIProvider[] {new MobileBookMarkPropertyUI(this), new MobileBooKMarkUsePropertyUI(this)};
} else {
return new WidgetPropertyUIProvider[0];
}
return new WidgetPropertyUIProvider[0];
}
@Override

36
designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java

@ -0,0 +1,36 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.MobileBookMarkCombinePane;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/4/18
*/
public class MobileBookMarkCombinePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public MobileBookMarkCombinePropertyUI(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return null;
}
@Override
public BasicPane createWidgetAttrPane() {
return new MobileBookMarkCombinePane(xCreator);
}
@Override
public String tableTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr");
}
}

34
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -31,6 +31,7 @@ import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.fun.FormAdaptiveConfigUIProcessor;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.fun.PropertyItemPaneProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
@ -129,20 +130,20 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
public JForm() {
super(new Form(new WBorderLayout("form")), "Form");
initPluginPane();
startListenPlugin();
}
public JForm(Form form, FILE file) {
super(form, file);
initPluginPane();
startListenPlugin();
}
private void startListenPlugin() {
PluginFilter filter = new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
@ -162,25 +163,25 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
}
}, filter);
}
private void initPluginPane() {
ExtraDesignClassManager classManager = PluginModule.getAgent(PluginModule.ExtraDesign);
Set<PropertyItemPaneProvider> providers = classManager.getArray(PropertyItemPaneProvider.XML_TAG);
for (PropertyItemPaneProvider provider : providers) {
addPane(provider);
}
}
private void addPane(PropertyItemPaneProvider provider) {
PaneHolder<FormDesigner> holder = provider.getPaneHolder(FormDesigner.class);
if (holder != null) {
JPanel panel = holder.getInstance(formDesign);
EastRegionContainerPane.getInstance().replaceKeyPane(provider.key(), panel);
}
}
@Override
public void refreshEastPropertiesPane() {
// 暂时用不到,遇到的时候再加刷新右侧tab面板的代码
@ -561,12 +562,21 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
@Override
public ShortCut[] shortcut4TemplateMenu() {
if (this.index == FORM_TAB) {
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), new ReportFitAttrAction(this)}, new ShortCut[0]);
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), getReportFitAttrAction()}, new ShortCut[0]);
} else {
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), new ReportFitAttrAction(this)}, this.elementCaseDesign.shortcut4TemplateMenu());
return ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this), getReportFitAttrAction()}, this.elementCaseDesign.shortcut4TemplateMenu());
}
}
private ShortCut getReportFitAttrAction() {
FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING);
if (adaptiveConfigUI != null) {
return adaptiveConfigUI.getConfigShortCut(this);
}
return new ReportFitAttrAction(this);
}
/**
* 权限细粒度模板菜单
* 表单中去掉此菜单项
@ -825,7 +835,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
refreshWidgetLibPane();
}
private void refreshWidgetLibPane() {
if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) {
new Thread() {

4
designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java

@ -6,6 +6,8 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI;
import com.fr.design.designer.properties.mobile.MobileStylePropertyUI;
@ -179,7 +181,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
if (selection != null && xCreator != null) {
embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders();
if(!designer.getDesignerMode().isFormParameterEditor()) {
if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class) && FormDesignerUtils.isAppRelayout(designer)) {
if (!xCreator.acceptType(XWAbsoluteLayout.class, XWFitLayout.class, XWCardTagLayout.class) && FormDesignerUtils.isAppRelayout(designer)) {
embeddedPropertyUIProviders = ArrayUtils.insert(0, embeddedPropertyUIProviders, new MobileBookMarkPropertyUI(xCreator));
}
if (xCreator.supportMobileStyle()) {

7
designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

@ -127,6 +127,11 @@ public class FormWidgetDefinePaneFactoryBase {
}
public static void registerDefinePane(Class<? extends Widget> widget, Appearance appearance) {
defineMap.put(widget, appearance);
}
public static RN createWidgetDefinePane(XCreator creator, FormDesigner designer, Widget widget, Operator operator) {
if (isExtraXWidget(widget)) {
WidgetDefinePane widgetDefinePane = new WidgetDefinePane(creator, designer);
@ -165,4 +170,4 @@ public class FormWidgetDefinePaneFactoryBase {
}
}
}
}

137
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java

@ -1,40 +1,14 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.main.Form;
import com.fr.form.ui.FormWidgetHelper;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.mobile.MobileBookMark;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Iterator;
import java.util.List;
/**
* @author hades
@ -44,8 +18,7 @@ import java.util.List;
public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
private XCreator xCreator;
private UICheckBox useBookMarkCheck;
private UITextField bookMarkNameField;
private MobileAdvanceInnerPane innerPane;
public MobileAdvanceDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
@ -54,71 +27,13 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.useBookMarkCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Use_BookMark"), false);
this.bookMarkNameField = new UITextField() {
@Override
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
attributeChange();
}
}
});
}
}
};
JPanel useBookMarkPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{useBookMarkCheck}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
final JPanel bookMarkNamePane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Name")), bookMarkNameField}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
this.useBookMarkCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
boolean selected = MobileAdvanceDefinePane.this.useBookMarkCheck.isSelected();
Widget widget = MobileAdvanceDefinePane.this.xCreator.toData();
MobileBookMark bookMark = widget.getMobileBookMark();
bookMarkNamePane.setVisible(selected);
if (selected && StringUtils.isEmpty(bookMark.getBookMarkName())) {
String name = widget.getWidgetName();
MobileAdvanceDefinePane.this.bookMarkNameField.setText(name);
bookMark.setBookMarkName(name);
}
}
});
bookMarkNamePane.setVisible(xCreator.toData().getMobileBookMark().isUseBookMark());
contentPane.add(useBookMarkPane, BorderLayout.NORTH);
contentPane.add(bookMarkNamePane, BorderLayout.CENTER);
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark"), 280, 20, contentPane);
this.innerPane = new MobileAdvanceInnerPane(xCreator);
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark"), 280, 20, innerPane);
JPanel wrapPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
wrapPane.add(uiExpandablePane, BorderLayout.NORTH);
this.add(wrapPane, BorderLayout.NORTH);
initData();
}
private void initData() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
String bookMarkName = bookMark.getBookMarkName();
if (StringUtils.isEmpty(bookMarkName)) {
String widgetName = xCreator.toData().getWidgetName();
this.bookMarkNameField.setText(widgetName);
bookMark.setBookMarkName(widgetName);
} else {
this.bookMarkNameField.setText(bookMarkName);
}
}
private void bindListeners2Widgets() {
reInitAllListeners();
@ -147,53 +62,13 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
@Override
public void populate(FormDesigner designer) {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
this.bookMarkNameField.setText(bookMark.getBookMarkName());
if (bookMark.isFrozen()) {
this.useBookMarkCheck.setSelected(false);
this.useBookMarkCheck.setEnabled(false);
} else {
this.useBookMarkCheck.setSelected(bookMark.isUseBookMark());
}
this.innerPane.populate();
this.bindListeners2Widgets();
}
@Override
public void update() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
bookMark.setUseBookMark(this.useBookMarkCheck.isSelected());
String newBookMarkName = this.bookMarkNameField.getText();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) {
return;
}
if (!isExist(newBookMarkName)) {
bookMark.setBookMarkName(newBookMarkName);
} else {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Rename_Failure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"),
JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
this.bookMarkNameField.setText(bookMark.getBookMarkName());
}
}
private boolean isExist(String name) {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
List<String> list = wSortLayout.getOrderedMobileWidgetList();
for (String value : list) {
Widget widget = form.getWidgetByName(value);
if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) {
return true;
}
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) {
return true;
}
}
return false;
this.innerPane.update();
}
}

69
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java

@ -0,0 +1,69 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane;
import javax.swing.*;
import java.awt.*;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/4/18
*/
public class MobileBookMarkCombinePane extends MobileWidgetDefinePane {
private MobileBookMarkUsePane mobileBookMarkUsePane;
private MobileAdvanceInnerPane mobileAdvanceInnerPane;
private XCreator xCreator;
public MobileBookMarkCombinePane(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.mobileAdvanceInnerPane = new MobileAdvanceInnerPane(xCreator);
this.mobileBookMarkUsePane = new MobileBookMarkUsePane();
panel.add(this.mobileBookMarkUsePane, BorderLayout.NORTH);
panel.add(this.mobileAdvanceInnerPane, BorderLayout.CENTER);
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panel);
this.add(uiExpandablePane, BorderLayout.NORTH);
}
private void bindListeners2Widgets() {
reInitAllListeners();
AttributeChangeListener changeListener = new AttributeChangeListener() {
@Override
public void attributeChange() {
update();
}
};
this.addAttributeChangeListener(changeListener);
}
private void reInitAllListeners() {
initListener(this);
}
@Override
public void populate(FormDesigner designer) {
this.mobileBookMarkUsePane.populate(xCreator);
this.mobileAdvanceInnerPane.populate();
this.bindListeners2Widgets();
}
@Override
public void update() {
this.mobileBookMarkUsePane.update(xCreator);
this.mobileAdvanceInnerPane.update();
}
}

5
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

@ -15,6 +15,7 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor;
import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane;
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;
@ -70,9 +71,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
intervalPane = new MobileComponentLayoutIntervalPane(FormTabPaddingAttrMark.XML_TAG);
if (FormDesignerUtils.isAppRelayout(designer)) {
mobileBookMarkUsePane = new MobileBookMarkUsePane();
innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.SOUTH);
innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER);
}
innerAdvancePane.add(marginPane, BorderLayout.CENTER);
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);
//高级

169
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java

@ -0,0 +1,169 @@
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.creator.XCreator;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.form.main.Form;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.mobile.MobileBookMark;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.List;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/4/17
*/
public class MobileAdvanceInnerPane extends BasicPane {
private XCreator xCreator;
private UICheckBox useBookMarkCheck;
private UITextField bookMarkNameField;
public MobileAdvanceInnerPane(XCreator xCreator) {
this.xCreator = xCreator;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initComponent();
}
private void initComponent() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.useBookMarkCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Use_BookMark"), false);
this.bookMarkNameField = new UITextField() {
@Override
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
attributeChange();
}
}
});
}
}
};
JPanel useBookMarkPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{useBookMarkCheck}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
final JPanel bookMarkNamePane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Name")), bookMarkNameField}},
TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.HGAP_LARGE);
this.useBookMarkCheck.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
boolean selected = MobileAdvanceInnerPane.this.useBookMarkCheck.isSelected();
Widget widget = MobileAdvanceInnerPane.this.xCreator.toData();
MobileBookMark bookMark = widget.getMobileBookMark();
bookMarkNamePane.setVisible(selected);
if (selected && StringUtils.isEmpty(bookMark.getBookMarkName())) {
String name = widget.getWidgetName();
MobileAdvanceInnerPane.this.bookMarkNameField.setText(name);
bookMark.setBookMarkName(name);
}
}
});
bookMarkNamePane.setVisible(xCreator.toData().getMobileBookMark().isUseBookMark());
contentPane.add(useBookMarkPane, BorderLayout.NORTH);
contentPane.add(bookMarkNamePane, BorderLayout.CENTER);
this.add(contentPane);
initData();
}
private void initData() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
String bookMarkName = bookMark.getBookMarkName();
if (StringUtils.isEmpty(bookMarkName)) {
String widgetName = xCreator.toData().getWidgetName();
this.bookMarkNameField.setText(widgetName);
bookMark.setBookMarkName(widgetName);
} else {
this.bookMarkNameField.setText(bookMarkName);
}
}
public void populate() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
this.bookMarkNameField.setText(bookMark.getBookMarkName());
if (bookMark.isFrozen()) {
this.useBookMarkCheck.setSelected(false);
this.useBookMarkCheck.setEnabled(false);
} else {
this.useBookMarkCheck.setSelected(bookMark.isUseBookMark());
}
}
public void update() {
MobileBookMark bookMark = xCreator.toData().getMobileBookMark();
bookMark.setUseBookMark(this.useBookMarkCheck.isSelected());
String newBookMarkName = this.bookMarkNameField.getText();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
if (ComparatorUtils.equals(newBookMarkName, bookMark.getBookMarkName())) {
return;
}
if (!isExist(newBookMarkName)) {
bookMark.setBookMarkName(newBookMarkName);
} else {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_BookMark_Rename_Failure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"),
JOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
this.bookMarkNameField.setText(bookMark.getBookMarkName());
}
}
private boolean isExist(String name) {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
List<String> list = wSortLayout.getOrderedMobileWidgetList();
for (String value : list) {
Widget widget = form.getWidgetByName(value);
if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) {
return true;
}
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) {
return true;
}
}
return false;
}
@Override
protected String title4PopupWindow() {
return "MobileAdvanceInnerPane";
}
}

19
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java

@ -11,9 +11,12 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.main.Form;
import com.fr.form.ui.FormWidgetHelper;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory;
@ -58,6 +61,7 @@ public class MobileComponentFrozenPane extends BasicPane {
}
List<String> widgetList = ((WSortLayout) selectedModel).getNonContainerWidgetList();
widgetList.removeAll(frozenWidgets());
return widgetList.toArray(new String[0]);
}
@ -99,6 +103,21 @@ public class MobileComponentFrozenPane extends BasicPane {
uiComboCheckBox.setSelectedValues(map);
}
private List<String> frozenWidgets() {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
List<String> list = wSortLayout.getNonContainerWidgetList();
List<String> widgets = new ArrayList<>();
for (String value : list) {
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
if (boundsWidget.getWidget().getMobileBookMark().isUseBookMark()) {
widgets.add(value);
}
}
return widgets;
}
@Override
protected String title4PopupWindow() {
return "ComponentFrozenPane";

50
designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java

@ -4,20 +4,18 @@
package com.fr.design.actions.columnrow;
import com.fr.design.DesignerEnvManager;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.gui.frpane.UnitInputPane;
import com.fr.design.gui.frpane.UnitInputPane.ValueNotChangeException;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.UnitConvertUtil;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.unit.CM;
import com.fr.stable.unit.INCH;
import com.fr.stable.unit.MM;
import com.fr.stable.unit.PT;
import com.fr.stable.unit.UNIT;
/**
@ -28,7 +26,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
protected ColumnRowSizingAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
@ -43,7 +41,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
};
UNIT len = getShowLen(report, cs);
populateNumberDialog(uPane, len);
final CellSelection finalCS = cs;
uPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@ -52,21 +50,13 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
try {
float newHeight = (float) uPane.update();
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
UNIT len;
if (unitType == Constants.UNIT_CM) {
len = new CM(newHeight);
} else if (unitType == Constants.UNIT_INCH) {
len = new INCH(newHeight);
} else if (unitType == Constants.UNIT_PT) {
len = new PT(newHeight);
} else {
len = new MM(newHeight);
}
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
UNIT len = lengthUNIT.float2UNIT(newHeight);
updateAction(report, len, finalCS);
} catch (ValueNotChangeException e) {
// nothing
}
ePane.fireTargetModified();
}
}).setVisible(true);
@ -75,28 +65,16 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
protected void populateNumberDialog(final UnitInputPane uPane, UNIT unit) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
float va;
if (unitType == Constants.UNIT_CM) {
va = unit.toCMValue4Scale2();
uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM"));
} else if (unitType == Constants.UNIT_INCH) {
va = unit.toINCHValue4Scale3();
uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH"));
} else if (unitType == Constants.UNIT_PT) {
va = unit.toPTValue4Scale2();
uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT"));
} else {
va = unit.toMMValue4Scale2();
uPane.setUnitText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"));
}
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
float va = lengthUNIT.unit2Value4Scale(unit);
uPane.setUnitText(lengthUNIT.unitText());
uPane.populate(va);
}
protected abstract String title4UnitInputPane();
protected abstract void updateAction(ElementCase report, UNIT len, CellSelection cs);
protected abstract UNIT getShowLen(ElementCase report, CellSelection cs);
protected abstract UNIT getIndexLen(int index, ElementCase report);

15
designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.report;
import com.fr.base.PaperSize;
import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
@ -13,8 +14,10 @@ import com.fr.general.IOUtils;
import com.fr.intelli.record.Focus;
import com.fr.main.TemplateWorkBook;
import com.fr.page.PaperSettingProvider;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.report.report.Report;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -51,6 +54,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{
final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane();
mobileAttrPane.populateBean(mobileAttr);
final boolean oldMobileCanvasSize = mobileAttr.isMobileCanvasSize();
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
@ -69,7 +73,16 @@ public class ReportMobileAttrAction extends JWorkBookAction{
}
recordFunction();
// 设置移动端属性并刷新界面
wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后
wbTpl.setReportMobileAttr(elementCaseMobileAttr);
boolean change = !oldMobileCanvasSize && elementCaseMobileAttr.isMobileCanvasSize();
if (change) {
// 当相关属性从未勾选到勾选状态时 设置成移动端标准页面大小
for (int i = 0; i < wbTpl.getReportCount(); i++) {
Report report = wbTpl.getReport(i);
PaperSettingProvider paperSetting = report.getReportSettings().getPaperSetting();
paperSetting.setPaperSize(PaperSize.PAPERSIZE_MOBILE);
}
}
jwb.fireTargetModified();
}
});

53
designer-realize/src/main/java/com/fr/design/condition/WHPane.java

@ -3,17 +3,16 @@ package com.fr.design.condition;
import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.stable.Constants;
import com.fr.stable.unit.*;
import com.fr.stable.unit.UNIT;
import javax.swing.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import java.math.BigDecimal;
import java.text.ParseException;
/**
* @author richie
@ -45,23 +44,12 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
return nameForPopupMenuItem();
}
public void populate(HighlightAction ha, JSpinner sp) {
public void populate(HighlightAction ha, JSpinner sp) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
UNIT width = getUnit(ha);
double va;
if (unitType == Constants.UNIT_CM) {
va = width.toCMValue4Scale2();
unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM"));
} else if (unitType == Constants.UNIT_INCH) {
va = width.toINCHValue4Scale3();
unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH"));
} else if (unitType == Constants.UNIT_PT) {
va = width.toPTValue4Scale2();
unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate"));
} else {
va = width.toMMValue4Scale2();
unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"));
}
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
double va = lengthUNIT.unit2Value4Scale(width);
unitLabel.setText(lengthUNIT.unitText());
// 只保留两位
Float d = new Float(new BigDecimal(va + "").setScale(2, BigDecimal.ROUND_DOWN).floatValue());
sp.setValue(d);
@ -71,15 +59,8 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
protected String getUnitString() {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
if (unitType == Constants.UNIT_CM) {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM");
} else if (unitType == Constants.UNIT_INCH) {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH");
} else if (unitType == Constants.UNIT_PT) {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate");
} else {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM");
}
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
return lengthUNIT.unitText();
}
public HighlightAction update(UIBasicSpinner sp) {
@ -87,16 +68,8 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
// 只保留两位
newWidth = new Float(new BigDecimal(newWidth + "").setScale(2, BigDecimal.ROUND_DOWN).floatValue());
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
UNIT width;
if (unitType == Constants.UNIT_CM) {
width = new CM(newWidth);
} else if (unitType == Constants.UNIT_INCH) {
width = new INCH(newWidth);
} else if (unitType == Constants.UNIT_PT) {
width = new PT(newWidth);
} else {
width = new MM(newWidth);
}
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
UNIT width = lengthUNIT.float2UNIT(newWidth);
return returnAction(width);
}

9
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -5,6 +5,7 @@ package com.fr.design.mainframe.form;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.AllowAuthorityEditAction;
import com.fr.design.actions.ExitAuthorityEditAction;
import com.fr.design.base.mode.DesignModeContext;
@ -25,6 +26,7 @@ import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.fun.FormAdaptiveConfigUIProcessor;
import com.fr.design.selection.SelectableElement;
import com.fr.design.selection.Selectedable;
import com.fr.design.selection.SelectionListener;
@ -78,6 +80,7 @@ public class FormElementCaseDesigner
}
@Override
public void setTarget(T t) {
super.setTarget(t);
@ -123,6 +126,10 @@ public class FormElementCaseDesigner
*/
@Override
public BufferedImage getElementCaseImage(Dimension size) {
FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING);
if (adaptiveConfigUI != null) {
return adaptiveConfigUI.paintFormElementCaseImage(size, this.elementCasePane);
}
BufferedImage image = null;
try {
image = new java.awt.image.BufferedImage(size.width, size.height,
@ -351,4 +358,4 @@ public class FormElementCaseDesigner
public FormElementCaseProvider getEditingElementCase() {
return this.getEditingElementCasePane().getTarget();
}
}
}

26
designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java

@ -5,8 +5,10 @@ import com.fr.base.DynamicUnitList;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
@ -14,7 +16,6 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.unit.FU;
import com.fr.stable.unit.UNIT;
@ -306,25 +307,10 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
// int resolution = ScreenResolution.getScreenResolution();
FU ulen = FU.valueOfPix((int) doubleValue, resolution);
FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution);
String unit;
double len, tlen;
if (unitType == Constants.UNIT_PT) {
len = ulen.toPTValue4Scale2();
tlen = tulen.toPTValue4Scale2();
unit = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT");
} else if (unitType == Constants.UNIT_CM) {
len = ulen.toCMValue4Scale2();
tlen = tulen.toCMValue4Scale2();
unit = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM");
} else if (unitType == Constants.UNIT_INCH) {
len = ulen.toINCHValue4Scale3();
tlen = tulen.toINCHValue4Scale3();
unit = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH");
} else {
len = ulen.toMMValue4Scale2();
tlen = tulen.toMMValue4Scale2();
unit = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM");
}
ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
String unit = lengthUNIT.unitText();
double len = lengthUNIT.unit2Value4Scale(ulen);
double tlen = lengthUNIT.unit2Value4Scale(tulen);
StringBuilder sb = new StringBuilder();
sb.append(String.format("%.2f", new Double(len)))
.append('/').append(String.format("%.2f", new Double(tlen)))

4
designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java

@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit;
public class DesignerSuperListener {
private static final DesignerSuperListener INSTANCE = new DesignerSuperListener();
private static final int ONCE_DELAY = 90;
private static final int ONCE_DELAY = 180;
private static final int FIXED_DELAY = 0;
private static final int FIXED_FREQ = 2;
@ -116,6 +116,7 @@ public class DesignerSuperListener {
@Override
protected void okEvent() {
dispose();
DesignerLauncher.getInstance().exit();
}
@Override
@ -125,7 +126,6 @@ public class DesignerSuperListener {
}
};
dialog.setVisible(true);
DesignerLauncher.getInstance().exit();
}
private void startFallBackListener() {

8
designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java

@ -1,5 +1,6 @@
package com.fr.start;
import com.fr.common.report.ReportState;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.ErrorDialog;
import com.fr.design.dialog.FineJOptionPane;
@ -10,6 +11,9 @@ import com.fr.exit.DesignerExiter;
import com.fr.general.IOUtils;
import com.fr.io.utils.ResourceIOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.process.ProcessEventPipe;
import com.fr.process.engine.core.CarryMessageEvent;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.stable.StableUtils;
import com.fr.stable.lifecycle.ErrorType;
import com.fr.stable.lifecycle.FineLifecycleFatalError;
@ -45,6 +49,10 @@ public class LifecycleFatalErrorHandler {
public void handle(FineLifecycleFatalError fatal) {
SplashContext.getInstance().hide();
ProcessEventPipe eventPipe = FineProcessContext.getParentPipe();
if (eventPipe != null) {
eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue()));
}
map.get(fatal.getErrorType()).handle(fatal);
}

8
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -16,11 +16,11 @@ import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.DesignerPort;
import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.record.analyzer.Metrics;
import com.fr.stable.ArrayUtils;
import com.fr.stable.BuildContext;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
@ -35,8 +35,6 @@ import com.fr.start.server.FineEmbedServer;
import com.fr.value.NotNullLazyValue;
import org.jetbrains.annotations.NotNull;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import java.io.File;
import java.util.concurrent.ExecutorService;
@ -71,7 +69,9 @@ public class DesignerStartup extends Activator {
if (DesignUtils.isStarted()) {
// 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了
final String[] args = startupArgsValue.getValue().get();
DesignUtils.clientSend(args);
if (ArrayUtils.isNotEmpty(args)) {
DesignUtils.clientSend(args);
}
FineLoggerFactory.getLogger().info("The Designer Has Been Started");
if (args.length == 0) {
TipDialog dialog = new TipDialog(null,

Loading…
Cancel
Save