diff --git a/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java index 22263a871e..041852857b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/CloseCurrentTemplateAction.java @@ -7,6 +7,7 @@ import com.fr.design.file.MultiTemplateTabPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; /** @@ -21,6 +22,7 @@ public class CloseCurrentTemplateAction extends UpdateAction { this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setAccelerator(getMenuKeySet().getKeyStroke()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java b/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java index d007e315fe..0d920a5230 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java @@ -5,6 +5,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.JTemplate; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; @@ -13,6 +14,7 @@ public class EditEnvAction extends UpdateAction { public EditEnvAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Others") + "..."); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java b/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java index 5925e250f4..0e395da9fe 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/ExitDesignerAction.java @@ -5,6 +5,7 @@ package com.fr.design.actions.file; import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.mainframe.TemplateSavingChecker; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; import com.fr.design.actions.UpdateAction; @@ -22,6 +23,7 @@ public class ExitDesignerAction extends UpdateAction { this.setMenuKeySet(KeySetUtils.EXIT_DESIGNER); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java index dd48e26841..d571d60f34 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferenceAction.java @@ -11,6 +11,7 @@ import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; +import com.fr.general.IOUtils; import java.awt.event.ActionEvent; @@ -20,6 +21,7 @@ public class PreferenceAction extends UpdateAction { this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.generateAndSetSearchText(PreferencePane.class.getName()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java index 4dcc53a13c..8bf83e78c1 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutAction.java @@ -8,7 +8,8 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.MenuKeySet; -import javax.swing.*; +import com.fr.general.IOUtils; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; /** @@ -19,6 +20,7 @@ public class AboutAction extends UpdateAction { this.setMenuKeySet(ABOUT); this.setName(getMenuKeySet().getMenuKeySetName()+"..."); this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); } /** diff --git a/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java b/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java index ea6d12c7ba..422e002f33 100644 --- a/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java +++ b/designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java @@ -68,4 +68,12 @@ public class FineBorderFactory { ); } + /** + * 创建具有padding的边框 + * @return 边框 + */ + public static Border createBorderWithPadding(Border border) { + return BorderFactory.createCompoundBorder(border, new ScaledEmptyBorder(0, 6, 0, 0) + ); + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java index ebbdbf0f35..3db9c3aff1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java @@ -11,7 +11,6 @@ import javax.swing.JList; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.data.TableDataSource; import com.fr.design.data.tabledata.Prepare4DataSourceChange; @@ -48,14 +47,15 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel renderer = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value instanceof TableDataWrapper) { + if (index == -1 && value == null) { + // 显示空白 + renderer.setIcon(null); + renderer.setText(StringUtils.EMPTY); + }else if (value instanceof TableDataWrapper) { TableDataWrapper tabledatawrappe = (TableDataWrapper)value; renderer.setIcon(tabledatawrappe.getIcon()); renderer.setText(tabledatawrappe.getTableDataName()); renderer.setToolTipText(tabledatawrappe.getTableDataName()); - } else { - renderer.setIcon(null); - renderer.setText(StringUtils.EMPTY); } return renderer; } @@ -75,7 +75,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC setDsMap(); DefaultComboBoxModel model = new DefaultComboBoxModel(); this.setModel(model); - model.addElement(UIConstants.PENDING); + // 遍历添加所有数据项到模型 Iterator> entryIt = dsMap.entrySet().iterator(); while (entryIt.hasNext()) { TableDataWrapper tableDataWrapper = entryIt.next().getValue(); @@ -83,6 +83,8 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC model.addElement(tableDataWrapper); } } + // 设置默认选项为空白 + this.setSelectedItem(null); if (dataWrapper != null) { if (DesignTableDataManager.isDsNameChanged(dataWrapper.getTableDataName())) { this.setSelectedTableDataByName(DesignTableDataManager.getChangedDsNameByOldDsName(dataWrapper.getTableDataName())); diff --git a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java index 1da3e34e0c..ec36eb65e1 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java @@ -14,9 +14,9 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.JPanel; +import javax.swing.SwingUtilities; import javax.swing.event.DocumentEvent; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Dialog; import java.awt.Dimension; import java.awt.Frame; @@ -164,12 +164,17 @@ public abstract class BasicPane extends JPanel { dg = new DIALOG((Dialog) window); } - if (l != null) { - dg.addDialogActionListener(l); - } - dg.setBasicDialogSize(dimension); - GUICoreUtils.centerWindow(dg); - dg.setResizable(false); + SwingUtilities.invokeLater(() -> { + if (l != null) { + dg.addDialogActionListener(l); + } + dg.setBasicDialogSize(dimension); + GUICoreUtils.centerWindow(dg); + dg.setResizable(false); + dg.setVisible(true); + dg.toFront(); + dg.requestFocus(); + }); return dg; } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index 547900386b..0e06bcd344 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -33,7 +33,13 @@ import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.BorderLayout; +import java.awt.AlphaComposite; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.lang.reflect.Constructor; @@ -559,7 +565,8 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li super.paint(g); } }; - label.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); + + label.setBorder(BorderFactory.createMatteBorder(scale(1), 0, scale(1), 0, FineUIUtils.getUIColor("fill.hover", "fill.hover"))); label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); label.setFont(label.getFont().deriveFont(scale(11F))); label.setPreferredSize(new Dimension(this.getPreferredSize().width, scale(24))); @@ -572,6 +579,4 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li } } - - } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java index 342221fd20..e5e765510b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane; +import com.fine.theme.icon.LazyIcon; import com.fr.base.BaseUtils; import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeWrapper; @@ -16,17 +17,26 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.ToolBarDef; -import com.fr.form.ui.TreeEditor; import com.fr.general.ComparatorUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; -import javax.swing.*; +import javax.swing.JPanel; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; -import javax.swing.tree.*; -import java.awt.*; +import javax.swing.JTree; +import javax.swing.BorderFactory; +import javax.swing.JOptionPane; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.DefaultTreeCellRenderer; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Component; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; @@ -178,7 +188,7 @@ public class JTreeControlPane extends ControlPane { this.creator = creators[0]; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); this.setMnemonic('A'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + this.setSmallIcon(new LazyIcon("add")); } public void actionPerformed(ActionEvent e) { @@ -209,7 +219,7 @@ public class JTreeControlPane extends ControlPane { public RemoveTreeNodeAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setMnemonic('R'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(new LazyIcon("remove")); } public void actionPerformed(ActionEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java index b187a8bfa0..25e0f44b37 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java @@ -1,7 +1,7 @@ package com.fr.design.gui.frpane; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.data.impl.TableDataDictionary; -import com.fr.data.impl.TreeAttr; import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeWrapper; import com.fr.design.data.DataCreatorUI; @@ -13,17 +13,18 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.TreeDataCardPane; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.form.ui.TreeComboBoxEditor; -import com.fr.form.ui.TreeEditor; import com.fr.form.ui.tree.LayerConfig; import com.fr.general.NameObject; -import javax.swing.*; -import java.awt.*; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.Arrays; +import javax.swing.JPanel; +import javax.swing.JComponent; +import java.awt.BorderLayout; + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX; +import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE; public class TreeSettingPane extends BasicPane implements DataCreatorUI { /** @@ -58,19 +59,18 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel buildWayPanel = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); - buildWayPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - UILabel buildWayLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Way") + " :"); - buildWayPanel.add(buildWayLabel); + UILabel buildWayLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Way")); buildBox = new UIComboBox(buildWay); buildBox.addItemListener(e -> { cardChanged(buildBox.getSelectedIndex()); }); - buildWayPanel.add(buildBox); + buildWayPanel.add(row(20, cell(buildWayLabel), cell(buildBox).with(it -> it.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX))).getComponent()); controlPane = new JTreeControlPane(new NameableCreator[]{treeNode}, new TreeDataCardPane()); autoBuildPane = new JTreeAutoBuildPane(); layerDataControlPane = new LayerDataControlPane(); + buildWayPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); this.add(buildWayPanel, BorderLayout.NORTH); cardChanged(0); } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java index 1bf9d604fc..b24964f1cc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.gui.frpane.tree.layer.config; +import com.fine.theme.icon.LazyIcon; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.FineJOptionPane; @@ -146,7 +147,7 @@ public class LayerDataControlPane extends ControlPane { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); this.setMnemonic('A'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + this.setSmallIcon(new LazyIcon("add")); } public void actionPerformed(ActionEvent e) { @@ -173,7 +174,7 @@ public class LayerDataControlPane extends ControlPane { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setMnemonic('R'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(new LazyIcon("remove")); } public void actionPerformed(ActionEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java index f4c3cfe920..4c9135e151 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ilist; +import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.NameInspector; import com.fr.design.gui.itextfield.UITextField; import com.fr.general.GeneralUtils; @@ -256,7 +257,7 @@ public class JNameEdList extends UIList implements CellEditorListener { } public int getIconWidth() { - return ICON_WIDTH; + return FineUIScale.scale(ICON_WIDTH); } public Rectangle createRect(Rectangle rect, int iconWidth) { diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java index d26cf47e61..8ab812e9dc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java @@ -129,6 +129,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse Component[][] components = getComponent(fontPane, centerPane, typePane); this.add(createContentPane(components), BorderLayout.CENTER); + centerPane.setVisible(!isTextOrNull()); } protected JPanel createContentPane (Component[][] components) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java index 760e53f3bf..f89e4104b0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.theme; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyle; @@ -145,7 +146,7 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane { - private static final int EDITOR_COLUMN = 15; - private static final int LEFT_BORDER = 5; - private static final int MAX_WIDTH = 30; private FormulaEditor keyFormulaEditor; private FormulaEditor valueFormulaEditor; @@ -32,45 +31,27 @@ public class FormulaDictPane extends FurtherBasicBeanPane { private void initComponents() { keyFormulaEditor = new FormulaEditor(); - keyFormulaEditor.setColumns(EDITOR_COLUMN); - JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0)); - keyFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER)); - Icon icon = new LazyIcon("formula"); - keyFormulaContainer.add(new JLabel(icon)); - keyFormulaContainer.add(keyFormulaEditor); - valueFormulaEditor = new FormulaEditor(); - valueFormulaEditor.setColumns(EDITOR_COLUMN); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + // html多行提示待优化 UILabel tag = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_Dictionary_Display_Examples_Html")); tag.setForeground(new Color(143, 143, 146)); - JPanel t = new JPanel(new BorderLayout()); - t.add(tag, BorderLayout.CENTER); BaseFormula vf = BaseFormula.createFormulaBuilder().build("$$$"); valueFormulaEditor = new FormulaEditor(StringUtils.EMPTY, vf); - - JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0)); - valueFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER)); - valueFormulaContainer.add(new JLabel(icon)); - valueFormulaContainer.add(valueFormulaEditor); - - Component[][] components = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), MAX_WIDTH, UILabel.LEFT), keyFormulaContainer}, - new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), MAX_WIDTH, UILabel.LEFT), valueFormulaContainer}, - new Component[]{tag, null} - }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); - + JPanel panel = column(LayoutConstants.VERTICAL_GAP, + row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"))).weight(1), + row(cell(new JLabel(new LazyIcon("formula"))), fix(4), cell(keyFormulaEditor).weight(1)).weight(2) + ), + row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"))).weight(1), + row(cell(new JLabel(new LazyIcon("formula"))), fix(4), cell(valueFormulaEditor).weight(1)).weight(2) + ), + cell(tag) + ).getComponent(); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); - } public void addChangeListener(DocumentListener l) { diff --git a/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java b/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java index 770c7b2372..cfdfdd488d 100644 --- a/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java +++ b/designer-base/src/main/java/com/fr/design/scrollruler/BaseRuler.java @@ -1,5 +1,6 @@ package com.fr.design.scrollruler; +import com.fine.theme.utils.FineUIScale; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; @@ -100,7 +101,7 @@ public abstract class BaseRuler extends JComponent { protected abstract RulerUI getRulerUI(); public Dimension getPreferredSize() { - return new Dimension(_WIDTH, _HEIGHT); + return FineUIScale.scale(new Dimension(_WIDTH, _HEIGHT)); } // class RulerUnitItem extends UICheckBoxMenuItem { diff --git a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java index 23a6364f3b..091cedaeeb 100644 --- a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java @@ -209,35 +209,7 @@ public class FRFontPane extends BasicPane { */ public void populate(FRFont frFont) { - this.fontNameComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updatePreviewLabel(); - } - }); - - this.fontSizeStylePane.fontComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updatePreviewLabel(); - } - }); - - this.fontSizeStylePane.fontSizeComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - updatePreviewLabel(); - } - }); - - //foreground. - this.foregroundColorPane.setSelectObject(frFont.getForeground()); - //update frFont. - this.underlineCombo.setSelectedLineStyle(frFont.getUnderline()); - - //effects - this.isStrikethroughCheckBox.setSelected(frFont.isStrikethrough()); - this.isShadowCheckBox.setSelected(frFont.isShadow()); - this.isSuperscriptCheckBox.setSelected(frFont.isSuperscript()); - this.isSubscriptCheckBox.setSelected(frFont.isSubscript()); - + populateFont(frFont); //actionlistner ActionListener updatePreviewActionListener = new ActionListener() { @@ -250,7 +222,7 @@ public class FRFontPane extends BasicPane { this.isSuperscriptCheckBox.addActionListener(updatePreviewActionListener); this.isSubscriptCheckBox.addActionListener(updatePreviewActionListener); -//underline + //underline this.underlineCombo.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { updatePreviewLabel(); @@ -267,6 +239,23 @@ public class FRFontPane extends BasicPane { updatePreviewLabel(); } + private void populateFont(FRFont frFont) { + this.fontNameComboBox.setSelectedItem(frFont.getName()); + // 字体 + this.fontSizeStylePane.populate(frFont); + //foreground. + this.foregroundColorPane.setSelectObject(frFont.getForeground()); + //update frFont. + this.underlineCombo.setSelectedLineStyle(frFont.getUnderline()); + + //effects + this.isStrikethroughCheckBox.setSelected(frFont.isStrikethrough()); + this.isShadowCheckBox.setSelected(frFont.isShadow()); + this.isSuperscriptCheckBox.setSelected(frFont.isSuperscript()); + this.isSubscriptCheckBox.setSelected(frFont.isSubscript()); + } + + /** * Update pane to get new font. */ diff --git a/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java b/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java index 924c1129a1..255d9e2301 100644 --- a/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java +++ b/designer-base/src/main/java/com/fr/design/style/FontSizeStylePane.java @@ -1,45 +1,33 @@ package com.fr.design.style; - -import javax.swing.Box; -import javax.swing.JList; import javax.swing.JPanel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.FRFont; -import com.fr.design.utils.gui.GUICoreUtils; - 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; public class FontSizeStylePane extends JPanel { - - public UIComboBox fontComboBox; public UIComboBox fontSizeComboBox; + private static final String[] STYLES = { + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Plain"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Italic"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold_Italic")}; + public FontSizeStylePane() { this.init(); } private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - - String[] styles = { - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Plain"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Italic"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Bold_Italic")}; - - fontComboBox = new UIComboBox(styles); + fontComboBox = new UIComboBox(STYLES); fontSizeComboBox = new UIComboBox(FRFontPane.Font_Sizes); this.add(row( @@ -50,4 +38,13 @@ public class FontSizeStylePane extends JPanel { flex(0.2) ).getComponent()); } + + /** + * Populate + * @param frFont + */ + public void populate(FRFont frFont) { + fontComboBox.setSelectedItem(STYLES[frFont.getStyle()]); + fontSizeComboBox.setSelectedItem(frFont.getSize()); + } } 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 bef5d2905b..8ceab59960 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 @@ -76,8 +76,16 @@ "chtFile": "filetree/filetype/chtFile.svg", "classFile": "filetree/filetype/classFile.svg", "cpt_locked": "filetree/filetype/cpt_locked.svg", - "excel_import": "filetree/filetype/excel_import.svg", - "excelFile": "filetree/filetype/excelFile.svg", + "excel_import": { + "normal": "filetree/filetype/excel_import.svg", + "disable": "filetree/filetype/excel_import_disable.svg", + "white": "filetree/filetype/excel_import_white.svg" + }, + "excelFile": { + "normal": "filetree/filetype/excelFile.svg", + "disable": "filetree/filetype/excelFile_disable.svg", + "white": "filetree/filetype/excelFile_white.svg" + }, "flashFile": "filetree/filetype/flashFile.svg", "frm_locked": "filetree/filetype/frm_locked.svg", "fvs_locked": "filetree/filetype/fvs_locked.svg", @@ -88,15 +96,35 @@ "jpgFile": "filetree/filetype/jpgFile.svg", "jsFile": "filetree/filetype/jsFile.svg", "jspFile": "filetree/filetype/jspFile.svg", - "pdfFile": "filetree/filetype/pdfFile.svg", + "pdfFile": { + "normal": "filetree/filetype/pdfFile.svg", + "disable": "filetree/filetype/pdfFile_disable.svg", + "white": "filetree/filetype/pdfFile_white.svg" + }, "pngFile": "filetree/filetype/pngFile.svg", "sqlFile": "filetree/filetype/sqlFile.svg", - "wordFile": "filetree/filetype/wordFile.svg", + "wordFile": { + "normal": "filetree/filetype/wordFile.svg", + "disable": "filetree/filetype/wordFile_disable.svg", + "white": "filetree/filetype/wordFile_white.svg" + }, "xlsFile": "filetree/filetype/xlsFile.svg", "xmlFile": "filetree/filetype/xmlFile.svg", - "csvFile": "filetree/filetype/csvFile.svg", - "svgFile": "filetree/filetype/svgFile.svg", - "txtFile": "filetree/filetype/txtFile.svg", + "csvFile": { + "normal": "filetree/filetype/csvFile.svg", + "disable": "filetree/filetype/csvFile_disable.svg", + "white": "filetree/filetype/csvFile_white.svg" + }, + "svgFile": { + "normal": "filetree/filetype/svgFile.svg", + "disable": "filetree/filetype/svgFile_disable.svg", + "white": "filetree/filetype/svgFile_white.svg" + }, + "txtFile": { + "normal": "filetree/filetype/txtFile.svg", + "disable": "filetree/filetype/txtFile_disable.svg", + "white": "filetree/filetype/txtFile_white.svg" + }, "cellattr": "propertiestab/cellattr.svg", "cellattr_disabled": "propertiestab/cellattr_disabled.svg", "cellattr_selected": "propertiestab/cellattr_selected.svg", diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java index 48ba6f2d5e..1b1eeffded 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java @@ -46,7 +46,7 @@ public class ChartPropertyPane extends BaseChartPropertyPane { this.setLayout(new BorderLayout()); this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); // 外部轮廓大小固定,适配滚动面板 - this.setPreferredSize(new Dimension(getWidth(), FineUIScale.scale(900))); + this.setPreferredSize(new Dimension(getWidth(), FineUIScale.scale(800))); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java index abe44f4461..9dce2aa9a1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java @@ -94,7 +94,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl @Override protected Icon getButtonIcon() { - return new LazyIcon("delete"); + return new LazyIcon("remove"); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java index 9a7911fb17..e424b1f636 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java @@ -31,7 +31,7 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse protected UIObserverListener listener; public TinyFormulaWithButtonPane(String text) { - this(text, new LazyIcon("delete")); + this(text, new LazyIcon("remove")); } public TinyFormulaWithButtonPane(String text, Icon icon) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java index 86852ffd45..cecf40a981 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java @@ -119,8 +119,8 @@ public class DesensitizationCellPane extends BasicBeanPane { private void setInsideBorder(Color borderColor) { ruleButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, borderColor)); - emptyTextField.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, borderColor)); - ruleTextField.setBorder(FineBorderFactory.createDefaultUnderlineBorder()); + emptyTextField.setBorder(FineBorderFactory.createBorderWithPadding(BorderFactory.createMatteBorder(0, 0, 0, 1, borderColor))); + ruleTextField.setBorder(FineBorderFactory.createBorderWithPadding(FineBorderFactory.createDefaultUnderlineBorder())); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java index a287c2ef29..6dd020e555 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java @@ -4,6 +4,7 @@ import com.fine.theme.utils.FineUIScale; import com.fr.base.CellBorderStyle; import com.fr.base.NameStyle; import com.fr.base.Style; +import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; @@ -33,6 +34,9 @@ import java.text.Format; 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; + public class StylePane extends BasicPane implements UIObserver { public static final String[] FOLLOWING_THEME_STRING_ARRAYS = new String[]{ Toolkit.i18nText("Fine-Design_Style_Follow_Theme"), @@ -158,9 +162,8 @@ public class StylePane extends BasicPane implements UIObserver { JPanel container = new JPanel(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Style_Applying")); uiLabel.setPreferredSize(new Dimension(uiLabel.getPreferredSize().width, FineUIScale.scale(20))); - container.add(uiLabel, BorderLayout.NORTH); nameStyleListPane.setBorder(BorderFactory.createEmptyBorder()); - container.add(nameStyleListPane, BorderLayout.CENTER); + container.add(column(LayoutConstants.VERTICAL_GAP, cell(uiLabel), cell(nameStyleListPane)).getComponent()); return container; }