Browse Source

Merge pull request #14910 in DESIGN/design from fbp/release to fbp/feature

* commit 'ca58766a6282943ffe5c5bc47486e7e6f1978357':
  REPORT-135703 【fr-fbp回归】linux设计器,下拉树-构建树按钮点不开
  REPORT-135672 fix: 启动阶段从本地获取日志级别配置,兼容fp的修改
  REPORT-130379 fix:NewUI富文本编辑器字体缩放适配
  无jira 自查newui细节问题处理
  模板主题tab调整区分控件显示增强&调整dragbar和spinner的占比、textfield的border
fbp/feature
superman 2 months ago
parent
commit
308410b8e0
  1. 7
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java
  3. 5
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  4. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  5. 14
      designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java
  6. 43
      designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java
  7. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java
  8. 32
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java
  9. 20
      designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java

7
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -5,10 +5,10 @@ import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.common.annotations.Open;
import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ToolBarDef;
@ -19,7 +19,6 @@ import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Iterator;
import java.util.LinkedHashMap;
@ -73,13 +72,11 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setLayout(new BorderLayout());
toolBar.setBorder(new FineRoundBorder());
toolBar.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
toolbarDef.updateToolBar(toolBar);
addItemPane.add(toolBar, BorderLayout.WEST);
addItemPane.setBorder(new FineRoundBorder());
addItemPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
addItemPane.setPreferredSize(new Dimension(addItemPane.getPreferredSize().width, FineUIScale.scale(24)));
selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();

4
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataComboBox.java

@ -13,7 +13,6 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.security.encryption.transmission.TransmissionEncryptionManager;
import com.fr.stable.StringUtils;
import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.tabledata.TableDataRepository;
@ -73,14 +72,11 @@ public class TreeTableDataComboBox extends UIComboBox {
Map<String, TableData> map = new HashMap<>();
final Map<String, Connection> connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll());
try {
TransmissionEncryptionManager.setTransEncryptionLevel(1);
for (ServerDataSetBean bean : beans) {
map.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData()));
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
TransmissionEncryptionManager.removeTransEncryptionLevel();
}
for (Map.Entry<String, TableData> entry : map.entrySet()) {
TableData tableData = entry.getValue();

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

@ -1,13 +1,13 @@
package com.fr.design.data.datapane.connect;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.tabledata.tabledatapane.loading.SwitchableTableDataPane;
@ -175,7 +175,8 @@ public class ConnectionTableProcedurePane extends BasicPane {
UILabel searchLabel = new UILabel(new LazyIcon("search"));
searchLabel.setBorder(new ScaledEmptyBorder(0, 3, 0, 3));
searchField.setBorder(null);
panel.add(row(cell(searchLabel), cell(searchField).weight(1)).with(it -> it.setBorder(new FineRoundBorder())).getComponent());
panel.add(row(cell(searchLabel), cell(searchField).weight(1)).with(
it -> it.setBorder(FineBorderFactory.createWrappedRoundBorder())).getComponent());
panel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return panel;
}

7
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java

@ -1,6 +1,7 @@
package com.fr.design.gui.frpane;
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
@ -12,11 +13,14 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNameObserver {
private static final long serialVersionUID = -8681716725163358249L;
private static double DRAG_BAR_WEIGHT = 0.64;
private static double SPINNER_WIGHT = 0.36;
private UISlider dragBar;
private UISpinner spinner;
private boolean isEditing = false;
@ -40,11 +44,12 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
dragBar.setPaintLabels(true);
dragBar.setMajorTickSpacing(minValue < 0 ? (int) maxValue : (int) maxValue - (int) minValue);
spinner = createUISpinner(minValue, maxValue, dierta);
spinner.getTextField().setBorder(new ScaledEmptyBorder(0, 0, 0, 0));
spinner.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"));
spinner.setValue(dragBar.getValue());
this.setLayout(new BorderLayout());
this.add(Layouts.row(
cell(dragBar).weight(0.7), flex(0.1), cell(spinner).weight(0.7)
cell(dragBar).weight(DRAG_BAR_WEIGHT), fix(2), cell(spinner).weight(SPINNER_WIGHT)
).getComponent());
dragBar.addChangeListener(e -> {
if (globalNameListener != null && shouldResponseNameListener()) {

14
designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java

@ -2,11 +2,9 @@ package com.fr.design.javascript;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.svg.IconUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.DesignerEnvManager;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.KeyWords;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -27,7 +25,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.js.JavaScriptImpl;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
@ -42,8 +39,6 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.cell;
@ -51,10 +46,9 @@ public class JSContentPane extends BasicPane {
protected RSyntaxTextArea contentTextArea;
private UILabel funNameLabel = new UILabel();
private AutoCompletion ac;
private static final Dimension FUNCTION_NAME_LABEL_SIZE = new Dimension(300, 80);
private String[] defaultArgs;
private int titleWidth = 180;
private JPanel labelPane = new JPanel();
private JPanel labelPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(10, 0));
private NewJavaScriptImplPane newJavaScriptImplPane = null;
private JavaScriptImpl javaScript;
private JSImplUpdateAction jsImplUpdateAction;
@ -189,17 +183,15 @@ public class JSContentPane extends BasicPane {
}.execute();
}
});
labelPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
labelPane.add(label,BorderLayout.CENTER);
JPanel jsParaPane = new JPanel(new BorderLayout());
funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
UIScrollPane scrollPane = new UIScrollPane(funNameLabel);
scrollPane.setOpaque(true);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
jsParaPane.add(row(4,
cell(scrollPane).weight(1),
cell(labelPane)
).getComponent());
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 0, 10))).getComponent());
return jsParaPane;
}

43
designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java

@ -1,9 +1,11 @@
package com.fr.design.javascript;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.svg.IconUtils;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.autocomplete.AutoCompleteExtraRefreshComponent;
import com.fr.design.gui.autocomplete.BasicCompletion;
import com.fr.design.gui.autocomplete.CompletionCellRenderer;
@ -54,7 +56,6 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
@ -72,7 +73,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutionException;
public class JSContentWithDescriptionPane extends JSContentPane implements KeyListener {
@ -424,27 +424,27 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
JPanel mainPane = new JPanel(card);
initHelpDocumentList();
UIScrollPane helpDOCScrollPane = new UIScrollPane(helpDOCList);
helpDOCScrollPane.setPreferredSize(new Dimension(200, 200));
helpDOCScrollPane.setPreferredSize(FineUIScale.createScaleDimension(200, 200));
helpDOCScrollPane.setBorder(null);
mainPane.add(helpDOCScrollPane, DOC_LIST_CARD);
UILabel imageLabel = new UILabel();
imageLabel.setIcon(IconUtils.readIcon("com/fr/design/javascript/jsapi/images/connectFailed.svg"));
imageLabel.setPreferredSize(new Dimension(180, 65));
imageLabel.setPreferredSize(FineUIScale.createScaleDimension(180, 65));
JPanel imagePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
imagePane.setBorder(BorderFactory.createEmptyBorder(0, 42, 0, 0));
imagePane.setBorder(new ScaledEmptyBorder(0, 42, 0, 0));
imagePane.add(imageLabel);
imagePane.setBackground(Color.WHITE);
UILabel failedLabel = new UILabel(Toolkit.i18nText("Fine-Design_Net_Connect_Failed"), 0);
failedLabel.setPreferredSize(new Dimension(180, 20));
failedLabel.setPreferredSize(FineUIScale.createScaleDimension(180, 20));
UILabel reloadLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Reload"), 0);
reloadLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
reloadLabel.setPreferredSize(new Dimension(180, 20));
reloadLabel.setPreferredSize(FineUIScale.createScaleDimension(180, 20));
reloadLabel.setForeground(Color.blue);
JPanel labelPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, 0, 0, 0);
labelPane.setBorder(BorderFactory.createEmptyBorder(35, 45, 0, 0));
labelPane.setBorder(new ScaledEmptyBorder(35, 45, 0, 0));
labelPane.setBackground(Color.WHITE);
labelPane.add(imagePane);
labelPane.add(failedLabel);
@ -506,7 +506,7 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof HelpDocument) {
this.setText(((HelpDocument) value).getName());
this.setForeground(Color.BLUE);
this.setForeground(FlatUIUtils.getUIColor("brand.normal", Color.BLUE));
}
return this;
}
@ -545,10 +545,12 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
private void initDescriptionArea(JPanel descriptionPanel) {
descriptionTextArea = new UITextArea();
descriptionTextArea.setBorder(null);
UIScrollPane descriptionScrollPane = new UIScrollPane(descriptionTextArea);
descriptionScrollPane.setPreferredSize(new Dimension(300, 200));
descriptionScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
descriptionScrollPane.setPreferredSize(FineUIScale.createScaleDimension(300, 200));
descriptionPanel.add(this.createNamePane(Toolkit.i18nText("Fine-Design_Interface_Description"), descriptionScrollPane), BorderLayout.CENTER);
descriptionTextArea.setBackground(Color.white);
descriptionTextArea.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
descriptionTextArea.setLineWrap(true);
descriptionTextArea.setWrapStyleWord(true);
descriptionTextArea.setEditable(false);
@ -581,10 +583,12 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
private void initInterfaceModuleTree(JPanel interfacePanel) {
moduleTree = new JTree();
FineUIStyle.setStyle(moduleTree, FineUIStyle.PURE_TREE);
UIScrollPane moduleTreePane = new UIScrollPane(moduleTree);
moduleTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
moduleTreePane.setBorder(FineBorderFactory.createWrappedRoundBorder());
interfacePanel.add(this.createNamePane(Toolkit.i18nText("Fine-Design_Module"), moduleTreePane), BorderLayout.WEST);
moduleTreePane.setPreferredSize(new Dimension(180, 200));
moduleTreePane.setPreferredSize(FineUIScale.createScaleDimension(180, 200));
moduleTree.setRootVisible(false);
moduleTree.setShowsRootHandles(true);
@ -648,13 +652,14 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
private void initInterfaceNameList(JPanel interfacePanel) {
interfaceNameList = new JList(new DefaultListModel());
FineUIStyle.setStyle(interfaceNameList, FineUIStyle.PURE_LIST);
UIScrollPane interfaceNamePanelScrollPane = new UIScrollPane(interfaceNameList);
interfaceNamePanelScrollPane.setPreferredSize(new Dimension(180, 200));
interfaceNamePanelScrollPane.setPreferredSize(FineUIScale.createScaleDimension(180, 200));
interfacePanel.add(
this.createNamePane(Toolkit.i18nText("Fine-Design_Interface") + ":", interfaceNamePanelScrollPane),
BorderLayout.CENTER);
interfaceNamePanelScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
interfaceNamePanelScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
initInterfaceNameModule();
initInterfaceNameListSelectionListener();
initInterfaceNameListMouseListener();
@ -857,8 +862,8 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
popupMenu = new JPopupMenu();
JScrollPane tipsScrollPane = new JScrollPane(tipsList);
popupMenu.add(tipsScrollPane);
tipsScrollPane.setPreferredSize(new Dimension(220, 146));
tipsScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
tipsScrollPane.setPreferredSize(FineUIScale.createScaleDimension(220, 146));
tipsScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
}
private void popTips() {

6
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java

@ -361,7 +361,11 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
}
protected void buildTabPane() {
uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build();
if (WidgetThemeDesignerUtils.enableWidgetEnhance()) {
uiTabbedPane = tabPaneBuilder.withHeadRatio(1.0f).build();
} else {
uiTabbedPane = tabPaneBuilder.withHeadRatio(0.6f).build();
}
uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1));
}
}

32
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java vendored

@ -55,6 +55,7 @@ import com.fr.env.detect.EnvDetectorCenter;
import com.fr.event.EventDispatcher;
import com.fr.general.FRLogger;
import com.fr.general.log.Log4jConfig;
import com.fr.general.log.Log4jConfigFactory;
import com.fr.general.log.Log4jUtils;
import com.fr.intelli.metrics.Compute;
import com.fr.intelli.metrics.DBMonitorInterceptor;
@ -88,6 +89,7 @@ import com.fr.stable.db.session.DBSession;
import com.fr.stable.project.ProjectConstants;
import com.fr.tenant.context.TenantContext;
import com.fr.tenant.context.provider.CurrentTenantKey;
import com.fr.third.apache.logging.log4j.Level;
import com.fr.third.apache.logging.log4j.core.config.Configurator;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers;
@ -244,6 +246,8 @@ public class DesignEnvComponent {
* ----------- logger --------
*/
private void startLogger() {
// 获取本地的日志级别配置
Log4jConfigFactory.getInstance().setRootLevel(Log4jConfig.getInstance().getRootLevel());
URI uri = Log4jUtils.buildUserConfigURI(StringUtils.EMPTY);
FRLogger.getLogger().config(uri);
// 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下
@ -251,21 +255,19 @@ public class DesignEnvComponent {
}
private void listenConfig() {
/// 等fbp改完,现在先配合打包注释掉
// ValidateConfigManger.getInstance().registerListener(new ConfigChangeListener() {
//
// @Override
// public boolean accept(Class<? extends Configuration> configClass) {
// return configClass.equals(Log4jConfig.class);
// }
//
// @Override
// public void change() {
// // The root logger is the topmost logger with a name of "" (the empty string).
// Configurator.setAllLevels("", Log4jConfig.getInstance().getRootLevel());
// }
// });
ValidateConfigManger.getInstance().registerListener(new ConfigChangeListener() {
@Override
public boolean accept(Class<? extends Configuration> configClass) {
return configClass.equals(Log4jConfig.class);
}
@Override
public void change() {
// The root logger is the topmost logger with a name of "" (the empty string).
Configurator.setAllLevels("", Log4jConfig.getInstance().getRootLevel());
}
});
}
private void stopLogger() {

20
designer-realize/src/main/java/com/fr/design/report/RichTextEditingPane.java

@ -14,12 +14,14 @@ import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.cellattr.core.RichText;
import com.fr.report.cell.cellattr.core.RichTextConverter;
import java.awt.Font;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultHighlighter;
import javax.swing.text.DefaultStyledDocument;
import javax.swing.text.Element;
import javax.swing.text.Highlighter;
import javax.swing.text.StyledDocument;
@ -27,6 +29,8 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import static com.formdev.flatlaf.util.UIScale.scale;
/**
* 富文本的编辑区域
*
@ -50,6 +54,22 @@ public class RichTextEditingPane extends UITextPane{
public RichTextEditingPane() {
this.addMouseListener(doubleClickFormulaListener);
this.addFocusListener(focusListener);
setDocument(new ScaledStyledDocument());
}
/**
* 支持字体缩放的Document对象
*/
public static class ScaledStyledDocument extends DefaultStyledDocument {
@Override
public Font getFont(AttributeSet a) {
Font font = super.getFont(a);
if (font != null) {
return font.deriveFont(font.getStyle(), scale(font.getSize()));
}
return null;
}
}
/**

Loading…
Cancel
Save