Browse Source

Pull request #13295: REPORT-107973 主页及组件视觉样式翻新

Merge in DESIGN/design from ~LEO.QIN/design:newui to newui

* commit '5c0b50211829dd2bfbd9c30d8dc0c44973173e16':
  改一下代码质量
  REPORT-107973 主页及组件视觉样式翻新 【问题原因】rt 【改动思路】翻新:数字步进、搜索框、BaseAccessibleEditor、popupTool面板,部分文本框组件高度
  REPORT-107973 主页及组件视觉样式翻新 【问题原因】rt 【改动思路】tooltip翻新
newui
Leo.Qin-覃宇攀 1 year ago
parent
commit
34ef7f9ec0
  1. 80
      designer-base/src/main/java/com/fine/theme/light/ui/FineInputUI.java
  2. 12
      designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java
  3. 2
      designer-base/src/main/java/com/fine/theme/light/ui/FineRoundBorder.java
  4. 97
      designer-base/src/main/java/com/fine/theme/light/ui/FineTooltipUI.java
  5. 125
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/FineSearchPane.java
  6. 86
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java
  7. 129
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  8. 10
      designer-base/src/main/java/com/fr/design/gui/itextarea/UITextArea.java
  9. 7
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java
  10. 41
      designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java
  11. 89
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  12. 120
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java
  13. 26
      designer-base/src/main/java/com/fr/design/mainframe/widget/editors/DataBindingEditor.java
  14. 3
      designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java
  15. 5
      designer-base/src/main/resources/com/fine/theme/icon/dot.svg
  16. 8
      designer-base/src/main/resources/com/fine/theme/icon/notification/notification_dot.svg
  17. 7
      designer-base/src/main/resources/com/fine/theme/icon/popup/collapse_popup.svg
  18. 5
      designer-base/src/main/resources/com/fine/theme/icon/popup/expand_popup.svg
  19. 4
      designer-base/src/main/resources/com/fine/theme/icon/up_arrow.svg
  20. 49
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  21. 2
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  22. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java
  23. 16
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  24. 10
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

80
designer-base/src/main/java/com/fine/theme/light/ui/FineInputUI.java

@ -0,0 +1,80 @@
package com.fine.theme.light.ui;
import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatPanelUI;
import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
/**
* Input输入框 UI类
*
* @author Leo.Qin
* @since 11.0
* Created on 2023/12/11
*/
public class FineInputUI extends FlatPanelUI {
public FineInputUI(boolean shared) {
super(shared);
}
/**
* 创建UI
*/
public static ComponentUI createUI(JComponent c) {
return new FineInputUI(false);
}
@Override
public void installUI(JComponent c) {
super.installUI(c);
c.setBackground(UIManager.getColor("Input.background"));
c.setBorder(UIManager.getBorder("Input.border"));
}
@Override
protected void installDefaults(JPanel p) {
super.installDefaults(p);
arc = UIManager.getInt("Input.arc");
}
/**
* input输入框中的Button UI类
*
* @author Leo.Qin
* @since 11.0
* Created on 2023/12/12
*/
public static class FineInputButtonUI extends FlatButtonUI {
public FineInputButtonUI(boolean shared) {
super(shared);
}
/**
* 创建UI
*/
public static ComponentUI createUI(JComponent c) {
return new FineInputButtonUI(false);
}
@Override
public void installUI(JComponent c) {
super.installUI(c);
c.setBorder(null);
c.setOpaque(false);
}
@Override
protected void installDefaults(AbstractButton b) {
super.installDefaults(b);
hoverBackground = UIManager.getColor("InputButton.hoverBackground");
pressedBackground = UIManager.getColor("InputButton.pressedBackground");
background = UIManager.getColor("InputButton.background");
}
}
}

12
designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java

@ -35,10 +35,12 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("drag_left", "com/fine/theme/icon/drag_left.svg", true),
new SvgIconSource("drag_right", "com/fine/theme/icon/drag_right.svg", true),
new SvgIconSource("down_arrow", "com/fine/theme/icon/down_arrow.svg", true),
new SvgIconSource("down_arrow_12", "com/fine/theme/icon/down_arrow.svg", true, 12),
new SvgIconSource("up_arrow_12", "com/fine/theme/icon/up_arrow.svg", true, 12),
// 数据集相关Icon
new SvgIconSource("database", "com/fine/theme/icon/dataset/database.svg", true),
new SvgIconSource("preview", "com/fine/theme/icon/dataset/preview.svg", false),
new SvgIconSource("preview", "com/fine/theme/icon/dataset/preview.svg", true),
new SvgIconSource("connection", "com/fine/theme/icon/dataset/connection.svg", true),
new SvgIconSource("class_table_data", "com/fine/theme/icon/dataset/class_table_data.svg", true),
new SvgIconSource("data_table", "com/fine/theme/icon/dataset/data_table.svg", true),
@ -155,6 +157,8 @@ public class FineLightIconSet extends AbstractIconSet {
// 北区菜单栏
new SvgIconSource("notification", "com/fine/theme/icon/notification/notification.svg"),
new SvgIconSource("notification_dot.svg", "com/fine/theme/icon/notification/notification_dot.svg"),
// 三角
new SvgIconSource("triangle_down", "com/fine/theme/icon/triangle/triangle_down.svg"),
@ -166,7 +170,11 @@ public class FineLightIconSet extends AbstractIconSet {
// 滚动条
new SvgIconSource("zoomIn", "com/fine/theme/icon/zoom/zoomIn.svg", true),
new SvgIconSource("zoomOut", "com/fine/theme/icon/zoom/zoomOut.svg", true)
new SvgIconSource("zoomOut", "com/fine/theme/icon/zoom/zoomOut.svg", true),
new SvgIconSource("dot", "com/fine/theme/icon/dot.svg"),
new SvgIconSource("expand_popup", "com/fine/theme/icon/popup/expand_popup.svg"),
new SvgIconSource("collapse_popup", "com/fine/theme/icon/popup/collapse_popup.svg")
);
}
}

2
designer-base/src/main/java/com/fine/theme/light/ui/FineRoundBorder.java

@ -27,8 +27,6 @@ public class FineRoundBorder extends FlatRoundBorder {
protected Color highlightBorderColor = UIManager.getColor("defaultHighlightBorderColor");
@Styleable(dot = true)
protected Color focusColor = UIManager.getColor("defaultBorderFocusShadow");
@Styleable(dot = true)
protected int focusWidth = UIManager.getInt("defaultBorderFocusWidth");
@Override
protected Paint getBorderColor(Component c) {

97
designer-base/src/main/java/com/fine/theme/light/ui/FineTooltipUI.java

@ -0,0 +1,97 @@
package com.fine.theme.light.ui;
import com.formdev.flatlaf.ui.FlatToolTipUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils;
import com.fr.stable.Constants;
import javax.swing.JComponent;
import javax.swing.JToolTip;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.util.List;
/**
* ToolTip UI类
*
* @author Leo.Qin
* @since 11.0
* Created on 2023/12/8
*/
public class FineTooltipUI extends FlatToolTipUI {
private int maxWidth;
private int arc;
private List<String> lines;
/**
* 创建UI
*/
public static ComponentUI createUI(JComponent c) {
return FlatUIUtils.createSharedUI(FineTooltipUI.class, FineTooltipUI::new);
}
@Override
public void paint(Graphics g, JComponent c) {
g.setColor(c.getBackground());
g.fillRoundRect(0, 0, c.getWidth(), c.getHeight(), arc, arc);
String text = ((JToolTip) c).getTipText();
if (text == null || text.isEmpty()) {
return;
}
Insets insets = c.getInsets();
Graphics2D g2d = (Graphics2D) g;
FontMetrics fm = g2d.getFontMetrics();
int x = insets.left;
int y = insets.top + fm.getAscent();
g2d.setColor(c.getForeground());
for (String line : lines) {
g2d.drawString(line, x, y);
y += fm.getHeight();
}
}
@Override
protected void installDefaults(JComponent c) {
super.installDefaults(c);
c.setOpaque(false);
arc = UIManager.getInt("ToolTip.arc");
maxWidth = UIManager.getInt("ToolTip.maxWidth");
}
@Override
public Dimension getPreferredSize(JComponent c) {
String text = ((JToolTip) c).getTipText();
if (text == null || text.isEmpty()) {
return new Dimension();
}
Insets insets = c.getInsets();
int fontWidth = this.maxWidth - insets.left - insets.right;
lines = BaseUtils.getLineTextList(text, null, null, fontWidth, Constants.FR_PAINT_RESOLUTION);
FontMetrics fm = c.getFontMetrics(c.getFont());
int width = 0;
int height = fm.getHeight() * Math.max(lines.size(), 1);
for (String line : lines) {
width = Math.max(width, SwingUtilities.computeStringWidth(fm, line));
}
return new Dimension(insets.left + width + insets.right, insets.top + height + insets.bottom);
}
}

125
designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/FineSearchPane.java

@ -0,0 +1,125 @@
package com.fr.design.data.datapane.management.search.pane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineInputUI;
import com.fr.design.event.HoverAware;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
import java.awt.Insets;
import java.awt.event.ActionListener;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* 搜索面板
*
* @author Leo.Qin
* @since 11.0
* Created on 2023/12/13
*/
public class FineSearchPane extends JPanel implements HoverAware {
private static final Insets LABEL_INSETS = UIManager.getInsets("SearchPanel.labelBorderInsets");
private static final Insets BUTTON_INSETS = UIManager.getInsets("SearchPanel.buttonBorderInsets");
private UITextField searchTextField;
private UIButton clearButton;
private boolean hover;
public FineSearchPane() {
this.setLayout(new BorderLayout());
this.setUI(new FineInputUI(false));
initComponents();
}
private void initComponents() {
// 左侧搜索图标
UILabel searchLabel = new UILabel(new LazyIcon("search"));
searchLabel.setBorder(BorderFactory.createEmptyBorder(LABEL_INSETS.top, LABEL_INSETS.left, LABEL_INSETS.bottom, LABEL_INSETS.right));
// 中间输入框
searchTextField = new UITextField();
searchTextField.setBorder(null);
searchTextField.setOpaque(false);
searchTextField.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
hover = false;
repaint();
}
});
// 右侧返回图标
clearButton = new UIButton(new LazyIcon("clear"));
clearButton.setUI(new FineInputUI.FineInputButtonUI(false));
clearButton.setBorder(BorderFactory.createEmptyBorder(BUTTON_INSETS.top, BUTTON_INSETS.left, BUTTON_INSETS.bottom, BUTTON_INSETS.right));
this.add(searchLabel, BorderLayout.WEST);
this.add(searchTextField, BorderLayout.CENTER);
this.add(clearButton, BorderLayout.EAST);
}
@Override
public boolean isHovered() {
return hover;
}
/**
* 添加KeyListener
*
* @param listener the key listener.
*/
public void addKeyListener(KeyListener listener) {
searchTextField.addKeyListener(listener);
}
public void setPlaceholder(String placeHolder) {
searchTextField.setPlaceholder(placeHolder);
}
public void setClearToolTipText(String text) {
clearButton.setToolTipText(text);
}
/**
* 添加DocumentListener
*
* @param listener
*/
public void addDocumentListener(DocumentListener listener) {
searchTextField.getDocument().addDocumentListener(listener);
}
/**
* 按钮添加监听器
*
* @param listener
*/
public void addClearActionListener(ActionListener listener) {
clearButton.addActionListener(listener);
}
public String getText() {
return searchTextField.getText();
}
public void setText(String text) {
searchTextField.setText(text);
}
}

86
designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java

@ -1,12 +1,8 @@
package com.fr.design.data.datapane.management.search.pane;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.DesignModelAdapter;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
@ -17,19 +13,15 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* @author Yvan
@ -40,6 +32,8 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
public static final String SEARCH_PANE = "searchPane";
private static final Insets INSETS = UIManager.getInsets("TreeSearchToolbarPane.borderInsets");
/**
* 工具栏
*/
@ -53,13 +47,7 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
/**
* 搜索面板
*/
private JPanel searchPane;
/**
* 搜索输入框
*/
private UITextField searchTextField;
private FineSearchPane searchPane;
/**
* 内容面板
*/
@ -74,7 +62,7 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
TableDataTreeSearchManager.getInstance().startSearch(searchTextField.getText());
TableDataTreeSearchManager.getInstance().startSearch(searchPane.getText());
}
}
};
@ -93,47 +81,17 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
private void initContentPane() {
cardLayout = new CardLayout();
contentPane = new JPanel(cardLayout);
contentPane.setBorder(BorderFactory.createEmptyBorder(INSETS.top, INSETS.left, INSETS.bottom, INSETS.right));
contentPane.add(searchPane, SEARCH_PANE);
contentPane.add(toolbarPane, TOOLBAR_PANE);
cardLayout.show(contentPane, TOOLBAR_PANE);
}
private void initSearchPane() {
searchPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.TOOLBAR_BORDER_COLOR));
searchPane.setBackground(Color.WHITE);
// 左侧搜索图标
UILabel searchLabel = new UILabel(new LazyIcon("search"));
searchLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
searchLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// do nothing
}
});
searchPane = new FineSearchPane();
// 中间输入框
searchTextField = new UITextField(){
@Override
public Insets getInsets() {
return new Insets(2, 4, 0, 4);
}
};
searchTextField.setBorderPainted(false);
searchTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Tree_Search_Press_Enter_For_Search"));
searchTextField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.NORMAL_BLUE));
searchPane.repaint();
}
@Override
public void focusLost(FocusEvent e) {
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.TOOLBAR_BORDER_COLOR));
searchPane.repaint();
}
});
this.searchTextField.getDocument().addDocumentListener(new DocumentListener() {
searchPane.setPlaceholder(Toolkit.i18nText("Fine-Design_Tree_Search_Press_Enter_For_Search"));
searchPane.addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
}
@ -147,25 +105,15 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
public void changedUpdate(DocumentEvent e) {
}
});
this.searchTextField.addKeyListener(enterPressed);
// 右侧返回图标
UILabel returnLabel = new UILabel(new LazyIcon("clear"));
returnLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Tree_Search_Return"));
returnLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 11));
returnLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
TableDataTreeSearchManager.getInstance().outOfSearchMode();
}
});
searchPane.add(searchLabel, BorderLayout.WEST);
searchPane.add(searchTextField, BorderLayout.CENTER);
searchPane.add(returnLabel, BorderLayout.EAST);
searchPane.addKeyListener(enterPressed);
searchPane.setClearToolTipText(Toolkit.i18nText("Fine-Design_Tree_Search_Return"));
searchPane.addClearActionListener(e -> TableDataTreeSearchManager.getInstance().outOfSearchMode());
}
private void dealWithTextChange() {
if (StringUtils.isEmpty(searchTextField.getText()) && TableDataTreeSearchManager.getInstance().isInSearchMode()) {
if (StringUtils.isEmpty(searchPane.getText()) && TableDataTreeSearchManager.getInstance().isInSearchMode()) {
// 如果是搜索模式下,看作是用户删除输入框文字,仅复原TableDataTreePane
TableDataTreeSearchManager.getInstance().restoreTreePane();
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
@ -186,7 +134,7 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
}
public void setPlaceHolder(String placeHolder) {
this.searchTextField.setPlaceholder(placeHolder);
searchPane.setPlaceholder(placeHolder);
}
/**
@ -198,7 +146,7 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
public void updateTreeSearchChange(TreeSearchStatusChangeEvent event) {
TreeSearchStatus treeSearchStatus = event.getTreeSearchStatus();
if (treeSearchStatus == TreeSearchStatus.NOT_IN_SEARCH_MODE) {
this.searchTextField.setText(StringUtils.EMPTY);
searchPane.setText(StringUtils.EMPTY);
switchPane(TOOLBAR_PANE);
} else {
switchPane(SEARCH_PANE);

129
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

@ -1,48 +1,52 @@
package com.fr.design.gui.ispinner;
import com.fr.design.constants.UIConstants;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineInputUI;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.HoverAware;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.CommonUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.ButtonModel;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.plaf.ButtonUI;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver {
/**
* Spinner类
*
* @author anonymous
* @Created on 2023/12/12
* @since 11.0
*/
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, HoverAware {
protected double value;
private static final int SIZE = 20;
private static final int LEN = 13;
private static final int WIDTH = 13;
private static final int HEIGHT = 10;
private static final int BUTTON_WIDTH = UIManager.getInt("InputButton.width");
private static final int BUTTON_HEIGHT = UIManager.getInt("InputButton.height");
private static final int HEIGHT = UIManager.getInt("Input.height");
private static final int DEFAULT_NUMBERFIELD_COLUMNS = 2;
private UINumberField textField;
private UIButton preButton;
@ -60,6 +64,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
private int numberFieldColumns;
private boolean textFieldFocus = false;
private boolean hover;
public UISpinner() {
}
@ -85,6 +91,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
this.dierta = dierta;
initComponents();
iniListener();
setUI(FineInputUI.createUI(this));
}
private void iniListener() {
@ -99,6 +106,21 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
});
}
textField.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
hover = false;
repaint();
}
});
}
/**
@ -210,7 +232,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = SIZE;
dim.height = HEIGHT;
return dim;
}
@ -243,33 +265,9 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
}
}
private class ButtionUI extends UIButtonUI {
private boolean isNormalPaint = true;
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
isNormalPaint = false;
Color pressColor = UIConstants.COMBOBOX_BTN_PRESS;
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), pressColor);
} else if (isRollOver(b)) {
isNormalPaint = false;
Color hoverColor = UIConstants.COMBOBOX_BTN_ROLLOVER;
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), hoverColor);
} else if (b.isNormalPainted()) {
isNormalPaint = true;
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
@Override
protected void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
if (isNormalPaint) {
g.setColor(UIConstants.COMBOBOX_BTN_NORMAL);
g.fillRect(0, 0, c.getWidth(), c.getHeight());
}
super.paintModelIcon(model, icon, g, c);
}
@Override
public boolean isHovered() {
return hover;
}
private void initComponents() {
@ -277,41 +275,30 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
textField.setMaxValue(maxValue);
textField.setMinValue(minValue);
setValue(value);
preButton = new UIButton(UIConstants.ARROW_UP_ICON) {
public boolean shouldResponseChangeListener() {
return false;
}
@Override
public ButtonUI getUI() {
return new ButtionUI();
}
};
preButton.setRoundBorder(true, Constants.LEFT);
nextButton = new UIButton(UIConstants.ARROW_DOWN_ICON) {
public boolean shouldResponseChangeListener() {
return false;
}
@Override
public ButtonUI getUI() {
return new ButtionUI();
}
};
nextButton.setRoundBorder(true, Constants.LEFT);
preButton = createArrowButton(new LazyIcon("up_arrow_12"));
nextButton = createArrowButton(new LazyIcon("down_arrow_12"));
setLayout(new BorderLayout());
add(textField, BorderLayout.CENTER);
JPanel arrowPane = new JPanel();
arrowPane.setPreferredSize(new Dimension(LEN, SIZE));
arrowPane.setLayout(new GridLayout(2, 1));
preButton.setBounds(0, 1, WIDTH, HEIGHT);
nextButton.setBounds(0, HEIGHT, WIDTH, HEIGHT);
arrowPane.add(preButton);
arrowPane.add(nextButton);
arrowPane.setOpaque(false);
arrowPane.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
add(arrowPane, BorderLayout.EAST);
componentInitListeners();
}
private UIButton createArrowButton(Icon icon) {
UIButton arrowButton = new UIButton(icon) {
public boolean shouldResponseChangeListener() {
return false;
}
};
arrowButton.setUI(new FineInputUI.FineInputButtonUI(false));
return arrowButton;
}
/**
* 设置最大值
* @param maxValue 最大值
@ -377,11 +364,15 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
protected UINumberField initNumberField() {
int columns = this.numberFieldColumns == 0 ? DEFAULT_NUMBERFIELD_COLUMNS : this.numberFieldColumns;
return new UINumberField(columns) {
UINumberField numberField = new UINumberField(columns) {
public boolean shouldResponseChangeListener() {
return false;
}
};
Insets insets = UIManager.getInsets("InputTextField.borderInsets");
numberField.setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
numberField.setOpaque(false);
return numberField;
}
private DocumentListener docListener = new DocumentListener() {

10
designer-base/src/main/java/com/fr/design/gui/itextarea/UITextArea.java

@ -48,7 +48,6 @@ public class UITextArea extends JTextArea implements UIObserver, HoverAware {
private void initComponents() {
setLineWrap(true);
setWrapStyleWord(true);
setMinimumSize(new Dimension(getMinimumSize().width, HEIGHT));
initListener();
}
@ -121,4 +120,13 @@ public class UITextArea extends JTextArea implements UIObserver, HoverAware {
public boolean isHovered() {
return hover;
}
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
if (size.height < HEIGHT) {
return new Dimension(size.width, HEIGHT);
}
return size;
}
}

7
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

@ -4,10 +4,10 @@ import com.fr.base.Utils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
import java.awt.Dimension;
import java.awt.Toolkit;
/**
@ -151,11 +151,6 @@ public class UINumberField extends UITextField {
this.isContentChanged = isContentChanged;
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 20);
}
class NumberDocument extends PlainDocument {
public boolean checkString(int offset, String s, String str) {

41
designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java

@ -40,7 +40,7 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
private GlobalNameListener globalNameListener = null;
private Dimension preferredSize = null;
private String placeholder = StringUtils.EMPTY;
private final int HEIGHT = UIManager.getInt("TextField.height");
private final int HEIGHT = UIManager.getInt("Input.height");
//有些情况下setText的时候不希望触发attributeChange,添加一个属性标识
private boolean isSetting = false;
@ -77,10 +77,28 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
*/
public void init() {
InputEventBaseOnOS.addBasicEditInputMap(this);
setPreferredSize(new Dimension(getPreferredSize().width, HEIGHT));
initCommonListeners();
initListener();
}
private void initCommonListeners() {
if (shouldResponseChangeListener()) {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
hover = false;
repaint();
}
});
}
}
protected void initListener() {
if (shouldResponseChangeListener()) {
getDocument().addDocumentListener(new DocumentListener() {
@ -99,20 +117,6 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
attributeChange();
}
});
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
hover = false;
repaint();
}
});
}
}
@ -236,4 +240,9 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
public boolean isHovered() {
return hover;
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, HEIGHT);
}
}

89
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -12,6 +12,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.PropertyItemPaneProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.icontainer.UIEastResizableContainer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.VerticalFlowLayout;
@ -20,8 +21,6 @@ import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
@ -53,7 +52,6 @@ import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
@ -83,7 +81,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final int TAB_BUTTON_WIDTH = 40;
private static final int TAB_BUTTON_HEIGHT = 40;
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH;
private static final int POPUP_TOOLPANE_HEIGHT = 40;
private static final int POPUP_TOOLPANE_HEIGHT = UIManager.getInt("PopupToolPane.height");
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30;
// 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145;
@ -1172,6 +1170,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 弹出属性面板的工具条
private class PopupToolPane extends JPanel {
private final UIButton popupButton;
private String title;
private PropertyItem propertyItem;
private String buttonType;
@ -1189,29 +1188,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String UP_BUTTON = "UpButton";
private static final String DOWN_BUTTON = "DownButton";
private MouseListener mouseListener = new MouseAdapter() {
@Override
public void mouseExited(MouseEvent e) {
setCursor(Cursor.getDefaultCursor());
if (mouseDownCompCoords == null) {
// contentPane.setBackground(originColor);
}
repaint();
}
private final Insets INSETS = UIManager.getInsets("PopupToolPane.borderInsets");
@Override
public void mouseClicked(MouseEvent e) {
if (e.getX() >= ARROW_RANGE_START) {
onPop();
}
}
private MouseListener mouseListener = new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
mouseDownCompCoords = null;
if (!getBounds().contains(e.getPoint())) {
// contentPane.setBackground(originColor);
}
}
@Override
@ -1229,7 +1212,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
} else if (isMovable) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
// contentPane.setBackground(UIConstants.POPUP_TITLE_BACKGROUND);
} else {
setCursor(Cursor.getDefaultCursor());
}
@ -1273,36 +1255,46 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
this.propertyItem = propertyItem;
this.title = propertyItem.getTitle();
originColor = UIConstants.UI_TOOLBAR_COLOR;
this.buttonType = buttonType;
this.setForeground(UIManager.getColor("DarkenedFontColor"));
contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
UILabel label = new UILabel(title);
contentPane.add(label, BorderLayout.WEST);
contentPane.setBorder(new EmptyBorder(5, 10, 5, 0));
contentPane.add(label, BorderLayout.CENTER);
popupButton = createPopupButton(buttonType);
contentPane.add(popupButton, BorderLayout.EAST);
contentPane.setBorder(new EmptyBorder(INSETS.top, INSETS.left, INSETS.bottom, INSETS.right));
setLayout(new BorderLayout());
add(contentPane, BorderLayout.CENTER);
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("East.border")));
initToolButton(buttonType);
}
public void setParentDialog(JDialog parentDialog) {
this.parentDialog = parentDialog;
isMovable = true;
}
private void initToolButton(final String buttonType) {
this.buttonType = buttonType;
if (StringUtils.isEmpty(buttonType) || buttonType.equals(NO_BUTTON)) {
return;
}
// validate
if (!buttonType.equals(UP_BUTTON) && !buttonType.equals(DOWN_BUTTON)) {
throw new IllegalArgumentException("unknown button type: " + buttonType);
private UIButton createPopupButton(String type) {
UIButton popupButton = new UIButton();
if (StringUtils.equals(type, UP_BUTTON)) {
popupButton = new UIButton(new LazyIcon("collapse_popup"));
} else if (StringUtils.equals(type, DOWN_BUTTON)) {
popupButton = new UIButton(new LazyIcon("expand_popup"));
}
popupButton.setUI(new UIButtonUI());
popupButton.setBorderPainted(false);
popupButton.setBorder(null);
popupButton.setBackground(null);
popupButton.setExtraPainted(false);
popupButton.addActionListener(e -> {
this.buttonType = type;
onPop();
});
addMouseMotionListener(mouseMotionListener);
addMouseListener(mouseListener);
return popupButton;
}
public void setParentDialog(JDialog parentDialog) {
this.parentDialog = parentDialog;
isMovable = true;
}
// 触发弹入、弹出
@ -1318,23 +1310,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, POPUP_TOOLPANE_HEIGHT);
}
@Override
public void paint(Graphics g) {
super.paint(g);
Image button;
g.setColor(new Color(69, 135, 255));
g.setFont(DesignUtils.getDefaultGUIFont().applySize(14));
if (buttonType.equals(NO_BUTTON)) {
return;
}
if (buttonType.equals(DOWN_BUTTON)) {
button = UIConstants.POP_BUTTON_DOWN;
} else {
button = UIConstants.POP_BUTTON_UP;
}
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, (ARROW_RANGE_START + 8), 4, null));
}
}
private class PopupDialog extends JDialog {

120
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java

@ -1,39 +1,42 @@
package com.fr.design.mainframe.widget.accessibles;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineInputUI;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.HoverAware;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.editors.TextField;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ButtonUI;
import com.fr.base.BaseUtils;
import com.fr.design.Exception.ValidationException;
import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.editors.TextField;
import com.fr.design.dialog.BasicPane;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
import com.fr.design.utils.gui.GUIPaintUtils;
/**
* 编辑器
* @author anonymous
* @created on 2023/12/13
* @since 6.5.3
*/
public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor {
public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor, HoverAware {
private ArrayList<ChangeListener> listeners;
private boolean showButton;
@ -41,6 +44,10 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
private Decoder decoder;
private UIButton btPopup;
protected ITextComponent txtValue;
private boolean hover;
private static final int HEIGHT = UIManager.getInt("Input.height");
private static final int BUTTON_WIDTH = UIManager.getInt("InputButton.width");
private static final int BUTTON_HEIGHT = UIManager.getInt("InputButton.height");
public BaseAccessibleEditor(Encoder enc, Decoder dec, boolean showBtn) {
listeners = new ArrayList<ChangeListener>();
@ -48,10 +55,30 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
this.encoder = enc;
this.decoder = dec;
initComponents();
initListener();
txtValue.setEditable(dec != null);
((JComponent) txtValue).setOpaque(true);
((JComponent) txtValue).setBorder(BorderFactory.createLineBorder(Color.lightGray));
((JComponent) txtValue).setBackground(Color.WHITE);
((JComponent) txtValue).setOpaque(false);
Insets insets = UIManager.getInsets("InputTextField.borderInsets");
((JComponent) txtValue).setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
this.setUI(FineInputUI.createUI(this));
setPreferredSize(new Dimension(getPreferredSize().width, HEIGHT));
}
private void initListener() {
((TextField) txtValue).addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
hover = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
hover = false;
repaint();
}
});
}
@Override
@ -77,7 +104,6 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
}
private void initComponents() {
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
txtValue = createTextField();
setLayout(FRGUIPaneFactory.createBorderLayout());
@ -88,33 +114,13 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
txtValueActionPerformed(evt);
}
});
add((JComponent) txtValue, BorderLayout.CENTER);
setOpaque(false);
if (showButton) {
btPopup = new UIButton(){
@Override
public ButtonUI getUI() {
return new UIButtonUI() {
@Override
protected boolean isPressed(AbstractButton b) {
return model.isArmed() && model.isPressed();
}
@Override
protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) {
if (isPressed(b) && b.isPressedPainted()) {
GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), UIConstants.COMBOBOX_BTN_PRESS);
} else if (isRollOver(b)) {
GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_ROLLOVER);
} else if (b.isNormalPainted()) {
GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted(), UIConstants.COMBOBOX_BTN_NORMAL);
}
}
};
}
};
btPopup = new UIButton();
initPopupButton();
btPopup.setUI(new FineInputUI.FineInputButtonUI(false));
btPopup.addActionListener(new ActionListener() {
@Override
@ -137,19 +143,15 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
protected void initPopupButton() {
if (!isComboButton()) {
btPopup.setIcon(new ImageIcon(UIConstants.ACCESSIBLE_EDITOR_DOT));
btPopup.setPreferredSize(new Dimension(20, 20));
btPopup.setIcon(new LazyIcon("dot"));
} else {
btPopup.setRolloverEnabled(true);
btPopup.setFocusPainted(false);
btPopup.setPreferredSize(new Dimension(15, 19));
btPopup.setBorderPainted(false);
btPopup.setContentAreaFilled(false);
btPopup.setMargin(new Insets(0, 0, 0, 0));
btPopup.setIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_up.png"));
btPopup.setPressedIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_down.png"));
btPopup.setRolloverIcon(BaseUtils.readIcon("/com/fr/design/images/form/designer/drop_over.png"));
btPopup.setIcon(new LazyIcon("down_arrow"));
}
btPopup.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
}
// 有的编辑器是使用下拉框来直接选择的,这时候就把按钮显示成下拉框
@ -227,4 +229,8 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
}
@Override
public boolean isHovered() {
return hover;
}
}

26
designer-base/src/main/java/com/fr/design/mainframe/widget/editors/DataBindingEditor.java

@ -1,5 +1,16 @@
package com.fr.design.mainframe.widget.editors;
import com.fr.data.TableDataSource;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.editor.editor.Editor;
import com.fr.design.gui.icombobox.LazyComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.form.data.DataBinding;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
@ -8,16 +19,6 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.icombobox.LazyComboBox;
import com.fr.design.editor.editor.Editor;
import com.fr.form.data.DataBinding;
/**
* DataBindingEditor
@ -26,8 +27,9 @@ import com.fr.form.data.DataBinding;
* @since 2012-3-29下午5:26:28
*/
public class DataBindingEditor extends Editor<DataBinding> {
private final static int HORI_GAP = 1;
private final static int VER_GAP = 7;
private final static int HORI_GAP = UIManager.getInt("DataBindingEditor.hgap");
private final static int VER_GAP = UIManager.getInt("DataBindingEditor.vgap");
protected TableDataComboBox tableDataComboBox;
protected LazyComboBox columnNameComboBox;

3
designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java

@ -1,7 +1,6 @@
package com.fr.design.notification.ui;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
@ -41,7 +40,7 @@ public class NotificationCenterPane extends BasicPane {
public void refreshButton() {
if (NotificationCenter.getInstance().getNotificationsCount() > 0) {
notificationCenterButton.setIcon(IconUtils.readIcon("/com/fr/design/standard/notification/notification_dot.svg"));
notificationCenterButton.setIcon(new LazyIcon("notification_dot"));
} else {
notificationCenterButton.setIcon(new LazyIcon("notification"));
}

5
designer-base/src/main/resources/com/fine/theme/icon/dot.svg

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M10.6998 16.7C10.6998 17.6389 9.93869 18.4 8.9998 18.4C8.06092 18.4 7.2998 17.6389 7.2998 16.7C7.2998 15.7611 8.06092 15 8.9998 15C9.93869 15 10.6998 15.7611 10.6998 16.7ZM17.6998 16.7C17.6998 17.6389 16.9387 18.4 15.9998 18.4C15.0609 18.4 14.2998 17.6389 14.2998 16.7C14.2998 15.7611 15.0609 15 15.9998 15C16.9387 15 17.6998 15.7611 17.6998 16.7ZM22.9998 18.4C23.9387 18.4 24.6998 17.6389 24.6998 16.7C24.6998 15.7611 23.9387 15 22.9998 15C22.0609 15 21.2998 15.7611 21.2998 16.7C21.2998 17.6389 22.0609 18.4 22.9998 18.4Z"
fill="#091E40"/>
</svg>

After

Width:  |  Height:  |  Size: 718 B

8
designer-base/src/main/resources/com/fine/theme/icon/notification/notification_dot.svg

@ -0,0 +1,8 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#179;&#187;&#231;&#187;&#159;&#229;&#155;&#190;&#230;&#160;&#135;">
<rect id="Rectangle" x="10" y="0.5" width="5" height="5" rx="2.5" fill="#F1393C"/>
<path id="Subtract" fill-rule="evenodd" clip-rule="evenodd"
d="M12.4977 6.5L12.4977 11.75H3.49773L3.49775 6.5C3.49775 4.01472 5.51247 2 7.99775 2C8.38055 2 8.75219 2.0478 9.10702 2.13775C9.19114 1.80571 9.32272 1.49258 9.49412 1.20601C9.01837 1.0718 8.51644 1 7.99775 1C4.96018 1 2.49775 3.46243 2.49775 6.5L2.49773 11.75L1.98277 12.3348C1.8406 12.4963 1.95526 12.75 2.17041 12.75H2.49773H3.49773H12.4977H13.4977H13.8249C14.0401 12.75 14.1548 12.4963 14.0126 12.3348L13.4977 11.75L13.4977 6.5C13.4977 6.45195 13.4971 6.40404 13.4959 6.35628C13.1803 6.4498 12.846 6.5 12.5 6.5C12.4993 6.5 12.4985 6.5 12.4977 6.5ZM5.563 13.75C6.10759 14.507 6.99621 15 7.99997 15C9.00374 15 9.89236 14.507 10.4369 13.75H5.563Z"
fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

7
designer-base/src/main/resources/com/fine/theme/icon/popup/collapse_popup.svg

@ -0,0 +1,7 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon &#230;&#148;&#182;&#232;&#181;&#183;&#233;&#157;&#162;&#230;&#157;&#191;">
<path id="Combined Shape" fill-rule="evenodd" clip-rule="evenodd"
d="M11.5404 6.63783L13.049 8.14644C13.1017 8.19919 13.1754 8.22665 13.2539 8.22279C13.4173 8.21476 13.5562 8.07581 13.5642 7.91245L13.8034 3.04896L8.93994 3.28815C8.86149 3.292 8.78472 3.32687 8.72652 3.38507C8.60532 3.50627 8.59611 3.69355 8.70594 3.80339L10.2146 5.312L3.2654 12.2612C2.86141 12.6651 2.83071 13.2894 3.19683 13.6556C3.56294 14.0217 4.18724 13.991 4.59123 13.587L11.5404 6.63783Z"
fill="#419BF9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 720 B

5
designer-base/src/main/resources/com/fine/theme/icon/popup/expand_popup.svg

@ -0,0 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M5.45974 10.0667L3.95113 8.55807C3.89838 8.50533 3.82468 8.47786 3.74623 8.48172C3.58286 8.48975 3.44392 8.6287 3.43588 8.79207L3.19669 13.6556L8.06019 13.4164C8.13864 13.4125 8.21541 13.3776 8.27361 13.3194C8.3948 13.1982 8.40401 13.011 8.29418 12.9011L6.78557 11.3925L13.7347 4.44336C14.1387 4.03937 14.1694 3.41507 13.8033 3.04895C13.4372 2.68284 12.8129 2.71354 12.4089 3.11753L5.45974 10.0667Z"
fill="#2576EF"/>
</svg>

After

Width:  |  Height:  |  Size: 593 B

4
designer-base/src/main/resources/com/fine/theme/icon/up_arrow.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.51486 19.8033C7.12433 19.4128 7.12434 18.7796 7.51486 18.3891L16.0001 9.90381L24.4854 18.3891C24.8759 18.7796 24.876 19.4128 24.4854 19.8033C24.0949 20.1938 23.4617 20.1938 23.0712 19.8033L16.0001 12.7322L8.92907 19.8033C8.53855 20.1938 7.90538 20.1938 7.51486 19.8033Z"
fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 436 B

49
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -83,13 +83,14 @@ TextPaneUI = com.formdev.flatlaf.ui.FlatTextPaneUI
ToggleButtonUI = com.fine.theme.light.ui.FineToggleButtonUI
ToolBarUI = com.formdev.flatlaf.ui.FlatToolBarUI
ToolBarSeparatorUI = com.formdev.flatlaf.ui.FlatToolBarSeparatorUI
ToolTipUI = com.formdev.flatlaf.ui.FlatToolTipUI
ToolTipUI=com.fine.theme.light.ui.FineTooltipUI
TreeUI = com.fine.theme.light.ui.UIFlatTreeUI
ViewportUI = com.formdev.flatlaf.ui.FlatViewportUI
#---- variables ----
Component.defaultHeight=24
Component.defaultVGap=10
# general background and foreground (text color)
@background = #F6F8FA
@ -162,13 +163,18 @@ defaultHighlightBorderColor = #2576EF
defaultBorderFocusShadow = #2576ef19
defaultBorderFocusWidth = 0
brand.normal=#2576EF
color.brand4=#84B1F6
background.normal=#FFFFFF
text.white=#ffffff
text.placeholder=fade(@foreground, 40%)
text.highlight=fade(@foreground, 90%)
fill.hover=#E6E9EF
fill.click=#DADEE7
fill.normal=#FFFFFF
fill.disabled=#F2F4F8
border.divider=#DADEE7
tooltip.normal=#3F506A
tooltip.disabled=#A3ADBD
#---- Button ----
@ -362,7 +368,9 @@ DesktopIcon.closeIcon = com.formdev.flatlaf.icons.FlatInternalFrameCloseIcon
EditorPane.border = com.formdev.flatlaf.ui.FlatMarginBorder
EditorPane.margin = @componentMargin
EditorPane.background = @componentBackground
DataBindingEditor.vgap=$Component.defaultVGap
DataBindingEditor.hgap=1
DataBindingEditor.height=$Component.defaultHeight
#---- FileChooser ----
@ -390,6 +398,7 @@ FileView.fullRowSelection = true
FormattedTextField.border = com.formdev.flatlaf.ui.FlatTextBorder
FormattedTextField.margin = @componentMargin
FormattedTextField.background = @componentBackground
FormattedTextField.selectionBackground=$color.brand4
FormattedTextField.placeholderForeground = @disabledForeground
FormattedTextField.iconTextGap = 4
@ -582,7 +591,8 @@ Popup.dropShadowPainted = true
Popup.dropShadowInsets = -4,-4,4,4
Popup.dropShadowColor = #000
Popup.dropShadowOpacity = 0.15
PopupToolPane.height=34
PopupToolPane.borderInsets=0, 10, 0, 10
#---- PopupMenu ----
@ -708,7 +718,10 @@ SearchField.searchIconPressedColor = fade(Actions.GreyInline,50%,lazy)
SearchField.clearIconColor = fade(Actions.GreyInline,50%,lazy)
SearchField.clearIconHoverColor = $SearchField.clearIconColor
SearchField.clearIconPressedColor = fade(Actions.GreyInline,80%,lazy)
#---- SearchPanel ----
SearchPanel.labelBorderInsets=3, 6, 3, 4
SearchPanel.buttonBorderInsets=4, 4, 4, 4
TreeSearchToolbarPane.borderInsets=0, 8, 0, 8
#---- Separator ----
@ -751,7 +764,20 @@ Spinner.padding = @componentMargin
Spinner.editorBorderPainted = false
# allowed values: button or none
Spinner.buttonStyle = button
#---- Input ----
InputButton.background=$fill.normal
InputButton.hoverBackground=$fill.hover
InputButton.pressedBackground=$fill.click
InputButton.width=$Component.defaultHeight
InputButton.height=$Component.defaultHeight
InputTextField.borderInsets=0, 6, 0, 6
Input.border=com.fine.theme.light.ui.FineRoundBorder
Input.background=$fill.normal
Input.height=$Component.defaultHeight
Input.arc=$Component.arc
#---- FormulaPane ----
FormulaPane.buttonWidth=$Component.defaultHeight
FormulaPane.buttonHeight=$Component.defaultHeight
#---- SplitPane ----
@ -910,6 +936,7 @@ TextComponent.arc=$Component.arc
TextField.border=com.fine.theme.light.ui.FineRoundBorder
TextField.margin = @componentMargin
TextField.background=$background.normal
TextField.selectionBackground=$color.brand4
TextField.placeholderForeground = @disabledForeground
TextField.iconTextGap = 4
TextField.height=$Component.defaultHeight
@ -1049,8 +1076,13 @@ ToolTipManager.enableToolTipMode = activeApplication
#---- ToolTip ----
ToolTip.borderCornerRadius = $Popup.borderCornerRadius
ToolTip.border = 4,6,4,6,shade(@background,40%)
ToolTip.background = lighten(@background,3%)
ToolTip.background=$tooltip.normal
ToolTip.foreground=$text.white
ToolTip.border=3,10,3,10
ToolTip.backgroundInactive=$tooltip.disabled
ToolTip.foregroundInactive=$text.white
ToolTip.arc=$Component.arc
ToolTip.maxWidth=392
#---- Tree ----
@ -1134,7 +1166,8 @@ Center.ZoneBorderColor = #E6E9EF
Center.GridColumnRowColor = #F8F9FC
Center.SpaceColor = #FFF
Center.border = 0, 10, 10, 10
#---- CellOtherSetPane ----
CellOtherSetPane.height=$Component.defaultHeight
#---- Styles ------------------------------------------------------------------

2
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -176,7 +176,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position")), hAlignmentPane}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
CRPropertyDescriptor[] extraTableEditor = new CRPropertyDescriptor[0];
extraTableEditor = root.getExtraTableEditor();
extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, root);

14
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java

@ -16,8 +16,11 @@ import com.fr.form.ui.WidgetValue;
import com.fr.form.ui.concept.data.ValueInitializer;
import com.fr.general.ComparatorUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
/**
* Created by ibm on 2017/7/27.
@ -28,6 +31,9 @@ public class FormWidgetValuePane extends JPanel {
private JPanel customPane;
private CardLayout cardLayout;
private final static int VER_GAP = UIManager.getInt("DataBindingEditor.vgap");
private final static int HEIGHT = UIManager.getInt("DataBindingEditor.height");
public FormWidgetValuePane(Object o, boolean onlyServer) {
DataControl widget = (DataControl) o;
@ -53,9 +59,9 @@ public class FormWidgetValuePane extends JPanel {
widgetValueHead.setSelectedIndex(index);
}
if (ComparatorUtils.equals(editor[index].getName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Field"))) {
customPane.setPreferredSize(new Dimension(100, 47));
customPane.setPreferredSize(new Dimension(100, HEIGHT * 2 + VER_GAP));
} else {
customPane.setPreferredSize(new Dimension(100, 20));
customPane.setPreferredSize(new Dimension(100, HEIGHT));
}
cardLayout.show(customPane, editor[index].getName());
}

16
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -44,6 +44,7 @@ import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
@ -66,6 +67,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private static final int HEAD_WDITH = 290;
private static final int HEAD_HEIGTH = 24;
private static final int COMBO_WIDTH = 154;
private static final int HEIGHT = UIManager.getInt("CellOtherSetPane.height");
private static final int BUTTON_GROUP_WIDTH = 140;
private static final double f = TableLayout.FILL;
private static final double p = TableLayout.PREFERRED;
@ -263,7 +265,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
@Override
public void stateChanged(ChangeEvent e) {
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowPane.setPreferredSize(new Dimension(100, HEIGHT));
insertRowLayout.show(insertRowPane, "content");
} else {
insertRowLayout.show(insertRowPane, "none");
@ -331,7 +333,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
@Override
public void stateChanged(ChangeEvent e) {
if (tooltipButtonGroup.getSelectedIndex() == 0) {
tooltipPane.setPreferredSize(new Dimension(154, 20));
tooltipPane.setPreferredSize(new Dimension(154, HEIGHT));
tooltipLayout.show(tooltipPane, "content");
} else {
tooltipLayout.show(tooltipPane, "none");
@ -367,7 +369,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
@Override
public void itemStateChanged(ItemEvent e) {
if (showPartComboBox.getSelectedIndex() == 0) {
showPartPane.setPreferredSize(new Dimension(70, 20));
showPartPane.setPreferredSize(new Dimension(70, HEIGHT));
showPartLayout.show(showPartPane, "content");
} else {
showPartLayout.show(showPartPane, "none");
@ -392,7 +394,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
textOverflowComPane.setVisible(e.getStateChange() == ItemEvent.SELECTED);
if (e.getStateChange() == ItemEvent.SELECTED) {
if (showPartComboBox.getSelectedIndex() == 0) {
showPartPane.setPreferredSize(new Dimension(70, 20));
showPartPane.setPreferredSize(new Dimension(70, HEIGHT));
showPartLayout.show(showPartPane, "content");
} else {
showPartLayout.show(showPartPane, "none");
@ -505,7 +507,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
if (showContent.getSelectedIndex() == 3) {
fileNamePane.setPreferredSize(new Dimension(100, 20));
fileNamePane.setPreferredSize(new Dimension(100, HEIGHT));
fileNameLayout.show(fileNamePane, "content");
} else {
fileNameLayout.show(fileNamePane, "none");
@ -630,7 +632,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
tooltipButtonGroup.setSelectedIndex(1);
}
if (tooltipButtonGroup.getSelectedIndex() == 0) {
tooltipPane.setPreferredSize(new Dimension(100, 20));
tooltipPane.setPreferredSize(new Dimension(100, HEIGHT));
tooltipLayout.show(tooltipPane, "content");
} else {
tooltipLayout.show(tooltipPane, "none");
@ -683,7 +685,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
this.valueEditor.populate(StringUtils.EMPTY);
}
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, 20));
insertRowPane.setPreferredSize(new Dimension(100, HEIGHT));
insertRowLayout.show(insertRowPane, "content");
} else {
insertRowLayout.show(insertRowPane, "none");

10
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -1,5 +1,6 @@
package com.fr.quickeditor.cellquick;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseFormula;
import com.fr.base.Style;
import com.fr.base.TextFormat;
@ -14,7 +15,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.IOUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.ReportHelper;
@ -25,6 +25,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
@ -59,6 +60,9 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
//正在编辑的单元格
private TemplateCellElement editingCellElement;
private static final int BUTTON_WIDTH = UIManager.getInt("FormulaPane.buttonWidth");
private static final int BUTTON_HEIGHT = UIManager.getInt("FormulaPane.buttonHeight");
private DocumentListener documentListener = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
@ -100,9 +104,9 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
textFieldPane.add(formulaTextField, BorderLayout.CENTER);
textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
UIButton formulaButton = new UIButton(new LazyIcon("formula"));
formulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "...");
formulaButton.setPreferredSize(new Dimension(20, formulaTextField.getPreferredSize().height));
formulaButton.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
formulaButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula();

Loading…
Cancel
Save