Browse Source

Merge branch 'feature/x' of https://code.fineres.com/scm/~fly.li/design into feature/x

feature/x
fly.li 3 years ago
parent
commit
2e3a6de6ef
  1. 4
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java
  2. 11
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  3. 5
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  4. 14
      designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java
  5. 80
      designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java
  6. 32
      designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java
  7. 5
      designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java
  8. 7
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  9. 22
      designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java
  10. 27
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java
  11. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  12. 17
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java
  13. 7
      designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java
  14. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java
  15. 2
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

4
designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

@ -123,7 +123,9 @@ public class CellStylePreviewPane extends JPanel {
Style.paintContent(g2d, paintText, style, width, height, resolution); Style.paintContent(g2d, paintText, style, width, height, resolution);
Style.paintBorder(g2d, style, width, height); Style.paintBorder(g2d, style,
width - GraphHelper.getLineStyleSize(style.getBorderRight()) / 2F,
height - GraphHelper.getLineStyleSize(style.getBorderBottom()) / 2F);
} }
@Override @Override

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

@ -19,7 +19,7 @@ import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icombobox.FilterableComboBoxModel; import com.fr.design.gui.icombobox.FilterableComboBoxModel;
import com.fr.design.gui.icombobox.SearchFRTreeComboBox; import com.fr.design.gui.icombobox.TableSearchTreeComboBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxEditor; import com.fr.design.gui.icombobox.UIComboBoxEditor;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
@ -91,7 +91,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
/** /**
* 表名 * 表名
*/ */
protected SearchFRTreeComboBox tableNameComboBox; protected TableSearchTreeComboBox tableNameComboBox;
private SwingWorker populateWorker; private SwingWorker populateWorker;
@ -146,7 +146,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
schemaBox = new StringUIComboBox(); schemaBox = new StringUIComboBox();
schemaBox.setEditor(new ComboBoxEditor()); schemaBox.setEditor(new ComboBoxEditor());
tableNameComboBox = new SearchFRTreeComboBox(this, new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer); tableNameComboBox = new TableSearchTreeComboBox(this, new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer);
tableNameComboBox.setEditable(true); tableNameComboBox.setEditable(true);
tableNameComboBox.setRenderer(listCellRenderer); tableNameComboBox.setRenderer(listCellRenderer);
registerDSChangeListener(); registerDSChangeListener();
@ -486,13 +486,10 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
protected String getTableName() { protected String getTableName() {
String tableName = ""; String tableName = "";
Object obj = this.tableNameComboBox.getSelectedItemObject(); Object obj = this.tableNameComboBox.getSelectedItem();
if (obj == null) {
obj = this.tableNameComboBox.getSelectedItem();
if (obj == null) { if (obj == null) {
obj = this.tableNameComboBox.getEditor().getItem(); obj = this.tableNameComboBox.getEditor().getItem();
} }
}
if (obj instanceof TreePath) { if (obj instanceof TreePath) {
Object tp = ((ExpandMutableTreeNode) ((TreePath) obj).getLastPathComponent()).getUserObject(); Object tp = ((ExpandMutableTreeNode) ((TreePath) obj).getLastPathComponent()).getUserObject();
if (tp instanceof TableProcedure) { if (tp instanceof TableProcedure) {

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

@ -103,7 +103,6 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (reportletsTree.getPathForLocation(evt.getX(), evt.getY()) != null && evt.getClickCount() == 2) { if (reportletsTree.getPathForLocation(evt.getX(), evt.getY()) != null && evt.getClickCount() == 2) {
openFile(); openFile();
} }
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(reportletsTree.getSelectedFileNode());
} }
@Override @Override
@ -121,6 +120,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (toolBarStateChangeListener != null) { if (toolBarStateChangeListener != null) {
toolBarStateChangeListener.stateChange(); toolBarStateChangeListener.stateChange();
} }
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(reportletsTree.getSelectedFileNode());
} }
}; };
// lx: add mouse listener // lx: add mouse listener
@ -231,7 +231,8 @@ public class TemplateTreePane extends JPanel implements FileOperations {
return; return;
} }
String lock = node.getLock(); String lock = node.getLock();
boolean showLockInfo = LockInfoUtils.isCompatibleOperator() ? (lock != null && !lock.equals(node.getUserID())) boolean showLockInfo = LockInfoUtils.isCompatibleOperator() || LockInfoUtils.unableGetLockInfo()
? (lock != null && !lock.equals(node.getUserID()))
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); : WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath);
if (showLockInfo) { if (showLockInfo) {
UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath); UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath);

14
designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java

@ -127,7 +127,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
buildBox.setSelectedIndex(1); buildBox.setSelectedIndex(1);
TableDataDictionary dictionary = treeEditor.getDictionary(); TableDataDictionary dictionary = treeEditor.getDictionary();
autoBuildPane.populate(dictionary); autoBuildPane.populate(dictionary);
} else if (treeEditor.isLayerBuild()) { } else if (treeEditor.isFastLayerBuild()) {
buildBox.setSelectedIndex(0); buildBox.setSelectedIndex(0);
java.util.List<LayerConfig> layerConfigList = treeEditor.getLayerConfigs(); java.util.List<LayerConfig> layerConfigList = treeEditor.getLayerConfigs();
LayerConfig[] layerConfigs = new LayerConfig[layerConfigList.size()]; LayerConfig[] layerConfigs = new LayerConfig[layerConfigList.size()];
@ -156,12 +156,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) { if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update(); TableDataDictionary dictionary = this.autoBuildPane.update();
te.setAutoBuild(true); te.setAutoBuild(true);
te.setLayerBuild(false); te.setFastLayerBuild(false);
te.setDictionary(dictionary); te.setDictionary(dictionary);
te.setNodeOrDict(dictionary); te.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { } else if (buildBox.getSelectedIndex() == 2) {
te.setAutoBuild(false); te.setAutoBuild(false);
te.setLayerBuild(false); te.setFastLayerBuild(false);
NameObject no = this.controlPane.update(); NameObject no = this.controlPane.update();
if (no != null) { if (no != null) {
TreeEditor editor = (TreeEditor) no.getObject(); TreeEditor editor = (TreeEditor) no.getObject();
@ -181,7 +181,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
} else { } else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject(); LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
te.setAutoBuild(false); te.setAutoBuild(false);
te.setLayerBuild(true); te.setFastLayerBuild(true);
te.setLayerConfigs(Arrays.asList(configs)); te.setLayerConfigs(Arrays.asList(configs));
} }
return te; return te;
@ -215,12 +215,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) { if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update(); TableDataDictionary dictionary = this.autoBuildPane.update();
tcb.setAutoBuild(true); tcb.setAutoBuild(true);
tcb.setLayerBuild(false); tcb.setFastLayerBuild(false);
tcb.setDictionary(dictionary); tcb.setDictionary(dictionary);
tcb.setNodeOrDict(dictionary); tcb.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { } else if (buildBox.getSelectedIndex() == 2) {
tcb.setAutoBuild(false); tcb.setAutoBuild(false);
tcb.setLayerBuild(false); tcb.setFastLayerBuild(false);
NameObject no = this.controlPane.update(); NameObject no = this.controlPane.update();
if (no != null) { if (no != null) {
if (no.getObject() instanceof TreeComboBoxEditor) { if (no.getObject() instanceof TreeComboBoxEditor) {
@ -244,7 +244,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
}else { }else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject(); LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
tcb.setAutoBuild(false); tcb.setAutoBuild(false);
tcb.setLayerBuild(true); tcb.setFastLayerBuild(true);
tcb.setLayerConfigs(Arrays.asList(configs)); tcb.setLayerConfigs(Arrays.asList(configs));
} }
return tcb; return tcb;

80
designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java → designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java

@ -10,6 +10,7 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Filter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
@ -24,7 +25,7 @@ import java.awt.event.MouseEvent;
import java.util.Enumeration; import java.util.Enumeration;
/** /**
* 实现模糊搜索的FRTreeComboBox * 实现模糊搜索表名的FRTreeComboBox
* FRTreeComboBox搜索后滚动到首个匹配节点 * FRTreeComboBox搜索后滚动到首个匹配节点
* SearchFRTreeComboBox显示所有匹配的节点 * SearchFRTreeComboBox显示所有匹配的节点
* *
@ -32,19 +33,27 @@ import java.util.Enumeration;
* @version 10.0 * @version 10.0
* Created by Lucian.Chen on 2021/4/14 * Created by Lucian.Chen on 2021/4/14
*/ */
public class SearchFRTreeComboBox extends FRTreeComboBox { public class TableSearchTreeComboBox extends FRTreeComboBox {
// 持有父容器,需要实时获取其他组件值 // 持有父容器,需要实时获取其他组件值
private final ChoosePane parent; private final ChoosePane parent;
public SearchFRTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) {
super(tree, renderer); super(tree, renderer);
this.parent = parent; this.parent = parent;
setUI(new SearchFRTreeComboBoxUI()); setUI(new TableSearchTreeComboBoxUI());
} }
protected UIComboBoxEditor createEditor() { protected UIComboBoxEditor createEditor() {
return new SearchFRComboBoxEditor(this); return new TableSearchComboBoxEditor(this);
}
@Override
protected String pathToString(TreePath path) {
Object obj = ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject();
if (obj instanceof TableProcedure) {
return ((TableProcedure) obj).getName();
}
return super.pathToString(path);
} }
/** /**
@ -142,27 +151,7 @@ public class SearchFRTreeComboBox extends FRTreeComboBox {
} }
} }
/** private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() {
* 重写输入框编辑器实现输入框模糊搜索逻辑
*/
private class SearchFRComboBoxEditor extends FrTreeSearchComboBoxEditor {
public SearchFRComboBoxEditor(FRTreeComboBox comboBox) {
super(comboBox);
}
@Override
protected void changeHandler() {
if (isSetting()) {
return;
}
setPopupVisible(true);
this.item = textField.getText();
searchExecute();
}
}
private static final TableNameFilter EMPTY_FILTER = new TableNameFilter(StringUtils.EMPTY) {
public boolean accept(TableProcedure procedure) { public boolean accept(TableProcedure procedure) {
return true; return true;
} }
@ -171,17 +160,18 @@ public class SearchFRTreeComboBox extends FRTreeComboBox {
/** /**
* 表名模糊搜索实现 * 表名模糊搜索实现
*/ */
private static class TableNameFilter { private static class TableNameFilter implements Filter<TableProcedure> {
private final String searchFilter; private String searchFilter;
public TableNameFilter(String searchFilter) { public TableNameFilter() {
if (StringUtils.isNotEmpty(searchFilter)) {
searchFilter = searchFilter.toLowerCase().trim();
} }
this.searchFilter = searchFilter;
public TableNameFilter(String searchFilter) {
this.searchFilter = searchFilter.toLowerCase().trim();
} }
// 字符串匹配 // 表名匹配
@Override
public boolean accept(TableProcedure procedure) { public boolean accept(TableProcedure procedure) {
return procedure.getName().toLowerCase().contains(searchFilter); return procedure.getName().toLowerCase().contains(searchFilter);
} }
@ -190,11 +180,31 @@ public class SearchFRTreeComboBox extends FRTreeComboBox {
/** /**
* 重写FRTreeComboBoxUI实现点击下拉时触发模糊搜索 * 重写FRTreeComboBoxUI实现点击下拉时触发模糊搜索
*/ */
private class SearchFRTreeComboBoxUI extends FRTreeComboBoxUI { private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
searchExecute(); searchExecute();
} }
} }
/**
* 重写输入框编辑器实现输入框模糊搜索逻辑
*/
private class TableSearchComboBoxEditor extends FrTreeSearchComboBoxEditor {
public TableSearchComboBoxEditor(FRTreeComboBox comboBox) {
super(comboBox);
}
@Override
protected void changeHandler() {
if (isSetting()) {
return;
}
setPopupVisible(true);
this.item = textField.getText();
searchExecute();
}
}
} }

32
designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java

@ -6,10 +6,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.TemplateUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.IOUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -24,7 +26,6 @@ import java.time.format.DateTimeFormatter;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.UIManager;
/** /**
* @author hades * @author hades
@ -39,13 +40,11 @@ public class LockInfoDialog extends JDialog {
super(DesignerContext.getDesignerFrame()); super(DesignerContext.getDesignerFrame());
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
UILabel iconLabel = new UILabel(UIManager.getIcon("OptionPane.warningIcon"));
panel.add(iconLabel, BorderLayout.WEST);
panel.add(createContentPane(userInfo), BorderLayout.CENTER); panel.add(createContentPane(userInfo), BorderLayout.CENTER);
panel.add(createControlPane(), BorderLayout.SOUTH); panel.add(createControlPane(), BorderLayout.SOUTH);
this.getContentPane().add(panel); this.getContentPane().add(panel);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Alert")); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint"));
this.setSize(400, 180); this.setSize(400, 160);
this.setResizable(false); this.setResizable(false);
this.setModal(true); this.setModal(true);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
@ -54,12 +53,21 @@ public class LockInfoDialog extends JDialog {
private JPanel createContentPane(UserInfo userInfo) { private JPanel createContentPane(UserInfo userInfo) {
JPanel contentPanel = new JPanel(new BorderLayout()); JPanel contentPanel = new JPanel(new BorderLayout());
contentPanel.setBorder(BorderFactory.createEmptyBorder(15, 0, 0, 0)); contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
contentPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Template_Lock_And_SaveAs_Tip")), BorderLayout.NORTH); JPanel messagePane = new JPanel(new BorderLayout(13, 0));
UILabel iconLabel = new UILabel(IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"));
iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
messagePane.add(iconLabel, BorderLayout.WEST);
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Template_Lock_And_SaveAs_Tip"));
tipLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
messagePane.add(tipLabel, BorderLayout.CENTER);
contentPanel.add(messagePane, BorderLayout.NORTH);
JPanel detailInfoPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel detailInfoPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
detailInfoPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0,0)); detailInfoPane.setBorder(BorderFactory.createEmptyBorder(0, 45, 0,0));
if (userInfo != null && StringUtils.isNotEmpty(userInfo.getUserName())) { if (userInfo != null && StringUtils.isNotEmpty(userInfo.getUserName())) {
detailInfoPane.add(createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder", userInfo.getUserName()))); UILabel label = createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder", userInfo.getUserName()));
label .setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
detailInfoPane.add(label);
} }
if (userInfo != null && StringUtils.isNotEmpty(userInfo.getIp())) { if (userInfo != null && StringUtils.isNotEmpty(userInfo.getIp())) {
detailInfoPane.add(createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder_Ip", userInfo.getIp()) )); detailInfoPane.add(createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder_Ip", userInfo.getIp()) ));
@ -72,12 +80,13 @@ public class LockInfoDialog extends JDialog {
private UILabel createLabel(String text) { private UILabel createLabel(String text) {
UILabel label = new UILabel(text); UILabel label = new UILabel(text);
label.setForeground(Color.GRAY); label.setForeground(Color.GRAY);
label.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));
return label; return label;
} }
private JPanel createControlPane() { private JPanel createControlPane() {
JPanel controlPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel controlPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 5));
controlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0,5));
UIButton saveAsButton = new UIButton(Toolkit.i18nText("Fine_Design_Template_Lock_Save_As")); UIButton saveAsButton = new UIButton(Toolkit.i18nText("Fine_Design_Template_Lock_Save_As"));
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Button_Cancel"));
saveAsButton.addActionListener(new ActionListener() { saveAsButton.addActionListener(new ActionListener() {
@ -105,6 +114,7 @@ public class LockInfoDialog extends JDialog {
public static void show(UserInfo userInfo) { public static void show(UserInfo userInfo) {
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(TemplateTreePane.getInstance().getFileNode());
new LockInfoDialog(userInfo); new LockInfoDialog(userInfo);
} }

5
designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java

@ -2,6 +2,7 @@ package com.fr.design.lock;
import com.fr.report.lock.DefaultLockInfoOperator; import com.fr.report.lock.DefaultLockInfoOperator;
import com.fr.report.lock.LockInfoOperator; import com.fr.report.lock.LockInfoOperator;
import com.fr.start.server.FineEmbedServer;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
/** /**
@ -15,4 +16,8 @@ public class LockInfoUtils {
LockInfoOperator lockInfoOperator = WorkContext.getCurrent().get(LockInfoOperator.class); LockInfoOperator lockInfoOperator = WorkContext.getCurrent().get(LockInfoOperator.class);
return lockInfoOperator instanceof DefaultLockInfoOperator; return lockInfoOperator instanceof DefaultLockInfoOperator;
} }
public static boolean unableGetLockInfo() {
return WorkContext.getCurrent().isLocal() && !FineEmbedServer.isRunning();
}
} }

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

@ -63,7 +63,6 @@ import javax.swing.JDialog;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -198,7 +197,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
rightToolBar = new UIToolbar(FlowLayout.RIGHT); rightToolBar = new UIToolbar(FlowLayout.RIGHT);
rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
rightToolBar.setBorderPainted(true); rightToolBar.setBorderPainted(true);
rightToolBar.add(new UILabel(Toolkit.i18nText("Fine_Design_Template_Lock_Status"))); UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Lock_Status"));
tipLabel.setForeground(Color.GRAY);
rightToolBar.add(tipLabel);
UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/lock.png")); UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/lock.png"));
button.setRolloverIcon(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/unlock.png")); button.setRolloverIcon(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/unlock.png"));
button.setBorderPainted(false); button.setBorderPainted(false);
@ -213,7 +214,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
Toolkit.i18nText("Fine-Design_Basic_Alert"), Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.YES_NO_OPTION, JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE, JOptionPane.WARNING_MESSAGE,
UIManager.getIcon("OptionPane.warningIcon"), IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"),
new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null); new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null);
if (option == JOptionPane.YES_OPTION) { if (option == JOptionPane.YES_OPTION) {
String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath()); String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath());

22
designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java

@ -14,8 +14,11 @@ import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager; import java.awt.LayoutManager;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
@ -37,6 +40,7 @@ public class ForbiddenPane extends JPanel {
private static final Color BUTTON_COLOR = new Color(63, 155, 249); private static final Color BUTTON_COLOR = new Color(63, 155, 249);
private static final int Y_GAP = 10; private static final int Y_GAP = 10;
private static final int X_GAP = 10; private static final int X_GAP = 10;
private static final int ARC = 4;
private final UILabel lockLabel; private final UILabel lockLabel;
private final UILabel tipLabel; private final UILabel tipLabel;
@ -71,11 +75,11 @@ public class ForbiddenPane extends JPanel {
int tipLabelWidth = tipLabel.getPreferredSize().width; int tipLabelWidth = tipLabel.getPreferredSize().width;
int tipLabelHeight = tipLabel.getPreferredSize().height; int tipLabelHeight = tipLabel.getPreferredSize().height;
int tipLabelX = (width - tipLabelWidth) / 2 + X_GAP; int tipLabelX = (width - tipLabelWidth) / 2 + X_GAP;
int tipLabelY = lockLabelY + lockLabelHeight - Y_GAP; int tipLabelY = lockLabelY + lockLabelHeight;
int refreshButtonWidth = refreshButton.getPreferredSize().width; int refreshButtonWidth = refreshButton.getPreferredSize().width;
int refreshButtonHeight = refreshButton.getPreferredSize().height; int refreshButtonHeight = refreshButton.getPreferredSize().height;
int refreshButtonX = (width - refreshButtonWidth) / 2 + X_GAP; int refreshButtonX = (width - refreshButtonWidth) / 2 + X_GAP;
int refreshButtonY = tipLabelY + refreshButtonHeight; int refreshButtonY = tipLabelY + refreshButtonHeight + Y_GAP;
lockLabel.setBounds(lockLabelX, lockLabelY, lockLabelWidth, lockLabelHeight); lockLabel.setBounds(lockLabelX, lockLabelY, lockLabelWidth, lockLabelHeight);
tipLabel.setBounds(tipLabelX, tipLabelY, tipLabelWidth, tipLabelHeight); tipLabel.setBounds(tipLabelX, tipLabelY, tipLabelWidth, tipLabelHeight);
refreshButton.setBounds(refreshButtonX, refreshButtonY, refreshButtonWidth, refreshButtonHeight); refreshButton.setBounds(refreshButtonX, refreshButtonY, refreshButtonWidth, refreshButtonHeight);
@ -88,16 +92,20 @@ public class ForbiddenPane extends JPanel {
setBackground(Color.WHITE); setBackground(Color.WHITE);
lockLabel = new UILabel(LOCK_ICON); lockLabel = new UILabel(LOCK_ICON);
tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Has_Been_Locked_Tip")); tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Has_Been_Locked_Tip"));
Font labelFont = tipLabel.getFont();
tipLabel.setFont(new Font(labelFont.getName(), labelFont.getStyle(), 14));
tipLabel.setForeground(TIP_COLOR); tipLabel.setForeground(TIP_COLOR);
refreshButton = new JButton(Toolkit.i18nText("Fine-Design_Basic_Refresh")) { refreshButton = new JButton(Toolkit.i18nText("Fine-Design_Basic_Refresh")) {
@Override @Override
public void paintComponent(Graphics g) public void paintComponent(Graphics g) {
{ Graphics2D g2d = (Graphics2D) g;
g.setColor(BUTTON_COLOR); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.fillRect(0, 0, getSize().width, getSize().height); g2d.setColor(BUTTON_COLOR);
super.paintComponent(g); g2d.fillRoundRect(0, 0, getWidth(), getHeight(), ARC, ARC);
super.paintComponent(g2d);
} }
}; };
refreshButton.setPreferredSize(new Dimension(68, 24));
refreshButton.setForeground(Color.WHITE); refreshButton.setForeground(Color.WHITE);
refreshButton.setBorderPainted(false); refreshButton.setBorderPainted(false);
refreshButton.setContentAreaFilled(false); refreshButton.setContentAreaFilled(false);

27
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java

@ -1,27 +0,0 @@
package com.fr.design.mainframe.loghandler;
import com.fr.third.apache.log4j.spi.LoggingEvent;
import com.fr.third.apache.logging.log4j.Level;
import com.fr.third.apache.logging.log4j.core.LogEvent;
import com.fr.third.apache.logging.log4j.core.impl.Log4jLogEvent;
import com.fr.third.apache.logging.log4j.message.SimpleMessage;
/**
* 兼容log4j1和2之间logEvent之间的转换
*
* @author hades
* @version 11.0
* Created by hades on 2021/12/9
*/
public class LogEventConverter {
public static LogEvent convert(LoggingEvent loggingEvent) {
SimpleMessage message = new SimpleMessage(loggingEvent.getRenderedMessage());
return Log4jLogEvent.newBuilder().
setMessage(message).
setLevel(Level.getLevel(loggingEvent.getLevel().toString())).
build();
}
}

6
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -135,18 +135,18 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override @Override
protected void initLayout() { protected void initLayout() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(new BorderLayout(0, 10));
JPanel jPanel = new JPanel(); JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 4)); jPanel.setLayout(new BorderLayout(0, 4));
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewArea = new CellRectangleStylePreviewPane(true); previewArea = new CellRectangleStylePreviewPane(true);
previewArea.setPreferredSize(new Dimension(215, 52)); previewArea.setPreferredSize(new Dimension(215, 48));
previewPane.setBorder(BorderFactory.createCompoundBorder( previewPane.setBorder(BorderFactory.createCompoundBorder(
BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")), BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")),
BorderFactory.createEmptyBorder(4, 4, 4, 4))); BorderFactory.createEmptyBorder(4, 4, 4, 4)));
previewPane.add(previewArea, BorderLayout.CENTER); previewPane.add(previewArea, BorderLayout.NORTH);
this.add(previewPane, BorderLayout.NORTH); this.add(previewPane, BorderLayout.NORTH);

17
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java

@ -1,12 +1,15 @@
package com.fr.design.mainframe.theme.preview.ecpreview.cell; package com.fr.design.mainframe.theme.preview.ecpreview.cell;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.stable.Constants;
import javax.swing.JComponent; import javax.swing.JComponent;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
public abstract class AbstractPreviewCell extends JComponent { public abstract class AbstractPreviewCell extends JComponent {
private static final double BORDER_INSET = 0.5D;
protected Style style = Style.DEFAULT_STYLE; protected Style style = Style.DEFAULT_STYLE;
private static final int NO_SCALE_RESOLUTION = 100; private static final int NO_SCALE_RESOLUTION = 100;
@ -19,7 +22,19 @@ public abstract class AbstractPreviewCell extends JComponent {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
Style.paintBackground(g2d, style, getWidth(), getHeight()); Style.paintBackground(g2d, style, getWidth(), getHeight());
paintContent(g2d, NO_SCALE_RESOLUTION); paintContent(g2d, NO_SCALE_RESOLUTION);
Style.paintBorder(g2d, style, getWidth(), getHeight()); paintBorder(g2d);
}
private void paintBorder(Graphics2D g2d) {
double width = getWidth();
double height = getHeight();
if (style.getBorderLeft() == Constants.LINE_SLIM || style.getBorderRight() == Constants.LINE_SLIM) {
width -= BORDER_INSET;
}
if (style.getBorderBottom() == Constants.LINE_SLIM || style.getBorderTop() == Constants.LINE_SLIM) {
height -= BORDER_INSET;
}
Style.paintBorder(g2d, style, width, height);
} }
protected abstract void paintContent(Graphics2D g2d, int resolution); protected abstract void paintContent(Graphics2D g2d, int resolution);

7
designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java

@ -9,12 +9,12 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.TemplateUtils;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.IOUtils;
import com.fr.report.UnLockedException; import com.fr.report.UnLockedException;
import com.fr.workspace.exception.DiskSpaceFullException; import com.fr.workspace.exception.DiskSpaceFullException;
import com.fr.report.InconsistentLockException; import com.fr.report.InconsistentLockException;
import java.awt.Frame; import java.awt.Frame;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.UIManager;
/** /**
* @author hades * @author hades
@ -50,7 +50,8 @@ public class SaveFailureHandler implements ThrowableHandler {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine_Design_Template_Save_Failed_By_Full_Disk"), Toolkit.i18nText("Fine_Design_Template_Save_Failed_By_Full_Disk"),
Toolkit.i18nText("Fine-Design_Basic_Alert"), Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE); JOptionPane.WARNING_MESSAGE,
IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"));
return true; return true;
} }
return false; return false;
@ -98,7 +99,7 @@ public class SaveFailureHandler implements ThrowableHandler {
Toolkit.i18nText("Fine-Design_Basic_Alert"), Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.YES_NO_OPTION, JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE, JOptionPane.WARNING_MESSAGE,
UIManager.getIcon("OptionPane.warningIcon"), IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"),
new Object[] {Toolkit.i18nText("Fine_Design_Template_SaveAs_Backup"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null); new Object[] {Toolkit.i18nText("Fine_Design_Template_SaveAs_Backup"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null);
if (option == JOptionPane.YES_OPTION) { if (option == JOptionPane.YES_OPTION) {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();

4
designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

@ -273,9 +273,9 @@ public class CreateComponentAction extends UpdateAction {
XChartEditor chartEditor = (XChartEditor) body; XChartEditor chartEditor = (XChartEditor) body;
Dimension size = chartEditor.getSize(); Dimension size = chartEditor.getSize();
BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
Insets margin = chartEditor.getInsets();; Insets margin = chartEditor.getInsets();
chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin); chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin);
im.getGraphics().drawImage(chartImage, 0, chartEditor.getY(), null); im.getGraphics().drawImage(chartImage, chartEditor.getX(), chartEditor.getY(), null);
} }
} }
return im; return im;

2
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -11,7 +11,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogger; import com.fr.design.mainframe.loghandler.DesignerLogger;
import com.fr.design.mainframe.loghandler.LogEventConverter;
import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.mainframe.share.ui.base.MouseClickListener;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil; import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
import com.fr.design.mainframe.toast.ToastMsgDialog; import com.fr.design.mainframe.toast.ToastMsgDialog;
@ -34,6 +33,7 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.server.socket.LogEventConverter;
import io.socket.client.IO; import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
import io.socket.emitter.Emitter; import io.socket.emitter.Emitter;

Loading…
Cancel
Save