Browse Source

Merge branch 'release/10.0' of ssh://cloud.finedevelop.com:7999/~zheng/C-design into release/10.0

feature/big-screen
shine 5 years ago
parent
commit
fc20b97c2d
  1. 1
      designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java
  2. 7
      designer-base/src/main/java/com/fr/design/designer/creator/CRPropertyDescriptor.java
  3. 4
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  4. 14
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  5. 25
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  6. 13
      designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java
  7. 5
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java
  8. 1
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  9. 35
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java
  10. 11
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  11. 16
      designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

1
designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java

@ -64,6 +64,7 @@ public class TableDataSourceAction extends TemplateComponentAction<JTemplate<?,
* 撤销 * 撤销
*/ */
public void prepare4Undo() { public void prepare4Undo() {
//do nothing
} }
/** /**

7
designer-base/src/main/java/com/fr/design/designer/creator/CRPropertyDescriptor.java

@ -4,6 +4,7 @@
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.stable.core.PropertyChangeListener; import com.fr.stable.core.PropertyChangeListener;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
@ -40,6 +41,12 @@ public final class CRPropertyDescriptor extends PropertyDescriptor {
return this; return this;
} }
@Deprecated
public CRPropertyDescriptor setPropertyChangeListener(PropertyChangeAdapter l) {
this.l = l;
return this;
}
public void firePropertyChanged() { public void firePropertyChanged() {
if (l != null) { if (l != null) {
l.propertyChange(); l.propertyChange();

4
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -1,6 +1,6 @@
package com.fr.design.env; package com.fr.design.env;
import com.fr.cluster.engine.remote.ClusterOperator; import com.fr.cluster.engine.base.FineClusterConfig;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -70,7 +70,7 @@ public class RemoteWorkspace implements Workspace {
@Override @Override
public boolean isCluster() { public boolean isCluster() {
return WorkContext.getCurrent().get(ClusterOperator.class).isCluster(); return FineClusterConfig.getInstance().isCluster();
} }
@Override @Override

14
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -44,6 +44,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Objects;
import static javax.swing.JOptionPane.WARNING_MESSAGE; import static javax.swing.JOptionPane.WARNING_MESSAGE;
import static javax.swing.JOptionPane.YES_NO_OPTION; import static javax.swing.JOptionPane.YES_NO_OPTION;
@ -299,7 +300,18 @@ public class TemplateTreePane extends JPanel implements FileOperations {
} }
} }
} }
reportletsTree.refresh(); refreshAfterDelete();
}
private void refreshAfterDelete() {
TreePath[] paths = reportletsTree.getSelectionPaths();
if (paths == null) {
reportletsTree.refresh();
} else {
for (TreePath path : Objects.requireNonNull(reportletsTree.getSelectionPaths())) {
reportletsTree.refreshParent(path);
}
}
} }
private boolean deleteNodes(Collection<ExpandMutableTreeNode> nodes) { private boolean deleteNodes(Collection<ExpandMutableTreeNode> nodes) {

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

13
designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java

@ -7,6 +7,9 @@ import javax.swing.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.text.ParseException;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
@ -56,7 +59,17 @@ public class UIBasicSpinner extends JSpinner implements UIObserver {
} }
}); });
} }
final JFormattedTextField textField = ((JSpinner.DefaultEditor) this.getEditor()).getTextField();
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
try {
textField.commitEdit();
} catch (ParseException ignore) {
}
}
});
} }

5
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java

@ -145,6 +145,11 @@ public abstract class RefreshableJTree extends CheckBoxTree {
refresh((ExpandMutableTreeNode) this.getModel().getRoot(), StringUtils.EMPTY); refresh((ExpandMutableTreeNode) this.getModel().getRoot(), StringUtils.EMPTY);
} }
//REPORT-24085,只刷新父节点
public void refreshParent(TreePath path) {
refresh((ExpandMutableTreeNode) path.getParentPath().getLastPathComponent(), StringUtils.EMPTY);
}
public void refreshChildByName(String childName) { public void refreshChildByName(String childName) {
refresh((ExpandMutableTreeNode) this.getModel().getRoot(), childName); refresh((ExpandMutableTreeNode) this.getModel().getRoot(), childName);
} }

1
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -133,6 +133,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
@Deprecated @Deprecated
public void reLayout(Chart currentChart) { public void reLayout(Chart currentChart) {
//do nothing
} }
/** /**

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

11
designer-realize/src/main/java/com/fr/design/condition/WHPane.java

@ -33,17 +33,6 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
GUICoreUtils.setColumnForSpinner(spinner, 5); GUICoreUtils.setColumnForSpinner(spinner, 5);
this.spinner.setValue(new Integer(0)); this.spinner.setValue(new Integer(0));
this.locString = locString; this.locString = locString;
final JFormattedTextField textField = ((JSpinner.NumberEditor) this.spinner.getEditor()).getTextField();
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
try {
textField.commitEdit();
} catch (ParseException ignore) {
}
}
});
} }
@Override @Override

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