diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index 487cce3d9e..ab0ba9da8b 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java @@ -18,15 +18,16 @@ import com.fr.stable.StringUtils; import javax.swing.DefaultCellEditor; import javax.swing.JPanel; import javax.swing.JTable; +import javax.swing.UIManager; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; @@ -42,7 +43,7 @@ import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.flex; public class EmbeddedTableDataPane extends AbstractTableDataPane { - private static final int MIN_CELL_WIDTH = FineUIScale.scale(30); + private static final int MIN_CELL_WIDTH = 30; private static final int PREVIEW_TABLE_MIN_COLUMN_WIDTH = FineUIScale.scale(75); private static final int PREVIEW_TABLE_WIDTH = FineUIScale.scale(860); private JTable dataJTable ; @@ -250,7 +251,14 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane 1) { + dataJTable.getTableHeader().setPreferredSize(new Dimension(super.getWidth(), FineUIScale.scale((Integer) UIManager.get("Table.rowHeight")))); + } else { + dataJTable.getTableHeader().setPreferredSize(new Dimension(super.getWidth(), FineUIScale.scale(4))); + } } private class DoubleRenderer extends FineTableHeaderUI.TableRenderer { diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java index 4d1b5e69bd..598ec35677 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -43,7 +43,7 @@ public class UIResizableContainer extends JPanel { private int direction; private boolean hasParameterPane; - private static final int MAX_WIDTH = FineUIScale.scale(300); + private static final int MAX_WIDTH = FineUIScale.scale(350); private static final int ARROW_RANGE = FineUIScale.scale(35); private static final int ARROW_RANGE_VERTICAL = FineUIScale.scale(25); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 2dba288ec8..264cfc0016 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -1,6 +1,9 @@ package com.fr.design.mainframe; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIStyle; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; @@ -224,13 +227,15 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt JPanel panel = new JPanel(new BorderLayout()); if (WorkContext.getCurrent().isRoot()) { rightToolBar = new UIToolbar(FlowLayout.RIGHT); - rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); + JPanel contentPane = FineLayoutBuilder.asBorderLayoutWrapped(rightToolBar); + contentPane.setBorder(BorderFactory.createCompoundBorder(new ScaledEmptyBorder(4, 8, 4, 8), + BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR))); rightToolBar.setBorderPainted(true); UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Lock_Status")); - tipLabel.setForeground(Color.GRAY); + FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP); rightToolBar.add(tipLabel); - UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/lock.png")); - button.setRolloverIcon(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/unlock.png")); + UIButton button = new UIButton(new LazyIcon("locked")); + button.setRolloverIcon(new LazyIcon("unlocked")); button.setBorderPainted(false); button.setContentAreaFilled(false); button.set4ToolbarButton(); @@ -243,7 +248,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, - IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"), + new LazyIcon("warning", 20), new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null); if (option == JOptionPane.YES_OPTION) { String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath()); @@ -264,7 +269,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt }); rightToolBar.add(button); refreshRightToolBarBy(TemplateTreePane.getInstance().getFileNode()); - panel.add(rightToolBar, BorderLayout.EAST); + panel.add(contentPane, BorderLayout.EAST); } return panel; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java index d835e2f372..2cde384fdc 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java @@ -86,6 +86,14 @@ public class ColorFillStylePane extends BasicBeanPane { return customPane; } + @Override + public void repaint() { + if (colorAdjustPane != null) { + colorAdjustPane.repaint(); + } + super.repaint(); + } + protected ColorSchemeComboBox createColorSchemeComboBox() { return new ColorSchemeComboBox(); } diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/list/MemberList.java b/designer-base/src/main/java/com/fr/design/remote/ui/list/MemberList.java index 10e99f0e32..e79c3f1492 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/list/MemberList.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/list/MemberList.java @@ -14,12 +14,13 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Vector; +import static com.fine.theme.utils.FineUIScale.scale; + public abstract class MemberList extends JList { - static final int TRIGGER_AREA_X = 270; - static final int TRIGGER_AREA_Y_EACH = 25; + static final int TRIGGER_AREA_Y_EACH = scale(20); - static final int TRIGGER_AREA_WIDTH = 25; - static final int TRIGGER_AREA_HEIGHT = 25; + static final int TRIGGER_AREA_WIDTH = scale(20); + static final int TRIGGER_AREA_HEIGHT = scale(20); public MemberList(DefaultListModel dataModel) { @@ -91,7 +92,7 @@ public abstract class MemberList extends JList { int rX = point.x; int rY = point.y; int index = this.getSelectedIndex(); - int x = TRIGGER_AREA_X; + int x = this.getWidth() - TRIGGER_AREA_WIDTH; int y = TRIGGER_AREA_Y_EACH * index; return x <= rX && rX <= x + TRIGGER_AREA_WIDTH && y <= rY && rY <= y + TRIGGER_AREA_HEIGHT; } diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java index 7a57667532..dd3c86c720 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java @@ -106,7 +106,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo jPanel.add(column( 4, row(cell(buttonGroup), flex()), - cell(scrollPane) + cell(scrollPane).weight(1) ).getComponent()); this.add(jPanel, BorderLayout.CENTER); jPanel.setBorder(new ScaledEmptyBorder(0, 4, 4, 4)); diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java index 25dd2d450e..829a027145 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java @@ -109,7 +109,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver { if (preferSize > size) { maxCountOfRow = size / WIDTH; } else { - maxCountOfRow = defaultMaxCountOfRow; + maxCountOfRow = Math.max(defaultMaxCountOfRow, size / WIDTH); } if (oldMaxCountOfRow != maxCountOfRow) { @@ -130,7 +130,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver { colorButtons.get(j).setLastButton(false); panel.add(colorButtons.get(j)); } - if (i + maxCountOfRow > colorButtons.size()) { + if (i + maxCountOfRow > colorButtons.size() && colorButtons.size() != MAX_BUTTON) { panel.add(new AddColorButton()); this.add(panel); } else if (i + maxCountOfRow == colorButtons.size() && colorButtons.size() != MAX_BUTTON) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java b/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java index 0625a3e1fa..b9a88140d7 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/comp/BorderAttriPane.java @@ -27,11 +27,11 @@ public class BorderAttriPane extends BasicPane { this.setLayout(new BorderLayout()); lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); colorSelectBox = new ColorSelectBox(80); - colorSelectBox.setPreferredSize(FineUIScale.scale(new Dimension(60, 24))); + colorSelectBox.setPreferredSize(FineUIScale.scale(new Dimension(80, 24))); colorSelectBox.setSelectObject(null); this.add(row(10, row(cell(new UILabel(lineString + ":")), cell(lineCombo)), - row(cell(new UILabel(colorSting + ":"))), cell(colorSelectBox)).getComponent(), BorderLayout.WEST); + row(cell(new UILabel(colorSting + ":")), cell(colorSelectBox))).getComponent(), BorderLayout.WEST); } public void setLineColor(Color color) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java index af4be834ae..df211f716e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java @@ -1,12 +1,13 @@ package com.fr.van.chart.column; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.chart.comp.BorderAttriPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; - -import java.awt.Dimension; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; /** * Created by hufan on 2016/8/11. @@ -19,10 +20,9 @@ public class ColumnBorderAttriPane extends BorderAttriPane { } public ColumnBorderAttriPane(String radiusString) { - this.add(new UILabel(radiusString + ":")); radius = new UISpinnerWithPx(0,1000,1,0); - this.add(radius); - radius.setPreferredSize(new Dimension(60, 18)); + this.add(row(cell(new UILabel(radiusString + ":")), cell(radius).weight(1)) + .weight(1).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent()); } public void setRadius(int value) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java index be2f5ff3e3..b16924c591 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.structure.desinger.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.background.ImageBackground; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.frpane.UINumberDragPane; @@ -9,6 +10,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; @@ -59,10 +61,12 @@ public class StructureNodeStylePane extends BasicBeanPane { }; nodeOpacity = new UINumberDragPaneWithPercent(0, 100); - JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Node_Radius"), nodeRadiusType), BorderLayout.NORTH); - nodeRadiusPane = TableLayout4VanChartHelper.createGapTableLayoutPane("", nodeRadius); - jPanel.add(nodeRadiusPane, BorderLayout.CENTER); + Component[][] nodeRadiusTypeCom = new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Node_Radius")), nodeRadiusType}, + new Component[]{null, nodeRadius}, + + }; + JPanel jPanel = FineLayoutBuilder.compatibleTableLayout(10, nodeRadiusTypeCom, new double[]{1.2, 3}); Component[][] components1 = new Component[][]{ new Component[]{null, null}, @@ -72,7 +76,7 @@ public class StructureNodeStylePane extends BasicBeanPane { new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), nodeOpacity} }; - JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components1, rowSize, columnSize); + JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components1, new double[]{1.2, 3}); useImage = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")}); @@ -81,9 +85,9 @@ public class StructureNodeStylePane extends BasicBeanPane { Component[][] components = new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")), useImage}, }; - JPanel useImagePane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, columnSize); + JPanel useImagePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); - JPanel panel2 = new JPanel(new BorderLayout(0, 6)); + JPanel panel2 = FRGUIPaneFactory.createScaledBorderLayout_S_Pane(0, 6); panel2.add(useImagePane, BorderLayout.NORTH); panel2.add(imagePane, BorderLayout.CENTER); @@ -101,13 +105,13 @@ public class StructureNodeStylePane extends BasicBeanPane { } }); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 6)); this.add(panel1, BorderLayout.NORTH); this.add(panel2, BorderLayout.CENTER); } private void checkRadius() { - nodeRadiusPane.setVisible(nodeRadiusType.getSelectedIndex() == 1); + nodeRadius.getParent().setVisible(nodeRadiusType.getSelectedIndex() == 1); } private void checkImagePane() {