Browse Source

Merge pull request #1312 in DESIGN/design from ~PENGDA/design:release/10.0 to release/10.0

* commit '1b936122d0bd92763e207a70250635f2a116b2c2':
  REPORT-23943 进入参数面板,点击预定义控件,弹框无法缩回
  REPORT-23960 linux设计器-rhel系统,超级链接问题
  REPORT-23954  linux设计器-rhel系统,条件属性问题
feature/big-screen
neil 5 years ago
parent
commit
f0a0e6a219
  1. 25
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  2. 35
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java
  3. 16
      designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

25
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -9,18 +9,9 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
@ -34,6 +25,14 @@ import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Window; import java.awt.Window;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.border.EmptyBorder;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
@ -72,7 +71,6 @@ abstract class UIControlPane extends JControlPane {
this.creators = this.createNameableCreators(); this.creators = this.createNameableCreators();
initCardPane(); initCardPane();
if (isNewStyle()) { if (isNewStyle()) {
getPopupEditDialog(cardPane); getPopupEditDialog(cardPane);
this.add(getLeftPane(), BorderLayout.CENTER); this.add(getLeftPane(), BorderLayout.CENTER);
@ -148,9 +146,7 @@ abstract class UIControlPane extends JControlPane {
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
JPanel leftTopPane = getLeftTopPane(topToolBar); JPanel leftTopPane = getLeftTopPane(topToolBar);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));
leftPane.add(leftTopPane, BorderLayout.NORTH); leftPane.add(leftTopPane, BorderLayout.NORTH);
@ -171,7 +167,6 @@ abstract class UIControlPane extends JControlPane {
JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
leftTopPane.add(toolBarPane, BorderLayout.EAST); leftTopPane.add(toolBarPane, BorderLayout.EAST);
leftTopPane.add(addItemLabel, BorderLayout.CENTER); leftTopPane.add(addItemLabel, BorderLayout.CENTER);
return leftTopPane; return leftTopPane;
} }
@ -202,7 +197,6 @@ abstract class UIControlPane extends JControlPane {
topToolBar.validate(); topToolBar.validate();
this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板
cardPane.add(controlUpdatePane, "EDIT"); cardPane.add(controlUpdatePane, "EDIT");
this.repaint(); this.repaint();
} }
@ -248,7 +242,6 @@ abstract class UIControlPane extends JControlPane {
return; return;
} }
} }
// 要隐藏 先检查有没有非法输入 // 要隐藏 先检查有没有非法输入
// 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框 // 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框
try { try {
@ -268,6 +261,8 @@ abstract class UIControlPane extends JControlPane {
addWindowFocusListener(new WindowAdapter() { addWindowFocusListener(new WindowAdapter() {
@Override @Override
public void windowLostFocus(WindowEvent e) { public void windowLostFocus(WindowEvent e) {
//在Linux上拉回焦点,不然导致一些面板关不掉
requestFocus();
hideDialog(); hideDialog();
} }
}); });

35
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java

@ -12,14 +12,11 @@ import java.awt.Rectangle;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JWindow; import javax.swing.JWindow;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.location.Location;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.stable.OperatingSystem; import com.fr.stable.os.OperatingSystem;
//august: //august:
public class FormWidgetPopWindow extends JWindow { public class FormWidgetPopWindow extends JWindow {
@ -52,24 +49,28 @@ public class FormWidgetPopWindow extends JWindow {
if (event instanceof MouseEvent) { if (event instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) event; MouseEvent mv = (MouseEvent) event;
if (mv.getClickCount() > 0) { if (mv.getClickCount() > 0) {
Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY()); hideWindow(mv);
if (OperatingSystem.isWindows()) {
if(!FormWidgetPopWindow.this.contains(point)) {
FormWidgetPopWindow.this.setVisible(false);
}
} else if (OperatingSystem.isMacOS()) {
Dimension d = FormWidgetPopWindow.this.getSize();
Point p = FormWidgetPopWindow.this.getLocation();
Rectangle rect = new Rectangle(p, d);
if (!rect.contains(point)) {
FormWidgetPopWindow.this.setVisible(false);
}
}
} }
} }
} }
}; };
private void hideWindow(MouseEvent mv){
Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY());
if (OperatingSystem.isWindows()) {
if (!FormWidgetPopWindow.this.contains(point)) {
FormWidgetPopWindow.this.setVisible(false);
}
}else if(OperatingSystem.isMacos() || OperatingSystem.isLinux()){
Dimension d = FormWidgetPopWindow.this.getSize();
Point p = FormWidgetPopWindow.this.getLocation();
Rectangle rect = new Rectangle(p, d);
if (!rect.contains(point)) {
FormWidgetPopWindow.this.setVisible(false);
}
}
}
private class EditorChoosePane extends JPanel { private class EditorChoosePane extends JPanel {
public EditorChoosePane() { public EditorChoosePane() {
super(); super();

16
designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

@ -3,7 +3,7 @@ package com.fr.design.mainframe;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -24,7 +24,7 @@ import java.awt.Color;
*/ */
public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider { public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider {
private static HyperlinkGroupPaneActionProvider instance; private static HyperlinkGroupPaneActionProvider instance;
private static Selection selection ;
private HyperlinkGroupPaneActionImpl() { private HyperlinkGroupPaneActionImpl() {
} }
@ -40,7 +40,9 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
ElementCasePane reportPane = (ElementCasePane)elementCasePane; ElementCasePane reportPane = (ElementCasePane)elementCasePane;
final TemplateElementCase report = reportPane.getEditingElementCase(); final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report); NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
selection = reportPane.getSelection();
hyperlinkGroupPane.populate(nameHyperlinks); hyperlinkGroupPane.populate(nameHyperlinks);
} }
private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) { private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) {
@ -67,13 +69,12 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
} }
ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane(); ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane();
final TemplateElementCase report = reportPane.getEditingElementCase(); final TemplateElementCase report = reportPane.getEditingElementCase();
final Selection sel = reportPane.getSelection();
final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup(); final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup();
if (sel instanceof FloatSelection) { if (selection instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName()); FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)selection).getSelectedFloatName());
selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks); selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks);
} else { } else {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new ReportActionUtils.IterAction() { ReportActionUtils.actionIterateWithCellSelection((CellSelection)selection, report, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) { public void dealWith(CellElement editCellElement) {
Style elementStyle = editCellElement.getStyle(); Style elementStyle = editCellElement.getStyle();
FRFont frFont = elementStyle.getFRFont(); FRFont frFont = elementStyle.getFRFont();
@ -94,7 +95,6 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
} }
}); });
} }
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
} }
} }

Loading…
Cancel
Save