Browse Source

Pull request #15096: REPORT-137896 & REPORT-137712 & REPORT-135889 & REPORT-137786 & REPORT-137586 fix: NewUI冒烟问题修复

Merge in DESIGN/design from ~LEVY.XIE/design:fbp/release to fbp/release

* commit 'ab13a84103d2989ce4f2667f614ac9c8267b82d7':
  REPORT-137586 fix: 控件背景交互逻辑修复
  REPORT-137786 fix: comboBox提供最大尺寸及下拉框大小计算逻辑优化
  REPORT-135889 fix: 去除西区折叠面板点击事件
  REPORT-137712 fix: 控件对齐面板翻新
  REPORT-137896 fix:checkBoxList边框问题修复
  Revert "REPORT-135888 fix:高分屏启动页缩放适配"
  REPORT-135888 fix:高分屏启动页缩放适配
fbp/release
Levy.Xie-解安森 1 month ago
parent
commit
75aab9dd50
  1. 50
      designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java
  2. 15
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  3. 7
      designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxList.java
  4. 10
      designer-base/src/main/java/com/fr/design/widget/component/BackgroundCompPane.java
  5. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align.svg
  6. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align_disable.svg
  7. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center.svg
  8. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center_disable.svg
  9. 8
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute.svg
  10. 5
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute_disable.svg
  11. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align.svg
  12. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align_disable.svg
  13. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align.svg
  14. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align_disable.svg
  15. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align.svg
  16. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align_disable.svg
  17. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center.svg
  18. 4
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center_disable.svg
  19. 8
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute.svg
  20. 5
      designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute_disable.svg
  21. 11
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  22. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  23. 18
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  24. 19
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java
  25. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java
  26. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java
  27. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java
  28. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java
  29. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java
  30. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java
  31. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java
  32. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java
  33. 97
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java

50
designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java

@ -2,16 +2,21 @@ package com.fine.theme.light.ui;
import com.fine.theme.utils.FineClientProperties;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatComboBoxUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
import org.jetbrains.annotations.Nullable;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
/**
* 提供 {@link javax.swing.JComboBox} 的UI类
@ -47,8 +52,10 @@ public class FineComboBoxUI extends FlatComboBoxUI {
@Override
public Dimension getMinimumSize(JComponent c) {
// ComboBox基于子组件计算适配尺寸性能一般,仅考虑部分ComboBox进行适配计算,其他采用默认值
if (FineClientProperties.ADAPTIVE_COMBO_BOX.equals(getComboBoxTypeStr(c))) {
return super.getMinimumSize(c);
if (isAdaptiveComboBox(c)) {
Dimension dimension = super.getMinimumSize(c);
return new Dimension(Math.min(dimension.width,
FineUIUtils.getAndScaleInt("ComboBox.maximumWidth", 400)), dimension.height);
}
return FineUIScale.scale(new Dimension(
FlatUIUtils.getUIInt("ComboBox.minimumWidth", 72),
@ -56,12 +63,41 @@ public class FineComboBoxUI extends FlatComboBoxUI {
));
}
@Nullable
static String getComboBoxTypeStr(JComponent c) {
static boolean isAdaptiveComboBox(JComponent c) {
Object value = c.getClientProperty(FineClientProperties.COMBO_BOX_TYPE);
if (value instanceof String) {
return (String) value;
return FineClientProperties.ADAPTIVE_COMBO_BOX.equals(value);
}
return false;
}
@Override
protected ComboPopup createPopup() {
return new FineComboPopup(this.comboBox);
}
protected class FineComboPopup extends FlatComboPopup {
protected FineComboPopup(JComboBox combo) {
super(combo);
}
@Override
protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
Rectangle fitRectangle = super.computePopupBounds(px, py, pw, ph);
// 限制最大宽度,如超出则高度预留展示横向滚动条所需宽度
int comboWidth = comboBox.getWidth();
if (fitRectangle.width > comboWidth) {
return new Rectangle(px, py, comboWidth, fitRectangle.height + FlatUIUtils.getUIInt("ScrollBar.width", 10));
}
return fitRectangle;
}
@Override
protected JScrollPane createScroller() {
return new JScrollPane( list,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
return null;
}
}

15
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -452,21 +452,6 @@ public class UIResizableContainer extends JPanel {
repaint();
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getY() <= ARROW_RANGE_VERTICAL) {
if (containerWidth == toolPaneHeight) {
containerWidth = preferredWidth;
} else {
setPreferredWidth(containerWidth);
containerWidth = toolPaneHeight;
}
refreshContainer();
if (DesignModeContext.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();
}
}
}
});
}

7
designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxList.java

@ -256,13 +256,6 @@ public class CheckBoxList extends JComponent {
this.setBackground(list.getBackground());
this.setForeground(list.getForeground());
}
if (cellHasFocus) {
this.setBorder(UIManager.getBorder("List.focusCellHighlightBorder"));
} else {
this.setBorder(NO_FOCUS_BORDER);
}
return this;
}
}

10
designer-base/src/main/java/com/fr/design/widget/component/BackgroundCompPane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.component;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
@ -12,7 +13,6 @@ import javax.swing.JPanel;
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.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
@ -40,26 +40,24 @@ public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
backgroundHead = new UIButtonGroup(titles);
panel = column(VERTICAL_GAP,
row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial"))).weight(RIGHT_WEIGHT / 2),
cell(initialBackgroundEditor).weight(RIGHT_WEIGHT / 2)
),
row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over"))).weight(RIGHT_WEIGHT / 2),
cell(overBackgroundEditor).weight(RIGHT_WEIGHT / 2)
),
row(
flex(LEFT_WEIGHT),
cell(getClickLabel()).weight(RIGHT_WEIGHT / 2),
cell(clickBackgroundEditor).weight(RIGHT_WEIGHT / 2)
)
).getComponent();
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent();
this.add(column(VERTICAL_GAP,
row(
cell(headLabel).weight(LEFT_WEIGHT),
cell(backgroundHead).weight(RIGHT_WEIGHT)
)
),
cell(panel)
).getComponent());
}

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20 2C20.5523 2 21 2.44772 21 3L21 25C21 25.5523 20.5523 26 20 26H12C11.4477 26 11 25.5523 11 25L11 3C11 2.44772 11.4477 2 12 2L20 2Z" fill="#5493F2"/>
<path d="M30 29C30 29.5523 29.5523 30 29 30L3 30C2.44772 30 2 29.5523 2 29C2 28.4477 2.44772 28 3 28L29 28C29.5523 28 30 28.4477 30 29Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 437 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_bottom_align_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20 2C20.5523 2 21 2.44772 21 3L21 25C21 25.5523 20.5523 26 20 26H12C11.4477 26 11 25.5523 11 25L11 3C11 2.44772 11.4477 2 12 2L20 2Z" fill="#A3ADBD"/>
<path d="M30 29C30 29.5523 29.5523 30 29 30L3 30C2.44771 30 2 29.5523 2 29C2 28.4477 2.44772 28 3 28L29 28C29.5523 28 30 28.4477 30 29Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 418 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 2C17.5523 2 18 2.44772 18 3L18 29C18 29.5523 17.5523 30 17 30H15C14.4477 30 14 29.5523 14 29L14 3C14 2.44771 14.4477 2 15 2L17 2Z" fill="#A3ADBD"/>
<path d="M30 21C30 21.5523 29.5523 22 29 22L3 22C2.44771 22 2 21.5523 2 21L2 11C2 10.4477 2.44772 10 3 10L29 10C29.5523 10 30 10.4477 30 11V21Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 426 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_center_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 2C17.5523 2 18 2.44772 18 3L18 29C18 29.5523 17.5523 30 17 30H15C14.4477 30 14 29.5523 14 29L14 3C14 2.44771 14.4477 2 15 2L17 2Z" fill="#CFD4DC"/>
<path d="M30 21C30 21.5523 29.5523 22 29 22L3 22C2.44771 22 2 21.5523 2 21L2 11C2 10.4477 2.44772 10 3 10L29 10C29.5523 10 30 10.4477 30 11V21Z" fill="#A3ADBD"/>
</svg>

After

Width:  |  Height:  |  Size: 426 B

8
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute.svg

@ -0,0 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 28C11.4477 28 11 27.5523 11 27L11 5C11 4.44772 11.4477 4 12 4L20 4C20.5523 4 21 4.44771 21 5L21 27C21 27.5523 20.5523 28 20 28H12Z" fill="#A3ADBD"/>
<path d="M12 28C11.4477 28 11 27.5523 11 27L11 5C11 4.44772 11.4477 4 12 4L20 4C20.5523 4 21 4.44771 21 5L21 27C21 27.5523 20.5523 28 20 28H12Z" fill="#105DD1"/>
<path d="M5 2C5.55229 2 6 2.44772 6 3L6 29C6 29.5523 5.55228 30 5 30H3C2.44772 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2L5 2Z" fill="#CFD4DC"/>
<path d="M5 2C5.55229 2 6 2.44772 6 3L6 29C6 29.5523 5.55228 30 5 30H3C2.44772 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2L5 2Z" fill="#5493F2"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30H27C26.4477 30 26 29.5523 26 29L26 3C26 2.44771 26.4477 2 27 2L29 2Z" fill="#CFD4DC"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30H27C26.4477 30 26 29.5523 26 29L26 3C26 2.44771 26.4477 2 27 2L29 2Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

5
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_horizontal_distribute_disable.svg

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 28C11.4477 28 11 27.5523 11 27L11 5C11 4.44772 11.4477 4 12 4L20 4C20.5523 4 21 4.44771 21 5L21 27C21 27.5523 20.5523 28 20 28H12Z" fill="#A3ADBD"/>
<path d="M5 2C5.55229 2 6 2.44772 6 3L6 29C6 29.5523 5.55228 30 5 30H3C2.44772 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2L5 2Z" fill="#CFD4DC"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30H27C26.4477 30 26 29.5523 26 29L26 3C26 2.44771 26.4477 2 27 2L29 2Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 574 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 2C3.55229 2 4 2.44772 4 3L4 29C4 29.5523 3.55228 30 3 30C2.44771 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M6 12C6 11.4477 6.44772 11 7 11H29C29.5523 11 30 11.4477 30 12V20C30 20.5523 29.5523 21 29 21H7C6.44772 21 6 20.5523 6 20V12Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_left_align_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 2C3.55229 2 4 2.44772 4 3L4 29C4 29.5523 3.55228 30 3 30C2.44771 30 2 29.5523 2 29L2 3C2 2.44771 2.44772 2 3 2Z" fill="#CFD4DC"/>
<path d="M6 12C6 11.4477 6.44772 11 7 11H29C29.5523 11 30 11.4477 30 12V20C30 20.5523 29.5523 21 29 21H7C6.44772 21 6 20.5523 6 20V12Z" fill="#A3ADBD"/>
</svg>

After

Width:  |  Height:  |  Size: 398 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 12C2 11.4477 2.44772 11 3 11H25C25.5523 11 26 11.4477 26 12V20C26 20.5523 25.5523 21 25 21H3C2.44772 21 2 20.5523 2 20V12Z" fill="#5493F2"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30C28.4477 30 28 29.5523 28 29L28 3C28 2.44771 28.4477 2 29 2Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 428 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_right_align_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 12C2 11.4477 2.44772 11 3 11H25C25.5523 11 26 11.4477 26 12V20C26 20.5523 25.5523 21 25 21H3C2.44772 21 2 20.5523 2 20V12Z" fill="#A3ADBD"/>
<path d="M29 2C29.5523 2 30 2.44772 30 3L30 29C30 29.5523 29.5523 30 29 30C28.4477 30 28 29.5523 28 29L28 3C28 2.44771 28.4477 2 29 2Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 409 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 30C11.4477 30 11 29.5523 11 29L11 7C11 6.44772 11.4477 6 12 6L20 6C20.5523 6 21 6.44772 21 7L21 29C21 29.5523 20.5523 30 20 30H12Z" fill="#5493F2"/>
<path d="M2 3C2 2.44771 2.44772 2 3 2H29C29.5523 2 30 2.44771 30 3C30 3.55228 29.5523 4 29 4H3C2.44771 4 2 3.55228 2 3Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 422 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_top_align_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 30C11.4477 30 11 29.5523 11 29L11 7C11 6.44772 11.4477 6 12 6L20 6C20.5523 6 21 6.44771 21 7V29C21 29.5523 20.5523 30 20 30H12Z" fill="#A3ADBD"/>
<path d="M2 3C2 2.44771 2.44772 2 3 2H29C29.5523 2 30 2.44771 30 3C30 3.55228 29.5523 4 29 4H3C2.44771 4 2 3.55228 2 3Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 400 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 15C2 14.4477 2.44772 14 3 14H29C29.5523 14 30 14.4477 30 15V17C30 17.5523 29.5523 18 29 18H3C2.44771 18 2 17.5523 2 17V15Z" fill="#A3ADBD"/>
<path d="M21 2C21.5523 2 22 2.44772 22 3L22 29C22 29.5523 21.5523 30 21 30H11C10.4477 30 10 29.5523 10 29L10 3C10 2.44771 10.4477 2 11 2L21 2Z" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

4
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_center_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 15C2 14.4477 2.44772 14 3 14H29C29.5523 14 30 14.4477 30 15V17C30 17.5523 29.5523 18 29 18H3C2.44771 18 2 17.5523 2 17V15Z" fill="#CFD4DC"/>
<path d="M21 2C21.5523 2 22 2.44772 22 3L22 29C22 29.5523 21.5523 30 21 30H11C10.4477 30 10 29.5523 10 29L10 3C10 2.44771 10.4477 2 11 2L21 2Z" fill="#A3ADBD"/>
</svg>

After

Width:  |  Height:  |  Size: 417 B

8
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute.svg

@ -0,0 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="11" width="24" height="10" rx="1" fill="#A3ADBD"/>
<rect x="4" y="11" width="24" height="10" rx="1" fill="#105DD1"/>
<rect x="30" y="6" width="28" height="4" rx="1" transform="rotate(-180 30 6)" fill="#CFD4DC"/>
<rect x="30" y="6" width="28" height="4" rx="1" transform="rotate(-180 30 6)" fill="#5493F2"/>
<rect x="30" y="30" width="28" height="4" rx="1" transform="rotate(-180 30 30)" fill="#CFD4DC"/>
<rect x="30" y="30" width="28" height="4" rx="1" transform="rotate(-180 30 30)" fill="#5493F2"/>
</svg>

After

Width:  |  Height:  |  Size: 619 B

5
designer-base/src/main/resources/com/fine/theme/icon/arrange/arrange_vertical_distribute_disable.svg

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4 12C4 11.4477 4.44772 11 5 11H27C27.5523 11 28 11.4477 28 12V20C28 20.5523 27.5523 21 27 21H5C4.44772 21 4 20.5523 4 20V12Z" fill="#A3ADBD"/>
<path d="M30 5C30 5.55229 29.5523 6 29 6L3 6C2.44771 6 2 5.55228 2 5L2 3C2 2.44772 2.44772 2 3 2L29 2C29.5523 2 30 2.44772 30 3V5Z" fill="#CFD4DC"/>
<path d="M30 29C30 29.5523 29.5523 30 29 30L3 30C2.44771 30 2 29.5523 2 29L2 27C2 26.4477 2.44772 26 3 26L29 26C29.5523 26 30 26.4477 30 27V29Z" fill="#CFD4DC"/>
</svg>

After

Width:  |  Height:  |  Size: 567 B

11
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -472,7 +472,14 @@
"layout_top_right": "layout/layout_top_right.svg",
"theme_edit": "theme_edit.svg",
"folder_half_authority" : "filetree/folder_half_authority.svg",
"folder_half_authority_open" : "filetree/folder_half_authority_open.svg"
"folder_half_authority_open" : "filetree/folder_half_authority_open.svg",
"arrange_left_align": "arrange/arrange_left_align.svg",
"arrange_horizontal_center": "arrange/arrange_horizontal_center.svg",
"arrange_right_align": "arrange/arrange_right_align.svg",
"arrange_top_align": "arrange/arrange_top_align.svg",
"arrange_vertical_center": "arrange/arrange_vertical_center.svg",
"arrange_bottom_align": "arrange/arrange_bottom_align.svg",
"arrange_horizontal_distribute": "arrange/arrange_horizontal_distribute.svg",
"arrange_vertical_distribute": "arrange/arrange_vertical_distribute.svg"
}
}

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

@ -302,6 +302,7 @@ ColorChooser.swatchesDefaultRecentColor = $control
ComboBox.border = com.fine.theme.light.ui.FineRoundBorder
ComboBox.padding = @componentMargin
ComboBox.minimumWidth = 72
ComboBox.maximumWidth = 400
ComboBox.editorColumns = 0
ComboBox.maximumRowCount = 15
[mac]ComboBox.showPopupOnNavigation = true

18
designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java

@ -1,7 +1,6 @@
package com.fr.design.chartx.component;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chartx.TwoTuple;
@ -48,8 +47,8 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.theme.utils.FineClientProperties.ADAPTIVE_COMBO_BOX;
import static com.fine.theme.utils.FineClientProperties.COMBO_BOX_TYPE;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
/**
@ -102,12 +101,13 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
}
private JPanel createContentPane() {
tableNameCombox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
areaNameBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
return FineLayoutBuilder.createHorizontalLayout(10,
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":"), tableNameCombox,
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":"), areaNameBox,
refreshLabel);
return row(10,
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data") + ":")),
cell(tableNameCombox).weight(1),
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Name") + ":")),
cell(areaNameBox).weight(1),
cell(refreshLabel)
).getComponent();
}
private void initTable(TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems) {

19
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java

@ -1,10 +1,13 @@
package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -16,11 +19,21 @@ public abstract class AbstractMultiSelectionArrangementButton extends UIButton i
public AbstractMultiSelectionArrangementButton(MultiSelectionArrangement arrangement) {
super();
this.arrangement = arrangement;
this.setNormalPainted(false);
this.setBorderPaintedOnlyWhenPressed(true);
this.setIcon(getIcon());
this.setToolTipText(getTipText());
this.addActionListener(getActionListener());
setBorderPainted(false);
setBackground(null);
setBackground(null);
}
@Override
public Icon getIcon() {
LazyIcon icon = new LazyIcon(getIconId());
return isEnabled() ? icon : icon.disabled();
}
public String getIconId() {
return StringUtils.EMPTY;
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2397455240682353024L;
@ -15,8 +12,8 @@ public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_bottom_align.png");
public String getIconId() {
return "arrange_bottom_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 6290178236460051049L;
@ -15,8 +12,8 @@ public class HorizontalCenterButton extends AbstractMultiSelectionArrangementBut
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_center_align.png");
public String getIconId() {
return "arrange_horizontal_center";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 5052092252720664954L;
@ -15,8 +12,8 @@ public class HorizontalDistributionButton extends AbstractMultiSelectionArrangem
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_auto_spacing.png");
public String getIconId() {
return "arrange_horizontal_distribute";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8177637788632733710L;
@ -15,8 +12,8 @@ public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_left_align.png");
public String getIconId() {
return "arrange_left_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8698936349956288409L;
@ -15,8 +12,8 @@ public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_right_align.png");
public String getIconId() {
return "arrange_right_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2896267783075870924L;
@ -15,8 +12,8 @@ public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_top_align.png");
public String getIconId() {
return "arrange_top_align";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton {
public VerticalCenterButton(MultiSelectionArrangement arrangement) {
@ -13,8 +10,8 @@ public class VerticalCenterButton extends AbstractMultiSelectionArrangementButto
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_center_align.png");
public String getIconId() {
return "arrange_vertical_center";
}
@Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java

@ -3,9 +3,6 @@ package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils;
import javax.swing.Icon;
public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton {
public VerticalDistributionButton(MultiSelectionArrangement arrangement) {
@ -13,8 +10,8 @@ public class VerticalDistributionButton extends AbstractMultiSelectionArrangemen
}
@Override
public Icon getIcon() {
return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_auto_spacing.png");
public String getIconId() {
return "arrange_vertical_distribute";
}
@Override

97
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java

@ -1,5 +1,8 @@
package com.fr.design.mainframe.widget.ui;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ibutton.UIButton;
@ -24,7 +27,6 @@ import com.fr.general.IOUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -43,93 +45,46 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane {
public void initPropertyPane() {
arrangement = new MultiSelectionArrangement(designer);
content.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0));
content.add(createArrangementLayoutPane(), BorderLayout.CENTER);
this.listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_RESIZED);
}
};
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.listener = () -> designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_RESIZED);
}
// 整个排列分布面板的layout,可以看成一个三行一列的表格,第一行是分布,第二行是自动间距,第三行是手动间距
/**
* 整个排列分布面板的layout可以看成一个两行一列的表格第一行是分布第二行是自动间距
*/
private JPanel createArrangementLayoutPane() {
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] columnSize = {TableLayout.PREFERRED};
Component[][] components = new Component[][] {
new Component[] {
createAlignmentPane()
},
new Component[] {
createAutoSpacingPane()
}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 16);
return FineLayoutBuilder.createVerticalLayout(10, createAlignmentPane(), createAutoSpacingPane());
}
// 对齐
private JPanel createAlignmentPane() {
double[] rowSize = {TableLayout.PREFERRED};
double[] columnSize = {
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED,
TableLayout.PREFERRED
};
Component[][] components = new Component[][] {
new Component[] {
new LeftAlignButton(arrangement),
new HorizontalCenterButton(arrangement),
new RightAlignButton(arrangement),
new TopAlignButton(arrangement),
new VerticalCenterButton(arrangement),
new BottomAlignButton(arrangement)
}
};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 18, 0);
JPanel centerPane = FineLayoutBuilder.createHorizontalLayout(16,
new LeftAlignButton(arrangement),
new HorizontalCenterButton(arrangement),
new RightAlignButton(arrangement),
new TopAlignButton(arrangement),
new VerticalCenterButton(arrangement),
new BottomAlignButton(arrangement));
return createTitleLayout(Toolkit.i18nText("Fine-Design_Multi_Selection_Align"), centerPane);
}
// 自动间距
private JPanel createAutoSpacingPane() {
double[] rowSize = {TableLayout.PREFERRED};
double[] columnSize = {
TableLayout.PREFERRED,
TableLayout.PREFERRED
};
UIButton horizontalAutoSpacingBtn = new HorizontalDistributionButton(arrangement);
UIButton verticalAutoSpacingBtn = new VerticalDistributionButton(arrangement);
if (designer.getSelectionModel().getSelection().size() < 3) {
horizontalAutoSpacingBtn.setEnabled(false);
verticalAutoSpacingBtn.setEnabled(false);
}
Component[][] components = new Component[][] {
new Component[] {
horizontalAutoSpacingBtn,
verticalAutoSpacingBtn
}
};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 18, 0);
JPanel centerPane = FineLayoutBuilder.createHorizontalLayout(16, horizontalAutoSpacingBtn, verticalAutoSpacingBtn);
UILabel tip = new UILabel(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_auto_spacing_tip.png"));
UILabel tip = new UILabel(new LazyIcon("jumpHelp", 12));
tip.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Spacing_Tip"));
Component[][] titleComponents = new Component[][] {
new Component[] {
new UILabel(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Spacing")),
tip
}
};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(titleComponents, rowSize, columnSize, 5, 0);
JPanel northPane = FineLayoutBuilder.createHorizontalLayout(5, new UILabel(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Spacing")), tip);
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 8));
jPanel.add(northPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
return jPanel;
return FineLayoutBuilder.createVerticalLayout(10, northPane, centerPane);
}
// 手动间距
@ -195,13 +150,11 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane {
}
}
// 创建一个BorderLayout布局,上面是标题,例如“对齐”,下面是个容器
/**
* 创建一个面板上面是标题例如对齐下面是个容器
*/
private JPanel createTitleLayout(String title, JPanel centerPane) {
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 8));
jPanel.add(new UILabel(title), BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
return jPanel;
return FineLayoutBuilder.createVerticalLayout(10, new UILabel(title), centerPane);
}
@Override

Loading…
Cancel
Save