Browse Source

Pull request #14773: REPORT-133339 & REPORT-130408

Merge in DESIGN/design from ~RENEKTON/design:fbp/release to fbp/release

* commit '63550c49a7e4f1357391bdd197380858fb4e5ad3':
  缩放以及事件不响应
fbp/merge
Renekton-张世豪 4 months ago
parent
commit
58701b7071
  1. 2
      designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java
  2. 1
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java
  3. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  4. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  5. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java
  6. 18
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

2
designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java

@ -29,7 +29,7 @@ public class UIDayLabel extends UILabel {
public UIDayLabel(Date date, boolean isSmallLabel) { public UIDayLabel(Date date, boolean isSmallLabel) {
setHorizontalAlignment(UILabel.CENTER); setHorizontalAlignment(UILabel.CENTER);
setFont(DesignUtils.getDefaultGUIFont()); setFont(DesignUtils.getDefaultGUIFont().applySize(scale(12)));
this.date = date; this.date = date;
setPreferredSize(scale(new Dimension(30, 18))); setPreferredSize(scale(new Dimension(30, 18)));
if (isSmallLabel) { if (isSmallLabel) {

1
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java

@ -91,7 +91,6 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane {
*/ */
@Override @Override
public void registerChangeListener(final UIObserverListener listener) { public void registerChangeListener(final UIObserverListener listener) {
gradientBar.addChangeListener(new ChangeListenerImpl(listener));
directionPane.addChangeListener(new ChangeListenerImpl(listener)); directionPane.addChangeListener(new ChangeListenerImpl(listener));
} }

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -46,6 +46,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
import static com.fr.design.i18n.Toolkit.i18nText; import static com.fr.design.i18n.Toolkit.i18nText;
/** /**
@ -127,8 +128,8 @@ public class CellStyleListEditPane extends JListControlPane {
this.setCreators(this.createNameableCreators()); this.setCreators(this.createNameableCreators());
initCardPane(); initCardPane();
JPanel leftPane = getLeftPane(); JPanel leftPane = getLeftPane();
leftPane.setPreferredSize(new Dimension(90, 0)); leftPane.setPreferredSize(new Dimension(scale(90), super.getPreferredSize().height));
cardPane.setPreferredSize(new Dimension(270, 0)); cardPane.setPreferredSize(new Dimension(scale(270), super.getPreferredSize().height));
JPanel mainSplitPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel mainSplitPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
mainSplitPane.add(leftPane, BorderLayout.WEST); mainSplitPane.add(leftPane, BorderLayout.WEST);
mainSplitPane.add(cardPane, BorderLayout.CENTER); mainSplitPane.add(cardPane, BorderLayout.CENTER);
@ -292,7 +293,7 @@ public class CellStyleListEditPane extends JListControlPane {
Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); Component component = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (component instanceof NameableListCellRenderer) { if (component instanceof NameableListCellRenderer) {
((NameableListCellRenderer) component).setIcon(null); ((NameableListCellRenderer) component).setIcon(null);
((NameableListCellRenderer) component).setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); ((NameableListCellRenderer) component).setBorder(new ScaledEmptyBorder(0, 4, 0, 0));
} }
return component; return component;
} }

8
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit.cell; package com.fr.design.mainframe.theme.edit.cell;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.CellBorderStyle; import com.fr.base.CellBorderStyle;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.theme.settings.ThemedCellStyle; import com.fr.base.theme.settings.ThemedCellStyle;
@ -24,6 +25,7 @@ import java.awt.Dimension;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
import static com.fr.design.i18n.Toolkit.i18nText; import static com.fr.design.i18n.Toolkit.i18nText;
@ -129,14 +131,14 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override @Override
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0, 10)); this.setLayout(new BorderLayout(0, 10));
this.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4)); this.setBorder(new ScaledEmptyBorder(0, 4, 0, 4));
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewArea = new CellRectangleStylePreviewPane(true); previewArea = new CellRectangleStylePreviewPane(true);
previewArea.setPreferredSize(new Dimension(207, 48)); previewArea.setPreferredSize(scale(new Dimension(207, 48)));
previewPane.setBorder(BorderFactory.createCompoundBorder( previewPane.setBorder(BorderFactory.createCompoundBorder(
BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")), BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")),
BorderFactory.createEmptyBorder(4, 4, 4, 4))); new ScaledEmptyBorder(4, 4, 4, 4)));
previewPane.add(previewArea, BorderLayout.NORTH); previewPane.add(previewArea, BorderLayout.NORTH);
this.add(previewPane, BorderLayout.NORTH); this.add(previewPane, BorderLayout.NORTH);

8
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/AbstractChartStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit.chart; package com.fr.design.mainframe.theme.edit.chart;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.base.theme.settings.ThemedChartStyle;
@ -31,11 +32,8 @@ public abstract class AbstractChartStylePane extends BasicPane {
protected void initPane() { protected void initPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double labelWidth = 90;
double totalWidth = 190; JPanel gapTableLayoutPane = FineLayoutBuilder.compatibleTableLayout(10, getComponent(), new double[]{1.2, 3});
double p = TableLayout.PREFERRED;
double[] columnSize = {labelWidth, totalWidth};
JPanel gapTableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getComponent(), getRows(p), columnSize, 5, LayoutConstants.VGAP_LARGE);
gapTableLayoutPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); gapTableLayoutPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane); UIScrollPane rightTopPane = new UIScrollPane(gapTableLayoutPane);
rightTopPane.setBorder(BorderFactory.createEmptyBorder()); rightTopPane.setBorder(BorderFactory.createEmptyBorder());

18
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.theme.edit.chart; package com.fr.design.mainframe.theme.edit.chart;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -9,6 +11,7 @@ import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.FineUITable;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -24,6 +27,9 @@ import java.awt.Component;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Font; import java.awt.Font;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* @author Bjorn * @author Bjorn
* @version 10.0 * @version 10.0
@ -67,8 +73,8 @@ public class ChartFontPane extends BasicPane {
Component[] components = new Component[]{ Component[] components = new Component[]{
fontSizeComboBox, fontColor, italic, bold fontSizeComboBox, fontColor, italic, bold
}; };
JPanel buttonPane = new JPanel(); JPanel buttonPane = new JPanel(new BorderLayout());
buttonPane.add(GUICoreUtils.createFlowPane(components, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE)); buttonPane.add(row(4, cell(fontSizeComboBox), cell(fontColor), cell(italic), cell(bold)).getComponent());
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(getContentPane(buttonPane), BorderLayout.CENTER); this.add(getContentPane(buttonPane), BorderLayout.CENTER);
@ -77,11 +83,7 @@ public class ChartFontPane extends BasicPane {
} }
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double labelWidth = 90;
double totalWidth = 190;
double p = TableLayout.PREFERRED;
double[] rows = {p, p, p};
double[] columnSize = {labelWidth, totalWidth};
UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT); UILabel text = new UILabel(getUILabelText(), SwingConstants.LEFT);
text.setToolTipText(getUILabelText()); text.setToolTipText(getUILabelText());
Component[][] components = { Component[][] components = {
@ -90,7 +92,7 @@ public class ChartFontPane extends BasicPane {
new Component[]{null, buttonPane} new Component[]{null, buttonPane}
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rows, columnSize, 5, 10); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
public String getUILabelText() { public String getUILabelText() {

Loading…
Cancel
Save