Browse Source

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

feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
6a348cafe4
  1. 8
      build.gradle
  2. 46
      designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java
  4. 26
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java
  5. 39
      designer-base/src/test/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePaneTest.java
  6. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

8
build.gradle

@ -57,10 +57,10 @@ allprojects {
}
dependencies {
implementation 'com.fr.third:jxbrowser:7.5'
implementation 'com.fr.third:jxbrowser-swing:7.5'
implementation 'com.fr.third:jxbrowser-mac:7.5'
implementation 'com.fr.third:jxbrowser-win64:7.5'
implementation 'com.fr.third:jxbrowser:6.23'
implementation 'com.fr.third:jxbrowser-swing:6.23'
implementation 'com.fr.third:jxbrowser-mac:6.23'
implementation 'com.fr.third:jxbrowser-win64:6.23'
implementation 'com.fr.third.server:servlet-api:3.0'
implementation 'org.swingexplorer:swexpl:2.0.1'
implementation 'org.swingexplorer:swag:1.0'

46
designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java

@ -21,6 +21,8 @@ import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@ -82,6 +84,20 @@ public class JSContentPane extends BasicPane {
UIScrollPane sp = new UIScrollPane(contentTextArea);
this.add(sp, BorderLayout.CENTER);
contentTextArea.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
// 获得焦点时 安装
installAutoCompletion();
}
@Override
public void focusLost(FocusEvent e) {
// 失去焦点时 卸载
uninstallAutoCompletion();
}
});
UILabel funNameLabel2 = new UILabel();
funNameLabel2.setText("}");
this.add(funNameLabel2, BorderLayout.SOUTH);
@ -91,12 +107,10 @@ public class JSContentPane extends BasicPane {
return KeyStroke.getKeyStroke(ks.replace("+", "pressed"));
}
@Override
protected String title4PopupWindow() {
return "JS";
}
public void populate(String js) {
/**
* 注册安装 自动补全监听
*/
private void installAutoCompletion() {
if (ac == null) {
CompletionProvider provider = createCompletionProvider();
ac = new AutoCompletion(provider);
@ -105,16 +119,28 @@ public class JSContentPane extends BasicPane {
ac.setTriggerKey(convert2KeyStroke(shortCuts));
ac.install(contentTextArea);
}
this.contentTextArea.setText(js);
}
public String update() {
/**
* 卸载移除 自动补全监听
*/
private void uninstallAutoCompletion() {
if (ac != null) {
this.ac.uninstall();
ac.uninstall();
ac = null;
}
}
@Override
protected String title4PopupWindow() {
return "JS";
}
public void populate(String js) {
this.contentTextArea.setText(js);
}
public String update() {
return this.contentTextArea.getText();
}

2
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java

@ -109,7 +109,7 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane<Mobile
UILabel tabStyleLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Style"));
tabStyleLabel.setPreferredSize(new Dimension(55, 20));
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tabStyleLabel, custom}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
jPanel.setPreferredSize(new Dimension(200, 20));
jPanel.setPreferredSize(new Dimension(212, 20));
outPanel.add(jPanel);
scrollPanel.add(outPanel, BorderLayout.NORTH);

26
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java

@ -33,6 +33,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
private UnsignedIntUISpinner paddingLeftSpinner;
private UnsignedIntUISpinner paddingRightSpinner;
private UnsignedIntUISpinner paddingTopSpinner;
private UnsignedIntUISpinner paddingBottomSpinner;
private NewColorSelectBox initialBackgroundColorBox;
private NewColorSelectBox selectedBackgroundColorBox;
@ -77,6 +79,15 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
}
private JPanel createPaddingConfPane() {
this.paddingTopSpinner = new UnsignedIntUISpinner(0, 30, 1, UniteStyle.DEFAULT_PADDING_TOP);
this.paddingTopSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT));
this.paddingBottomSpinner = new UnsignedIntUISpinner(0, 30, 1, UniteStyle.DEFAULT_PADDING_BOTTOM);
this.paddingBottomSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT));
UILabel paddingTopLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Base_Top") + ":", SwingConstants.RIGHT);
paddingTopLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT));
UILabel paddingBottomLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Base_Bottom") + ":", SwingConstants.RIGHT);
paddingBottomLabel.setPreferredSize(new Dimension(LABEL_WIDTH / 2, LINE_COMPONENT_HEIGHT));
this.paddingLeftSpinner = new UnsignedIntUISpinner(0, Integer.MAX_VALUE, 1, UniteStyle.DEFAULT_PADDING_LEFT);
this.paddingLeftSpinner.setPreferredSize(new Dimension(62, LINE_COMPONENT_HEIGHT));
@ -86,11 +97,12 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
UILabel paddingLeftLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":", SwingConstants.RIGHT);
paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT));
UILabel paddingRightLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Right") + ":", SwingConstants.RIGHT);
paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH, LINE_COMPONENT_HEIGHT));
paddingLeftLabel.setPreferredSize(new Dimension(LABEL_WIDTH / 2, LINE_COMPONENT_HEIGHT));
JPanel paddingPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{
paddingLeftLabel, paddingLeftSpinner, paddingRightLabel,paddingRightSpinner
}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
JPanel paddingPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{ paddingTopLabel, paddingTopSpinner, paddingBottomLabel, paddingBottomSpinner},
new Component[]{ paddingLeftLabel, paddingLeftSpinner, paddingRightLabel,paddingRightSpinner}
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
paddingPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20));
return paddingPanel;
@ -164,6 +176,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
@Override
protected void initDefaultConfig() {
this.paddingTopSpinner.setValue(UniteStyle.DEFAULT_PADDING_TOP);
this.paddingBottomSpinner.setValue(UniteStyle.DEFAULT_PADDING_BOTTOM);
this.paddingLeftSpinner.setValue(UniteStyle.DEFAULT_PADDING_LEFT);
this.paddingRightSpinner.setValue(UniteStyle.DEFAULT_PADDING_RIGHT);
@ -191,6 +205,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
@Override
public void populateSubStyle(MobileTemplateStyle ob) {
UniteStyle style = (UniteStyle) ob;
this.paddingTopSpinner.setValue(style.getPaddingTop());
this.paddingBottomSpinner.setValue(style.getPaddingBottom());
this.paddingLeftSpinner.setValue(style.getPaddingLeft());
this.paddingRightSpinner.setValue(style.getPaddingRight());
@ -208,6 +224,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
@Override
public MobileTemplateStyle updateSubStyle() {
UniteStyle style = new UniteStyle();
style.setPaddingTop((int) this.paddingTopSpinner.getValue());
style.setPaddingBottom((int) this.paddingBottomSpinner.getValue());
style.setPaddingLeft((int) this.paddingLeftSpinner.getValue());
style.setPaddingRight((int) this.paddingRightSpinner.getValue());

39
designer-base/src/test/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePaneTest.java

@ -0,0 +1,39 @@
package com.fr.design.mainframe.mobile.ui;
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.cardtag.mobile.UniteStyle;
import com.fr.invoke.Reflect;
import junit.framework.TestCase;
import org.junit.Test;
import java.awt.*;
public class UniteStyleDefinePaneTest extends TestCase {
@Test
public void testDefaultConfig() {
UniteStyleDefinePane definePane = new UniteStyleDefinePane(new WCardTagLayout());
Reflect.on(definePane).call("initDefaultConfig");
double paddingTop = Reflect.on(definePane).field("paddingTopSpinner").call("getValue").get();
assertEquals((int)paddingTop, UniteStyle.DEFAULT_PADDING_TOP);
double paddingBottom = Reflect.on(definePane).field("paddingBottomSpinner").call("getValue").get();
assertEquals((int)paddingBottom, UniteStyle.DEFAULT_PADDING_BOTTOM);
double paddingLeft = Reflect.on(definePane).field("paddingLeftSpinner").call("getValue").get();
assertEquals((int)paddingLeft, UniteStyle.DEFAULT_PADDING_LEFT);
double paddingRight = Reflect.on(definePane).field("paddingRightSpinner").call("getValue").get();
assertEquals((int)paddingRight, UniteStyle.DEFAULT_PADDING_RIGHT);
Color initialBackgroundColor = Reflect.on(definePane).field("initialBackgroundColorBox").call("getSelectObject").get();
assertEquals(initialBackgroundColor, UniteStyle.DEFAULT_INITIAL_BACKGROUND_COLOR);
Color selectedBackgroundColor = Reflect.on(definePane).field("selectedBackgroundColorBox").call("getSelectObject").get();
assertEquals(selectedBackgroundColor, UniteStyle.DEFAULT_SELECTED_BACKGROUND_COLOR);
int lineStyle = Reflect.on(definePane).field("borderWidthComboBox").call("getSelectedLineStyle").get();
assertEquals(lineStyle, UniteStyle.DEFAULT_BORDER_LINE.lineStyle);
Color borderColor = Reflect.on(definePane).field("borderColorBox").call("getSelectObject").get();
assertEquals(borderColor, UniteStyle.DEFAULT_BORDER_LINE.color);
double borderRadius = Reflect.on(definePane).field("borderRadiusSpinner").call("getValue").get();
assertEquals((int)borderRadius, UniteStyle.DEFAULT_BORDER_RADIUS);
}
}

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

@ -53,7 +53,7 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
Component[][] components = getShowComponents();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 24, 6);
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 5, 15));
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 5, 8));
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.NORTH);

Loading…
Cancel
Save