Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~java.edge/design into localsss

feature/big-screen
Java.Edge 5 years ago
parent
commit
1dcd6a24f6
  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. 16
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButton.java
  7. 121
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButtonUI.java
  8. 16
      designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java
  9. 8
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java
  10. 2
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java
  11. 3
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java
  12. 3
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java
  13. 49
      designer-base/src/main/java/com/fr/design/os/impl/MacOsAddListenerAction.java
  14. 2
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  15. 5
      designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java
  16. 7
      designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java
  17. 3
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java
  18. 2
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java
  19. 52
      designer-base/src/main/java/com/fr/design/unit/UnitConvertUtil.java
  20. 32
      designer-base/src/main/java/com/fr/design/unit/impl/CMReportLengthUNIT.java
  21. 31
      designer-base/src/main/java/com/fr/design/unit/impl/INCHReportLengthUNIT.java
  22. 31
      designer-base/src/main/java/com/fr/design/unit/impl/MMReportLengthUNIT.java
  23. 31
      designer-base/src/main/java/com/fr/design/unit/impl/PTReportLengthUNIT.java
  24. 2
      designer-base/src/main/java/com/fr/design/upm/UpmFinder.java
  25. 11
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  26. 9
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  27. 2
      designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java
  28. 9
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java
  29. 18
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  30. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  31. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/cuvette.png
  32. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_180.png
  33. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/pointer_360.png
  34. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/ring.png
  35. BIN
      designer-chart/src/main/resources/com/fr/van/chart/custom/images/custom/icon/slot.png
  36. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/cuvette.png
  37. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/pointer.png
  38. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/pointer_180.png
  39. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/ring.png
  40. BIN
      designer-chart/src/main/resources/com/fr/van/chart/gauge/images/slot.png
  41. 4
      designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java
  42. 5
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java
  43. 9
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  44. 4
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  45. 36
      designer-form/src/main/java/com/fr/design/designer/properties/mobile/MobileBookMarkCombinePropertyUI.java
  46. 14
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  47. 4
      designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java
  48. 5
      designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  49. 9
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java
  50. 5
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java
  51. 137
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java
  52. 69
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileBookMarkCombinePane.java
  53. 5
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  54. 169
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileAdvanceInnerPane.java
  55. 19
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java
  56. 38
      designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java
  57. 15
      designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java
  58. 2
      designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java
  59. 51
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  60. 2
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java
  61. 7
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  62. 8
      designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java
  63. 3
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  64. 8
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  65. 4
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java
  66. 14
      designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java
  67. 26
      designer-realize/src/main/java/com/fr/grid/AbstractGridHeaderMouseHandler.java
  68. 4
      designer-realize/src/main/java/com/fr/start/DesignerSuperListener.java
  69. 8
      designer-realize/src/main/java/com/fr/start/LifecycleFatalErrorHandler.java
  70. 6
      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;
}
}

16
designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButton.java

@ -22,6 +22,8 @@ public class UIRadioButton extends JRadioButton implements UIObserver, GlobalNam
private GlobalNameListener globalNameListener = null;
private String radioButtonName = StringUtils.EMPTY;
private boolean markMnemonic = true;
public UIRadioButton() {
super();
initListener();
@ -58,6 +60,13 @@ public class UIRadioButton extends JRadioButton implements UIObserver, GlobalNam
initComponent();
}
public UIRadioButton(String text, boolean selected, boolean markMnemonic) {
super(text, selected);
initListener();
initComponent();
this.markMnemonic = markMnemonic;
}
public UIRadioButton(String text, Icon icon) {
super(text, icon);
initListener();
@ -70,6 +79,13 @@ public class UIRadioButton extends JRadioButton implements UIObserver, GlobalNam
initListener();
}
public void setMnemonic(char mnemonic) {
super.setMnemonic(mnemonic);
if (!markMnemonic) {
setDisplayedMnemonicIndex(-1);
}
}
private void initListener() {
if (shouldResponseChangeListener()) {
this.addItemListener(new ItemListener() {

121
designer-base/src/main/java/com/fr/design/gui/ibutton/UIRadioButtonUI.java

@ -5,9 +5,12 @@ import com.fr.design.utils.ThemeUtils;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.metal.MetalRadioButtonUI;
import java.awt.*;
import java.awt.event.KeyEvent;
import javax.swing.text.View;
import sun.swing.SwingUtilities2;
/**
* Created by IntelliJ IDEA.
@ -84,6 +87,124 @@ public class UIRadioButtonUI extends MetalRadioButtonUI {
return radioButton;
}
// ********************************
// Paint Methods
// ********************************
public synchronized void paint(Graphics g, JComponent c) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
Dimension size = c.getSize();
int w = size.width;
int h = size.height;
Font f = c.getFont();
g.setFont(f);
FontMetrics fm = SwingUtilities2.getFontMetrics(c, g, f);
Rectangle viewRect = new Rectangle(size);
Rectangle iconRect = new Rectangle();
Rectangle textRect = new Rectangle();
Insets i = c.getInsets();
viewRect.x += i.left;
viewRect.y += i.top;
viewRect.width -= (i.right + viewRect.x);
viewRect.height -= (i.bottom + viewRect.y);
Icon altIcon = b.getIcon();
Icon selectedIcon = null;
Icon disabledIcon = null;
String text = SwingUtilities.layoutCompoundLabel(
c, fm, b.getText(), altIcon != null ? altIcon : getDefaultIcon(),
b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
viewRect, iconRect, textRect, b.getIconTextGap());
// fill background
if (c.isOpaque()) {
g.setColor(b.getBackground());
g.fillRect(0, 0, size.width, size.height);
}
// Paint the radio button
if (altIcon != null) {
if (!model.isEnabled()) {
if (model.isSelected()) {
altIcon = b.getDisabledSelectedIcon();
} else {
altIcon = b.getDisabledIcon();
}
} else if (model.isPressed() && model.isArmed()) {
altIcon = b.getPressedIcon();
if (altIcon == null) {
// Use selected icon
altIcon = b.getSelectedIcon();
}
} else if (model.isSelected()) {
if (b.isRolloverEnabled() && model.isRollover()) {
altIcon = b.getRolloverSelectedIcon();
if (altIcon == null) {
altIcon = b.getSelectedIcon();
}
} else {
altIcon = b.getSelectedIcon();
}
} else if (b.isRolloverEnabled() && model.isRollover()) {
altIcon = b.getRolloverIcon();
}
if (altIcon == null) {
altIcon = b.getIcon();
}
altIcon.paintIcon(c, g, iconRect.x, iconRect.y);
} else {
getDefaultIcon().paintIcon(c, g, iconRect.x, iconRect.y);
}
// Draw the Text
if (text != null) {
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, textRect);
} else {
int mnemIndex = b.getDisplayedMnemonicIndex();
if (model.isEnabled()) {
// *** paint the text normally
g.setColor(b.getForeground());
} else {
// *** paint the text disabled
g.setColor(getDisabledTextColor());
}
if (markMnemonic(text, mnemIndex)) {
SwingUtilities2.drawStringUnderlineCharAt(c, g, text,
mnemIndex, textRect.x, textRect.y + fm.getAscent());
} else {
SwingUtilities2.drawString(c, g, text, textRect.x, textRect.y + fm.getAscent());
}
}
if (b.hasFocus() && b.isFocusPainted() &&
textRect.width > 0 && textRect.height > 0) {
paintFocus(g, textRect, size);
}
}
}
/**
* @param text
* @param mnemIndex 助记符在text中的索引
* @return true:需要给助记符画一个下划线
*/
private boolean markMnemonic(String text, int mnemIndex) {
return mnemIndex > 0 && text != null && text.length() > 0 && text.length() > mnemIndex;
}
/**
* Paints the focus for the radiobutton

16
designer-base/src/main/java/com/fr/design/gui/icheckbox/UICheckBox.java

@ -34,6 +34,7 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser
private UIObserverListener uiObserverListener;
private GlobalNameListener globalNameListener = null;
private String checkboxName = "";
private boolean markMnemonic = true;
public UICheckBox(String string) {
super(string);
@ -53,6 +54,13 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser
initListener();
}
public UICheckBox(String locText, boolean b, boolean markMnemonic) {
super(locText, b);
setUI(new UICheckBoxUI());
initListener();
this.markMnemonic=markMnemonic;
}
public UICheckBox(String text, Icon icon) {
super(text, icon);
setUI(new UICheckBoxUI());
@ -189,14 +197,18 @@ public class UICheckBox extends JCheckBox implements UIObserver, GlobalNameObser
if (v != null) {
v.paint(g, textRect);
} else {
int mnemIndex = b.getDisplayedMnemonicIndex();
if (model.isEnabled()) {
g.setColor(b.getForeground());
} else {
g.setColor(getDisabledTextColor());
}
if (markMnemonic) {
SwingUtilities2.drawStringUnderlineCharAt(c, g, text,
mnemIndex, textRect.x, textRect.y + fm.getAscent());
b.getDisplayedMnemonicIndex(), textRect.x, textRect.y + fm.getAscent());
} else {
SwingUtilities2.drawString(c, g, text, textRect.x, textRect.y + fm.getAscent());
}
}
}
}

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

2
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java

@ -235,7 +235,7 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
public void actionPerformed(ActionEvent e) {
int[] selectedRow = table.getSelectedRows();
if (ismultiSelected()) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text"));
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multiple_Select_Warn_Text"));
return;
}
if (table.getCellEditor() != null) {

3
designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java

@ -2,6 +2,7 @@ package com.fr.design.javascript;
import com.fr.base.Parameter;
import com.fr.design.data.tabledata.tabledatapane.OneListTableModel;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditAction;
@ -62,7 +63,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
}
if (tempSet.contains(list.get(i).toString())) {
list.remove(i);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!");
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Duplicate_Name") + "!");
parameterChanger(list);
return;
}

3
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java

@ -12,6 +12,7 @@ import java.util.ArrayList;
import javax.swing.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
@ -222,7 +223,7 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
}
public static void showMessage(String message, Component editorComponent) {
JOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE);
FineJOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE);
}

49
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},
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 ("handleQuitRequestWith".equals(method.getName())) {
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();
}
}
return null;
}
});
Reflect.on(Reflect.on(app).call("getApplication").get()).call("setQuitHandler", instance);
} catch (ClassNotFoundException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
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();
}
},

5
designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java

@ -2,6 +2,7 @@ package com.fr.design.parameter;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.NameableSelfCreator;
@ -36,14 +37,14 @@ public class ParameterArrayPane extends JListControlPane {
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name"));
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name"));
setIllegalIndex(editingIndex);
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) {
nameableList.stopEditing();
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this),
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name"));
setIllegalIndex(editingIndex);
}

7
designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -20,6 +21,7 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
private static final int EDITOR_COLUMN = 15;
private static final int LEFT_BORDER = 5;
private static final int MAX_WIDTH = 30;
private FormulaEditor keyFormulaEditor;
private FormulaEditor valueFormulaEditor;
@ -61,10 +63,9 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
valueFormulaContainer.add(new JLabel(icon));
valueFormulaContainer.add(valueFormulaEditor);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), UILabel.LEFT), keyFormulaContainer},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), UILabel.LEFT), valueFormulaContainer},
new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), MAX_WIDTH, UILabel.LEFT), keyFormulaContainer},
new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), MAX_WIDTH, UILabel.LEFT), valueFormulaContainer},
new Component[]{tag, null}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);

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

2
designer-base/src/main/java/com/fr/design/upm/UpmFinder.java

@ -88,7 +88,7 @@ public class UpmFinder {
dialog.setVisible(true);
}
} else {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message"));
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Plugin_Message"));
UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame());
dialog.setAutoUpdateAfterInit();
dialog.showDialog();

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

9
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -3,6 +3,7 @@
*/
package com.fr.start;
import com.fr.common.report.ReportState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.DesignerLaunchStatus;
@ -24,6 +25,9 @@ import com.fr.file.FILEFactory;
import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils;
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.OperatingSystem;
import java.awt.Window;
@ -75,6 +79,11 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
@Override
public void on(Event event, Null param) {
EventDispatcher.stopListen(this);
// 启动完成 停止监听
ProcessEventPipe eventPipe = FineProcessContext.getParentPipe();
if (eventPipe != null) {
eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue()));
}
collectUserInformation();
}
});

2
designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java

@ -4,6 +4,7 @@ import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartHyperlinkGroup;
@ -50,6 +51,7 @@ public class ChartDesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());
ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance());
ChartTypeInterfaceManager.addPluginChangedListener();
}

9
designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java

@ -31,7 +31,7 @@ import java.awt.event.MouseMotionListener;
* 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件
右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件
*/
public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener{
public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener, CallbackEvent{
private static final long serialVersionUID = 744164838619052097L;
private final List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
private ChartCollection chartCollection4Design;
@ -257,7 +257,12 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
if (resolution == 0){
resolution = ScreenResolution.getScreenResolution();
}
painter.paint(g2d, chartWidth, chartHeight, resolution, null);
painter.paint(g2d, chartWidth, chartHeight, resolution, null,this);
}
}
@Override
public void callback() {
this.repaint();
}
}

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();
}
jf.fireTargetModified();
}
});

5
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.form.layout.FRBorderLayout;
import com.fr.general.ComparatorUtils;
@ -47,13 +48,13 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
if (ComparatorUtils.equals(constraints, BorderLayout.NORTH) || ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) {
int containerHeight = container.getHeight();
if (rectangle.height > containerHeight) {
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return true;
}
} else if (ComparatorUtils.equals(constraints, BorderLayout.EAST) || ComparatorUtils.equals(constraints, BorderLayout.WEST)) {
int containerWidth = container.getWidth();
if (rectangle.width > containerWidth) {
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return true;
}
}

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

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

@ -593,12 +593,8 @@ 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];
}
}
@Override
public void firePropertyChange(){

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");
}
}

14
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;
@ -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);
}
/**
* 权限细粒度模板菜单
* 表单中去掉此菜单项

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()) {

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

9
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.FormDesigner;
@ -115,11 +116,11 @@ public class WidgetBoundPane extends BasicPane {
PaddingMargin margin = wabs.getMargin();
if (bounds.width != w) {
if (bounds.width == rec.width - margin.getLeft() - margin.getRight()) {
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds"));
width.setValue(bounds.width);
return;
} else if (w < minWidth) {
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth));
width.setValue(bounds.width);
return;
}
@ -136,11 +137,11 @@ public class WidgetBoundPane extends BasicPane {
int minHeight = (int) (MINHEIGHT * ((WFitLayout) wabs).getResolutionScaling());
if (bounds.height != h) {
if (bounds.height == rec.height - margin.getTop() - margin.getBottom()) {
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds"));
height.setValue(bounds.height);
return;
} else if (h < minHeight) {
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight));
height.setValue(bounds.height);
return;
}

5
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java

@ -4,6 +4,7 @@ import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
@ -48,13 +49,13 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane {
Rectangle rectangle = tabLayout.getBounds();
if(ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){
if(rectangle.height < size){
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return;
}
parentBounds.height = size;
}else{
if(rectangle.width < size){
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
return;
}
parentBounds.width = size;

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";

38
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;
/**
@ -52,16 +50,8 @@ 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
@ -75,21 +65,9 @@ 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);
}

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

2
designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java

@ -65,7 +65,7 @@ public class DSColumnCellEditor extends AbstractCellEditor implements DialogActi
this.dsColumnPane = new DSColumnPane();
dsColumnPane.putElementcase(grid.getElementCasePane());
dsColumnPane.putCellElement(cellElement);
BasicDialog dsColumnDialog = this.dsColumnPane.showWindow(SwingUtilities.getWindowAncestor(grid));
BasicDialog dsColumnDialog = this.dsColumnPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(grid), null, DSColumnPane.DEFAULT_DIMENSION);
dsColumnDialog.addDialogActionListener(this);

51
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
@ -48,20 +47,9 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
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);
}

2
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java

@ -26,6 +26,8 @@ import java.beans.PropertyChangeListener;
*/
public class DSColumnPane extends BasicPane {
public static final Dimension DEFAULT_DIMENSION = new Dimension(700, 600);
private TableDataSource tplEC;
private UITabbedPane tabbedPane;
private DSColumnBasicPane basicPane = null;

7
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,

8
designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java

@ -22,7 +22,6 @@ import java.util.Map;
public class SolidCollector {
private static final String ATTR_CIPHER_TEXT = "cipherText";
private static final String ATTR_SIGNATURE = "signature";
private static final String SOLID_UPLOAD_URL = CloudCenter.getInstance().acquireUrlByKind("design.solid");
private static volatile SolidCollector instance;
@ -44,6 +43,11 @@ public class SolidCollector {
if (WorkContext.getCurrent().isLocal()) {
return;
}
String url = CloudCenter.getInstance().acquireConf("design.solid", "https://cloud.fanruan.com/api/solid/upload");
if (StringUtils.isEmpty(url)) {
FineLoggerFactory.getLogger().info("failed to get solid content upload url...");
return;
}
FineLoggerFactory.getLogger().info("start to get solid content from server...");
try {
String cipherText = requestContent();
@ -51,7 +55,7 @@ public class SolidCollector {
Map<String, Object> params = new HashMap<>();
params.put(ATTR_CIPHER_TEXT, cipherText);
params.put(ATTR_SIGNATURE, String.valueOf(CommonUtils.signature()));
HttpToolbox.post(SOLID_UPLOAD_URL, params);
HttpToolbox.post(url, params);
deleteSolidFile();
}

3
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.socketio;
import com.fr.config.RemoteConfigEvent;
import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogger;
@ -146,7 +147,7 @@ public class DesignerSocketIO {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(
FineJOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Remote_Disconnected"),
UIManager.getString("OptionPane.messageDialogTitle"),

8
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -885,12 +885,12 @@ public class PageSetupPane extends BasicPane {
Icon topBottomIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/down.png");
topBottomRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Top_To_Bottom"));
topBottomRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Top_To_Bottom"),false,false);
pageOrderPane.add(FRGUIPaneFactory.createIconRadio_S_Pane(topBottomIcon, topBottomRadioButton));
topBottomRadioButton.setMnemonic('B');
Icon leftRightIcon = BaseUtils.readIcon("/com/fr/base/images/dialog/pagesetup/over.png");
leftRightRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Left_To_Right"));
leftRightRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Left_To_Right"), false, false);
pageOrderPane.add(FRGUIPaneFactory.createIconRadio_S_Pane(leftRightIcon, leftRightRadioButton));
leftRightRadioButton.setMnemonic('R');
@ -907,9 +907,9 @@ public class PageSetupPane extends BasicPane {
defaultPane.add(outcenterOnPagePane);
this.horizonalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Horizontally"));
this.horizonalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Horizontally"), false, false);
this.horizonalCenterCheckBox.setMnemonic('H');
this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically"));
this.verticalCenterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Vertically"), false, false);
this.verticalCenterCheckBox.setMnemonic('V');
centerOnPagePane.add(GUICoreUtils.createFlowPane(horizonalCenterCheckBox, FlowLayout.CENTER));

4
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -129,7 +129,7 @@ public class WebJsPane extends BasicPane {
if (url.matches("^[a-zA-z]+://.+js")) {
return url;
} else {
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning"));
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning"));
return "";
}
}
@ -190,7 +190,7 @@ public class WebJsPane extends BasicPane {
public void actionPerformed(ActionEvent arg0) {
String uri = urlText.getText();
if (!uri.matches("^[a-zA-z]+://.+js")) {
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning"));
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(WebJsPane.this), com.fr.design.i18n.Toolkit.i18nText("Add_JS_warning"));
return;
}
InputStream in = null;

14
designer-realize/src/main/java/com/fr/design/webattr/printsettings/AbstractNativePrintSettingPane.java

@ -103,14 +103,14 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
showDialogCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Show_Print_Setting_Window_When_Printing"));
showDialogCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
UILabel showDialogCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Use_Default_Settings"));
JPanel showDialogCheckPane = GUICoreUtils.createFlowPane(new Component[] {
JPanel showDialogCheckPane = GUICoreUtils.createFlowPane(new Component[]{
showDialogCheck, showDialogCheckTip}, FlowLayout.LEFT);
// 打印需要指定 sheet
needSelectSheetCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Need_Select_Sheet_When_Printing"));
needSelectSheetCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
UILabel needSelectSheetCheckTip = GUICoreUtils.createTipLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tip_Invalid_In_Page_View"));
JPanel needSelectSheetCheckPane = GUICoreUtils.createFlowPane(new Component[] {
JPanel needSelectSheetCheckPane = GUICoreUtils.createFlowPane(new Component[]{
needSelectSheetCheck, needSelectSheetCheckTip}, FlowLayout.LEFT);
return createHeaderPane(tipDownload, showDialogCheckPane, needSelectSheetCheckPane);
@ -263,7 +263,7 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
' ' +
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_mm") +
']';
this.setText(sbuf);
this.setText(" " + sbuf);
break;
}
}
@ -461,8 +461,8 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
extraUpdate(nativePrintAttr);
nativePrintAttr.setShowDialog(showDialogCheck.isSelected());
nativePrintAttr.setNeedSelectSheet(needSelectSheetCheck.isSelected());
nativePrintAttr.setPrinterName((String)printerComboBox.getSelectedItem());
nativePrintAttr.setCopy((int)copySpinner.getValue());
nativePrintAttr.setPrinterName((String) printerComboBox.getSelectedItem());
nativePrintAttr.setCopy((int) copySpinner.getValue());
// 页码
if (allPageRadioButton.isSelected()) {
@ -472,7 +472,7 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
} else if (customPageRadioButton.isSelected()) {
nativePrintAttr.setPageType(NativePrintAttr.PageType.SPECIFIED_PAGES);
nativePrintAttr.setArea(specifiedAreaField.getText());
} else if (doublePrintComboBox.getSelectedIndex() == ODD_INDEX){
} else if (doublePrintComboBox.getSelectedIndex() == ODD_INDEX) {
nativePrintAttr.setPageType(NativePrintAttr.PageType.ODD_PAGES);
} else {
nativePrintAttr.setPageType(NativePrintAttr.PageType.EVEN_PAGES);
@ -494,7 +494,7 @@ public abstract class AbstractNativePrintSettingPane extends JPanel {
nativePrintAttr.setInheritPageMarginSetting(inheritPageMarginSettingCheck.isSelected());
nativePrintAttr.setMargin(pageMarginSettingPane.updateBean());
nativePrintAttr.setFitPaperSize(fitPaperSizeCheck.isSelected());
nativePrintAttr.setScalePercent((int)scalePercentField.getValue());
nativePrintAttr.setScalePercent((int) scalePercentField.getValue());
}
protected void extraUpdate(NativePrintAttr nativePrintAttr) {

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

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