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 e129e77349..8be32bb5cf 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 @@ -17,6 +17,7 @@ import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.JTableHeader; import java.awt.Color; import java.awt.Component; +import java.awt.FontMetrics; import java.awt.Graphics; /** @@ -87,7 +88,7 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { 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) { + if (column == table.getColumnCount() - 1 && table.getAutoResizeMode() != JTable.AUTO_RESIZE_OFF) { border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")), UIManager.getBorder("Table.cellNoFocusBorder")); } else { @@ -101,8 +102,26 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { } setBackground(selectionBackground); setText(value == null ? StringUtils.BLANK : String.valueOf(value)); + setToolTipText(table, value, column); setBorder(border); return this; } + + /** + * 显示不全的文字,增加了 toolTip + * @param table + * @param value + * @param column + */ + private void setToolTipText(JTable table, Object value, int column) { + String tipText = value == null ? StringUtils.BLANK : String.valueOf(value); + FontMetrics fm = this.getFontMetrics(this.getFont()); + int textWidth = fm.stringWidth(String.valueOf(value)); + if (textWidth > table.getColumnModel().getColumn(column).getWidth()) { + setToolTipText(tipText); + } else { + setToolTipText(null); + } + } } } diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index ce5534daad..8ce229b272 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -9,6 +9,7 @@ import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.tabledata.ResponseDataSourceChange; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; @@ -43,7 +44,8 @@ public class TableDataSourceAction extends TemplateComponentAction row( - cell(driverComboBox).weight(3), flex(0.2), cell(odbcTipsLink).weight(1.8) + cell(driverComboBox).weight(3), flex(0.2), row(cell(odbcTipsLink)).weight(1.8) ).getComponent()) .addSupplier("define", () -> row( - cell(driverLoaderBox).weight(3), flex(0.2), cell(driverManageLabel).weight(1.8) + cell(driverLoaderBox).weight(3), flex(0.2), row(cell(driverManageLabel)).weight(1.8) ).getComponent()); changeDriverRow(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 275b3ce6d4..b7b6a39fe7 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -26,7 +26,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.gui.frpane.FineTabbedPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UITableScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -101,6 +101,7 @@ public class PreviewTablePane extends BasicPane { private static final int PREVIEW_TABLE_MIN_COLUMN_WIDTH = FineUIScale.scale(75); private static final int PREVIEW_TABLE_WIDTH = FineUIScale.scale(610); + private static final int TAB_MAX_COUNT_WITH_LINE = 7; /** * 用于refreshLabel的鼠标监听 @@ -679,7 +680,7 @@ public class PreviewTablePane extends BasicPane { public static void previewMultiDataModels(NameDataModel[] nameDataModels) { // tab窗口 - UITabbedPane tabbedPane = new UITabbedPane(); + FineTabbedPane.TabPaneBuilder tabbedPane = new FineTabbedPane.TabPaneBuilder(); for (NameDataModel nameDataModel : nameDataModels) { // 单个结果集的展示面板 @@ -704,10 +705,23 @@ public class PreviewTablePane extends BasicPane { }; previewPane.setLayout(FRGUIPaneFactory.createBorderLayout()); - previewPane.add(tabbedPane, BorderLayout.CENTER); + if (nameDataModels.length > 0) { + previewPane.add(tabbedPane.withHeadRatio(0.8f).withTabLayout(buildTabLayout(nameDataModels)).build(), BorderLayout.CENTER); + } previewPane.showWindow(new JFrame()).setVisible(true); } + private static int[] buildTabLayout(NameDataModel[] nameDataModels) { + int length = nameDataModels.length; + int size = (length + TAB_MAX_COUNT_WITH_LINE - 1) / TAB_MAX_COUNT_WITH_LINE; + int[] tabLayout = new int[size]; + int index = 0; + for (int i = 0; i < length; i += TAB_MAX_COUNT_WITH_LINE) { + tabLayout[index ++] = Math.min(TAB_MAX_COUNT_WITH_LINE, length - i); + } + return tabLayout; + } + /** * 直接预览存储过程的所有返回数据集,没有实际值和显示值 * diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java index 0cf850d4dc..8abe19a405 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.preview.desensitization.view.common; +import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIUtils; import com.fr.base.svg.IconUtils; import com.fr.design.border.UITitledBorder; @@ -23,6 +24,7 @@ import java.net.URL; 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.row; /** * 启用数据脱敏的面板 @@ -56,7 +58,7 @@ public class DesensitizationOpenPane extends JPanel { // 启用数据脱敏的勾选框 desensitizeOpenCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened")); // 跳转帮助文档Label - hyperlinkLabel = new UILabel(IconUtils.readIcon("/com/fr/design/standard/tip/tips")); + hyperlinkLabel = new UILabel(new LazyIcon("jump_to_references")); hyperlinkLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Open_Tips")); hyperlinkLabel.addMouseListener(new MouseAdapter() { @Override @@ -70,8 +72,7 @@ public class DesensitizationOpenPane extends JPanel { } } }); - panel.add(desensitizeOpenCheckBox); - panel.add(hyperlinkLabel); + panel.add(row(4, cell(desensitizeOpenCheckBox), cell(hyperlinkLabel)).getComponent()); // 提示Label tipsLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened_Tooltips")); 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 dc0eaf2011..c5f9e06d15 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 @@ -2,6 +2,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.fine.theme.utils.FineUIStyle; import com.formdev.flatlaf.ui.FlatUIUtils; import com.fr.base.svg.IconUtils; import com.fr.data.desensitize.rule.DesensitizationRuleManager; @@ -12,6 +13,7 @@ import com.fr.design.data.datapane.preview.desensitization.view.common.ChooseMar import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itable.FineUITableCellEditor; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; @@ -20,12 +22,10 @@ import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; import com.fr.stable.collections.CollectionUtils; -import javax.swing.AbstractCellEditor; -import javax.swing.BorderFactory; +import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.SwingUtilities; -import javax.swing.UIManager; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.CardLayout; @@ -195,17 +195,15 @@ public class DesensitizationRuleChoosePane extends JPanel { /** * 规则状态展示页面 */ - private class DesensitizationRuleStatusPane extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + private class DesensitizationRuleStatusPane extends FineUITableCellEditor { private UILabel ruleStatusLabel; DesensitizationRuleStatusPane() { // 规则状态 this.ruleStatusLabel = new UILabel(); - this.ruleStatusLabel.setForeground(Color.RED); this.ruleStatusLabel.setOpaque(true); - this.ruleStatusLabel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); - this.ruleStatusLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor"))); + FineUIStyle.setStyle(ruleStatusLabel, FineUIStyle.LABEL_WARNING_TIP); } /** @@ -239,6 +237,9 @@ public class DesensitizationRuleChoosePane extends JPanel { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { refreshRuleStatus(getList().get(row)); + JComponent c = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + ruleStatusLabel.setBorder(c.getBorder()); + ruleStatusLabel.setBackground(c.getBackground()); return ruleStatusLabel; } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index 8b3d9464fe..7c5aa47d43 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -18,6 +18,7 @@ import com.fr.design.gui.icombobox.ComboCheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombocheckbox.UIComboCheckBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itable.FineUITableCellEditor; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itextfield.UITextField; @@ -432,7 +433,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter 1) { - dataJTable.getTableHeader().setPreferredSize(new Dimension(super.getWidth(), FineUIScale.scale((Integer) UIManager.get("Table.rowHeight")))); + dataJTable.getTableHeader().setVisible(true); } else { - dataJTable.getTableHeader().setPreferredSize(new Dimension(super.getWidth(), FineUIScale.scale(4))); + dataJTable.getTableHeader().setVisible(false); } } diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java index ac4298fba8..ebacf24d5d 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java @@ -56,7 +56,7 @@ public class UIDetailErrorLinkDialog extends UIDialog { private static final String TAG_A_END = ""; private static final double SCALE = 1.2; - private final Dimension dimension = new Dimension(360, 180); + private final Dimension dimension = new Dimension(360, 200); public static Builder newBuilder() { return new Builder(); @@ -99,8 +99,10 @@ public class UIDetailErrorLinkDialog extends UIDialog { contentPane.add(link, BorderLayout.SOUTH); // 确定 + 取消 - JPanel actionPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP_10, GAP_8)); - actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Report_OK"))); + JPanel actionPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, GAP_8, GAP_10)); + UIButton okButton = createButton(Toolkit.i18nText("Fine-Design_Report_OK")); + FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY); + actionPane.add(okButton); actionPane.add(createButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"))); this.getContentPane().add(column(10, diff --git a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java index 8ee5c61fb2..18065fb37d 100644 --- a/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/main/java/com/fr/design/file/SaveSomeTemplatePane.java @@ -10,6 +10,8 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; +import com.fr.design.gui.iscrollbar.UIBasicVerticalScrollBar; +import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBarUI; import com.fr.design.gui.itree.checkboxtree.NullTristateCheckBox; import com.fr.design.gui.itree.checkboxtree.TristateCheckBox; @@ -21,10 +23,10 @@ import com.fr.log.FineLoggerFactory; import org.jetbrains.annotations.Nullable; import javax.swing.AbstractListModel; -import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; import javax.swing.JList; import javax.swing.JPanel; +import javax.swing.JScrollBar; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Window; @@ -83,11 +85,13 @@ public class SaveSomeTemplatePane extends BasicPane { UILabel tip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_The_Source_To_Save")); this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); + UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane) { + @Override + public UIScrollBar createVerticalScrollBar() { + return new UIBasicVerticalScrollBar(JScrollBar.VERTICAL); + } + }; scrollPane.setBorder(new FineRoundBorder()); - if (SystemInfo.isWindows) { - scrollPane.getVerticalScrollBar().setUI(new UIScrollBarUI()); - } this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java index b3ad1e179a..c3d7ba7ef3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java @@ -1,9 +1,10 @@ package com.fr.design.gui.frpane.tree.layer.config; +import com.fine.theme.light.ui.FineTableHeaderUI; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.icontainer.UITableScrollPane; import com.fr.design.present.dict.TableDataDictPane; import com.fr.form.ui.tree.LayerDependence; @@ -126,7 +127,7 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener { buttonPanel.add(delButton); this.add(buttonPanel, BorderLayout.NORTH); //添加Table的panel - JScrollPane tablePanel = new JScrollPane(dependenceTable); + UITableScrollPane tablePanel = new UITableScrollPane(dependenceTable); this.add(tablePanel, BorderLayout.CENTER); @@ -177,23 +178,21 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener { /** * 第一列renderer */ - private static final class FirstRenderer extends UILabel implements TableCellRenderer { + private static final class FirstRenderer extends FineTableHeaderUI.TableRenderer { + public FirstRenderer() { + this.setOpaque(true); + } @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - + JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value != null) { //value是用户选择的字段索引值,从1开始的 - this.setText(String.valueOf(value)); - } else { - this.setText(""); - } - if (hasFocus) { - this.setBorder(UIManager.getBorder("Table.focusCelHighlightBorder")); + label.setText(String.valueOf(value)); } else { - this.setBorder(null); + label.setText(""); } - return this; + return label; } } @@ -201,14 +200,14 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener { * 第二列renderer * 由于从model中获取的数据是数据集列的索引值,这里要转换为列的名称 */ - private static final class FieldRenderer extends UILabel implements TableCellRenderer { + private static final class FieldRenderer extends FineTableHeaderUI.TableRenderer { //用于将字段索引转换为字段名;保存改pane,是为了当用户选择其他数据集时,renderer可同步更新 private TableDataDictPane tableDataDictPane; public FieldRenderer(TableDataDictPane tableDataDictPane) { - this.tableDataDictPane = tableDataDictPane; + this.setOpaque(true); } /** @@ -217,20 +216,15 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener { */ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - + JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value != null) { List columnNames = getColumnNameList(this.tableDataDictPane); //value是用户选择的字段索引值,从1开始的 - this.setText(columnNames.get(Integer.valueOf(String.valueOf(value)))); - } else { - this.setText(""); - } - if (hasFocus) { - this.setBorder(UIManager.getBorder("Table.focusCelHighlightBorder")); + label.setText(columnNames.get(Integer.valueOf(String.valueOf(value)))); } else { - this.setBorder(null); + label.setText(""); } - return this; + return label; } } diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java index d5f573f773..977c02e134 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java @@ -259,6 +259,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam private void togglePopup() { if (this.arrowButton.isEnabled()) { popup.setBorder(new FineRoundBorder()); + popup.setPreferredSize(new Dimension(getWidth(), this.popup.getPreferredSize().height)); popup.show(this, 0, getHeight()); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicVerticalScrollBar.java b/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicVerticalScrollBar.java new file mode 100644 index 0000000000..336ed71ef8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIBasicVerticalScrollBar.java @@ -0,0 +1,22 @@ +package com.fr.design.gui.iscrollbar; + +/** + * 解决 Windows 下垂直滚动条不显示的临时方案:替换 UI + * + * @author lemon + * @since + * Created on + */ +public class UIBasicVerticalScrollBar extends UIScrollBar { + private static final String UI_CLASS_ID = "BasicVerticalScrollBarUI"; + private static final long serialVersionUID = 1L; + + public UIBasicVerticalScrollBar(int orientation) { + super(orientation); + } + + public String getUIClassID() { + return UI_CLASS_ID; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java b/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java index 949b3958ae..487eafb31e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UIScrollBarUI.java @@ -56,6 +56,7 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo protected Color thumbLightShadowColor; protected Color thumbDarkShadowColor; protected Color thumbColor; + protected Color pressedThumbColor; protected Color trackColor; protected Color trackHighlightColor; @@ -139,6 +140,7 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo thumbLightShadowColor = UIManager.getColor("ScrollBar.thumbShadow"); thumbDarkShadowColor = UIManager.getColor("ScrollBar.thumbDarkShadow"); thumbColor = UIManager.getColor("ScrollBar.thumb"); + pressedThumbColor = UIManager.getColor( "ScrollBar.pressedThumbColor" ); trackColor = UIManager.getColor("ScrollBar.track"); trackHighlightColor = UIManager.getColor("ScrollBar.trackHighlight"); } @@ -472,9 +474,9 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.translate(thumbBounds.x, thumbBounds.y); - Color color = isPressing ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL; + Color color = isPressing ? pressedThumbColor : thumbColor; g2.setColor(color); - g2.fillRoundRect(1, 1, width - 2, height - 2, UIConstants.LARGEARC, UIConstants.LARGEARC); + g2.fillRoundRect(1, 1, width - 4, height - 4, UIConstants.LARGEARC, UIConstants.LARGEARC); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itable/FineUITableCellEditor.java b/designer-base/src/main/java/com/fr/design/gui/itable/FineUITableCellEditor.java new file mode 100644 index 0000000000..cba3c07bba --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/itable/FineUITableCellEditor.java @@ -0,0 +1,33 @@ +package com.fr.design.gui.itable; + +import com.fine.theme.light.ui.FineTableHeaderUI; + +import javax.swing.AbstractCellEditor; +import javax.swing.JTable; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import java.awt.Component; + +/** + * TableCellEditor 应用 {@link FineTableHeaderUI.TableRenderer} + * + * @author lemon + * @since + * Created on 2024/09/10 + */ +public class FineUITableCellEditor extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + return null; + } + + @Override + public Object getCellEditorValue() { + return null; + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + return new FineTableHeaderUI.TableRenderer().getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 61f1b6b62c..07dfde3cde 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -154,7 +154,7 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs * 设置变化的背景颜色 */ public void setBackgroundUIColor(Color color) { -// ((UITextFieldUI) this.ui).setBackgroundColor4NoGiveNumber(color); + setBackground(color); } /** diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 37339c2297..ab62b8e668 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -16,6 +16,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.ilable.UILabel; +import com.fr.design.gui.itable.FineUITableCellEditor; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; @@ -301,9 +302,6 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane[] vTypes) { + super(vTypes); + } + + protected Dimension createEditTablePreferredSize() { + return scale(new Dimension(280, 150)); + } + + protected Dimension getPreferredScrollableViewportSize() { + return scale(new Dimension(280, 120)); + } + protected Dimension createControlBtnPanePreferredSize(){ + return FineUIScale.scale(new Dimension(110, 20)); + } + + protected String setControlBtnPanePosition(){ + return BorderLayout.EAST; + } +} 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 ee71b66b35..01dafb590b 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 @@ -3,6 +3,7 @@ package com.fr.design.write.submit; import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; import com.fine.swing.ui.layout.Spacer; +import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineTableHeaderUI; import com.fine.theme.utils.FineClientProperties; import com.fine.theme.utils.FineUIScale; @@ -175,7 +176,7 @@ public class DBManipulationPane extends BasicBeanPane { keyColumnValuesTable = new KeyColumnNameValueTable(); editTablePane.add(new UIVerticalScrollPane(keyColumnValuesTable), BorderLayout.CENTER); keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - keyColumnValuesTable.setPreferredScrollableViewportSize(scale(new Dimension(280, 150))); + keyColumnValuesTable.setPreferredScrollableViewportSize(getPreferredScrollableViewportSize()); keyColumnValuesTable.setShowHorizontalLines(true); northPane.add(column(10, @@ -200,6 +201,10 @@ public class DBManipulationPane extends BasicBeanPane { addListeners(); } + protected Dimension getPreferredScrollableViewportSize() { + return scale(new Dimension(280, 150)); + } + public void setSubMitName(String subMitName) { this.subMitName = subMitName; } @@ -504,7 +509,9 @@ public class DBManipulationPane extends BasicBeanPane { return super.value2Text(value); } }; - bPane.add(new JScrollPane(list), BorderLayout.CENTER); + JScrollPane scrollPane = new JScrollPane(list); + scrollPane.setBorder(new FineRoundBorder()); + bPane.add(scrollPane, BorderLayout.CENTER); BasicDialog dlg = bPane.showSmallWindow(SwingUtilities.getWindowAncestor(DBManipulationPane.this), new DialogActionAdapter() { @Override @@ -884,7 +891,7 @@ public class DBManipulationPane extends BasicBeanPane { vPane = new ValueEditorPane(types); this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 45)); this.add(vPane); - vPane.setPreferredSize(new Dimension(220, 25)); + vPane.setPreferredSize(scale(new Dimension(220, 25))); } @Override diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_area.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_area.svg new file mode 100644 index 0000000000..8e7a17493a --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_area.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_bubble.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_bubble.svg new file mode 100644 index 0000000000..81eb99dad8 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_bubble.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_column.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_column.svg new file mode 100644 index 0000000000..ddf2ef872e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_column.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_cuvette.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_cuvette.svg new file mode 100644 index 0000000000..4d68f0943c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_cuvette.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_different_pie.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_different_pie.svg new file mode 100644 index 0000000000..99f947b8ba --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_different_pie.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_line.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_line.svg new file mode 100644 index 0000000000..9f4013ec9d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_line.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pie.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pie.svg new file mode 100644 index 0000000000..620f4db03e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pie.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pointer_180.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pointer_180.svg new file mode 100644 index 0000000000..32f8af8ede --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pointer_180.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pointer_360.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pointer_360.svg new file mode 100644 index 0000000000..1f680fd7a1 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_pointer_360.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_radar.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_radar.svg new file mode 100644 index 0000000000..d1141904ca --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_radar.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_ring.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_ring.svg new file mode 100644 index 0000000000..783652eeea --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_ring.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_same_pie.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_same_pie.svg new file mode 100644 index 0000000000..5f18014891 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_same_pie.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_scatter.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_scatter.svg new file mode 100644 index 0000000000..54b295eafe --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_scatter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_slot.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_slot.svg new file mode 100644 index 0000000000..542a90fa65 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_slot.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_stack_radar.svg b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_stack_radar.svg new file mode 100644 index 0000000000..c278096d54 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/chart/icon_stack_radar.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/tip/jump_to_references.svg b/designer-base/src/main/resources/com/fine/theme/icon/tip/jump_to_references.svg new file mode 100644 index 0000000000..192bdfff9a --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/tip/jump_to_references.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index 45971eca90..1aac4235da 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -425,6 +425,21 @@ "chart_rectangleTree": "chart/chart_rectangleTree.svg", "chart_wordCloud": "chart/chart_wordCloud.svg", "chart_frame": "chart/chart_frame.svg", + "icon_area": "chart/icon_area.svg", + "icon_bubble": "chart/icon_bubble.svg", + "icon_cuvette": "chart/icon_cuvette.svg", + "icon_different_pie": "chart/icon_different_pie.svg", + "icon_line": "chart/icon_line.svg", + "icon_pie": "chart/icon_pie.svg", + "icon_pointer_180": "chart/icon_pointer_180.svg", + "icon_pointer_360": "chart/icon_pointer_360.svg", + "icon_radar": "chart/icon_radar.svg", + "icon_ring": "chart/icon_ring.svg", + "icon_same_pie": "chart/icon_same_pie.svg", + "icon_scatter": "chart/icon_scatter.svg", + "icon_slot": "chart/icon_slot.svg", + "icon_stack_radar": "chart/icon_stack_radar.svg", + "icon_column": "chart/icon_column.svg", "out": "border/out.svg", "in": "border/in.svg", "bottom": "border/bottom.svg", @@ -445,6 +460,7 @@ "waiting":"tip/waiting.svg", "information":"tip/information.svg", "new_information":"tip/new_information.svg", + "jump_to_references":"tip/jump_to_references.svg", "success":"tip/success.svg", "warning":"tip/warning.svg", "layout_top": "layout/layout_top.svg", diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties index 9ac0952b65..165701c244 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties @@ -27,6 +27,7 @@ RadioButtonUI=com.formdev.flatlaf.ui.FlatRadioButtonUI RadioButtonMenuItemUI=com.formdev.flatlaf.ui.FlatRadioButtonMenuItemUI RootPaneUI=com.formdev.flatlaf.ui.FlatRootPaneUI ScrollBarUI=com.formdev.flatlaf.ui.FlatScrollBarUI +BasicVerticalScrollBarUI=com.fr.design.gui.iscrollbar.UIScrollBarUI ScrollPaneUI=com.formdev.flatlaf.ui.FlatScrollPaneUI SeparatorUI=com.formdev.flatlaf.ui.FlatSeparatorUI SliderUI=com.fine.theme.light.ui.FineSliderUI diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index f8f5b7f878..190da5ff4b 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -37,6 +37,7 @@ com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=800*630 com.fr.design.actions.printingSetting.dialog=700*600 com.fr.design.data.datapane.preview.dialog=700*600 +com.fr.design.data.tabledata.dialog=1200*600 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 2ffcb1aa42..32408cc796 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -36,6 +36,7 @@ com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 com.fr.design.data.datapane.preview.dialog=700*600 +com.fr.design.data.tabledata.dialog=900*600 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 598b8f68d1..86c6e11cb2 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -36,6 +36,7 @@ com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 com.fr.design.data.datapane.preview.dialog=700*600 +com.fr.design.data.tabledata.dialog=900*600 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 0663409e6d..44d8e4180e 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 @@ -36,6 +36,7 @@ com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=660*600 com.fr.design.actions.printingSetting.dialog=660*600 com.fr.design.data.datapane.preview.dialog=660*600 +com.fr.design.data.tabledata.dialog=900*600 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index e79bb892d1..ef212e9c63 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -35,6 +35,7 @@ com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 com.fr.design.data.datapane.preview.dialog=700*600 +com.fr.design.data.tabledata.dialog=900*600 diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java index 2cb52f4542..b29146223b 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/correlation/AbstractCorrelationPane.java @@ -81,6 +81,7 @@ public abstract class AbstractCorrelationPane extends BasicBeanPane { @Override public void actionPerformed(ActionEvent e) { tablePane.addLine(createLine()); + tablePane.doParentRepaintEvent(); fireTargetChanged(); } }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/ChartImageCheckOutPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/ChartImageCheckOutPane.java index 74bf668f8b..0715be73a4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/ChartImageCheckOutPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/ChartImageCheckOutPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.custom.component; +import com.fine.theme.icon.LazyIcon; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; @@ -8,21 +9,30 @@ import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.type.CustomPlotType; import javax.swing.BorderFactory; -import javax.swing.ImageIcon; +import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; +import java.awt.Graphics; +import java.awt.Dimension; import java.util.ArrayList; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.flex; + /** * Created by Fangjie on 2016/4/19. */ public class ChartImageCheckOutPane extends BasicPane implements UIObserver { private JCheckBox checkBox; - private CustomPlotType customPlotType; - private ArrayList changeListeners = new ArrayList(); + private Icon backgroundIcon; + private final CustomPlotType customPlotType; + private static final int ICON_WIDTH = 56; + private static final int ICON_HEIGHT = 50; + private final ArrayList changeListeners = new ArrayList(); public ChartImageCheckOutPane(CustomPlotType type){ this(type, false); @@ -30,40 +40,40 @@ public class ChartImageCheckOutPane extends BasicPane implements UIObserver { public ChartImageCheckOutPane( CustomPlotType type, boolean isSelected){ this.customPlotType = type; + initComponent(isSelected); + } - initCheckBox(isSelected); - - this.add(checkBox, BorderLayout.CENTER); + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + if (backgroundIcon != null) { + backgroundIcon.paintIcon(this, g, 0, 0); + } } public CustomPlotType getCustomPlotType() { return customPlotType; } - private void initCheckBox(boolean isSelected) { + private void initComponent(boolean isSelected) { this.checkBox = new JCheckBox(); this.checkBox.setSelected(isSelected); //设置提示 this.checkBox.setToolTipText(CustomPlotFactory.getTooltipText(this.customPlotType)); - //背景 - checkBox.setIcon(new ImageIcon(getClass().getResource(getIconPath(customPlotType,isSelected)))); - + //设置背景图标 + this.backgroundIcon = new LazyIcon(getIconId(this.customPlotType), new Dimension(ICON_WIDTH, ICON_HEIGHT)); this.setLayout(new BorderLayout()); + this.add(row(flex(), cell(checkBox)).getComponent(), BorderLayout.NORTH); } - private String getIconPath(CustomPlotType customPlotType, boolean isSelected) { - return isSelected ? CustomPlotFactory.getTypeIconPath(customPlotType)[0] : CustomPlotFactory.getTypeIconPath(customPlotType)[1]; + private String getIconId(CustomPlotType customPlotType) { + return CustomPlotFactory.getTypeIconId(customPlotType); } - public JCheckBox getCheckBox() { return checkBox; } - public void checkIconImage(){ - checkBox.setIcon(new ImageIcon(getClass().getResource(getIconPath(customPlotType, checkBox.isSelected())))); - } - public void setPaneBorder(boolean isRightLine, boolean isBottomLine){ this.setBorder(BorderFactory.createMatteBorder(1, 1, isBottomLine ? 1 : 0, isRightLine ? 1 : 0, UIConstants.LINE_COLOR)); } @@ -77,7 +87,6 @@ public class ChartImageCheckOutPane extends BasicPane implements UIObserver { } - @Override protected String title4PopupWindow() { return null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java index f73d23671b..296abc5601 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java @@ -65,8 +65,6 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { updateOldSelectedList(); addCheckBoxListener(); - - checkoutSelected(); } private void updateOldSelectedList() { @@ -76,13 +74,6 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { } } - private void checkoutSelected() { - for (int i = 0; i < customTypeList.size(); i++){ - //根据是否选中重置背景 - customTypeList.get(i).checkIconImage(); - } - } - private void initContentPane() { content = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(CUSTOM_TYPE_NUM, 0, 0); @@ -124,9 +115,6 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { //点击后更新已选顺序 checkoutSelectedPlotTypeList(); - //点击后,更新背景 - checkoutSelected(); - //响应观察者事件,以便更新chart fireDirty(); } @@ -169,8 +157,6 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { populateCustomTypeList(customPlot); populateSelectedPlotTypeList(customPlot); - - checkoutSelected(); } private void populateSelectedPlotTypeList(VanChartCustomPlot customPlot) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java index 7fa6b47e51..347e700747 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java @@ -10,6 +10,7 @@ import com.fr.plugin.chart.type.GradientType; import com.fr.van.chart.designer.component.VanChartBeautyPane; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionEvent; @@ -57,7 +58,9 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane { } private void checkGradientBarVisible() { - gradientBarPane.setVisible(getGradientTypeBox().getSelectedIndex() == 1); + SwingUtilities.invokeLater(() -> { + gradientBarPane.setVisible(getGradientTypeBox().getSelectedIndex() == 1); + }); } protected String[] getNameArray() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index 2b3976647a..79b4d5b9c3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -119,17 +119,6 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { JPanel stylePane = valueFillStylePane == null ? new JPanel() : valueFillStylePane; colorPickerPane = new ColorPickerPaneWithMaxMin(parentPane, "meterString", valueFillStylePane) { - protected int getBoundX() { - return 0; - } - - protected int getBoundY() { - return 10; - } - - protected int getPreferredMarginY() { - return 10; - } protected double getDescriptionWidth() { double descriptionWidth = super.getDescriptionWidth(); diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java b/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java index 2a3ab3dac2..143b7ee024 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java @@ -7,6 +7,7 @@ import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptActionPane; import com.fr.design.mainframe.FormDesigner; import com.fr.design.widget.EventCreator; +import com.fr.design.write.submit.DBManipulationInWdigetEventNoCellPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.designer.creator.XCreator; @@ -44,7 +45,7 @@ public class EventPropertyTable extends UIListControlPane { return new JavaScriptActionPane() { @Override protected DBManipulationPane createDBManipulationPane() { - return new DBManipulationPane(ValueEditorPaneFactory.formEditors()); + return new DBManipulationInWdigetEventNoCellPane(ValueEditorPaneFactory.formEditors()); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java b/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java index bb110c8203..b2d0e6dd08 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java @@ -7,7 +7,6 @@ import com.fr.base.background.ColorBackground; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.ElementCasePane; @@ -26,7 +25,6 @@ import com.fr.stable.ColumnRow; import com.fr.stable.EssentialUtils; import com.fr.stable.StringUtils; -import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.JTextField; import java.awt.BorderLayout; @@ -48,11 +46,8 @@ public class SortColumnRowPane extends JPanel implements UIObserver { private CellSelection oldSelection; private SelectionListener gridSelectionChangeListener; UIObserverListener uiObserverListener; - private final static Icon DISABLED_ICON = new LazyIcon("cellSelect").disabled(); - private final static Icon ENABLE_ICON = new LazyIcon("cellSelect"); private boolean enabled; SelectActionListener selectActionListener; - private AbstractAttrNoScrollPane parent; HeaderAreaPane.CellSelectionManager cellSelectionManager; @@ -65,13 +60,6 @@ public class SortColumnRowPane extends JPanel implements UIObserver { initTextField(); initSelectButton(); initLayout(); - //翻新前AbstractAttrNoScrollPane中递归注册已加载的Pane事件,UI翻新后部分面板未提前加载导致事件未注册,先主动调用下后续再重构 - registerChangeListener(new UIObserverListener() { - @Override - public void doChange() { - parent.attributeChanged(); - } - }); } private void initLayout() { @@ -100,7 +88,7 @@ public class SortColumnRowPane extends JPanel implements UIObserver { } void initSelectButton() { - selectButton = new UIButton(ENABLE_ICON); + selectButton = new UIButton(new LazyIcon("cellSelect")); selectActionListener = new SelectActionListener(this); selectButton.addMouseListener(selectActionListener); } @@ -123,12 +111,6 @@ public class SortColumnRowPane extends JPanel implements UIObserver { colJTextField.setText(StringUtils.EMPTY); rowJTextField.setText(StringUtils.EMPTY); } - if (enabled) { - selectButton.setIcon(ENABLE_ICON); - } else { - selectButton.setIcon(DISABLED_ICON); - } - selectButton.setEnabled(false); refresh(); } diff --git a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java index bff1c4ec72..cd9c616d26 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java @@ -1,7 +1,6 @@ package com.fr.design.sort.header; -import com.fr.design.constants.LayoutConstants; -import com.fr.design.gui.core.ReactiveCardPane; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; @@ -23,6 +22,8 @@ import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT; +import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT; public class HeaderAreaPane extends JPanel { @@ -31,10 +32,8 @@ public class HeaderAreaPane extends JPanel { private CellSelectionManager cellSelectionManager = new CellSelectionManager(); TemplateCellElement cellElement; SortColumnRowPane columnRowPane; - ReactiveCardPane cardPane; UIComboBox uiComboBox; - UILabel headerLabel; - boolean showHeaderArea; + JPanel sortColumnRowPanel; HeaderAreaPane(int headerAreaPaneWidth, int headerAreaPaneRightWidth) { this.headerAreaPaneWidth = headerAreaPaneWidth; @@ -43,59 +42,25 @@ public class HeaderAreaPane extends JPanel { } void initComponents() { - headerLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Area"), SwingConstants.LEFT); uiComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_None"), Toolkit.i18nText("Fine-Design_Basic_Custom")}); columnRowPane = new SortColumnRowPane(); - initCardPane(); - initChangeListener(); + sortColumnRowPanel = new JPanel(new BorderLayout()); + sortColumnRowPanel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); + sortColumnRowPanel.add(row(flex(LEFT_WEIGHT), cell(columnRowPane).weight(RIGHT_WEIGHT)).getComponent()); this.setLayout(new BorderLayout()); - this.add(cardPane); + this.add(column( + row(cell(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Area"))).weight(LEFT_WEIGHT), cell(uiComboBox).weight(RIGHT_WEIGHT)), + cell(sortColumnRowPanel) + ).getComponent()); + uiComboBox.setSelectedIndex(1); + initChangeListener(); } private void initChangeListener() { uiComboBox.addItemListener(e -> { - if ((showHeaderArea ? 1 : 0) != uiComboBox.getSelectedIndex()) { - triggerItemChanged(); - } + sortColumnRowPanel.setVisible(uiComboBox.getSelectedIndex() == 1); }); - uiComboBox.setEnabled(false); - } - - private void triggerItemChanged() { - if (uiComboBox.getSelectedIndex() == 0) { - cardPane.select("none").populate(); - showHeaderArea = false; - cellSelectionManager.removeNotSelectables(columnRowPane.updateBean()); - columnRowPane.cancelSelectState(); - } else { - cardPane.select("custom").populate(); - showHeaderArea = true; - ColumnRow columnRow = columnRowPane.updateBean(); - if (cellSelectionManager.isNotSelectables(columnRow)) { - columnRowPane.setColumnRow(ColumnRow.ERROR); - } else { - cellSelectionManager.addNotSelectables(columnRow); - } - } - } - - private void initCardPane() { - cardPane = ReactiveCardPane.create() - .addSupplier("none", () -> column(LayoutConstants.VERTICAL_GAP, - row( - cell(headerLabel).weight(1.2), cell(uiComboBox).weight(3) - ) - ).getComponent()) - .addSupplier("custom", () -> column(LayoutConstants.VERTICAL_GAP, - row( - cell(headerLabel).weight(1.2), cell(uiComboBox).weight(3) - ), - row( - flex(1.2), cell(columnRowPane).weight(3) - ) - ).getComponent()); - - cardPane.select("none").populate(); + uiComboBox.setSelectedIndex(0); } public void populateBean(ColumnRow columnRow, boolean showHeaderArea, TemplateCellElement cellElement) { diff --git a/designer-realize/src/main/java/com/fr/design/webattr/DragToolBarPane.java b/designer-realize/src/main/java/com/fr/design/webattr/DragToolBarPane.java index 496b368014..28087fd4f9 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/DragToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/DragToolBarPane.java @@ -112,7 +112,7 @@ public class DragToolBarPane extends WidgetToolBarPane { JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); movePane.add(column(1, cell(topToolbarPanel), - cell(toolbarButtonList), + cell(toolbarButtonList).weight(1), cell(bottomToolbarPanel) ).getComponent()); this.add(new JScrollPane(movePane), BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 7ced9bf8e9..fffdbbbb59 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -50,6 +50,8 @@ import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; +import static com.fine.theme.utils.FineUIScale.scale; + public class SmartInsertDBManipulationPane extends DBManipulationPane { private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1); private ElementCasePane ePane; @@ -352,7 +354,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * set Width */ TableColumn column0 = table.getColumnModel().getColumn(0); - column0.setMaxWidth(LEFT_COLUMN_MAX_WIDTH); + column0.setMaxWidth(scale(LEFT_COLUMN_MAX_WIDTH)); ColumnNameTableCellRenderer cellRenderer = new ColumnNameTableCellRenderer(); cellRenderer.setHorizontalAlignment(SwingConstants.LEFT); column0.setCellRenderer(new BooleanRenderer());