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. 13
      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.paintBorder(g2d, style, width, height);
Style.paintBorder(g2d, style,
width - GraphHelper.getLineStyleSize(style.getBorderRight()) / 2F,
height - GraphHelper.getLineStyleSize(style.getBorderBottom()) / 2F);
}
@Override

13
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.dialog.FineJOptionPane;
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.UIComboBoxEditor;
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;
@ -146,7 +146,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
schemaBox = new StringUIComboBox();
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.setRenderer(listCellRenderer);
registerDSChangeListener();
@ -486,12 +486,9 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
protected String getTableName() {
String tableName = "";
Object obj = this.tableNameComboBox.getSelectedItemObject();
Object obj = this.tableNameComboBox.getSelectedItem();
if (obj == null) {
obj = this.tableNameComboBox.getSelectedItem();
if (obj == null) {
obj = this.tableNameComboBox.getEditor().getItem();
}
obj = this.tableNameComboBox.getEditor().getItem();
}
if (obj instanceof TreePath) {
Object tp = ((ExpandMutableTreeNode) ((TreePath) obj).getLastPathComponent()).getUserObject();

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) {
openFile();
}
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(reportletsTree.getSelectedFileNode());
}
@Override
@ -121,6 +120,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (toolBarStateChangeListener != null) {
toolBarStateChangeListener.stateChange();
}
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(reportletsTree.getSelectedFileNode());
}
};
// lx: add mouse listener
@ -231,7 +231,8 @@ public class TemplateTreePane extends JPanel implements FileOperations {
return;
}
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);
if (showLockInfo) {
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);
TableDataDictionary dictionary = treeEditor.getDictionary();
autoBuildPane.populate(dictionary);
} else if (treeEditor.isLayerBuild()) {
} else if (treeEditor.isFastLayerBuild()) {
buildBox.setSelectedIndex(0);
java.util.List<LayerConfig> layerConfigList = treeEditor.getLayerConfigs();
LayerConfig[] layerConfigs = new LayerConfig[layerConfigList.size()];
@ -156,12 +156,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update();
te.setAutoBuild(true);
te.setLayerBuild(false);
te.setFastLayerBuild(false);
te.setDictionary(dictionary);
te.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) {
te.setAutoBuild(false);
te.setLayerBuild(false);
te.setFastLayerBuild(false);
NameObject no = this.controlPane.update();
if (no != null) {
TreeEditor editor = (TreeEditor) no.getObject();
@ -181,7 +181,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
} else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
te.setAutoBuild(false);
te.setLayerBuild(true);
te.setFastLayerBuild(true);
te.setLayerConfigs(Arrays.asList(configs));
}
return te;
@ -215,12 +215,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update();
tcb.setAutoBuild(true);
tcb.setLayerBuild(false);
tcb.setFastLayerBuild(false);
tcb.setDictionary(dictionary);
tcb.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) {
tcb.setAutoBuild(false);
tcb.setLayerBuild(false);
tcb.setFastLayerBuild(false);
NameObject no = this.controlPane.update();
if (no != null) {
if (no.getObject() instanceof TreeComboBoxEditor) {
@ -244,7 +244,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
}else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
tcb.setAutoBuild(false);
tcb.setLayerBuild(true);
tcb.setFastLayerBuild(true);
tcb.setLayerConfigs(Arrays.asList(configs));
}
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.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Filter;
import com.fr.stable.StringUtils;
import javax.swing.JOptionPane;
@ -24,7 +25,7 @@ import java.awt.event.MouseEvent;
import java.util.Enumeration;
/**
* 实现模糊搜索的FRTreeComboBox
* 实现模糊搜索表名的FRTreeComboBox
* FRTreeComboBox搜索后滚动到首个匹配节点
* SearchFRTreeComboBox显示所有匹配的节点
*
@ -32,19 +33,27 @@ import java.util.Enumeration;
* @version 10.0
* Created by Lucian.Chen on 2021/4/14
*/
public class SearchFRTreeComboBox extends FRTreeComboBox {
public class TableSearchTreeComboBox extends FRTreeComboBox {
// 持有父容器,需要实时获取其他组件值
private final ChoosePane parent;
public SearchFRTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) {
public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) {
super(tree, renderer);
this.parent = parent;
setUI(new SearchFRTreeComboBoxUI());
setUI(new TableSearchTreeComboBoxUI());
}
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 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) {
private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() {
public boolean accept(TableProcedure procedure) {
return true;
}
@ -171,17 +160,18 @@ public class SearchFRTreeComboBox extends FRTreeComboBox {
/**
* 表名模糊搜索实现
*/
private static class TableNameFilter {
private final String searchFilter;
private static class TableNameFilter implements Filter<TableProcedure> {
private String searchFilter;
public TableNameFilter() {
}
public TableNameFilter(String searchFilter) {
if (StringUtils.isNotEmpty(searchFilter)) {
searchFilter = searchFilter.toLowerCase().trim();
}
this.searchFilter = searchFilter;
this.searchFilter = searchFilter.toLowerCase().trim();
}
// 字符串匹配
// 表名匹配
@Override
public boolean accept(TableProcedure procedure) {
return procedure.getName().toLowerCase().contains(searchFilter);
}
@ -190,11 +180,31 @@ public class SearchFRTreeComboBox extends FRTreeComboBox {
/**
* 重写FRTreeComboBoxUI实现点击下拉时触发模糊搜索
*/
private class SearchFRTreeComboBoxUI extends FRTreeComboBoxUI {
private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI {
@Override
public void mouseClicked(MouseEvent e) {
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.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.utils.TemplateUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.general.IOUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@ -24,7 +26,6 @@ import java.time.format.DateTimeFormatter;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.UIManager;
/**
* @author hades
@ -39,13 +40,11 @@ public class LockInfoDialog extends JDialog {
super(DesignerContext.getDesignerFrame());
JPanel panel = new JPanel(new BorderLayout());
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(createControlPane(), BorderLayout.SOUTH);
this.getContentPane().add(panel);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Alert"));
this.setSize(400, 180);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint"));
this.setSize(400, 160);
this.setResizable(false);
this.setModal(true);
GUICoreUtils.centerWindow(this);
@ -54,12 +53,21 @@ public class LockInfoDialog extends JDialog {
private JPanel createContentPane(UserInfo userInfo) {
JPanel contentPanel = new JPanel(new BorderLayout());
contentPanel.setBorder(BorderFactory.createEmptyBorder(15, 0, 0, 0));
contentPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Template_Lock_And_SaveAs_Tip")), BorderLayout.NORTH);
contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
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();
detailInfoPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0,0));
detailInfoPane.setBorder(BorderFactory.createEmptyBorder(0, 45, 0,0));
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())) {
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) {
UILabel label = new UILabel(text);
label.setForeground(Color.GRAY);
label.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
label.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0));
return label;
}
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 cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Button_Cancel"));
saveAsButton.addActionListener(new ActionListener() {
@ -105,6 +114,7 @@ public class LockInfoDialog extends JDialog {
public static void show(UserInfo userInfo) {
DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(TemplateTreePane.getInstance().getFileNode());
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.LockInfoOperator;
import com.fr.start.server.FineEmbedServer;
import com.fr.workspace.WorkContext;
/**
@ -15,4 +16,8 @@ public class LockInfoUtils {
LockInfoOperator lockInfoOperator = WorkContext.getCurrent().get(LockInfoOperator.class);
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.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
@ -198,7 +197,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
rightToolBar = new UIToolbar(FlowLayout.RIGHT);
rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
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"));
button.setRolloverIcon(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/unlock.png"));
button.setBorderPainted(false);
@ -213,7 +214,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.YES_NO_OPTION,
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);
if (option == JOptionPane.YES_OPTION) {
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.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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 int Y_GAP = 10;
private static final int X_GAP = 10;
private static final int ARC = 4;
private final UILabel lockLabel;
private final UILabel tipLabel;
@ -71,11 +75,11 @@ public class ForbiddenPane extends JPanel {
int tipLabelWidth = tipLabel.getPreferredSize().width;
int tipLabelHeight = tipLabel.getPreferredSize().height;
int tipLabelX = (width - tipLabelWidth) / 2 + X_GAP;
int tipLabelY = lockLabelY + lockLabelHeight - Y_GAP;
int tipLabelY = lockLabelY + lockLabelHeight;
int refreshButtonWidth = refreshButton.getPreferredSize().width;
int refreshButtonHeight = refreshButton.getPreferredSize().height;
int refreshButtonX = (width - refreshButtonWidth) / 2 + X_GAP;
int refreshButtonY = tipLabelY + refreshButtonHeight;
int refreshButtonY = tipLabelY + refreshButtonHeight + Y_GAP;
lockLabel.setBounds(lockLabelX, lockLabelY, lockLabelWidth, lockLabelHeight);
tipLabel.setBounds(tipLabelX, tipLabelY, tipLabelWidth, tipLabelHeight);
refreshButton.setBounds(refreshButtonX, refreshButtonY, refreshButtonWidth, refreshButtonHeight);
@ -88,16 +92,20 @@ public class ForbiddenPane extends JPanel {
setBackground(Color.WHITE);
lockLabel = new UILabel(LOCK_ICON);
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);
refreshButton = new JButton(Toolkit.i18nText("Fine-Design_Basic_Refresh")) {
@Override
public void paintComponent(Graphics g)
{
g.setColor(BUTTON_COLOR);
g.fillRect(0, 0, getSize().width, getSize().height);
super.paintComponent(g);
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(BUTTON_COLOR);
g2d.fillRoundRect(0, 0, getWidth(), getHeight(), ARC, ARC);
super.paintComponent(g2d);
}
};
refreshButton.setPreferredSize(new Dimension(68, 24));
refreshButton.setForeground(Color.WHITE);
refreshButton.setBorderPainted(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
protected void initLayout() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(new BorderLayout(0, 10));
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 4));
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewArea = new CellRectangleStylePreviewPane(true);
previewArea.setPreferredSize(new Dimension(215, 52));
previewArea.setPreferredSize(new Dimension(215, 48));
previewPane.setBorder(BorderFactory.createCompoundBorder(
BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")),
BorderFactory.createEmptyBorder(4, 4, 4, 4)));
previewPane.add(previewArea, BorderLayout.CENTER);
previewPane.add(previewArea, 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;
import com.fr.base.Style;
import com.fr.stable.Constants;
import javax.swing.JComponent;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
public abstract class AbstractPreviewCell extends JComponent {
private static final double BORDER_INSET = 0.5D;
protected Style style = Style.DEFAULT_STYLE;
private static final int NO_SCALE_RESOLUTION = 100;
@ -19,7 +22,19 @@ public abstract class AbstractPreviewCell extends JComponent {
Graphics2D g2d = (Graphics2D) g;
Style.paintBackground(g2d, style, getWidth(), getHeight());
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);

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.file.FileNodeFILE;
import com.fr.file.filetree.FileNode;
import com.fr.general.IOUtils;
import com.fr.report.UnLockedException;
import com.fr.workspace.exception.DiskSpaceFullException;
import com.fr.report.InconsistentLockException;
import java.awt.Frame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
/**
* @author hades
@ -50,7 +50,8 @@ public class SaveFailureHandler implements ThrowableHandler {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine_Design_Template_Save_Failed_By_Full_Disk"),
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE);
JOptionPane.WARNING_MESSAGE,
IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"));
return true;
}
return false;
@ -98,7 +99,7 @@ public class SaveFailureHandler implements ThrowableHandler {
Toolkit.i18nText("Fine-Design_Basic_Alert"),
JOptionPane.YES_NO_OPTION,
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);
if (option == JOptionPane.YES_OPTION) {
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;
Dimension size = chartEditor.getSize();
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);
im.getGraphics().drawImage(chartImage, 0, chartEditor.getY(), null);
im.getGraphics().drawImage(chartImage, chartEditor.getX(), chartEditor.getY(), null);
}
}
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.mainframe.DesignerContext;
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.toast.DesignerToastMsgUtil;
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.base.WorkspaceConstants;
import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.server.socket.LogEventConverter;
import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;

Loading…
Cancel
Save