Browse Source

Merge remote-tracking branch 'origin/fbp/release' into fbp/release

fbp/release
Destiny.Lin 2 months ago
parent
commit
ff591ffe05
  1. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  2. 4
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  3. 6
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  4. 28
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  5. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  6. 9
      designer-base/src/main/java/com/fr/design/utils/ColorUtils.java
  7. 4
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  8. 3
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  9. 3
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

1
designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java

@ -54,6 +54,7 @@ public interface FineUIStyle {
String GRAY_BUTTON = "grayButton"; String GRAY_BUTTON = "grayButton";
String DETAIL_LABEL = "detailLabel"; String DETAIL_LABEL = "detailLabel";
String WIDGET_EVENT_LABEL = "widgetEventLabel"; String WIDGET_EVENT_LABEL = "widgetEventLabel";
String HYPER_LINK_LABEL = "hyperLinkLabel";
/** /**

4
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -2,7 +2,6 @@ package com.fr.design.condition;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.common.annotations.Open; import com.fr.common.annotations.Open;
@ -90,7 +89,8 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
this.add(FineUIUtils.wrapComponentWithTitle(column( this.add(FineUIUtils.wrapComponentWithTitle(column(
10, 10,
row(cell(addItemPane), flex()), row(cell(addItemPane), flex()),
cell(selectedItemScrollPane).weight(1).with(it -> it.setBorder(new FineRoundBorder())), cell(selectedItemScrollPane).weight(1).with(
it -> it.setBorder(FineBorderFactory.createWrappedRoundBorder())),
fix(10) fix(10)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")), BorderLayout.NORTH); ).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")), BorderLayout.NORTH);
} }

6
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -1,10 +1,9 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -29,7 +28,6 @@ import javax.swing.DefaultListModel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListModel; import javax.swing.ListModel;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.UIManager;
import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener; import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
@ -102,7 +100,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
@Override @Override
protected void initLeftPane(JPanel leftPane) { protected void initLeftPane(JPanel leftPane) {
leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER); leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder()); leftPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
} }

28
designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java

@ -43,7 +43,7 @@ public class FineTabbedPane extends Box {
private final UIButtonGroup<String> tabGroup; private final UIButtonGroup<String> tabGroup;
private final Map<String, JComponent> tabComponents; private final Map<String, JComponent> tabComponents;
private final int[] tabLayout; private final int[] tabLayout;
private final boolean useFitTab ; private final boolean useFitTab;
private FineTabbedPane(Map<String, JComponent> tabComponents, float headRatio, int[] tabLayout, boolean useFitTab) { private FineTabbedPane(Map<String, JComponent> tabComponents, float headRatio, int[] tabLayout, boolean useFitTab) {
this.headRatio = headRatio; this.headRatio = headRatio;
@ -142,35 +142,45 @@ public class FineTabbedPane extends Box {
initCoreComponents(); initCoreComponents();
setMatchParentSize(true); setMatchParentSize(true);
float flexRatio = (1 - headRatio) / 2; float flexRatio = (1 - headRatio) / 2;
int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight",24) * tabLayout.length / 2; int headHeight = FlatUIUtils.getUIInt("Component.defaultHeight", 24) * tabLayout.length / 2;
Component component = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent(); Component tabRow = useFitTab ? row(flex(), cell(tabGroup), flex()).getComponent() : row(flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)).getComponent();
Component backgroundComp = createBackGroundComp();
add( add(
column( column(
cell(component), cell(tabRow),
flex() cell(centerPane).with(it -> it.setBorder(new ScaledEmptyBorder(10, 10, 10, 10))).weight(1)
), ),
column( column(
fix(headHeight), fix(headHeight),
cell(centerPane).with(it -> it.setBorder(new ScaledEmptyBorder(headHeight + 10, 10, 10, 10))).weight(1) cell(backgroundComp).weight(1)
) )
); );
fillBackgroundColor(); fillBackgroundColor();
} }
private Component createBackGroundComp() {
JPanel pane = new JPanel();
pane.putClientProperty(PANEL_TYPE, ROUNDED_PANEL);
pane.setBackground(getFillColor());
return pane;
}
private void initCoreComponents() { private void initCoreComponents() {
cards = new CardLayout(); cards = new CardLayout();
centerPane = new JPanel(cards); centerPane = new JPanel(cards);
centerPane.putClientProperty(PANEL_TYPE, ROUNDED_PANEL);
tabComponents.forEach((key, value) -> { tabComponents.forEach((key, value) -> {
value.setOpaque(false); value.setOpaque(false);
centerPane.add(value, key); centerPane.add(value, key);
}); });
} }
private Color getFillColor() {
return FineUIUtils.getUIColor("FineTabbedPane.background", "fill.gray");
}
private void fillBackgroundColor() { private void fillBackgroundColor() {
Color fillColor = FineUIUtils.getUIColor("FineTabbedPane.background", "fill.gray");
Color defaultColor = FineUIUtils.getUIColor("default.background", "Component.background"); Color defaultColor = FineUIUtils.getUIColor("default.background", "Component.background");
ColorUtils.syncBackgroundIfAbsent(centerPane, fillColor, defaultColor); ColorUtils.syncBackgroundIfAbsent(centerPane, getFillColor(), defaultColor);
} }
private void initListeners() { private void initListeners() {

7
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java

@ -14,13 +14,12 @@ import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNameObserver { public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNameObserver {
private static final long serialVersionUID = -8681716725163358249L; private static final long serialVersionUID = -8681716725163358249L;
private static double DRAG_BAR_WEIGHT = 0.64; private static double DRAG_BAR_WEIGHT = 0.6;
private static double SPINNER_WIGHT = 0.36; private static double SPINNER_WIGHT = 0.4;
private UISlider dragBar; private UISlider dragBar;
private UISpinner spinner; private UISpinner spinner;
private boolean isEditing = false; private boolean isEditing = false;
@ -49,7 +48,7 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
spinner.setValue(dragBar.getValue()); spinner.setValue(dragBar.getValue());
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(Layouts.row( this.add(Layouts.row(
cell(dragBar).weight(DRAG_BAR_WEIGHT), fix(2), cell(spinner).weight(SPINNER_WIGHT) cell(dragBar).weight(DRAG_BAR_WEIGHT), fix(8), cell(spinner).weight(SPINNER_WIGHT)
).getComponent()); ).getComponent());
dragBar.addChangeListener(e -> { dragBar.addChangeListener(e -> {
if (globalNameListener != null && shouldResponseNameListener()) { if (globalNameListener != null && shouldResponseNameListener()) {

9
designer-base/src/main/java/com/fr/design/utils/ColorUtils.java

@ -7,6 +7,8 @@ import javax.swing.JScrollPane;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.event.ContainerAdapter;
import java.awt.event.ContainerEvent;
import java.util.Arrays; import java.util.Arrays;
/** /**
@ -53,6 +55,13 @@ public class ColorUtils {
if (components != null) { if (components != null) {
Arrays.stream(components).forEach((e) -> syncBackgroundIfAbsent(e, replaceColor, defaultColor)); Arrays.stream(components).forEach((e) -> syncBackgroundIfAbsent(e, replaceColor, defaultColor));
} }
container.addContainerListener(new ContainerAdapter() {
@Override
public void componentAdded(ContainerEvent e) {
Component addedComponent = e.getChild();
syncBackgroundIfAbsent(addedComponent, replaceColor, defaultColor);
}
});
} }
} }

4
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -1,11 +1,11 @@
package com.fr.design.web; package com.fr.design.web;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.Icon; import com.fr.base.Icon;
import com.fr.base.IconManager; import com.fr.base.IconManager;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
@ -90,7 +90,7 @@ public class CustomIconPane extends BasicPane {
UILabel iconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")); UILabel iconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel noNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel noNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
noNamePane.setBorder(new FineRoundBorder()); noNamePane.setBorder(FineBorderFactory.createWrappedRoundBorder());
noNamePane.setBackground(Color.WHITE); noNamePane.setBackground(Color.WHITE);
iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();

3
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -1427,3 +1427,6 @@ chart.selectedBorderColor = #2576EF
[style]Label.widgetEventLabel = \ [style]Label.widgetEventLabel = \
foreground: $List.wrapper.text.fontColor; \ foreground: $List.wrapper.text.fontColor; \
background: $fill.normal; background: $fill.normal;
[style]Label.hyperLinkLabel = \
foreground: $brand.normal;

3
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -2,6 +2,7 @@ package com.fr.design.report;
import com.fanruan.cloud.FanruanCloud; import com.fanruan.cloud.FanruanCloud;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
@ -221,7 +222,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
UILabel downExplainLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference")); UILabel downExplainLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Report_Detail_Reference"));
downExplainLabel.setForeground(new Color(0, 0, 0)); downExplainLabel.setForeground(new Color(0, 0, 0));
JLabel helper = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Community_Help")); JLabel helper = new FRExplainLabel(Toolkit.i18nText("Fine-Design_Report_Community_Help"));
helper.setForeground(new Color(1, 159, 222)); FineUIStyle.setStyle(helper, FineUIStyle.HYPER_LINK_LABEL);
helper.addMouseListener(new MouseAdapter() { helper.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {

Loading…
Cancel
Save