Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

feature/10.0
pengda 4 years ago
parent
commit
10a06ca57c
  1. 21
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  2. 10
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  3. 5
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  4. 6
      designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java
  5. 11
      designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java
  6. 73
      designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java
  7. 16
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  8. 7
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  9. 173
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  10. 139
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  11. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/check.png
  12. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/run24.png
  13. BIN
      designer-base/src/main/resources/com/fr/design/images/correct.png
  14. BIN
      designer-base/src/main/resources/com/fr/design/images/error.png
  15. BIN
      designer-base/src/main/resources/com/fr/design/images/waiting.png
  16. BIN
      designer-base/src/main/resources/com/fr/design/images/warnings/warning32.png
  17. 10
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  18. 18
      designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

21
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

@ -1,6 +1,7 @@
package com.fr.design.data.datapane;
import com.fr.base.TableData;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.TableProcedure;
@ -17,7 +18,7 @@ import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.icombobox.SearchPreTaskTreeComboBox;
import com.fr.design.gui.icombobox.FilterableComboBoxModel;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxEditor;
@ -59,6 +60,10 @@ import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
/**
* @author zhou
@ -80,21 +85,25 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
/**
* 表名
*/
protected FRTreeComboBox tableNameComboBox;
protected SearchPreTaskTreeComboBox tableNameComboBox;
private SwingWorker populateWorker;
private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(new NamedThreadFactory("ChoosePaneThread"));
private PopupMenuListener popupMenuListener = new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
new Thread() {
FutureTask<Void> task = new FutureTask<Void>(new Callable() {
@Override
public void run() {
public Object call() {
calculateTableDataNames();
return null;
}
}.start();
});
SERVICE.submit(task);
tableNameComboBox.setPreSearchTask(task);
}
@Override
@ -158,7 +167,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
schemaBox = new StringUIComboBox();
schemaBox.setEditor(new ComboBoxEditor());
tableNameComboBox = new FRTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false);
tableNameComboBox = new SearchPreTaskTreeComboBox(new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer, false);
tableNameComboBox.setEditable(true);
tableNameComboBox.setRenderer(listCellRenderer);
registerDSChangeListener();

10
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -99,7 +99,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
protected void done() {
try {
get();
dialog.setSize(new Dimension(380, 118));
dialog.setSize(new Dimension(380, 125));
okButton.setEnabled(true);
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
message.setText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully"));
@ -210,7 +210,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
} else {
dialog.setSize(new Dimension(380, 260));
dialog.setSize(new Dimension(380, 270));
hiddenPanel.setVisible(true);
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down"));
@ -349,7 +349,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(DatabaseConnectionPane.this), Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"), true);
dialog.setSize(new Dimension(380, 118));
dialog.setSize(new Dimension(380, 125));
okButton.setEnabled(false);
JPanel jp = new JPanel();
JPanel upPane = new JPanel();
@ -362,10 +362,10 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
detailLabel.setForeground(Color.BLUE);
hiddenPanel.setLayout(new BorderLayout(10, 0));
hiddenPanel.setLayout(new BorderLayout(2, 0));
hiddenPanel.add(new JPanel(), BorderLayout.WEST);
hiddenPanel.add(new JPanel(), BorderLayout.EAST);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 9));
downPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 15, 9));
downPane.add(okButton);
downPane.add(cancelButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));

5
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -98,6 +98,7 @@ public class JDBCDefPane extends JPanel {
private JDBCDatabaseConnection jdbcDatabase;
private boolean needRefresh = true;
public JDBCDefPane() {
this.setBorder(UITitledBorder.createBorderWithTitle("JDBC" + ":"));
@ -223,6 +224,7 @@ public class JDBCDefPane extends JPanel {
}
public void populate(JDBCDatabaseConnection jdbcDatabase) {
needRefresh = false;
if (jdbcDatabase == null) {
jdbcDatabase = new JDBCDatabaseConnection();
}
@ -261,6 +263,7 @@ public class JDBCDefPane extends JPanel {
} else {
this.charSetComboBox.setSelectedItem(jdbcDatabase.getOriginalCharsetName());
}
needRefresh = false;
}
protected JDBCDatabaseConnection getJDBCDatabase() {
@ -321,7 +324,9 @@ public class JDBCDefPane extends JPanel {
}
}
// 更改数据库类型后 数据库名称置空和之前逻辑保持一致
if (needRefresh) {
jdbcDatabase.setDatabase(StringUtils.EMPTY);
}
changePane(dbtypeComboBox.getSelectedItem());
}
};

6
designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java

@ -173,8 +173,8 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("FileChooser.upFolderIcon", loadIcon("ParentDirectoryIcon.png", this));
table.put("OptionPane.errorIcon", loadIcon("Information_Icon_Error_32x32.png", this));
table.put("OptionPane.informationIcon", loadIcon("Information_Icon_OK_32x32.png", this));
table.put("OptionPane.narrow.right", loadIcon("icon_narrow_right_16x16.png", this));
table.put("OptionPane.narrow.down", loadIcon("icon_narrow_down_16x16.png", this));
table.put("OptionPane.narrow.right", loadIcon("Icon_Narrow_Right_16x16.png", this));
table.put("OptionPane.narrow.down", loadIcon("Icon_Narrow_Down_16x16.png", this));
table.put("OptionPane.warningIcon", loadIcon("WarningIcon.png", this));
table.put("OptionPane.questionIcon", loadIcon("QuestionIcon.png", this));
table.put("ScrollPane.border", new UIScrollPaneBorder());
@ -205,7 +205,7 @@ public class UILookAndFeel extends MetalLookAndFeel {
"com/fr/design/images/lookandfeel/" + fileName, UILookAndFeel.class);
if (url == null) {
FineLoggerFactory.getLogger().error("Icon directory could not be resolved.");
FineLoggerFactory.getLogger().error(fileName + " :Icon directory could not be resolved.");
return null;
}
}

11
designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -597,6 +597,10 @@ public class FRTreeComboBox extends UIComboBox {
return this.item;
}
public boolean isSetting() {
return setting;
}
public void insertUpdate(DocumentEvent e) {
changeHandler();
}
@ -614,6 +618,13 @@ public class FRTreeComboBox extends UIComboBox {
return;
}
setPopupVisible(true);
search();
}
/**
* 模糊搜索选中首个匹配项
*/
protected void search() {
this.item = textField.getText();
TreeNode root = (TreeNode) tree.getModel().getRoot();
TreePath parent = new TreePath(root);

73
designer-base/src/main/java/com/fr/design/gui/icombobox/SearchPreTaskTreeComboBox.java

@ -0,0 +1,73 @@
package com.fr.design.gui.icombobox;
import com.fr.log.FineLoggerFactory;
import javax.swing.JTree;
import javax.swing.SwingWorker;
import javax.swing.tree.TreeCellRenderer;
import java.util.concurrent.FutureTask;
/**
* 模糊搜索前需执行完前置任务的TreeComboBox
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2021/4/14
*/
public class SearchPreTaskTreeComboBox extends FRTreeComboBox {
/**
* 模糊搜索前任务
*/
private FutureTask<Void> preSearchTask;
public SearchPreTaskTreeComboBox(JTree tree, TreeCellRenderer renderer, boolean editable) {
super(tree, renderer, editable);
}
public FutureTask<Void> getPreSearchTask() {
return preSearchTask;
}
public void setPreSearchTask(FutureTask<Void> preSearchTask) {
this.preSearchTask = preSearchTask;
}
protected UIComboBoxEditor createEditor() {
return new SearchPreTaskComboBoxEditor(this);
}
private class SearchPreTaskComboBoxEditor extends FrTreeSearchComboBoxEditor {
public SearchPreTaskComboBoxEditor(FRTreeComboBox comboBox) {
super(comboBox);
}
protected void changeHandler() {
if (isSetting()) {
return;
}
setPopupVisible(true);
// 模糊搜索异步
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() {
FutureTask<Void> task = getPreSearchTask();
try {
// 确保模糊搜索前任务执行完成后,再进行模糊搜索
if (task != null) {
task.get();
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (task != null) {
// 任务执行后置空,否则会被别的操作重复触发
setPreSearchTask(null);
}
search();
return null;
}
}.execute();
}
}
}

16
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -84,13 +84,13 @@ import javax.swing.UIManager;
import javax.swing.WindowConstants;
import javax.swing.border.MatteBorder;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Component;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
@ -701,6 +701,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
}
}
}
//添加检测按钮
addCheckButton();
//添加分享按钮
addShareButton();
//添加插件中的按钮
@ -724,6 +726,18 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
}
}
private void addCheckButton() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
return;
}
combineUp.addSeparator(new Dimension(2, 16));
UIButton[] checkButtons = jt.createCheckButton();
for (UIButton checkButton : checkButtons) {
combineUp.add(checkButton);
}
}
private void addShareButton() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();

7
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -38,6 +38,7 @@ import com.fr.design.gui.itree.filetree.TemplateFileTree;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.check.CheckButton;
import com.fr.design.mainframe.template.info.TemplateInfoCollector;
import com.fr.design.mainframe.template.info.TemplateProcessInfo;
import com.fr.design.mainframe.template.info.TimeConsumeTimer;
@ -82,11 +83,11 @@ import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.undo.UndoManager;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.awt.BorderLayout;
/**
* 报表设计和表单设计的编辑区域(设计器编辑的IO文件)
@ -1360,6 +1361,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return uiButtons;
}
public UIButton[] createCheckButton() {
return new UIButton[]{new CheckButton()};
}
/**
* 由于老版本的模板没有模板ID当勾选使用参数模板时候就加一个模板ID attr
*

173
designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java

@ -0,0 +1,173 @@
package com.fr.design.mainframe.check;
import com.fr.base.BaseUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.FILE;
import com.fr.file.FileNodeFILE;
import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.check.TemplateChecker;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
import static javax.swing.JOptionPane.OK_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
public class CheckButton extends UIButton {
private UILabel message;
private UIButton okButton;
private JDialog dialog;
private UILabel uiLabel;
public CheckButton() {
this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png"));
this.setToolTipText(Toolkit.i18nText("Fine_Designer_Check_Font"));
this.set4ToolbarButton();
this.addActionListener(checkListener);
}
private ActionListener checkListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// Try check
final SwingWorker<Set<String>, Void> checkThread = new SwingWorker<Set<String>, Void>() {
@Override
protected Set<String> doInBackground() throws Exception {
// 返回校验结果
return check(DesignerContext.getDesignerFrame().getSelectedJTemplate());
}
@Override
protected void done() {
try {
Set<String> set = get();
if (set == null) {
return;
}
if(set.isEmpty()) {
okButton.setEnabled(true);
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png"));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>");
} else {
dialog.dispose();
StringBuilder textBuilder = new StringBuilder();
textBuilder.append(Toolkit.i18nText("Fine_Designer_Check_Font_Missing_Font")).append("\n");
for (String font : set) {
textBuilder.append(font).append("\n");
}
String areaText = textBuilder.toString();
CheckFontInfoDialog dialog = new CheckFontInfoDialog(DesignerContext.getDesignerFrame(), areaText);
dialog.setVisible(true);
}
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
};
JTemplate jtemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
if (jtemplate == null || jtemplate.getEditingFILE() == null) {
return;
}
FILE currentTemplate = jtemplate.getEditingFILE();
if(currentTemplate instanceof FileNodeFILE){
checkThread.execute();
}else {
//模板不在报表环境下,提示保存
int selVal = FineJOptionPane.showConfirmDialog(
DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Web_Preview_Message"),
Toolkit.i18nText("Fine_Designer_Check_Font"),
OK_CANCEL_OPTION,
WARNING_MESSAGE);
if (OK_OPTION == selVal) {
//保存成功才执行检测
if (jtemplate.saveAsTemplate2Env()) {
checkThread.execute();
}
}
}
initDialogPane();
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
}
});
dialog.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) {
checkThread.cancel(true);
}
});
dialog.setVisible(true);
dialog.dispose();
}
};
private Set<String> check(JTemplate jtemplate) {
String path = jtemplate.getEditingFILE().getEnvFullName();
Set<String> fontSet = WorkContext.getCurrent().get(TemplateChecker.class, new ExceptionHandler<Void>() {
@Override
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) {
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png"));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>");
okButton.setEnabled(true);
return null;
}
}).checkFont(path);
return fontSet;
}
private void initDialogPane() {
message = new UILabel();
message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "...");
uiLabel = new UILabel();
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
okButton.setEnabled(false);
dialog = new JDialog();
dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font"));
dialog.setModal(true);
dialog.setSize(new Dimension(268, 118));
JPanel jp = new JPanel();
JPanel upPane = new JPanel();
JPanel downPane = new JPanel();
uiLabel = new UILabel(BaseUtils.readIcon("com/fr/design/images/waiting.png"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel);
upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(upPane);
jp.add(downPane);
dialog.add(jp);
dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));
}
}

139
designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

@ -0,0 +1,139 @@
package com.fr.design.mainframe.check;
import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Locale;
/**
* 字体缺失检测的具体结果对话框
*
*/
public class CheckFontInfoDialog extends JDialog implements ActionListener {
private JPanel topPanel;
private JPanel upInTopPanel;
private JPanel downInTopPanel;
private JPanel hiddenPanel;
private JPanel bottomPanel;
private UILabel imageLabel;
private UILabel directUiLabel;
private UILabel detailLabel;
public CheckFontInfoDialog(Frame parent, String areaText) {
super(parent,true);
//提示信息
JPanel imagePanel = new JPanel();
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/warnings/warning32.png"));
imagePanel.add(imageLabel);
JPanel messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"),
Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"),
CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html"));
linkMessage.setPreferredSize(new Dimension(380, 31));
messagePanel.add(linkMessage);
// 查看详情按钮
directUiLabel = new UILabel();
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
detailLabel = new UILabel();
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
upInTopPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
upInTopPanel.add(imageLabel, BorderLayout.WEST);
upInTopPanel.add(messagePanel, BorderLayout.CENTER);
downInTopPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
downInTopPanel.add(directUiLabel, BorderLayout.WEST);
downInTopPanel.add(detailLabel, BorderLayout.CENTER);
topPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
topPanel.add(upInTopPanel, BorderLayout.NORTH);
topPanel.add(downInTopPanel, BorderLayout.SOUTH);
//中间的详情展示(可隐藏)
hiddenPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
hiddenPanel.setBorder(BorderFactory.createEmptyBorder(0,12,0,12));
JScrollPane scrollPane = new JScrollPane();
JTextArea checkArea = new JTextArea(areaText);
scrollPane.setViewportView(checkArea);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
checkArea.setEnabled(false);
hiddenPanel.add(scrollPane);
hiddenPanel.setVisible(false);
downInTopPanel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (hiddenPanel.isVisible()) {
hiddenPanel.setVisible(false);
CheckFontInfoDialog.this.setSize(new Dimension(380, 185));
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
} else {
CheckFontInfoDialog.this.setSize(new Dimension(380, 280));
hiddenPanel.setVisible(true);
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down"));
}
}
@Override
public void mouseEntered(MouseEvent e) {
detailLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
@Override
public void mouseExited(MouseEvent e) {
detailLabel.setCursor(Cursor.getDefaultCursor());
}
});
//底部的按钮面板
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10));
buttonPanel.add(okButton, BorderLayout.EAST);
okButton.addActionListener(this);
bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
bottomPanel.add(buttonPanel);
this.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font"));
this.setResizable(false);
this.add(topPanel, BorderLayout.NORTH);
this.add(hiddenPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 400:380, 185));
GUICoreUtils.centerWindow(this);
}
@Override
public void actionPerformed(ActionEvent e) {
this.dispose();
}
}

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/check.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/run24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 736 B

BIN
designer-base/src/main/resources/com/fr/design/images/correct.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

BIN
designer-base/src/main/resources/com/fr/design/images/error.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

BIN
designer-base/src/main/resources/com/fr/design/images/waiting.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1011 B

BIN
designer-base/src/main/resources/com/fr/design/images/warnings/warning32.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

10
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -347,15 +347,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
//拖拽组件原大小、位置
Rectangle backupBound = creator.getBackupBound();
backupBound.x -= container.getX();
// REPORT-34739 对绝对画布块的backupBound.y的调整还需要考虑一下参数面板块的高度造成的偏移
int paraHeight = 0;
if (creator.acceptType(XWAbsoluteLayout.class)) {
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate instanceof JForm) {
paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight();
}
}
backupBound.y -= (container.getY() - paraHeight);
backupBound.y -= container.getY();
//当前拖拽组件的位置
int x = creator.getX();
int y = creator.getY();

18
designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

@ -12,6 +12,7 @@ import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget;
@ -270,7 +271,9 @@ public class FormSelection {
LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(designer, creator);
if (layoutAdapter != null) {
if (creator.acceptType(XWAbsoluteLayout.class) && recs.size() > i) {
creator.setBackupBound(recs.get(i));
Rectangle rectangle = recs.get(i);
check4ParaPane(rectangle);
creator.setBackupBound(rectangle);
} else {
creator.setBackupBound(backupBounds);
}
@ -280,6 +283,19 @@ public class FormSelection {
}
}
/**
* 检查下有没有参数面板如果存在处理下参数面板造成的偏移量
* @param rectangle
*/
private void check4ParaPane(Rectangle rectangle) {
int paraHeight = 0;
JTemplate<?, ?> jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate instanceof JForm) {
paraHeight = ((JForm) jTemplate).getFormDesign().getParaHeight();
}
rectangle.y += paraHeight;
}
private void removeCreatorFromContainer(XCreator creator) {
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(creator);
if (parent == null) {

Loading…
Cancel
Save