diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java index fb35b6bd42..e129e77349 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java @@ -15,6 +15,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.JTableHeader; +import java.awt.Color; import java.awt.Component; import java.awt.Graphics; @@ -26,6 +27,7 @@ import java.awt.Graphics; * Created on */ public class FineTableHeaderUI extends FlatTableHeaderUI { + protected static Color selectionBackground = UIManager.getColor("Table.background"); @Override public void installUI(JComponent c) { @@ -83,6 +85,7 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + Class columnClass = table.getColumnClass(0); Border border; if (column == table.getColumnCount() - 1) { border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")), @@ -91,7 +94,12 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")), UIManager.getBorder("Table.cellNoFocusBorder")); } - setBackground(UIManager.getColor("Table.background")); + if (isSelected && columnClass != Boolean.class) { + selectionBackground = UIManager.getColor( "Table.selectionBackground"); + } else { + selectionBackground = UIManager.getColor("Table.background"); + } + setBackground(selectionBackground); setText(value == null ? StringUtils.BLANK : String.valueOf(value)); setBorder(border); return this; diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 219925d8fc..bc2eca9fd1 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -33,7 +33,7 @@ import static com.fine.swing.ui.layout.Layouts.row; @Open public abstract class ConditionAttributesPane extends BasicBeanPane { - private static final int MAT_HEIGHT = 120; + private static final int MAT_HEIGHT = FineUIScale.scale(120); protected CellHighlightAddMenuDef menuDef; protected JPanel selectedItemPane; diff --git a/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java b/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java index 3bec57e955..a59c925405 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java @@ -25,6 +25,9 @@ import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.stable.StringUtils; +import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; +import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; + public class ObjectLiteConditionPane extends LiteConditionPane { @Override @@ -60,6 +63,7 @@ public class ObjectLiteConditionPane extends LiteConditionPane this.setLayout(FRGUIPaneFactory.createBorderLayout()); // condition operation conditionOPComboBox = new UIComboBox(); + conditionOPComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX); DefaultComboBoxModel opComboBoxModel = (DefaultComboBoxModel) conditionOPComboBox.getModel(); int[] allOperators = Compare.getAllOperators(); for (int i = 0; i < allOperators.length; i++) { diff --git a/designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java b/designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java index 0e5f23dcf4..48c23bab51 100644 --- a/designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java @@ -1,8 +1,7 @@ package com.fr.design.condition; -import java.awt.Color; -import java.awt.Insets; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -25,7 +24,7 @@ public abstract class SingleConditionPane extends BasicPane { } public SingleConditionPane(boolean isRemove) { - this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(10, 0)); if (isRemove) { if(cancel == null) { @@ -33,11 +32,19 @@ public abstract class SingleConditionPane extends BasicPane { cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove")); cancel.addActionListener(cancleListener); cancel.setMargin(new Insets(0, 0, 0, 0)); - cancel.setBorder(new ScaledEmptyBorder(0, 0, 0, 20)); + cancel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10)); cancel.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255))); } + addCancel(); } } + + /** + * 添加删除按钮 + */ + public void addCancel() { + this.add(cancel, BorderLayout.EAST); + } ActionListener cancleListener = new ActionListener() { public void actionPerformed(ActionEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java index aef396d626..8990d27b73 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java @@ -14,6 +14,10 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; + /** * 标记选中的CellEditor * @@ -36,7 +40,7 @@ public class ChooseMark extends AbstractCellEditor implements TableCellEditor, T @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { selectedButton.setSelected(isSelected); - pane.add(this.selectedButton); + pane.add(row(flex(), cell(selectedButton), flex()).getComponent()); return pane; } @@ -50,7 +54,7 @@ public class ChooseMark extends AbstractCellEditor implements TableCellEditor, T pane.removeAll(); selectedButton = new UIRadioButton(); selectedButton.setSelected(isSelected); - pane.add(this.selectedButton); + pane.add(row(flex(), cell(selectedButton), flex()).getComponent()); return pane; } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index 12a1feb833..dc0eaf2011 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -1,6 +1,7 @@ package com.fr.design.data.datapane.preview.desensitization.view.rule; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.ui.FlatUIUtils; import com.fr.base.svg.IconUtils; import com.fr.data.desensitize.rule.DesensitizationRuleManager; @@ -134,7 +135,7 @@ public class DesensitizationRuleChoosePane extends JPanel { this.setDefaultRenderer(ChooseMark.class, new ChooseMark()); this.setDefaultEditor(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); - this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); + this.createTable().getColumnModel().getColumn(0).setMaxWidth(FineUIScale.scale(28)); } @Override diff --git a/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java b/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java index 258a6cf8a5..c3dd50c871 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java @@ -1,9 +1,11 @@ package com.fr.design.dialog; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -42,7 +44,7 @@ public class NotificationDialog extends JDialog { private UILabel messageText; private NotificationDialogAction notificationDialogAction; private ScheduledExecutorService TIMER; - private Dimension dialogSize = new Dimension(230, 95); + private Dimension dialogSize = FineUIScale.scale(new Dimension(230, 95)); public NotificationDialog(Frame owner, String title, boolean isModal, int messageType, String message, NotificationDialogAction action) { this(owner, title, isModal, messageType, message, action, null); @@ -71,19 +73,19 @@ public class NotificationDialog extends JDialog { setAutoRequestFocus(false); setResizable(false); JPanel body = FRGUIPaneFactory.createBorderLayout_L_Pane(); - body.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + body.setBorder(new ScaledEmptyBorder(0, 0, 0, 0)); //消息内容 UILabel icon = new UILabel(getIconForType(messageType)); JPanel iconPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 8)); + iconPanel.setBorder(new ScaledEmptyBorder(0, 10, 10, 10)); iconPanel.add(icon); body.add(iconPanel, BorderLayout.WEST); messageText = new UILabel(HTML_TAG_1 + message + HTML_TAG_2); messageText.setForeground(new Color(51, 51, 52)); JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 5, 20)); + centerPanel.setBorder(new ScaledEmptyBorder(10, 0, 10, 10)); JScrollPane jScrollPane = new JScrollPane(messageText, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jScrollPane.setBorder(BorderFactory.createEmptyBorder()); centerPanel.add(jScrollPane, BorderLayout.CENTER); @@ -161,21 +163,21 @@ public class NotificationDialog extends JDialog { } protected Icon getIconForType(int messageType) { - String propertyName; + String id; switch (messageType) { case 0: - propertyName = "OptionPane.circularErrorIcon"; + id = "error"; break; case 1: - propertyName = "OptionPane.newMessageIcon"; + id = "new_information"; break; case 2: - propertyName = "OptionPane.circularWarningIcon"; + id = "warning"; break; default: return null; } - return UIManager.getIcon(propertyName); + return new LazyIcon(id, 20); } public static Builder Builder() { diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 8d25db7470..4d0c2d994b 100644 --- a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -710,7 +710,7 @@ public class MultiTemplateTabPane extends Row { private boolean isOverListDown(int evtX) { - int maxWidth = getWidth() - scale(leadingWidth); + int maxWidth = getWidth() - scale(TRAILING_WIDTH); return evtX >= (maxWidth + SMALLGAP) && evtX <= (getWidth() - SMALLGAP); } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 890fc5885d..814e52848b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -151,6 +151,7 @@ public abstract class UIControlPane extends JControlPane { cell(FRWidgetFactory.createLineWrapLabel(getAddItemText())), cell(topToolBar).with(it -> { it.setBorderPainted(true); + it.setPreferredSize(FineUIScale.scale(new Dimension(160, 24))); it.setBorder(FineBorderFactory.createWrappedRoundBorder()); it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE)); }).weight(1.0) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java index 68f1663ae4..469540c817 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java @@ -146,6 +146,7 @@ public class UICorrelationPane extends JPanel implements UIObserver { @Override public void actionPerformed(ActionEvent e) { tablePane.addBlankLine(); + tablePane.doParentRepaintEvent(); fireTargetChanged(); } }; @@ -154,13 +155,12 @@ public class UICorrelationPane extends JPanel implements UIObserver { protected void initLayout() { this.setLayout(new BorderLayout(0, scale(4))); Column tableContent = column( - cell(header), cell(tablePane).with(it -> - it.setBorder(BorderFactory.createMatteBorder(0, 1, 0, 1, + cell(header), cell(tablePane).weight(1).with(it -> + it.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, FlatUIUtils.getUIColor("defaultBorderColor", Color.BLACK) ))) ).getComponent(); - this.add(tableContent, BorderLayout.CENTER); - this.add(addButton, BorderLayout.SOUTH); + this.add(column(4, cell(tableContent), cell(addButton)).getComponent()); } protected void initComponents() { diff --git a/designer-base/src/main/java/com/fr/design/gui/itable/UITable.java b/designer-base/src/main/java/com/fr/design/gui/itable/UITable.java index 17ec504d0e..5515736573 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itable/UITable.java +++ b/designer-base/src/main/java/com/fr/design/gui/itable/UITable.java @@ -18,6 +18,7 @@ import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import java.awt.AWTEvent; import java.awt.Component; +import java.awt.Container; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; @@ -283,6 +284,18 @@ public class UITable extends JTable implements UIObserver { return new UIDefaultTableCellEditor(new UITextField()); } + /** + * repaint 所有父类,避免滚动条没有跟随 添加/删除 事件响应 + */ + public void doParentRepaintEvent() { + Container parent = this.getParent(); + while (parent != null) { + parent.revalidate(); + parent.repaint(); + parent = parent.getParent(); + } + } + @Override /** * diff --git a/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java b/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java index 9dd7edddf6..9248f3fb9d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java @@ -143,6 +143,7 @@ public class UITableUI extends BasicTableUI { ((UITable) table).removeLine(table.rowAtPoint(e.getPoint())); ((UITable) table).fireTargetChanged(); ((UITable) table).getParent().doLayout(); + ((UITable) table).doParentRepaintEvent(); return; } } diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java index 343183dee5..ddde924b61 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java @@ -76,7 +76,6 @@ public class UITableEditorPane extends BasicPane { controlPane.add(content == null ? l : content, BorderLayout.WEST); pane.add(Layouts.column(LayoutConstants.HGAP_LARGE, Layouts.cell(controlPane), Layouts.cell(scrollPane).weight(1)).getComponent()); - pane.add(Layouts.column(10, Layouts.cell(controlPane), Layouts.cell(scrollPane).weight(1)).getComponent()); this.editTable.setRowHeight(FineUIScale.scale(24)); } diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index d314f1fb36..ed9ea8a556 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -1,5 +1,6 @@ package com.fr.design.hyperlink; +import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseFormula; import com.fr.design.actions.UpdateAction; @@ -41,9 +42,10 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; +import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; +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; /** * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. @@ -152,7 +154,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane it.setPreferredSize(new Dimension(FineUIScale.scale(30), it.getHeight()))), - cell(messagePanel)).getComponent(); + 10, + column(cell(imageLabel), flex()), + column(cell(messagePanel))).getComponent(); + upInTopPanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); downInTopPanel = row(fix(30), row(cell(directUiLabel), cell(detailLabel), flex())).getComponent(); topPanel = column(cell(upInTopPanel), cell(downInTopPanel)).getComponent(); diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index cfa9439d37..4de6c29491 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -37,8 +37,8 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Set"), UILabel.LEFT)).weight(1), cell(jcb).weight(2) ), - cell(cardPane) - ).getComponent()); + cell(cardPane).weight(1) + ).weight(1).getComponent()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java b/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java index 2c00655201..792360f4d4 100644 --- a/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/AbstractSelectBox.java @@ -47,7 +47,7 @@ public abstract class AbstractSelectBox extends AbstractPopBox implements Mou displayPane.setBorder(null); displayPane.setOpaque(false); displayPane.add(displayComponent, BorderLayout.CENTER); - displayComponent.setSize(new Dimension(preWidth, displayPane.getPreferredSize().height)); + displayComponent.setSize(new Dimension(FineUIScale.scale(preWidth), displayPane.getPreferredSize().height)); // 添加事件监听 displayComponent.addMouseListener(mouseListener); triggerButton.addMouseListener(mouseListener); diff --git a/designer-base/src/main/java/com/fr/design/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/style/BorderPane.java index 65b46ced4c..18eb5b7a37 100644 --- a/designer-base/src/main/java/com/fr/design/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/style/BorderPane.java @@ -333,9 +333,9 @@ public class BorderPane extends BasicPane { private BorderButton(int border) { this.border = border; if (border == BorderPane.EXTERNAL_BORDERS) { - this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_format/out.png")); + this.setIcon(new LazyIcon("out")); } else if(border == BorderPane.INSIDE_BORDERS) { - this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_format/in.png")); + this.setIcon(new LazyIcon("in")); } this.setPreferredSize(FineUIScale.scale(new Dimension(40, 24))); this.addActionListener(this); diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorChooserPreview.java b/designer-base/src/main/java/com/fr/design/style/color/ColorChooserPreview.java index 45e2a2b948..100feb2d35 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorChooserPreview.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorChooserPreview.java @@ -4,6 +4,7 @@ import javax.swing.*; import java.awt.*; +import com.fine.theme.utils.FineUIScale; import sun.swing.SwingUtilities2; /** @@ -11,17 +12,17 @@ import sun.swing.SwingUtilities2; */ public class ColorChooserPreview extends JPanel { - private static final int SQUARE_SIZE = 25; - private static final int SQUARE_GAP = 5; + private static final int SQUARE_SIZE = FineUIScale.scale(25); + private static final int SQUARE_GAP = FineUIScale.scale(5); /** * 方形预览框,三层嵌套框之间的间隔 */ - private static final int INNER_GAP = 5; + private static final int INNER_GAP = FineUIScale.scale(5); private static final int INNER_GAP2 = (INNER_GAP * 2); private static final int INNER_GAP3 = (INNER_GAP * 4); - private static final int TEXT_GAP = 5; + private static final int TEXT_GAP = FineUIScale.scale(5); private static final int PREFERSIZE_TEXT_GAP = (TEXT_GAP * 3); private static final int PREFERSIZE_SQUARE_GAP = (SQUARE_GAP * 2); diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java index 4a19d7e51f..0f6631073d 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java @@ -104,7 +104,9 @@ public class ColorSelectDetailPane extends BasicPane { column(flex(), cell(colorChooserPreview), flex()), flex() ).getComponent()); - add(initCenterPane()); + JPanel center = initCenterPane(); + center.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); + add(center); } private FineTabbedPane buildTabbedPane() { diff --git a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java index 9d566667d1..48f5e5f2bf 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java @@ -638,7 +638,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec private JPanel createGradientPanel() { return new JPanel() { public Dimension getPreferredSize() { - return new Dimension(IMG_WIDTH, IMG_HEIGHT); + return FineUIScale.scale(new Dimension(IMG_WIDTH, IMG_HEIGHT)); } public void paint(Graphics g) { @@ -657,7 +657,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec private JPanel createTrackPanel() { return new JPanel() { public Dimension getPreferredSize() { - return new Dimension(TRACK_WIDTH, IMG_HEIGHT); + return FineUIScale.scale(new Dimension(TRACK_WIDTH, IMG_HEIGHT)); } public void paint(Graphics g) { @@ -718,7 +718,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec BUTTON_SPINNER_GAP, row(fix((int) hRadio.getPreferredSize().getHeight()), cell(new UILabel("#")), flex()).with(it -> it.setPreferredSize(hRadio.getPreferredSize())), cell(field), - cell(pane) + cell(pane).with(it -> it.setPreferredSize(new Dimension((int) pickColorButton.getPreferredSize().getWidth(), (int) pickColorButton.getPreferredSize().getHeight()))) ) ).getComponent()); @@ -790,7 +790,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec TextDocumentListener listen = new TextDocumentListener(); field = new UITextField(); - field.setPreferredSize(FineUIScale.scale(new Dimension(hSpinner.getPreferredSize()))); + field.setPreferredSize(new Dimension(hSpinner.getPreferredSize())); field.getDocument().addDocumentListener(listen); return column( diff --git a/designer-base/src/main/java/com/fr/design/style/color/SwatchChooserPanel.java b/designer-base/src/main/java/com/fr/design/style/color/SwatchChooserPanel.java index 120a0c2134..74f4b409a6 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/SwatchChooserPanel.java +++ b/designer-base/src/main/java/com/fr/design/style/color/SwatchChooserPanel.java @@ -1,5 +1,7 @@ package com.fr.design.style.color; +import com.fine.theme.utils.FineUIScale; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -68,8 +70,8 @@ public class SwatchChooserPanel extends AbstractColorChooserPanel{ int width = numCols * cellWidth + (numCols - 1) * gap; Insets insets = getInsets(); - return new Dimension(width + insets.left + insets.right, - height + insets.top + insets.bottom); + return FineUIScale.scale(new Dimension(width + insets.left + insets.right, + height + insets.top + insets.bottom)); } /** @@ -509,8 +511,8 @@ public class SwatchChooserPanel extends AbstractColorChooserPanel{ Insets insets = parent.getInsets(); - return new Dimension(insets.left + insets.right + xmax, - insets.top + insets.bottom + ymax); + return FineUIScale.scale(new Dimension(insets.left + insets.right + xmax, + insets.top + insets.bottom + ymax)); } diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 3c2e458738..1aa1422f15 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -33,6 +33,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.icontainer.UIVerticalScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.CheckBoxList; import com.fr.design.gui.itable.FineUITable; @@ -171,7 +172,7 @@ public class DBManipulationPane extends BasicBeanPane { Dimension editTableDimension = createEditTablePreferredSize(); editTablePane.setBounds(0, 0, editTableDimension.width, editTableDimension.height); keyColumnValuesTable = new KeyColumnNameValueTable(); - editTablePane.add(new UIScrollPane(keyColumnValuesTable), BorderLayout.CENTER); + editTablePane.add(new UIVerticalScrollPane(keyColumnValuesTable), BorderLayout.CENTER); keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); keyColumnValuesTable.setPreferredScrollableViewportSize(FineUIScale.scale(new Dimension(280, 150))); keyColumnValuesTable.setShowHorizontalLines(true); diff --git a/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java b/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java index 5fd4c9ec09..f12461888a 100644 --- a/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java +++ b/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java @@ -1,5 +1,8 @@ package com.fr.env; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.versioncheck.VersionCheckUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; @@ -46,7 +49,7 @@ public class VersionCheckMessageDialog extends JDialog implements ActionListener private void init(String message) { JPanel imagePanel = new JPanel(); - imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/warnings/warning32.png")); + imageLabel = new UILabel(new LazyIcon("warning")); imagePanel.add(imageLabel); JPanel messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); UILabel messageText = new UILabel(); @@ -54,7 +57,7 @@ public class VersionCheckMessageDialog extends JDialog implements ActionListener messagePanel.add(messageText); centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPanel.setBorder(BorderFactory.createEmptyBorder(15, 10, 10, 10)); + centerPanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); centerPanel.add(imagePanel, BorderLayout.WEST); centerPanel.add(messagePanel, BorderLayout.CENTER); @@ -90,7 +93,7 @@ public class VersionCheckMessageDialog extends JDialog implements ActionListener this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Sync_Prompt")); this.setResizable(false); this.add(body, BorderLayout.NORTH); - this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 300 : 280, 135)); + this.setSize(FineUIScale.scale(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 300 : 280, 135))); GUICoreUtils.centerWindow(this); } diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index eab36f69ae..f31bda6cf5 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties @@ -911,6 +911,7 @@ Table.focusCellForeground = $Table.foreground Table.background = $fill.normal Table.selectionInactiveBackground = @selectionInactiveBackground Table.selectionInactiveForeground = @selectionInactiveForeground +Table.selectionBackground = fade(#2576EF,12%) Table.dropCellBackground = @dropCellBackground Table.dropCellForeground = @dropCellForeground Table.dropLineColor = @dropLineColor diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index dc9b090cc6..3e54c98a84 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -2,7 +2,7 @@ com.fr.design.mainframe.check.CheckButton=250*118 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=360*185 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31 -com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280 +com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=360*280 com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 diff --git a/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java b/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java index 59f1e397a1..0625a3e1fa 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java @@ -1,5 +1,6 @@ package com.fr.design.chart.comp; +import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.ilable.UILabel; import com.fr.stable.Constants; @@ -10,6 +11,9 @@ import com.fr.design.style.color.ColorSelectBox; import java.awt.*; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + public class BorderAttriPane extends BasicPane { private LineComboBox lineCombo; @@ -20,16 +24,14 @@ public class BorderAttriPane extends BasicPane { } public BorderAttriPane(String lineString, String colorSting) { - this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0)); - - this.add(new UILabel(lineString + ":")); - this.add(lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART)); - lineCombo.setPreferredSize(new Dimension(60, 18)); - - this.add(new UILabel(colorSting + ":")); - this.add(colorSelectBox = new ColorSelectBox(80)); - colorSelectBox.setPreferredSize(new Dimension(60, 18)); + this.setLayout(new BorderLayout()); + lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); + colorSelectBox = new ColorSelectBox(80); + colorSelectBox.setPreferredSize(FineUIScale.scale(new Dimension(60, 24))); colorSelectBox.setSelectObject(null); + + this.add(row(10, row(cell(new UILabel(lineString + ":")), cell(lineCombo)), + row(cell(new UILabel(colorSting + ":"))), cell(colorSelectBox)).getComponent(), BorderLayout.WEST); } public void setLineColor(Color color) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java index aa8c9e46c8..09f2c77060 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java @@ -18,7 +18,6 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import java.util.Iterator; import java.awt.BorderLayout; -import java.awt.Dimension; /** * Created by IntelliJ IDEA. @@ -68,8 +67,6 @@ public class DataSeriesConditionPane extends ConditionAttributesPane it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent()); - this.add(nameLabel); - this.add(panel); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelBorderAttrPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelBorderAttrPane.java index 676fef17dc..2f877a9546 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelBorderAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelBorderAttrPane.java @@ -1,5 +1,6 @@ package com.fr.design.chart.series.SeriesCondition; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.chart.base.DataSeriesCondition; import com.fr.design.chart.comp.BorderAttriPane; import com.fr.design.condition.ConditionAttrSingleConditionPane; @@ -7,6 +8,9 @@ import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.ilable.UILabel; import com.fr.stable.StringUtils; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + /** * @author richie * @date 2015-03-26 @@ -25,12 +29,16 @@ public abstract class LabelBorderAttrPane extends ConditionAttrSingleConditionPa super(conditionAttributesPane, isRemove); nameLabel = new UILabel(label); linePane = initBorderAttrPane(); + nameLabel.setVisible(false); if (isRemove) { - this.add(nameLabel); + nameLabel.setVisible(true); } - this.add(linePane); this.labelName = label; + + this.add(row(cell(nameLabel).weight(0.2), cell(linePane).weight(0.8)) + .with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent()); + } protected BorderAttriPane initBorderAttrPane(){ diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelContentsPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelContentsPane.java index 19e7a1305b..d3f96672e5 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelContentsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelContentsPane.java @@ -54,6 +54,13 @@ public class LabelContentsPane extends ConditionAttrSingleConditionPane { @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - dim.height = FIL_HEIGHT; + dim.height = FineUIScale.scale(FIL_HEIGHT); return dim; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java index 38ae4a08ce..d76038c0a3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component.format; +import com.fine.theme.utils.FineUIScale; import com.fr.base.Style; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.UIBubbleFloatPane; @@ -79,8 +80,8 @@ public abstract class VanChartFormatPaneWithCheckBox extends JPanel{ formatPane = createFormatPane(); } Point comPoint = formatButton.getLocationOnScreen(); - Point arrowPoint = new Point(comPoint.x +formatButton.getWidth() - 25, comPoint.y + formatButton.getHeight()); - UIBubbleFloatPane