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

19
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.event.AWTEventListener;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;
import javax.swing.JWindow;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.location.Location;
import com.fr.design.gui.core.WidgetOption;
import com.fr.stable.OperatingSystem;
import com.fr.stable.os.OperatingSystem;
//august:
public class FormWidgetPopWindow extends JWindow {
@ -52,12 +49,19 @@ public class FormWidgetPopWindow extends JWindow {
if (event instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) event;
if (mv.getClickCount() > 0) {
hideWindow(mv);
}
}
}
};
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)) {
if (!FormWidgetPopWindow.this.contains(point)) {
FormWidgetPopWindow.this.setVisible(false);
}
} else if (OperatingSystem.isMacOS()) {
}else if(OperatingSystem.isMacos() || OperatingSystem.isLinux()){
Dimension d = FormWidgetPopWindow.this.getSize();
Point p = FormWidgetPopWindow.this.getLocation();
Rectangle rect = new Rectangle(p, d);
@ -66,9 +70,6 @@ public class FormWidgetPopWindow extends JWindow {
}
}
}
}
}
};
private class EditorChoosePane extends JPanel {
public EditorChoosePane() {

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

Loading…
Cancel
Save