Browse Source

Merge pull request #2060 in DESIGN/design from release/10.0 to bugfix/10.0

* commit '4acce104bc1129063b23bb69b8855ac665dfdeaf':
  REPORT-37250  windows下显示异常
  REPORT-37041 中文版设计器条件属性中超级链接和控件事件弹框尺寸发生变化
bugfix/10.0
superman 4 years ago
parent
commit
b9b786f85c
  1. 3
      designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java
  2. 28
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  3. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  4. 4
      designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java
  5. 6
      designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java

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

@ -31,6 +31,7 @@ public class JSContentPane extends BasicPane {
private RSyntaxTextArea contentTextArea; private RSyntaxTextArea contentTextArea;
private UILabel funNameLabel; private UILabel funNameLabel;
private AutoCompletion ac; private AutoCompletion ac;
private static final Dimension FUNCTION_NAME_LABEL_SIZE = new Dimension(300, 80);
private int titleWidth = 180; private int titleWidth = 180;
@ -68,7 +69,7 @@ public class JSContentPane extends BasicPane {
JPanel jsParaPane = new JPanel(new BorderLayout(4, 4)); JPanel jsParaPane = new JPanel(new BorderLayout(4, 4));
jsParaPane.setPreferredSize(new Dimension(300, 80)); jsParaPane.setPreferredSize(new Dimension(300, 80));
UIScrollPane scrollPane = new UIScrollPane(funNameLabel); UIScrollPane scrollPane = new UIScrollPane(funNameLabel);
scrollPane.setPreferredSize(new Dimension(400, 80)); scrollPane.setPreferredSize(FUNCTION_NAME_LABEL_SIZE);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC)); scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
jsParaPane.add(scrollPane, BorderLayout.WEST); jsParaPane.add(scrollPane, BorderLayout.WEST);
jsParaPane.add(label, BorderLayout.EAST); jsParaPane.add(label, BorderLayout.EAST);

28
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -402,6 +402,19 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
} }
public void paintChildren(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
AffineTransform old = g2d.getTransform();
AffineTransform at = new AffineTransform();
at.translate(this.getPaintX(), this.getPaintY());
at.scale(this.getScale(), this.getScale());
g2d.transform(at);
super.paintChildren(g);
g2d.setTransform(old);
}
/** /**
* 自动添加组件 * 自动添加组件
* *
@ -1283,21 +1296,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
this.formArea = formArea; this.formArea = formArea;
} }
public void paint(Graphics g){
//重新设置下绘制的起点和缩放幅度
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(this.getPaintX(), this.getPaintY());
at.scale(this.getScale(), this.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
super.paint(g);
}
/** /**
* 绘制组件根节点 * 绘制组件根节点
* *

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

@ -68,6 +68,13 @@ public class FormDesignerUI extends ComponentUI {
public void paint(final Graphics g, JComponent c) { public void paint(final Graphics g, JComponent c) {
XCreator rootComponent = designer.getRootComponent(); XCreator rootComponent = designer.getRootComponent();
this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution(); this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution();
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(designer.getPaintX(), designer.getPaintY());
at.scale(designer.getScale(), designer.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
if (rootComponent != null) { if (rootComponent != null) {
// 设计自适应界面 // 设计自适应界面
repaintFit(g, rootComponent, c); repaintFit(g, rootComponent, c);

4
designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java

@ -15,7 +15,6 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction;
import javax.swing.*; import javax.swing.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -31,7 +30,6 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
protected UIButton hyperlinkButton; protected UIButton hyperlinkButton;
protected HyperlinkGroupPane pane; protected HyperlinkGroupPane pane;
protected BasicDialog dialog; protected BasicDialog dialog;
private static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(730, 600);
public HyperlinkPane(final ConditionAttributesPane conditionAttributesPane) { public HyperlinkPane(final ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane); super(conditionAttributesPane);
@ -41,7 +39,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
NameJavaScriptGroup nameHyperlinks = jsGroup; NameJavaScriptGroup nameHyperlinks = jsGroup;
pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPaneNoPop(HyperlinkGroupPaneActionImpl.getInstance()); pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPaneNoPop(HyperlinkGroupPaneActionImpl.getInstance());
pane.populate(nameHyperlinks); pane.populate(nameHyperlinks);
dialog = pane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(conditionAttributesPane), null, WINDOW_CUSTOM_SIZE); dialog = pane.showWindow(SwingUtilities.getWindowAncestor(conditionAttributesPane));
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {

6
designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java

@ -12,12 +12,10 @@ import com.fr.design.widget.WidgetManageCardPane;
import com.fr.design.widget.WidgetPane; import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.form.ui.TextArea;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.WidgetHighlightAction; import com.fr.report.cell.cellattr.highlight.WidgetHighlightAction;
import javax.swing.*; import javax.swing.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -29,7 +27,6 @@ import java.awt.event.ActionListener;
public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<HighlightAction> { public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<HighlightAction> {
private static final int DIALOG_WIDTH = 700; private static final int DIALOG_WIDTH = 700;
private static final int DIALOG_HEIGHT = 400; private static final int DIALOG_HEIGHT = 400;
private static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(720, 600);
private Widget widget; private Widget widget;
private UIComboBox box; private UIComboBox box;
@ -48,7 +45,8 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
} }
}; };
widgetPane.populate(widget); widgetPane.populate(widget);
BasicDialog dialog = widgetPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(conditionAttributesPane), null, WINDOW_CUSTOM_SIZE); BasicDialog dialog = widgetPane.showWindow(
SwingUtilities.getWindowAncestor(conditionAttributesPane));
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() { public void doOk() {
widget = widgetPane.update(); widget = widgetPane.update();

Loading…
Cancel
Save