Browse Source

代码修改

feature/big-screen
kerry 5 years ago
parent
commit
06e18697dc
  1. 3
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 35
      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. 38
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormAdaptiveConfigUIProcessor.java
  5. 41
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportLengthUNITProvider.java
  6. 18
      designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java
  7. 26
      designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java
  8. 5
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  9. 21
      designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java
  10. 14
      designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java
  11. 26
      designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java
  12. 19
      designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java
  13. 22
      designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java
  14. 4
      designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java
  15. 4
      designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java
  16. 4
      designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java
  17. 3
      designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java
  18. 7
      designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java
  19. 8
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  20. 7
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  21. 4
      designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.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.VcsConfigManager;
import com.fr.design.mainframe.vcs.common.VcsHelper; import com.fr.design.mainframe.vcs.common.VcsHelper;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; 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 = 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.setPreferredSize(new Dimension(80, 20));
pageLengthComboBox.setMinimumSize(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.setPreferredSize(new Dimension(80, 20));
reportLengthComboBox.setMinimumSize(new Dimension(80, 20)); reportLengthComboBox.setMinimumSize(new Dimension(80, 20));
UILabel pagelengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":"); UILabel pagelengthLabel = new UILabel(i18nText("Fine-Design_Basic_Page_Setup_Scale_Units") + ":");

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

@ -0,0 +1,35 @@
package com.fr.design.fun;
import com.fr.design.beans.BasicBeanPane;
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 = "FormAdaptiveConfigUI";
int CURRENT_LEVEL = 1;
/**
* 获取表单自适应配置界面
* @return 表单自适应配置界面
*/
BasicBeanPane getConfigPane();
/**
* 绘制自适应下报表块在表单界面中显示图片
* @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);
}

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

@ -0,0 +1,38 @@
package com.fr.design.fun.impl;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.FormAdaptiveConfigUIProcessor;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
import javax.swing.JComponent;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
/**
* Created by kerry on 2020-04-09
*/
@API(level = FormAdaptiveConfigUIProcessor.CURRENT_LEVEL)
public abstract class AbstractFormAdaptiveConfigUIProcessor extends AbstractProvider implements FormAdaptiveConfigUIProcessor {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
@Override
public BasicBeanPane getConfigPane() {
return null;
}
@Override
public BufferedImage paintFormElementCaseImage(Dimension size, JComponent elementCasePane) {
return null;
}
}

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

@ -0,0 +1,41 @@
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 null;
}
}

18
designer-base/src/main/java/com/fr/design/report/fit/menupane/AbstractFormAdaptiveConfigUI.java

@ -1,18 +0,0 @@
package com.fr.design.report.fit.menupane;
/**
* Created by kerry on 2020-04-09
*/
public abstract class AbstractFormAdaptiveConfigUI implements FormAdaptiveConfigUI {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

26
designer-base/src/main/java/com/fr/design/report/fit/menupane/FormAdaptiveConfigUI.java

@ -1,26 +0,0 @@
package com.fr.design.report.fit.menupane;
import com.fr.design.beans.BasicBeanPane;
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 FormAdaptiveConfigUI extends Immutable {
String MARK_STRING = "FormAdaptiveConfigUI";
int CURRENT_LEVEL = 1;
BasicBeanPane getConfigPane();
BufferedImage getElementCaseImage(Dimension size, JComponent elementCasePane);
}

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

@ -5,6 +5,7 @@ import com.fr.design.actions.JTemplateAction;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.fun.FormAdaptiveConfigUIProcessor;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
@ -43,7 +44,7 @@ public class ReportFitAttrAction extends JTemplateAction {
@Override @Override
public String getMenuName() { public String getMenuName() {
FormAdaptiveConfigUI configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); FormAdaptiveConfigUIProcessor configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING);
if (configPane != null) { if (configPane != null) {
return configPane.getConfigPane().getTitle(); return configPane.getConfigPane().getTitle();
} }
@ -91,7 +92,7 @@ public class ReportFitAttrAction extends JTemplateAction {
showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); showReportFitDialog(fitAttr, jwb, wbTpl, attrPane);
} else { } else {
BasicBeanPane attrPane = null; BasicBeanPane attrPane = null;
FormAdaptiveConfigUI configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); FormAdaptiveConfigUIProcessor configPane = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING);
if (configPane != null) { if (configPane != null) {
attrPane = configPane.getConfigPane(); attrPane = configPane.getConfigPane();
}else{ }else{

21
designer-base/src/main/java/com/fr/design/unit/ReportLengthUNIT.java

@ -1,21 +0,0 @@
package com.fr.design.unit;
import com.fr.stable.fun.mark.Mutable;
import com.fr.stable.unit.UNIT;
/**
* Created by kerry on 2020-04-09
*/
public interface ReportLengthUNIT extends Mutable {
String MARK_STRING = "ReportLengthUNIT";
int CURRENT_LEVEL = 1;
String unitText();
int unitType();
float unit2Value4Scale(UNIT value);
UNIT float2UNIT(float value);
}

14
designer-base/src/main/java/com/fr/design/unit/ReportLengthUnitProcessor.java

@ -1,14 +0,0 @@
package com.fr.design.unit;
import com.fr.stable.fun.mark.Immutable;
/**
* Created by kerry on 2020-04-09
*/
public interface ReportLengthUnitProcessor extends Immutable {
String MARK_STRING = "ReportLengthUnitProcessor";
int CURRENT_LEVEL = 1;
ReportLengthUNIT getReportLengthUNIT(int unitType);
}

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

@ -1,6 +1,7 @@
package com.fr.design.unit; package com.fr.design.unit;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.impl.CMReportLengthUNIT; import com.fr.design.unit.impl.CMReportLengthUNIT;
import com.fr.design.unit.impl.INCHReportLengthUNIT; import com.fr.design.unit.impl.INCHReportLengthUNIT;
import com.fr.design.unit.impl.MMReportLengthUNIT; import com.fr.design.unit.impl.MMReportLengthUNIT;
@ -8,18 +9,23 @@ import com.fr.design.unit.impl.PTReportLengthUNIT;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* Created by kerry on 2020-04-09 * Created by kerry on 2020-04-09
*/ */
public class UnitConvertUtil { public class UnitConvertUtil {
private static List<ReportLengthUNIT> lengthUNITList = new ArrayList<ReportLengthUNIT>(); private static List<ReportLengthUNITProvider> lengthUNITList = new ArrayList<ReportLengthUNITProvider>();
static { static {
lengthUNITList.add(new MMReportLengthUNIT());
lengthUNITList.add(new CMReportLengthUNIT()); lengthUNITList.add(new CMReportLengthUNIT());
lengthUNITList.add(new INCHReportLengthUNIT()); lengthUNITList.add(new INCHReportLengthUNIT());
lengthUNITList.add(new PTReportLengthUNIT()); lengthUNITList.add(new PTReportLengthUNIT());
lengthUNITList.add(new MMReportLengthUNIT()); Set<ReportLengthUNITProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportLengthUNITProvider.MARK_STRING);
for (ReportLengthUNITProvider provider : providers) {
lengthUNITList.add(provider);
}
} }
private UnitConvertUtil() { private UnitConvertUtil() {
@ -27,16 +33,20 @@ public class UnitConvertUtil {
} }
public static ReportLengthUNIT parseLengthUNIT(int unitType) { public static ReportLengthUNITProvider parseLengthUNIT(int unitType) {
ReportLengthUnitProcessor lengthUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(ReportLengthUnitProcessor.MARK_STRING); for (ReportLengthUNITProvider lengthUNIT : lengthUNITList) {
if (lengthUnitProcessor != null) {
return lengthUnitProcessor.getReportLengthUNIT(unitType);
}
for (ReportLengthUNIT lengthUNIT : lengthUNITList) {
if (unitType == lengthUNIT.unitType()) { if (unitType == lengthUNIT.unitType()) {
return lengthUNIT; return lengthUNIT;
} }
} }
return new MMReportLengthUNIT(); 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;
}
} }

19
designer-base/src/main/java/com/fr/design/unit/impl/AbstracReportLengthUnitProcessor.java

@ -1,19 +0,0 @@
package com.fr.design.unit.impl;
import com.fr.design.unit.ReportLengthUnitProcessor;
/**
* Created by kerry on 2020-04-09
*/
public abstract class AbstracReportLengthUnitProcessor implements ReportLengthUnitProcessor {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

22
designer-base/src/main/java/com/fr/design/unit/impl/AbstractReportLengthUNIT.java

@ -1,22 +0,0 @@
package com.fr.design.unit.impl;
import com.fr.design.unit.ReportLengthUNIT;
/**
* Created by kerry on 2020-04-09
*/
public abstract class AbstractReportLengthUNIT implements ReportLengthUNIT {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

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

@ -1,6 +1,6 @@
package com.fr.design.unit.impl; package com.fr.design.unit.impl;
import com.fr.design.unit.impl.AbstractReportLengthUNIT; import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.unit.CM; import com.fr.stable.unit.CM;
import com.fr.stable.unit.UNIT; import com.fr.stable.unit.UNIT;
@ -8,7 +8,7 @@ import com.fr.stable.unit.UNIT;
/** /**
* Created by kerry on 2020-04-09 * Created by kerry on 2020-04-09
*/ */
public class CMReportLengthUNIT extends AbstractReportLengthUNIT { public class CMReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override @Override
public String unitText() { public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM");

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

@ -1,6 +1,6 @@
package com.fr.design.unit.impl; package com.fr.design.unit.impl;
import com.fr.design.unit.impl.AbstractReportLengthUNIT; import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.unit.INCH; import com.fr.stable.unit.INCH;
import com.fr.stable.unit.UNIT; import com.fr.stable.unit.UNIT;
@ -8,7 +8,7 @@ import com.fr.stable.unit.UNIT;
/** /**
* Created by kerry on 2020-04-09 * Created by kerry on 2020-04-09
*/ */
public class INCHReportLengthUNIT extends AbstractReportLengthUNIT { public class INCHReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override @Override
public String unitText() { public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH");

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

@ -1,6 +1,6 @@
package com.fr.design.unit.impl; package com.fr.design.unit.impl;
import com.fr.design.unit.impl.AbstractReportLengthUNIT; import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.unit.MM; import com.fr.stable.unit.MM;
import com.fr.stable.unit.UNIT; import com.fr.stable.unit.UNIT;
@ -8,7 +8,7 @@ import com.fr.stable.unit.UNIT;
/** /**
* Created by kerry on 2020-04-09 * Created by kerry on 2020-04-09
*/ */
public class MMReportLengthUNIT extends AbstractReportLengthUNIT { public class MMReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override @Override
public String unitText() { public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM");

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

@ -1,5 +1,6 @@
package com.fr.design.unit.impl; package com.fr.design.unit.impl;
import com.fr.design.fun.impl.AbstractReportLengthUNITProvider;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.unit.PT; import com.fr.stable.unit.PT;
import com.fr.stable.unit.UNIT; import com.fr.stable.unit.UNIT;
@ -7,7 +8,7 @@ import com.fr.stable.unit.UNIT;
/** /**
* Created by kerry on 2020-04-09 * Created by kerry on 2020-04-09
*/ */
public class PTReportLengthUNIT extends AbstractReportLengthUNIT { public class PTReportLengthUNIT extends AbstractReportLengthUNITProvider {
@Override @Override
public String unitText() { public String unitText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_PT_Duplicate");

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

@ -4,13 +4,14 @@
package com.fr.design.actions.columnrow; package com.fr.design.actions.columnrow;
import com.fr.design.DesignerEnvManager; 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;
import com.fr.design.gui.frpane.UnitInputPane.ValueNotChangeException; import com.fr.design.gui.frpane.UnitInputPane.ValueNotChangeException;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.unit.ReportLengthUNIT; import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.UnitConvertUtil; import com.fr.design.unit.UnitConvertUtil;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
@ -49,7 +50,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
try { try {
float newHeight = (float) uPane.update(); float newHeight = (float) uPane.update();
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
UNIT len = lengthUNIT.float2UNIT(newHeight); UNIT len = lengthUNIT.float2UNIT(newHeight);
updateAction(report, len, finalCS); updateAction(report, len, finalCS);
} catch (ValueNotChangeException e) { } catch (ValueNotChangeException e) {
@ -64,7 +65,7 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction
protected void populateNumberDialog(final UnitInputPane uPane, UNIT unit) { protected void populateNumberDialog(final UnitInputPane uPane, UNIT unit) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
float va = lengthUNIT.unit2Value4Scale(unit); float va = lengthUNIT.unit2Value4Scale(unit);
uPane.setUnitText(lengthUNIT.unitText()); uPane.setUnitText(lengthUNIT.unitText());
uPane.populate(va); uPane.populate(va);

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

@ -3,7 +3,7 @@ package com.fr.design.condition;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.unit.ReportLengthUNIT; import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.UnitConvertUtil; import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -47,7 +47,7 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
public void populate(HighlightAction ha, JSpinner sp) { public void populate(HighlightAction ha, JSpinner sp) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
UNIT width = getUnit(ha); UNIT width = getUnit(ha);
ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
double va = lengthUNIT.unit2Value4Scale(width); double va = lengthUNIT.unit2Value4Scale(width);
unitLabel.setText(lengthUNIT.unitText()); unitLabel.setText(lengthUNIT.unitText());
// 只保留两位 // 只保留两位
@ -59,7 +59,7 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
protected String getUnitString() { protected String getUnitString() {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
return lengthUNIT.unitText(); return lengthUNIT.unitText();
} }
@ -68,7 +68,7 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
// 只保留两位 // 只保留两位
newWidth = new Float(new BigDecimal(newWidth + "").setScale(2, BigDecimal.ROUND_DOWN).floatValue()); newWidth = new Float(new BigDecimal(newWidth + "").setScale(2, BigDecimal.ROUND_DOWN).floatValue());
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
UNIT width = lengthUNIT.float2UNIT(newWidth); UNIT width = lengthUNIT.float2UNIT(newWidth);
return returnAction(width); return returnAction(width);
} }

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

@ -26,7 +26,7 @@ import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.report.fit.menupane.FormAdaptiveConfigUI; import com.fr.design.fun.FormAdaptiveConfigUIProcessor;
import com.fr.design.selection.SelectableElement; import com.fr.design.selection.SelectableElement;
import com.fr.design.selection.Selectedable; import com.fr.design.selection.Selectedable;
import com.fr.design.selection.SelectionListener; import com.fr.design.selection.SelectionListener;
@ -80,6 +80,7 @@ public class FormElementCaseDesigner
} }
@Override @Override
public void setTarget(T t) { public void setTarget(T t) {
super.setTarget(t); super.setTarget(t);
@ -125,9 +126,9 @@ public class FormElementCaseDesigner
*/ */
@Override @Override
public BufferedImage getElementCaseImage(Dimension size) { public BufferedImage getElementCaseImage(Dimension size) {
FormAdaptiveConfigUI adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUI.MARK_STRING); FormAdaptiveConfigUIProcessor adaptiveConfigUI = ExtraDesignClassManager.getInstance().getSingle(FormAdaptiveConfigUIProcessor.MARK_STRING);
if (adaptiveConfigUI != null) { if (adaptiveConfigUI != null) {
return adaptiveConfigUI.getElementCaseImage(size, this.elementCasePane); return adaptiveConfigUI.paintFormElementCaseImage(size, this.elementCasePane);
} }
BufferedImage image = null; BufferedImage image = null;
try { try {

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

@ -5,9 +5,9 @@ import com.fr.base.DynamicUnitList;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.unit.ReportLengthUNIT;
import com.fr.design.unit.UnitConvertUtil; import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
@ -307,7 +307,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
// int resolution = ScreenResolution.getScreenResolution(); // int resolution = ScreenResolution.getScreenResolution();
FU ulen = FU.valueOfPix((int) doubleValue, resolution); FU ulen = FU.valueOfPix((int) doubleValue, resolution);
FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution); FU tulen = FU.valueOfPix((int) totalDoubleValue, resolution);
ReportLengthUNIT lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType);
String unit = lengthUNIT.unitText(); String unit = lengthUNIT.unitText();
double len = lengthUNIT.unit2Value4Scale(ulen); double len = lengthUNIT.unit2Value4Scale(ulen);
double tlen = lengthUNIT.unit2Value4Scale(tulen); double tlen = lengthUNIT.unit2Value4Scale(tulen);

Loading…
Cancel
Save