Browse Source

Pull request #14571: REPORT-130803 & REPORT-130794 & REPORT-130779 & REPORT-130717 & REPORT-130669 & REPORT-130852 【NewUI】视觉&测试验收问题修复

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

* commit '4268769dbbc93e529b97d9d348785b1365d20d59':
  REPORT-113994 【NewUI】视觉&测试验收问题修复
  REPORT-113994 【NewUI】视觉&测试验收问题修复
newui
Levy.Xie-解安森 4 months ago
parent
commit
3f57114b39
  1. 27
      designer-base/src/main/java/com/fine/theme/light/ui/RectangleButtonUI.java
  2. 21
      designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java
  3. 16
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  4. 10
      designer-base/src/main/java/com/fine/theme/utils/FineUIConstants.java
  5. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  6. 17
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  7. 1
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  8. 29
      designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java
  9. 4
      designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java
  10. 13
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java
  11. 3
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  12. 50
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  13. 68
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  14. 8
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  15. 95
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  16. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  17. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  18. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java
  19. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java
  20. 2
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java
  21. 2
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  22. 26
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  23. 13
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java
  24. 5
      designer-realize/src/main/java/com/fr/grid/GridCorner.java
  25. 22
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  26. 14
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java

27
designer-base/src/main/java/com/fine/theme/light/ui/RectangleButtonUI.java

@ -1,10 +1,14 @@
package com.fine.theme.light.ui; package com.fine.theme.light.ui;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import javax.swing.AbstractButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import java.awt.*; import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
/** /**
* 矩形按钮UI忽略圆角属性 * 矩形按钮UI忽略圆角属性
@ -20,6 +24,13 @@ public class RectangleButtonUI extends FlatButtonUI {
super(shared); super(shared);
} }
@Override
protected void installDefaults(AbstractButton b) {
super.installDefaults(b);
selectedBackground = FineUIUtils.getUIColor( "East.TabSelectedColor", "fill.deep");
}
@Override @Override
protected void paintBackground(Graphics g, JComponent c) { protected void paintBackground(Graphics g, JComponent c) {
Color background = getBackground(c); Color background = getBackground(c);
@ -36,4 +47,18 @@ public class RectangleButtonUI extends FlatButtonUI {
g2.dispose(); g2.dispose();
} }
} }
@Override
protected Color getBackground(JComponent c) {
if( ((AbstractButton)c).isSelected() ) {
return selectedBackground;
}
return buttonStateColor( c,
getBackgroundBase( c, false ),
disabledBackground,
isCustomBackground( c.getBackground() ) ? null : focusedBackground,
hoverBackground,
pressedBackground );
}
} }

21
designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java

@ -5,6 +5,14 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JPanel;
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;
import static com.fine.theme.utils.FineUIStyle.STYLE_PRIMARY;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/** /**
* 设计器典型组件组合工厂 * 设计器典型组件组合工厂
@ -41,4 +49,17 @@ public class FineComponentsFactory {
return new UIButtonGroup<>(alignmentIconArray, alignment); return new UIButtonGroup<>(alignmentIconArray, alignment);
} }
/**
* 创建确认&取消按钮组间距为8右对齐
*
* @param confirmButton 确认按钮
* @param cancelButton 取消按钮
* @return 确认&取消按钮组面板
*/
public static JPanel createConfirmCancelButtonPane(JButton confirmButton, JButton cancelButton) {
setStyle(confirmButton, STYLE_PRIMARY);
return row(8,
flex(), cell(confirmButton), cell(cancelButton)).getComponent();
}
} }

16
designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java

@ -157,6 +157,22 @@ public class FineLayoutBuilder {
return row; return row;
} }
/**
* 创建水平布局面板
*
* @param spacing 间距
* @param elements 面板元素
* @return 面板
*/
public static Row createHorizontalLayout(int spacing, Component... elements) {
Row row = new Row();
row.setSpacing(spacing);
for (Component element : elements) {
Layouts.populate(row, cell(element));
}
return row;
}
/** /**
* 组件包装于BorderLayout中 * 组件包装于BorderLayout中

10
designer-base/src/main/java/com/fine/theme/utils/FineUIConstants.java

@ -1,5 +1,7 @@
package com.fine.theme.utils; package com.fine.theme.utils;
import java.awt.Dimension;
/** /**
* 主题UI常量 * 主题UI常量
* *
@ -12,4 +14,12 @@ public class FineUIConstants {
public static final int SCALE_FONT_SIZE_12 = FineUIScale.scale(12); public static final int SCALE_FONT_SIZE_12 = FineUIScale.scale(12);
public static final int SCALE_FONT_SIZE_13 = FineUIScale.scale(13); public static final int SCALE_FONT_SIZE_13 = FineUIScale.scale(13);
/**
* 对话框常量
*/
public static class Dialog {
public static final Dimension POP_DIALOG_MEDIUM = FineUIScale.scale(new Dimension(360, 400));
}
} }

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

@ -42,6 +42,7 @@ public interface FineUIStyle {
String TRANSPARENT_TEXT_FIELD = "transparentTextField"; String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String TRANSPARENT_BACKGROUND = "transparentBackground"; String TRANSPARENT_BACKGROUND = "transparentBackground";
String PURE_LIST = "pureList"; String PURE_LIST = "pureList";
String NO_BORDER_LIST = "noBorderList";
String PURE_TREE = "pureTree"; String PURE_TREE = "pureTree";
String PASTEL_BUTTON = "pastelButton"; String PASTEL_BUTTON = "pastelButton";
String BREADCRUMB_BUTTON = "breadcrumbButton"; String BREADCRUMB_BUTTON = "breadcrumbButton";

17
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,5 +1,6 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
@ -478,17 +479,20 @@ public class PreferencePane extends BasicPane {
//gc面板 //gc面板
gcControlPane = createGcControlPane(); gcControlPane = createGcControlPane();
boolean supportV2 = VcsHelper.getInstance().checkV2FunctionSupport();
boolean legacyMode = VcsHelper.getInstance().isLegacyMode();
Component savePane = FineUIUtils.wrapComponentWithTitle(column(10, Component savePane = FineUIUtils.wrapComponentWithTitle(column(10,
cell(vcsEnableCheckBox), cell(vcsEnableCheckBox),
cell(saveIntervalPane).with(it -> it.setVisible(VcsHelper.getInstance().checkV2FunctionSupport())) cell(saveIntervalPane).with(it -> it.setVisible(supportV2))
).getComponent(), i18nText("Fine-Design_Vcs_Save_Setting")); ).getComponent(), i18nText("Fine-Design_Vcs_Save_Setting"));
Component vcsPane = FineUIUtils.wrapComponentWithTitle(column(10, Component vcsPane = FineUIUtils.wrapComponentWithTitle(column(10,
cell(remindVcsLabel), cell(remindVcsLabel),
cell(intervalPanel), cell(intervalPanel),
cell(saveCommitCheckBox).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode())), cell(saveCommitCheckBox).with(it -> it.setVisible(legacyMode)),
cell(autoCleanPane), cell(autoCleanPane).with(it -> it.setVisible(supportV2)),
cell(gcControlPane).with(it -> it.setVisible(VcsHelper.getInstance().isLegacyMode())) cell(gcControlPane).with(it -> it.setVisible(legacyMode))
).getComponent(), i18nText("Fine-Design_Vcs_Clean_Setting")); ).getComponent(), i18nText("Fine-Design_Vcs_Clean_Setting"));
JPanel containPane = column(SETTING_V_GAP, JPanel containPane = column(SETTING_V_GAP,
cell(savePane), cell(savePane),
@ -522,12 +526,15 @@ public class PreferencePane extends BasicPane {
}; };
private JPanel createAutoCleanPane() { private JPanel createAutoCleanPane() {
JPanel autoCleanPane = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); Row autoCleanPane = new Row();
autoCleanPane.setSpacing(2);
useVcsAutoCleanScheduleCheckBox = new UICheckBox(); useVcsAutoCleanScheduleCheckBox = new UICheckBox();
autoCleanIntervalComboBox = new UIComboBox(INTERVAL); autoCleanIntervalComboBox = new UIComboBox(INTERVAL);
autoCleanIntervalComboBox.setSelectedIndex(DEFAULT_INDEX); autoCleanIntervalComboBox.setSelectedIndex(DEFAULT_INDEX);
autoCleanRetainIntervalComboBox = new UIComboBox(INTERVAL); autoCleanRetainIntervalComboBox = new UIComboBox(INTERVAL);
autoCleanRetainIntervalComboBox.setSelectedIndex(DEFAULT_INDEX); autoCleanRetainIntervalComboBox.setSelectedIndex(DEFAULT_INDEX);
autoCleanIntervalComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
autoCleanRetainIntervalComboBox.putClientProperty(COMBO_BOX_TYPE, ADAPTIVE_COMBO_BOX);
autoCleanPane.add(useVcsAutoCleanScheduleCheckBox); autoCleanPane.add(useVcsAutoCleanScheduleCheckBox);
autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Every"))); autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Every")));
autoCleanPane.add(autoCleanIntervalComboBox); autoCleanPane.add(autoCleanIntervalComboBox);

1
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -314,6 +314,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// text // text
initFormulaTextArea(); initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextArea.setBorder(null);
formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
// buttonPane // buttonPane

29
designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java

@ -9,22 +9,15 @@ import com.fr.stable.Constants;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.BasicStroke;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Polygon; import java.awt.Polygon;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Shape; import java.awt.Shape;
import java.awt.Stroke;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Window; import java.awt.Window;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
@ -326,27 +319,7 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
final JPanel contentPane = (JPanel) this.getContentPane(); final JPanel contentPane = (JPanel) this.getContentPane();
this.setLayout(null); this.setLayout(null);
contentPane.add(UIBubbleFloatPane.this); contentPane.add(UIBubbleFloatPane.this);
contentPane.setBorder(new Border() { contentPane.setBorder(null);
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Graphics2D g2d = (Graphics2D) g;
Stroke oldStroke = g2d.getStroke();
g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
g2d.setColor(new Color(51, 51, 51));
g2d.drawPolygon((Polygon) getShape4Board());
g2d.setStroke(oldStroke);
}
@Override
public Insets getBorderInsets(Component c) {
return null;
}
@Override
public boolean isBorderOpaque() {
return false;
}
});
} }
/** /**

4
designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java

@ -1,11 +1,14 @@
package com.fr.design.gui.ilist; package com.fr.design.gui.ilist;
import com.fine.theme.utils.FineUIStyle;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.ListModel; import javax.swing.ListModel;
import java.awt.Point; import java.awt.Point;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/** /**
* Created by plough on 2017/7/23. * Created by plough on 2017/7/23.
*/ */
@ -14,6 +17,7 @@ public class UINameEdList extends JNameEdList {
protected UINameEdList(ListModel dataModel) { protected UINameEdList(ListModel dataModel) {
super(dataModel); super(dataModel);
setStyle(this, FineUIStyle.NO_BORDER_LIST);
} }
public Object getType(int index) { public Object getType(int index) {

13
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/RSyntaxTextArea.java

@ -39,6 +39,7 @@ import javax.swing.text.Document;
import javax.swing.text.Element; import javax.swing.text.Element;
import javax.swing.text.Highlighter; import javax.swing.text.Highlighter;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.focusabletip.FocusableTip; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.focusabletip.FocusableTip;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.Fold; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.Fold;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.FoldManager; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.folding.FoldManager;
@ -318,6 +319,7 @@ private boolean fractionalFontMetricsEnabled;
* Constructor. * Constructor.
*/ */
public RSyntaxTextArea() { public RSyntaxTextArea() {
initBorder();
} }
@ -328,6 +330,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(RSyntaxDocument doc) { public RSyntaxTextArea(RSyntaxDocument doc) {
super(doc); super(doc);
initBorder();
} }
/** /**
@ -337,6 +340,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(String text) { public RSyntaxTextArea(String text) {
super(text); super(text);
initBorder();
} }
@ -350,6 +354,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(int rows, int cols) { public RSyntaxTextArea(int rows, int cols) {
super(rows, cols); super(rows, cols);
initBorder();
} }
@ -364,6 +369,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(String text, int rows, int cols) { public RSyntaxTextArea(String text, int rows, int cols) {
super(text, rows, cols); super(text, rows, cols);
initBorder();
} }
@ -379,6 +385,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(RSyntaxDocument doc, String text,int rows,int cols) { public RSyntaxTextArea(RSyntaxDocument doc, String text,int rows,int cols) {
super(doc, text, rows, cols); super(doc, text, rows, cols);
initBorder();
} }
@ -390,6 +397,7 @@ private boolean fractionalFontMetricsEnabled;
*/ */
public RSyntaxTextArea(int textMode) { public RSyntaxTextArea(int textMode) {
super(textMode); super(textMode);
initBorder();
} }
@ -435,6 +443,11 @@ private boolean fractionalFontMetricsEnabled;
} }
protected void initBorder() {
setBorder(FineBorderFactory.createWrappedRoundBorder());
}
/** /**
* Adds the parser to "validate" the source code in this text area. This * Adds the parser to "validate" the source code in this text area. This

3
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -974,6 +974,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void resetButtonIcon() { public void resetButtonIcon() {
button.setBackground(new Color(0, 0, 0, 0)); button.setBackground(new Color(0, 0, 0, 0));
button.setSelected(false);
if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) {
iconSuffix = ICON_SUFFIX_NORMAL; iconSuffix = ICON_SUFFIX_NORMAL;
button.setIcon(new LazyIcon(getBtnIconId(), ICON_WIDTH)); button.setIcon(new LazyIcon(getBtnIconId(), ICON_WIDTH));
@ -994,8 +995,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED; iconSuffix = ICON_SUFFIX_SELECTED_DEPRECATED;
button.setIcon(IconUtils.readIcon(getBtnIconUrl())); button.setIcon(IconUtils.readIcon(getBtnIconUrl()));
} }
button.setBackground(selectedBtnBackground);
button.setOpaque(true); button.setOpaque(true);
button.setSelected(true);
selectedItem = this; selectedItem = this;
} }

50
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.light.ui.FineRoundBorder;
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;
@ -16,14 +16,10 @@ import com.fr.design.gui.ifilechooser.FileChooserFactory;
import com.fr.design.gui.ifilechooser.FileChooserProvider; import com.fr.design.gui.ifilechooser.FileChooserProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itextarea.DescriptionTextArea;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.ImageUtils; import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.WidgetInfoConfig; import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -35,15 +31,12 @@ import com.fr.transaction.WorkerFacade;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Window; import java.awt.Window;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -63,8 +56,9 @@ import java.awt.event.FocusListener;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import static com.fine.swing.ui.layout.Layouts.column;
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.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
/** /**
@ -116,7 +110,7 @@ public class CustomIconPane extends BasicPane {
cell(desLabel).weight(0.1) cell(desLabel).weight(0.1)
).getComponent()); ).getComponent());
JPanel eastPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); JPanel eastPane = new JPanel(new BorderLayout());
JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
// 增加、删除、编辑按钮 // 增加、删除、编辑按钮
@ -124,7 +118,7 @@ public class CustomIconPane extends BasicPane {
initRemoveButton(buttonPane); initRemoveButton(buttonPane);
initEditButton(buttonPane); initEditButton(buttonPane);
eastPane.add(buttonPane); eastPane.add(buttonPane, BorderLayout.NORTH);
this.add(column(10, this.add(column(10,
cell(iconLabel), cell(iconLabel),
row(10, cell(centerPane).weight(0.9), cell(eastPane).weight(0.1)).weight(1.0) row(10, cell(centerPane).weight(0.9), cell(eastPane).weight(0.1)).weight(1.0)
@ -425,19 +419,11 @@ public class CustomIconPane extends BasicPane {
private void init() { private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, p};
UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon")); UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"));
browseButton.setPreferredSize(new Dimension(80, 25));
browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button")); browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button"));
nameTextField = new UITextField(20); nameTextField = new UITextField(20);
browseButton.addActionListener(new ActionListener() { browseButton.addActionListener(e -> onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this)));
public void actionPerformed(ActionEvent e) {
onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this));
}
});
// 焦点丢失时看看名称是否已经存在 // 焦点丢失时看看名称是否已经存在
nameTextField.addFocusListener(new FocusListener() { nameTextField.addFocusListener(new FocusListener() {
@ -458,16 +444,22 @@ public class CustomIconPane extends BasicPane {
} }
}); });
JPanel imagePane = new JPanel();
imagePane.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 0));
showImageLabel = new UILabel(); showImageLabel = new UILabel();
showImageLabel.setPreferredSize(new Dimension(50, 50)); showImageLabel.setPreferredSize(FineUIScale.scale(new Dimension(50, 50)));
imagePane.add(showImageLabel);
imagePane.add(browseButton); JPanel centerPane = column(10,
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}}; row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(1.2),
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); cell(nameTextField).weight(3)
this.add(centerPane, BorderLayout.CENTER); ),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")).weight(1.2),
row(
cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)
).weight(3)
)
).getComponent();
this.add(centerPane, BorderLayout.WEST);
} }
private void onBrowseButtonClicked(Window parent) { private void onBrowseButtonClicked(Window parent) {

68
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -1,8 +1,11 @@
package com.fr.file; package com.fr.file;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
@ -28,8 +31,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.filetree.FileTreeIcon; import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -86,7 +87,6 @@ import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets; import java.awt.Insets;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -112,6 +112,7 @@ 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.column;
import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
import static javax.swing.JOptionPane.DEFAULT_OPTION; import static javax.swing.JOptionPane.DEFAULT_OPTION;
import static javax.swing.JOptionPane.WARNING_MESSAGE; import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -1788,10 +1789,6 @@ public class FILEChooserPane extends BasicPane {
UILabel newNameLabel = new UILabel(Toolkit.i18nText( UILabel newNameLabel = new UILabel(Toolkit.i18nText(
"Fine-Design_Basic_Enter_New_Folder_Name") "Fine-Design_Basic_Enter_New_Folder_Name")
); );
newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
newNameLabel.setPreferredSize(new Dimension(118, 15));
// 文件名输入框 // 文件名输入框
nameField = new UITextField(); nameField = new UITextField();
nameField.getDocument().addDocumentListener(new DocumentListener() { nameField.getDocument().addDocumentListener(new DocumentListener() {
@ -1809,12 +1806,9 @@ public class FILEChooserPane extends BasicPane {
} }
}); });
nameField.selectAll(); nameField.selectAll();
nameField.setPreferredSize(new Dimension(180, 20)); JPanel topPanel = FineLayoutBuilder.createHorizontalLayout(10, new double[]{1,1},
newNameLabel, nameField
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); );
topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15));
topPanel.add(newNameLabel);
topPanel.add(nameField);
// 增加enter以及esc快捷键的支持 // 增加enter以及esc快捷键的支持
nameField.addKeyListener(new KeyAdapter() { nameField.addKeyListener(new KeyAdapter() {
@ -1831,54 +1825,32 @@ public class FILEChooserPane extends BasicPane {
}); });
// 重名提示 // 重名提示
warnLabel = new UILabel(); warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30)); FineUIStyle.setStyle(warnLabel, FineUIStyle.LABEL_WARNING_TIP);
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setForeground(Color.RED);
warnLabel.setVisible(false); warnLabel.setVisible(false);
JPanel midPanel = new JPanel(new BorderLayout()); JPanel midPanel = new JPanel(new BorderLayout());
midPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15));
midPanel.add(warnLabel, BorderLayout.WEST); midPanel.add(warnLabel, BorderLayout.WEST);
// 确认按钮 // 确认按钮
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25)); confirmButton.addActionListener(e -> confirmClose());
confirmButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
confirmClose();
}
});
// 取消按钮 // 取消按钮
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
cancelButton.setPreferredSize(new Dimension(60, 25));
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(e -> dispose());
public void actionPerformed(ActionEvent e) {
dispose();
}
});
JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel bottomPanel = FineComponentsFactory.createConfirmCancelButtonPane(confirmButton, cancelButton);
bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15));
bottomPanel.add(confirmButton); JPanel panel = new JPanel(new BorderLayout(0, scale(10)));
bottomPanel.add(cancelButton); panel.add(topPanel, BorderLayout.NORTH);
panel.add(midPanel, BorderLayout.CENTER);
this.add( panel.add(bottomPanel, BorderLayout.SOUTH);
TableLayoutHelper.createTableLayoutPane( panel.setBorder(new ScaledEmptyBorder(20, 10, 20, 10));
new Component[][]{ this.add(panel, BorderLayout.CENTER);
new Component[]{topPanel},
new Component[]{midPanel}, this.setSize(scale(new Dimension(360, 180)));
new Component[]{bottomPanel}
},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
new double[]{TableLayout.FILL}
),
BorderLayout.CENTER);
this.setSize(340, 180);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir")); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir"));
this.setResizable(false); this.setResizable(false);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);

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

@ -427,7 +427,7 @@ HelpButton.innerFocusWidth = $?Button.innerFocusWidth
#---- List ---- #---- List ----
List.border = 0,0,0,0 List.border = 4,0,4,0
List.cellMargins = 1,12,1,12 List.cellMargins = 1,12,1,12
List.selectionInsets = 0,4,0,4 List.selectionInsets = 0,4,0,4
List.selectionArc = 2 List.selectionArc = 2
@ -1167,7 +1167,7 @@ HeaderPane.height=$Component.defaultHeight
#---- East ---- #---- East ----
East.border = $defaultBorderColor East.border = $defaultBorderColor
East.TabSelectedColor = #B3CFF9 East.TabSelectedColor = @selectionBackground
#---- South ---- #---- South ----
South.SheetTabRadius = 6 South.SheetTabRadius = 6
@ -1195,6 +1195,7 @@ Center.ZoneBorderColor = #E6E9EF
Center.GridColumnRowColor=#e8e8e9 Center.GridColumnRowColor=#e8e8e9
Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%) Center.GridColumnRowSelectedColor=fade(@BrandColor, 12%)
Center.GridColumnRowEditedColor=#e9ecf1 Center.GridColumnRowEditedColor=#e9ecf1
Center.GridCornerFill=fade(#0A1C38, 47%)
Center.SpaceColor = #FFF Center.SpaceColor = #FFF
Center.border = 0, 10, 10, 10 Center.border = 0, 10, 10, 10
Center.arc=10 Center.arc=10
@ -1363,6 +1364,9 @@ chart.selectedBorderColor = #2576EF
[style]List.pureList = \ [style]List.pureList = \
background: $fill.normal background: $fill.normal
[style]List.noBorderList = \
border: 0,0,0,0
[style]Tree.pureTree = \ [style]Tree.pureTree = \
background: $fill.normal background: $fill.normal

95
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -4,6 +4,8 @@ package com.fr.design.mainframe.chart.gui;
* Created by hufan on 2016/10/20. * Created by hufan on 2016/10/20.
*/ */
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
@ -20,22 +22,16 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -44,20 +40,16 @@ import java.awt.event.MouseListener;
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;
/** /**
* 图表切换设置面板 * 图表切换设置面板
*/ */
public class ChangeConfigPane extends BasicBeanPane<ChartCollection> { public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private static final int WIDTH = 100; private static final int WIDTH = scale(100);
private static final int EDIT_AREA_WIDTH = 180;
private static final int LABEL_WIDTH = 20;
private static final int MIN_TIME = 0; private static final int MIN_TIME = 0;
private static final int MAX_TIME = Integer.MAX_VALUE; private static final int MAX_TIME = Integer.MAX_VALUE;
private static final int CONSTANT_TEN = 10;
private static final int CONSTANT_THIRTY = 30;
private static final int CONSTANT_ZERO = 0;
private static final int COL_COUNT = 4; private static final int COL_COUNT = 4;
private JPanel contentPane; private JPanel contentPane;
//配置方式按钮 //配置方式按钮
@ -84,7 +76,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
public ChangeConfigPane() { public ChangeConfigPane() {
init(); init();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 15, 10, 15)); this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(createScrollPane(), BorderLayout.CENTER); this.add(createScrollPane(), BorderLayout.CENTER);
} }
@ -101,20 +93,15 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
initButtonGroup(); initButtonGroup();
configPane = createConfigPane(); configPane = createConfigPane();
contentPane = createContentPane(); contentPane = createContentPane();
contentPane.setBorder(BorderFactory.createEmptyBorder(CONSTANT_TEN, CONSTANT_THIRTY, CONSTANT_TEN, CONSTANT_THIRTY));
} }
private JPanel createContentPane() { private JPanel createContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Change_Style")), configStyleButton}, new Component[]{new UILabel(i18nText("Fine-Design_Chart_Change_Style")), configStyleButton},
new Component[]{configPane, null}, new Component[]{configPane, null},
new Component[]{createButtonContentPane(), null} new Component[]{createButtonContentPane(), null}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private JPanel createConfigPane() { private JPanel createConfigPane() {
@ -136,39 +123,29 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
panel.add(buttonConfigPane, "button"); panel.add(buttonConfigPane, "button");
panel.add(carouselConfigPane, "carousel"); panel.add(carouselConfigPane, "carousel");
panel.setBorder(BorderFactory.createEmptyBorder(CONSTANT_ZERO, CONSTANT_TEN, CONSTANT_ZERO, CONSTANT_ZERO));
return panel; return panel;
} }
private JPanel createCarouseConfigPane() { private JPanel createCarouseConfigPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, p};
double[] rowSize = {p, p, p};
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0); timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
switchStyleGroup = new UIButtonGroup(new String[]{i18nText("Fine-Design_Chart_Show"), i18nText("Fine-Design_Report_Hide")}); switchStyleGroup = new UIButtonGroup(new String[]{i18nText("Fine-Design_Chart_Show"), i18nText("Fine-Design_Report_Hide")});
JPanel timeIntervalPane = FineLayoutBuilder.createHorizontalLayout(5, timeInterval, new UILabel(i18nText("Fine-Design_Chart_Time_Second")));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup, null}, new Component[]{new UILabel(i18nText("Fine-Design_Chart_Arrow_Style")), switchStyleGroup},
new Component[]{new UILabel(i18nText("Fine-Design_Chart_Time_Interval")), timeInterval, new UILabel(i18nText("Fine-Design_Chart_Time_Second"))}, new Component[]{new UILabel(i18nText("Fine-Design_Chart_Time_Interval")), timeIntervalPane},
new Component[]{new UILabel(i18nText("Fine-Design_Basic_Background")), colorSelectBox4carousel, null} new Component[]{new UILabel(i18nText("Fine-Design_Basic_Background")), colorSelectBox4carousel}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private JPanel createTitleStylePane() { private JPanel createTitleStylePane() {
final UILabel text = new UILabel(i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); final UILabel text = new UILabel(i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT);
styleAttrPane = new ChartTextAttrPane() { styleAttrPane = new ChartTextAttrPane() {
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED; return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
double f = TableLayout.FILL;
double[] columnSize = {f, EDIT_AREA_WIDTH};
double[] rowSize = {p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
} }
protected Component[][] getComponents(JPanel buttonPane) { protected Component[][] getComponents(JPanel buttonPane) {
@ -184,54 +161,44 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
private JPanel createButtonBackgroundColorPane() { private JPanel createButtonBackgroundColorPane() {
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayout4VanChartHelper.createGapTableLayoutPane(i18nText("Fine-Design_Basic_Background"), colorSelectBox4button, EDIT_AREA_WIDTH); return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(i18nText("Fine-Design_Basic_Background")),
colorSelectBox4button);
} }
private JPanel createButtonContentPane() { private JPanel createButtonContentPane() {
JPanel buttonContentPane = new JPanel(new BorderLayout()); JPanel buttonContentPane = new JPanel(new BorderLayout(0, scale(10)));
chartTypesPane = new JPanel(); chartTypesPane = new JPanel();
chartTypesPane.setLayout(new BoxLayout(chartTypesPane, BoxLayout.Y_AXIS)); chartTypesPane.setLayout(new BorderLayout());
chartTypesPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
switchTitlePane.setLayout(new CardLayout()); switchTitlePane.setLayout(new CardLayout());
JPanel titleEditPane = TableLayout4VanChartHelper.createGapTableLayoutPane( JPanel titleEditPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
i18nText("Fine-Design_Chart_Switch_Title_Label"), new UILabel(i18nText("Fine-Design_Chart_Switch_Title_Label")),
switchTitlePane, switchTitlePane
EDIT_AREA_WIDTH
); );
titleEditPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
buttonContentPane.add(chartTypesPane, BorderLayout.NORTH); buttonContentPane.add(chartTypesPane, BorderLayout.NORTH);
buttonContentPane.add(titleEditPane, BorderLayout.CENTER); buttonContentPane.add(titleEditPane, BorderLayout.CENTER);
UIExpandablePane expandablePane = new UIExpandablePane(i18nText("Fine-Design_Chart_Button_And_Rotation_Content"), buttonContentPane) { return new UIExpandablePane(i18nText("Fine-Design_Chart_Button_And_Rotation_Content"), buttonContentPane);
protected void setcontentPanelontentPanelBorder() {
}
};
expandablePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
return expandablePane;
} }
private void populateButtonContentPane(ChartCollection collection) { private void populateButtonContentPane(ChartCollection collection) {
int count = collection.getChartCount(); int count = collection.getChartCount();
int select = collection.getSelectedIndex(); int select = collection.getSelectedIndex();
JPanel pane = null; chartTypesPane.removeAll();
ArrayList<Component> buttons = new ArrayList<>();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
if (i % COL_COUNT == 0) {
pane = new JPanel(new FlowLayout(FlowLayout.LEFT));
chartTypesPane.add(pane);
}
ChangeChartButton button = new ChangeChartButton(i, collection); ChangeChartButton button = new ChangeChartButton(i, collection);
changeChartButtons.add(button); changeChartButtons.add(button);
button.setSelected(i == select); button.setSelected(i == select);
pane.add(button); buttons.add(button);
populateSwitchTitlePane(i, collection); populateSwitchTitlePane(i, collection);
} }
chartTypesPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, buttons));
showSwitchTitleCard(collection.getChartName(select)); showSwitchTitleCard(collection.getChartName(select));
chartTypesPane.revalidate(); chartTypesPane.revalidate();
@ -258,22 +225,17 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
} }
private JPanel createButtonConfigPane() { private JPanel createButtonConfigPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(), null}, new Component[]{createTitleStylePane(), null},
new Component[]{createButtonBackgroundColorPane(), null}, new Component[]{createButtonBackgroundColorPane(), null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private void initButtonGroup() { private void initButtonGroup() {
configStyleButton = new UIButtonGroup<Integer>(new String[]{i18nText("Fine-Design_Chart_Button_Style"), configStyleButton = new UIButtonGroup<Integer>(new String[]{i18nText("Fine-Design_Chart_Button_Style"),
i18nText("Fine-Design_Chart_Carousel_Style")}); i18nText("Fine-Design_Chart_Carousel_Style")});
configStyleButton.setPreferredSize(new Dimension(WIDTH * 2, (int) configStyleButton.getPreferredSize().getHeight()));
configStyleButton.addActionListener(new ActionListener() { configStyleButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -359,8 +321,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
} }
private class ChangeChartButton extends UIToggleButton { private class ChangeChartButton extends UIToggleButton {
private static final int BUTTON_WIDTH = 52;
private static final int BUTTON_HEIGHT = 20;
private ChartCollection collection; private ChartCollection collection;
private int buttonIndex; private int buttonIndex;
@ -384,9 +344,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
}; };
} }
public Dimension getPreferredSize() {
return new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT);
}
} }
private void resetChangeChartButtons() { private void resetChangeChartButtons() {

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
@ -64,11 +65,7 @@ import static com.fine.swing.ui.layout.Layouts.row;
*/ */
public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implements UIObserver { public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implements UIObserver {
private static final long serialVersionUID = -8130803225718028933L; private static final long serialVersionUID = -8130803225718028933L;
private static final int B_W = 52;
private static final int B_H = 20;
private static final int COL_COUNT = 4; private static final int COL_COUNT = 4;
private static final int P_W = 300;
private static final int P_H = 400;
private static Set<Class<? extends ChartProvider>> supportChangeConfigChartClassSet = new HashSet<Class<? extends ChartProvider>>(); private static Set<Class<? extends ChartProvider>> supportChangeConfigChartClassSet = new HashSet<Class<? extends ChartProvider>>();
@ -228,7 +225,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
}); });
dialog.setSize(P_W, P_H); dialog.setSize(FineUIConstants.Dialog.POP_DIALOG_MEDIUM);
dialog.setVisible(true); dialog.setVisible(true);
} }

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -228,7 +228,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
preDataNumPane = column(10, preDataNumPane = column(10,
row(cell(label).weight(1.2), cell(preDataNum).weight(3)), row(cell(label).weight(1.2), cell(preDataNum).weight(3)),
cell(combineOther) cell(combineOther)
).getComponent(); ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent();
preDataNumPane.setVisible(false); preDataNumPane.setVisible(false);
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));

3
designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.designer.other;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -26,6 +27,7 @@ import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
/** /**
* Created by hufan on 2016/12/30. * Created by hufan on 2016/12/30.
*/ */
@ -130,6 +132,7 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
} }
}); });
dialog.setPreferredSize(FineUIConstants.Dialog.POP_DIALOG_MEDIUM);
dialog.pack(); dialog.pack();
dialog.setModal(true); dialog.setModal(true);
dialog.setVisible(true); dialog.setVisible(true);

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java

@ -3,6 +3,7 @@ package com.fr.van.chart.designer.style.axis.component;
import com.fine.swing.ui.layout.Column; import com.fine.swing.ui.layout.Column;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -214,7 +215,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
} }
private class ChartAxisButton extends UIToggleButton { private class ChartAxisButton extends UIToggleButton {
private static final double DEL_WIDTH = 10; private final double DEL_WIDTH = FineUIScale.scale(10);
private static final long serialVersionUID = -3701452534814584608L; private static final long serialVersionUID = -3701452534814584608L;
private BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/chartChangeClose.png"); private BufferedImage closeIcon = BaseUtils.readImageWithCache("com/fr/design/images/toolbarbtn/chartChangeClose.png");
private boolean isMoveOn = false; private boolean isMoveOn = false;
@ -231,7 +232,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
} }
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(B_W, B_H); return FineUIScale.scale(new Dimension(B_W, B_H));
} }
private void paintDeleteButton(Graphics g2d) { private void paintDeleteButton(Graphics g2d) {

2
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.drillmap.designer.data; package com.fr.van.chart.drillmap.designer.data;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
@ -35,6 +36,7 @@ public class VanChartMapLayerAndDataTabPane extends MultiTabPane<ChartCollection
private void initComponents() { private void initComponents() {
super.relayoutWhenListChange(); super.relayoutWhenListChange();
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
} }
protected void tabChanged() { protected void tabChanged() {

2
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -50,6 +51,7 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.add(dataDefinitionType, BorderLayout.CENTER); this.add(dataDefinitionType, BorderLayout.CENTER);
} }

26
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java

@ -1,7 +1,9 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane;
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.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -52,7 +54,6 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
@Override @Override
protected void layoutContentPane() { protected void layoutContentPane() {
leftcontentPane = createContentPane(); leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(leftcontentPane); this.add(leftcontentPane);
} }
@ -67,26 +68,13 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
JPanel mapDataTreePanel = new JPanel(new BorderLayout()); JPanel mapDataTreePanel = new JPanel(new BorderLayout());
mapDataTreePanel.add(mapDataTree); mapDataTreePanel.add(mapDataTree);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)}, new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel, true)},
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())} new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())}
}; };
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
JPanel panel = new JPanel(new BorderLayout()); return FineLayoutBuilder.asBorderLayoutWrapped(contentPane);
panel.add(contentPane, BorderLayout.CENTER);
return panel;
}
private JPanel createTitlePane (String title, JPanel panel) {
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
jPanel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
return jPanel;
} }
private JPanel createLayerDetailPane() { private JPanel createLayerDetailPane() {
@ -111,7 +99,7 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
detailComps[i + 1] = new Component[]{label, level, type}; detailComps[i + 1] = new Component[]{label, level, type};
} }
return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 10, 6); return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 5, 6);
} }
/** /**

13
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java

@ -1,13 +1,12 @@
package com.fr.van.chart.drillmap.designer.data.comp; package com.fr.van.chart.drillmap.designer.data.comp;
import com.fr.design.constants.UIConstants; import com.fr.design.border.FineBorderFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
@ -17,6 +16,9 @@ import javax.swing.tree.TreePath;
import java.awt.Component; import java.awt.Component;
import java.util.Enumeration; import java.util.Enumeration;
import static com.fine.theme.utils.FineUIStyle.PURE_TREE;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/** /**
* Created by Mitisky on 16/5/3. * Created by Mitisky on 16/5/3.
*/ */
@ -30,8 +32,9 @@ public class MapDataTree extends JTree {
this.setRootVisible(false); this.setRootVisible(false);
this.setShowsRootHandles(true); this.setShowsRootHandles(true);
this.setInvokesStopCellEditing(true); this.setInvokesStopCellEditing(true);
this.setBackground(UIConstants.NORMAL_BACKGROUND);
this.setCellRenderer(treeCellRenderer); this.setCellRenderer(treeCellRenderer);
setBorder(FineBorderFactory.createWrappedRoundBorder());
setStyle(this, PURE_TREE);
} }
private DefaultTreeModel model = new DefaultTreeModel(null); private DefaultTreeModel model = new DefaultTreeModel(null);
@ -114,10 +117,6 @@ public class MapDataTree extends JTree {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value;
String name = getPresentName(treeNode); String name = getPresentName(treeNode);
this.setText(name); this.setText(name);
this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0));
this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND);
this.setForeground(UIConstants.FONT_COLOR);
this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE);
return this; return this;
} }
}; };

5
designer-realize/src/main/java/com/fr/grid/GridCorner.java

@ -3,6 +3,7 @@
*/ */
package com.fr.grid; package com.fr.grid;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.DesignerUIModeConfig;
@ -70,14 +71,14 @@ public class GridCorner extends BaseGridComponent {
private void paintArc(Graphics2D g2d, Dimension size, float time) { private void paintArc(Graphics2D g2d, Dimension size, float time) {
g2d.setColor(UIConstants.LINE_COLOR); g2d.setColor(FlatUIUtils.getUIColor("Center.GridCornerFill", UIConstants.LINE_COLOR));
float height = 2 * time; float height = 2 * time;
float width = 2 * time; float width = 2 * time;
float hgap = 4 * time; float hgap = 4 * time;
float vgap = 3 * time; float vgap = 3 * time;
int x = (int) ((size.width - (hgap * 2 + width * 3)) / 2); int x = (int) ((size.width - (hgap * 2 + width * 3)) / 2);
int y = (int) (size.height - (vgap * 2 + height * 3)); int y = (int) (size.height - (vgap * 3 + height * 3));
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
GraphHelper.fillRect(g2d, x + (i * hgap), y + (j * vgap), width, height); GraphHelper.fillRect(g2d, x + (i * hgap), y + (j * vgap), width, height);

22
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -1,13 +1,12 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ImageCellAction; import com.fr.design.actions.insert.cell.ImageCellAction;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.report.SelectImagePane; import com.fr.design.report.SelectImagePane;
@ -17,11 +16,6 @@ import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/** /**
* 单元格元素图片编辑器 * 单元格元素图片编辑器
@ -37,20 +31,10 @@ public class CellImageQuickEditor extends CellQuickEditor {
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
editButton.addActionListener(new ActionListener() { editButton.addActionListener(e -> showEditingDialog());
@Override
public void actionPerformed(ActionEvent e) {
showEditingDialog();
}
});
editButton.setOpaque(false); editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ return FineLayoutBuilder.asBorderLayoutWrapped(editButton);
new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
} }
private void showEditingDialog() { private void showEditingDialog() {

14
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -1,19 +1,14 @@
package com.fr.quickeditor.cellquick; package com.fr.quickeditor.cellquick;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.RichTextCellAction; import com.fr.design.actions.insert.cell.RichTextCellAction;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/** /**
* 单元格元素富文本编辑器 * 单元格元素富文本编辑器
@ -30,14 +25,9 @@ public class CellRichTextEditor extends CellQuickEditor {
@Override @Override
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
richTextButton = new UIButton(); richTextButton = new UIButton();
richTextButton.setOpaque(false); richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ return FineLayoutBuilder.asBorderLayoutWrapped(richTextButton);
new Component[]{EMPTY_LABEL, richTextButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
} }
@Override @Override

Loading…
Cancel
Save