Browse Source

Pull request #14608: REPORT-130807 & REPORT-130703【NewUI】测试验收问题修复

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

* commit 'c691437de14975a39d50a8f1d05aff32616571fa':
  REPORT-113994 【NewUI】视觉&测试验收问题修复
newui
Levy.Xie-解安森 3 months ago
parent
commit
4d46f5b990
  1. 2
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  2. 18
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java
  3. 51
      designer-base/src/main/java/com/fr/env/LocalEnvPane.java
  4. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  5. 41
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  6. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java
  7. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartValueColorPane.java
  8. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartYAxisScrollPaneWithRadar.java
  9. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  10. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartMultiColorSeriesPane.java
  11. 36
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java
  12. 117
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  13. 15
      designer-chart/src/main/java/com/fr/van/chart/range/component/GradualLegendPane.java
  14. 17
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java
  15. 48
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceEditPane.java
  16. 2
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java

2
designer-base/src/main/java/com/fr/design/dialog/BasicPane.java

@ -153,7 +153,7 @@ public abstract class BasicPane extends JPanel {
* 以自定义的宽高显示窗口 * 以自定义的宽高显示窗口
* @param window 窗口 * @param window 窗口
* @param l 对话框监听器 * @param l 对话框监听器
* @param dimension 自定义尺寸 * @param dimension 自定义尺寸已适配缩放
* @return 对话框 * @return 对话框
*/ */
public BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) { public BasicDialog showWindowWithCustomSize(Window window, DialogActionListener l, Dimension dimension) {

18
designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java

@ -1,8 +1,8 @@
package com.fr.design.gui.itree.filetree; package com.fr.design.gui.itree.filetree;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -256,11 +256,7 @@ public class JFileTree extends AbstractFileTree {
FileSystemView view = FileSystemView.getFileSystemView(); FileSystemView view = FileSystemView.getFileSystemView();
// File的全部路径. // File的全部路径.
// 得到本地tree图标 // 得到本地tree图标
Icon tmpIcon = view.getSystemIcon(currentFile); this.setIcon(getIcon(expanded, fBuf, currentFile, view, leaf));
if (currentFile.isDirectory() && fBuf.length() > 0) {
tmpIcon = IOUtils.readIcon("/com/fr/design/images/gui/folder.png");
}
this.setIcon(tmpIcon);
this.setName(null); this.setName(null);
Font oldFont = this.getFont(); Font oldFont = this.getFont();
if (ComparatorUtils.equals(currentFile.getName(), ProjectConstants.WEBINF_NAME)) { if (ComparatorUtils.equals(currentFile.getName(), ProjectConstants.WEBINF_NAME)) {
@ -280,9 +276,19 @@ public class JFileTree extends AbstractFileTree {
treeNode = (DefaultMutableTreeNode) treeNode.getParent(); treeNode = (DefaultMutableTreeNode) treeNode.getParent();
} }
return this; return this;
}
private Icon getIcon(boolean expanded, StringBuilder fBuf, File currentFile, FileSystemView view, boolean leaf) {
boolean folderFile = !leaf || (currentFile.isDirectory() && fBuf.length() > 0);
if (folderFile) {
return expanded ? new LazyIcon("folder_open") : new LazyIcon("folder");
}
return view.getSystemIcon(currentFile);
} }
}; };
/** /**
* 对文件夹进行排序 先文件夹 然后各种类型文件 * 对文件夹进行排序 先文件夹 然后各种类型文件
* *

51
designer-base/src/main/java/com/fr/env/LocalEnvPane.java vendored

@ -1,23 +1,27 @@
package com.fr.env; package com.fr.env;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.filetree.JFileTree; import com.fr.design.gui.itree.filetree.JFileTree;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.filter.OnlyShowDirectoryFileFilter; import com.fr.file.filter.OnlyShowDirectoryFileFilter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.io.File; import java.io.File;
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.row;
/** /**
* @author yaohwu * @author yaohwu
*/ */
@ -27,46 +31,37 @@ public class LocalEnvPane extends BasicBeanPane<LocalDesignerWorkspaceInfo> {
private JFileTree localEnvTree; private JFileTree localEnvTree;
public LocalEnvPane() { public LocalEnvPane() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(new BorderLayout());
// northPane
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(northPane, BorderLayout.NORTH);
northPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.WEST);
pathTextField = new UITextField(); pathTextField = new UITextField();
northPane.add(pathTextField, BorderLayout.CENTER);
// 删除选择文件按钮 添加JFileTree
// centerPane
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
// 添加JFileTree // 添加JFileTree
localEnvTree = new JFileTree(); localEnvTree = new JFileTree();
FineUIStyle.setStyle(localEnvTree, FineUIStyle.PURE_TREE);
JScrollPane localEnvPane = new JScrollPane(localEnvTree); JScrollPane localEnvPane = new JScrollPane(localEnvTree);
centerPane.add(localEnvPane, BorderLayout.CENTER);
JPanel centerPane = FineLayoutBuilder.asBorderLayoutWrapped(localEnvPane);
// 设置根路径File 和 文件过滤类型 // 设置根路径File 和 文件过滤类型
localEnvTree.setFileFilter(new OnlyShowDirectoryFileFilter()); localEnvTree.setFileFilter(new OnlyShowDirectoryFileFilter());
localEnvTree.setRootFiles(File.listRoots()); localEnvTree.setRootFiles(File.listRoots());
localEnvTree.addTreeSelectionListener(new TreeSelectionListener() { localEnvTree.addTreeSelectionListener(e -> {
File selectFile = localEnvTree.getSelectedFile();
@Override if (selectFile == null) {
public void valueChanged(TreeSelectionEvent e) { return;
File selectFile = localEnvTree.getSelectedFile();
if (selectFile == null) {
return;
}
pathTextField.setText(selectFile.getPath());
} }
pathTextField.setText(selectFile.getPath());
}); });
UITextArea description = new UITextArea(); UITextArea description = new UITextArea();
centerPane.add(description, BorderLayout.SOUTH);
description.setText(Toolkit.i18nText("Fine-Design_Basic_Env_Des1")); description.setText(Toolkit.i18nText("Fine-Design_Basic_Env_Des1"));
description.setEditable(false); description.setEditable(false);
this.add(column(10,
row(5,
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Location") + ":")), cell(pathTextField).weight(1)
),
cell(centerPane).with(it -> it.setBorder(FineBorderFactory.createWrappedRoundBorder())).weight(1),
cell(description).with(it -> it.setBorder(null))
).getComponent());
} }
@Override @Override

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

@ -388,7 +388,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_Series")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series"));

41
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.style.series; package com.fr.design.mainframe.chart.gui.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.chart.base.AreaColor; import com.fr.chart.base.AreaColor;
import com.fr.chart.base.ChartBaseUtils; import com.fr.chart.base.ChartBaseUtils;
@ -15,7 +16,6 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ipoppane.PopupHider; import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindow;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -44,17 +44,20 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
public class UIColorPickerPane extends BasicPane implements UIObserver { public class UIColorPickerPane extends BasicPane implements UIObserver {
private static final int MARGIN_TOP = 7; private static final int MARGIN_TOP = scale(7);
private static final int MARGIN_LEFT = 5; private static final int MARGIN_LEFT = scale(5);
private static final int COLORGROUP_MARGIN_LEFT = 20; private static final int COLORGROUP_MARGIN_LEFT = scale(20);
private static final int OFF_HEIGHT = 6; private static final int OFF_HEIGHT = scale(6);
private static final int COLOR_REC_HEIGHT = 40; private static final int COLOR_REC_HEIGHT = scale(40);
private static final int COLOR_REC_WIDTH = 30; private static final int COLOR_REC_WIDTH = scale(30);
protected static final int TEXTFIELD_HEIGHT = 20; protected static final int TEXTFIELD_HEIGHT = scale(20);
protected static final int TEXTFIELD_WIDTH = 130; protected static final int TEXTFIELD_WIDTH = scale(130);
protected static final int UPCONTROLPANE_WIDTH = 230; protected static final int UPCONTROLPANE_WIDTH = scale(230);
private static final int LAYOUR_DET = 6; private static final int LAYOUR_DET = 6;
public static final double VALUE = 100; public static final double VALUE = 100;
protected ArrayList<JComponent> textFieldList; protected ArrayList<JComponent> textFieldList;
@ -128,11 +131,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
} }
protected JPanel getUpControlPane (Component[][] components) { protected JPanel getUpControlPane (Component[][] components) {
double p = TableLayout.PREFERRED; return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
return TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize);
} }
@ -202,19 +201,15 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
} }
}; };
double p = TableLayout.PREFERRED; Component[][] tmpComp = new Component[][]{new Component[]{
double e = getEditAreaWidth(); new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), regionNumPane}};
double d = getDescriptionWidth();
double[] columnSize = {d, e};
double[] rowSize = {p};
Component[][] tmpComp = new Component[][]{new Component[]{new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), regionNumPane}};
stagePanel = TableLayout4VanChartHelper.createGapTableLayoutPane(tmpComp, rowSize, columnSize); stagePanel = FineLayoutBuilder.compatibleTableLayout(0, tmpComp, new double[]{1.2, 3});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Tick_And_Color")), designTypeButtonGroup}, new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Tick_And_Color")), designTypeButtonGroup},
}; };
upControlPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); upControlPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
this.textGroup = new TextFieldGroupPane(); this.textGroup = new TextFieldGroupPane();
this.colorGroup = new ColorGroupPane(); this.colorGroup = new ColorGroupPane();

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHeatValueColorPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
@ -50,7 +51,7 @@ public class VanChartHeatValueColorPane extends VanChartValueColorPane {
@Override @Override
protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) { protected MapColorPickerPaneWithFormula createSectionIntervalConfigPane(AbstractAttrNoScrollPane parent) {
return new SectionIntervalConfigPaneWithOutNum(parent) { return new SectionIntervalConfigPaneWithOutNum(parent) {
private static final int WIDTH = 227; private final int WIDTH = FineUIScale.scale(227);
@Override @Override
protected int getBoundX() { protected int getBoundX() {

14
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartValueColorPane.java

@ -1,21 +1,18 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.range.VanChartRangeLegend; import com.fr.plugin.chart.range.VanChartRangeLegend;
import com.fr.plugin.chart.type.LegendType; import com.fr.plugin.chart.type.LegendType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.range.component.GradualLegendPane; import com.fr.van.chart.range.component.GradualLegendPane;
import com.fr.van.chart.range.component.SectionLegendPane; import com.fr.van.chart.range.component.SectionLegendPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -65,8 +62,7 @@ public class VanChartValueColorPane extends BasicPane {
Component[][] labelComponent = new Component[][]{ Component[][] labelComponent = new Component[][]{
new Component[]{label, valueColorTypeButton}, new Component[]{label, valueColorTypeButton},
}; };
JPanel legendTypeButtonWithTilePane = TableLayout4VanChartHelper.createGapTableLayoutPane(labelComponent); JPanel legendTypeButtonWithTilePane = FineLayoutBuilder.compatibleTableLayout(0, labelComponent, new double[]{1.2, 3});
legendTypeButtonWithTilePane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
//渐变色图例面板 //渐变色图例面板
gradualLegendPane = createGradualLegendPane(); gradualLegendPane = createGradualLegendPane();
//区域段图例面板 //区域段图例面板
@ -86,15 +82,11 @@ public class VanChartValueColorPane extends BasicPane {
rangeLegendPane.add(gradualLegendPane, LegendType.GRADUAL.getStringType()); rangeLegendPane.add(gradualLegendPane, LegendType.GRADUAL.getStringType());
rangeLegendPane.add(sectionLegendPane, LegendType.SECTION.getStringType()); rangeLegendPane.add(sectionLegendPane, LegendType.SECTION.getStringType());
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] col = {f};
double[] row = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{legendTypeButtonWithTilePane}, new Component[]{legendTypeButtonWithTilePane},
new Component[]{rangeLegendPane} new Component[]{rangeLegendPane}
}; };
JPanel tableLayoutPane = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel tableLayoutPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(tableLayoutPane, BorderLayout.CENTER); this.add(tableLayoutPane, BorderLayout.CENTER);

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartYAxisScrollPaneWithRadar.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.style.axis.radar; package com.fr.van.chart.designer.style.axis.radar;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.van.chart.designer.style.axis.VanChartAxisScrollPaneWithOutTypeSelect; import com.fr.van.chart.designer.style.axis.VanChartAxisScrollPaneWithOutTypeSelect;
/** /**
@ -10,5 +11,6 @@ public class VanChartYAxisScrollPaneWithRadar extends VanChartAxisScrollPaneWith
protected void initAxisPane() { protected void initAxisPane() {
axisPane = new VanChartRadarYAxisPane(); axisPane = new VanChartRadarYAxisPane();
axisPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
} }
} }

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -32,7 +32,6 @@ import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.type.GradientType; import com.fr.plugin.chart.type.GradientType;
import com.fr.van.chart.custom.style.VanChartCustomStylePane; import com.fr.van.chart.custom.style.VanChartCustomStylePane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane; import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane;
import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartBeautyPane;
import com.fr.van.chart.designer.component.VanChartFillStylePane; import com.fr.van.chart.designer.component.VanChartFillStylePane;
@ -153,7 +152,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//趋势线 //趋势线
protected JPanel createTrendLinePane() { protected JPanel createTrendLinePane() {
trendLinePane = new VanChartTrendLinePane(); trendLinePane = new VanChartTrendLinePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TrendLine"), trendLinePane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_TrendLine"), trendLinePane, true);
} }
//线 //线
@ -169,7 +168,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//标记点类型 //标记点类型
protected JPanel createMarkerPane() { protected JPanel createMarkerPane() {
markerPane = new VanChartMarkerPane(); markerPane = new VanChartMarkerPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true);
} }
//填充颜色 //填充颜色

22
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartMultiColorSeriesPane.java

@ -1,16 +1,15 @@
package com.fr.van.chart.designer.style.series; package com.fr.van.chart.designer.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -38,7 +37,7 @@ public abstract class VanChartMultiColorSeriesPane extends VanChartAbstractPlotS
//获取颜色面板 //获取颜色面板
protected JPanel getColorPane() { protected JPanel getColorPane() {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
JPanel colorChoosePane = createColorChoosePane(); JPanel colorChoosePane = createColorChoosePane();
if (colorChoosePane != null) { if (colorChoosePane != null) {
panel.add(colorChoosePane, BorderLayout.CENTER); panel.add(colorChoosePane, BorderLayout.CENTER);
@ -46,8 +45,7 @@ public abstract class VanChartMultiColorSeriesPane extends VanChartAbstractPlotS
stylePane = createStylePane(); stylePane = createStylePane();
setColorPaneContent(panel); setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); JPanel colorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Color"), panel, true);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));
return panel.getComponentCount() == 0 ? null : colorPane; return panel.getComponentCount() == 0 ? null : colorPane;
} }
@ -55,15 +53,11 @@ public abstract class VanChartMultiColorSeriesPane extends VanChartAbstractPlotS
JPanel divideButtonPane = initDivideButtonPane(); JPanel divideButtonPane = initDivideButtonPane();
colorDividePane = createColorDividePane(); colorDividePane = createColorDividePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] col = {f};
double[] row = {p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{divideButtonPane}, new Component[]{divideButtonPane},
new Component[]{colorDividePane} new Component[]{colorDividePane}
}; };
return TableLayoutHelper.createCommonTableLayoutPane(components, row, col, 0); return FineLayoutBuilder.compatibleTableLayout(10, components,new double[1]);
} }
private JPanel initDivideButtonPane() { private JPanel initDivideButtonPane() {
@ -74,9 +68,7 @@ public abstract class VanChartMultiColorSeriesPane extends VanChartAbstractPlotS
Component[][] labelComponent = new Component[][]{ Component[][] labelComponent = new Component[][]{
new Component[]{label, colorDivideButton}, new Component[]{label, colorDivideButton},
}; };
JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(labelComponent); return FineLayoutBuilder.compatibleTableLayout(10, labelComponent, new double[]{1.2, 3});
gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
return gapTableLayoutPane;
} }
protected abstract UIButtonGroup<String> createDivideButton(); protected abstract UIButtonGroup<String> createDivideButton();

36
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

@ -1,9 +1,12 @@
package com.fr.van.chart.gauge; package com.fr.van.chart.gauge;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.GradientStyle; import com.fr.chart.base.GradientStyle;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
@ -11,8 +14,6 @@ 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.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithMaxMin; import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithMaxMin;
import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane;
@ -75,18 +76,13 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
} }
protected JPanel getContentInPlotType() { protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createGaugeLayoutPane()}, new Component[]{createGaugeLayoutPane()},
new Component[]{createGaugeStylePane(rowSize, new double[]{f, e})}, new Component[]{createGaugeStylePane()},
new Component[]{createGaugeBandsPane()} new Component[]{createGaugeBandsPane()}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
} }
protected JPanel createColorChoosePane() { protected JPanel createColorChoosePane() {
@ -183,7 +179,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
changeLabelPosition(); changeLabelPosition();
} }
}); });
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Layout"), panel); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Layout"), panel, true);
} }
private void changeLabelPosition() { private void changeLabelPosition() {
@ -213,15 +209,16 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
} }
} }
private JPanel createGaugeStylePane(double[] row, double[] col) { private JPanel createGaugeStylePane() {
JPanel panel = new JPanel(new BorderLayout(0, 6)); JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
JPanel centerPanel = TableLayoutHelper.createTableLayoutPane(getDiffComponentsWithGaugeStyle(), row, col); JPanel centerPanel = FineLayoutBuilder.compatibleTableLayout(10, getDiffComponentsWithGaugeStyle(), new double[]{1.2, 3});
panel.add(centerPanel, BorderLayout.CENTER); panel.add(centerPanel, BorderLayout.CENTER);
if (rotate != null) { if (rotate != null) {
JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Rotation_Direction"), rotate); JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Rotation_Direction")), rotate);
panel.add(panel1, BorderLayout.NORTH); panel.add(panel1, BorderLayout.NORTH);
} }
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel, true);
} }
private Component[][] getDiffComponentsWithGaugeStyle() { private Component[][] getDiffComponentsWithGaugeStyle() {
@ -230,7 +227,6 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
case RING: case RING:
initRotate(); initRotate();
return new Component[][]{ return new Component[][]{
new Component[]{null, null},
getPaneBackgroundColorAuto(), getPaneBackgroundColorAuto(),
new Component[]{null, paneBackgroundColor}, new Component[]{null, paneBackgroundColor},
getInnerPaneBackgroundColor(), getInnerPaneBackgroundColor(),
@ -239,7 +235,6 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
}; };
case SLOT: case SLOT:
return new Component[][]{ return new Component[][]{
new Component[]{null, null},
getNeedleColor(), getNeedleColor(),
getSlotBackgroundColorAuto(), getSlotBackgroundColorAuto(),
new Component[]{null, slotBackgroundColor}, new Component[]{null, slotBackgroundColor},
@ -248,7 +243,6 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
}; };
case THERMOMETER: case THERMOMETER:
return new Component[][]{ return new Component[][]{
new Component[]{null, null},
getNeedleColor(), getNeedleColor(),
getSlotBackgroundColorAuto(), getSlotBackgroundColorAuto(),
new Component[]{null, slotBackgroundColor}, new Component[]{null, slotBackgroundColor},
@ -257,7 +251,6 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
}; };
default: default:
return new Component[][]{ return new Component[][]{
new Component[]{null, null},
getHingeColorAuto(), getHingeColorAuto(),
new Component[]{null, hingeColor}, new Component[]{null, hingeColor},
getHingeBackgroundColor(), getHingeBackgroundColor(),
@ -354,24 +347,21 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane {
GaugeStyle gaugeStyle = getGaugeStyle(); GaugeStyle gaugeStyle = getGaugeStyle();
if (gaugeStyle == GaugeStyle.POINTER || gaugeStyle == GaugeStyle.POINTER_SEMI) { if (gaugeStyle == GaugeStyle.POINTER || gaugeStyle == GaugeStyle.POINTER_SEMI) {
colorPickerPane = new ColorPickerPaneWithMaxMin(parentPane, "meterString"); colorPickerPane = new ColorPickerPaneWithMaxMin(parentPane, "meterString");
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Range"), colorPickerPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Range"), colorPickerPane);
} }
return null; return null;
} }
private void checkHingeColorAutoButton() { private void checkHingeColorAutoButton() {
hingeColor.setVisible(hingeColorAuto.getSelectedIndex() == 1); hingeColor.setVisible(hingeColorAuto.getSelectedIndex() == 1);
hingeColor.setPreferredSize(hingeColorAuto.getSelectedIndex() == 1 ? new Dimension(0, 20) : new Dimension(0, 0));
} }
private void checkSlotBackgroundColorAutoButton() { private void checkSlotBackgroundColorAutoButton() {
slotBackgroundColor.setVisible(slotBackgroundColorAuto.getSelectedIndex() == 1); slotBackgroundColor.setVisible(slotBackgroundColorAuto.getSelectedIndex() == 1);
slotBackgroundColor.setPreferredSize(slotBackgroundColorAuto.getSelectedIndex() == 1 ? new Dimension(0, 20) : new Dimension(0, 0));
} }
private void checkPaneBackgroundColorAutoButton() { private void checkPaneBackgroundColorAutoButton() {
paneBackgroundColor.setVisible(paneBackgroundColorAuto.getSelectedIndex() == 1); paneBackgroundColor.setVisible(paneBackgroundColorAuto.getSelectedIndex() == 1);
paneBackgroundColor.setPreferredSize(paneBackgroundColorAuto.getSelectedIndex() == 1 ? new Dimension(0, 20) : new Dimension(0, 0));
} }
public void populateBean(Plot plot) { public void populateBean(Plot plot) {

117
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -1,17 +1,16 @@
package com.fr.van.chart.map; package com.fr.van.chart.map;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.chart.chartdata.model.DataProcessor; import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
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.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -45,7 +44,6 @@ import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane;
import com.fr.van.chart.map.line.VanChartCurvePane; import com.fr.van.chart.map.line.VanChartCurvePane;
import com.fr.van.chart.map.line.VanChartLineMapEffectPane; import com.fr.van.chart.map.line.VanChartLineMapEffectPane;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -57,8 +55,10 @@ import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; 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.row;
/** /**
* Created by Mitisky on 16/5/4. * Created by Mitisky on 16/5/4.
@ -165,7 +165,8 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
checkLineMapLarge(); checkLineMapLarge();
} }
}); });
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup); JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), lineMapLargeDataModelGroup);
return createLargeDataModelPane(panel); return createLargeDataModelPane(panel);
} }
@ -264,7 +265,6 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
mapType = ((VanChartMapPlot) plot).getAllLayersMapType(); mapType = ((VanChartMapPlot) plot).getAllLayersMapType();
if (mapType == MapType.CUSTOM || mapType == MapType.DRILL_CUSTOM) { if (mapType == MapType.CUSTOM || mapType == MapType.DRILL_CUSTOM) {
JPanel pane = createColorChoosePane(); JPanel pane = createColorChoosePane();
pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
panel.add(pane, BorderLayout.NORTH); panel.add(pane, BorderLayout.NORTH);
} }
panel.add(getContentInPlotType(), BorderLayout.CENTER); panel.add(getContentInPlotType(), BorderLayout.CENTER);
@ -283,8 +283,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
} }
setColorPaneContent(panel, paneType); setColorPaneContent(panel, paneType);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); JPanel colorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Color"), panel, true);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));
return panel.getComponentCount() == 0 ? null : colorPane; return panel.getComponentCount() == 0 ? null : colorPane;
} }
@ -323,33 +322,22 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
//不透明度 //不透明度
protected JPanel createAlphaPane() { protected JPanel createAlphaPane() {
setTransparent(new UINumberDragPaneWithPercent(0, 100)); setTransparent(new UINumberDragPaneWithPercent(0, 100));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
double[] rowSize = {p, p};
UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Alpha")); UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Alpha"));
label.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{label, UIComponentUtils.wrapWithBorderLayoutPane(getTransparent())}, new Component[]{label, UIComponentUtils.wrapWithBorderLayoutPane(getTransparent())},
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
protected JPanel createAreaPane() { protected JPanel createAreaPane() {
borderWithAlphaPane = new VanChartBorderWithAlphaPane(true); borderWithAlphaPane = new VanChartBorderWithAlphaPane(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{getColorPane(MapType.AREA)}, new Component[]{getColorPane(MapType.AREA)},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)},
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
} }
protected JPanel createNullValueColorPane() { protected JPanel createNullValueColorPane() {
@ -358,19 +346,12 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
initNullValueListener(); initNullValueListener();
nullValueColorBox = new ColorSelectBox(80); nullValueColorBox = new ColorSelectBox(80);
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), SwingConstants.LEFT); UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), SwingConstants.LEFT);
Component[][] components = { Component[][] components = {
new Component[]{null, null},
new Component[]{text, nullValueAuto}, new Component[]{text, nullValueAuto},
new Component[]{null, nullValueColorBox}, new Component[]{null, nullValueColorBox},
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
@ -385,16 +366,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
private void checkNullValueButton() { private void checkNullValueButton() {
nullValueColorBox.setVisible(nullValueAuto.getSelectedIndex() == 1); nullValueColorBox.setVisible(nullValueAuto.getSelectedIndex() == 1);
nullValueColorBox.setPreferredSize(nullValueAuto.getSelectedIndex() == 1 ? new Dimension(0, 20) : new Dimension(0, 0));
} }
private JPanel createPointPane() { private JPanel createPointPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{getColorPane(MapType.POINT)}, new Component[]{getColorPane(MapType.POINT)},
new Component[]{createMarkerComPane()}, new Component[]{createMarkerComPane()},
@ -403,15 +378,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
new Component[]{createPointEffectPane()}, new Component[]{createPointEffectPane()},
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
} }
private JPanel createLinePane() { private JPanel createLinePane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p};
double[] col = {f};
curvePane = new VanChartCurvePane(); curvePane = new VanChartCurvePane();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -422,28 +392,29 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
new Component[]{createAnimationPane()} new Component[]{createAnimationPane()}
}; };
return TableLayoutHelper.createTableLayoutPane(components, row, col); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
} }
private Component createCurvePane() { private Component createCurvePane() {
curvePane = new VanChartCurvePane(); curvePane = new VanChartCurvePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane, true);
} }
private Component createAnimationPane() { private Component createAnimationPane() {
lineMapEffectPane = new VanChartLineMapEffectPane(); lineMapEffectPane = new VanChartLineMapEffectPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane, true);
} }
//不透明度 //不透明度
private JPanel createPointAlphaPane() { private JPanel createPointAlphaPane() {
pointAlphaPane = new UINumberDragPaneWithPercent(0, 100); pointAlphaPane = new UINumberDragPaneWithPercent(0, 100);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), pointAlphaPane);
} }
private JPanel createPointEffectPane() { private JPanel createPointEffectPane() {
pointEffectPane = new VanChartEffectPane(); pointEffectPane = new VanChartEffectPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane, true);
} }
private JPanel createMarkerComPane() { private JPanel createMarkerComPane() {
@ -454,15 +425,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);
bubblePane = new VanChartBubblePane() { bubblePane = new VanChartBubblePane() {
protected JPanel getContentPane() { protected JPanel getContentPane() {
double p = TableLayout.PREFERRED; return FineLayoutBuilder.compatibleTableLayout(10, getComponent(), new double[]{1.2, 3});
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] row = {p, p, p, p, p};
double[] col = {f, e};
JPanel panel = TableLayoutHelper.createTableLayoutPane(getComponent(), row, col);
panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);
return panel;
} }
}; };
imageMarkerPane = new VanChartImageMarkerPane(); imageMarkerPane = new VanChartImageMarkerPane();
@ -483,19 +446,19 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
markerContentPane.add(panes[i], COMPATIBLE_MARKER_TYPES[i]); markerContentPane.add(panes[i], COMPATIBLE_MARKER_TYPES[i]);
} }
markerTypeCom.addItemListener(new ItemListener() { markerTypeCom.addItemListener(e -> {
@Override markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem());
public void itemStateChanged(ItemEvent e) { checkPointEffectPane(plot);
markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem());
checkPointEffectPane(plot);
}
}); });
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Point_Style"), markerTypeCom); JPanel markerPane = column(10,
JPanel markerPane = new JPanel(new BorderLayout(0, 6)); row(
markerPane.add(northPane, BorderLayout.NORTH); cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Point_Style"))).weight(1.2),
markerPane.add(markerContentPane, BorderLayout.CENTER); cell(markerTypeCom).weight(3)
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); ),
cell(markerContentPane)
).getComponent();
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true);
} }
private JPanel createCustomPane(Plot plot) { private JPanel createCustomPane(Plot plot) {
@ -503,9 +466,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
JPanel pointPane = createPointPane(); JPanel pointPane = createPointPane();
JPanel linePane = createLinePane(); JPanel linePane = createLinePane();
JPanel panel = createGroupPane(plot, areaPane, pointPane, linePane); return createGroupPane(plot, areaPane, pointPane, linePane);
return panel;
} }
private JPanel createGroupPane(Plot plot, JPanel areaPane, JPanel pointPane, JPanel linePane) { private JPanel createGroupPane(Plot plot, JPanel areaPane, JPanel pointPane, JPanel linePane) {
@ -515,7 +476,6 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} else { } else {
panel = createMapCustomGroupPane(areaPane, pointPane, linePane); panel = createMapCustomGroupPane(areaPane, pointPane, linePane);
} }
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
return panel; return panel;
} }
@ -542,10 +502,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
}); });
JPanel panel = new JPanel(new BorderLayout(0, 4)); return column(10,cell(areaPointAndLineGroup), cell(centerPane)).getComponent();
panel.add(areaPointAndLineGroup, BorderLayout.NORTH);
panel.add(centerPane, BorderLayout.CENTER);
return panel;
} }
private JPanel createDrillMapCustomGroupPane(JPanel areaPane, JPanel pointPane) { private JPanel createDrillMapCustomGroupPane(JPanel areaPane, JPanel pointPane) {
@ -567,11 +524,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
} }
}); });
return column(10,cell(areaAndPointGroup), cell(centerPane)).getComponent();
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(areaAndPointGroup, BorderLayout.NORTH);
panel.add(centerPane, BorderLayout.CENTER);
return panel;
} }
public void populateBean(Plot plot) { public void populateBean(Plot plot) {

15
designer-chart/src/main/java/com/fr/van/chart/range/component/GradualLegendPane.java

@ -1,12 +1,9 @@
package com.fr.van.chart.range.component; package com.fr.van.chart.range.component;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.range.GradualLegend; import com.fr.plugin.chart.range.GradualLegend;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
public class GradualLegendPane extends JPanel { public class GradualLegendPane extends JPanel {
private static final long serialVersionUID = 1614283200308877353L; private static final long serialVersionUID = 1614283200308877353L;
@ -20,18 +17,8 @@ public class GradualLegendPane extends JPanel {
private void initComponents() { private void initComponents() {
intervalConfigPane = createGradualIntervalConfigPane(); intervalConfigPane = createGradualIntervalConfigPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] col = {f};
double[] row = {p};
Component[][] components = new Component[][]{
new Component[]{intervalConfigPane},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(intervalConfigPane, BorderLayout.CENTER);
} }
protected GradualIntervalConfigPane createGradualIntervalConfigPane() { protected GradualIntervalConfigPane createGradualIntervalConfigPane() {

17
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -1,15 +1,14 @@
package com.fr.van.chart.scatter; package com.fr.van.chart.scatter;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.Marker; import com.fr.chart.chartglyph.Marker;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane; import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane; import com.fr.van.chart.designer.component.VanChartLineTypePane;
import com.fr.van.chart.designer.component.VanChartMarkerPane; import com.fr.van.chart.designer.component.VanChartMarkerPane;
import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane;
@ -33,12 +32,6 @@ public class VanChartScatterSeriesPane extends VanChartColorValueSeriesPane {
protected JPanel getContentInPlotType() { protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createLineTypePane()}, new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()}, new Component[]{createMarkerPane()},
@ -48,7 +41,7 @@ public class VanChartScatterSeriesPane extends VanChartColorValueSeriesPane {
new Component[]{createTrendLinePane()}, new Component[]{createTrendLinePane()},
}; };
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
return contentPane; return contentPane;
} }
@ -71,7 +64,7 @@ public class VanChartScatterSeriesPane extends VanChartColorValueSeriesPane {
return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis"); return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
} }
}; };
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane, true);
return stackAndAxisEditExpandablePane; return stackAndAxisEditExpandablePane;
} }
@ -99,6 +92,6 @@ public class VanChartScatterSeriesPane extends VanChartColorValueSeriesPane {
} }
}; };
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true);
} }
} }

48
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceEditPane.java

@ -1,5 +1,10 @@
package com.fr.design.sort.expressionpane; package com.fr.design.sort.expressionpane;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -28,11 +33,13 @@ import java.awt.dnd.DropTargetDropEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.theme.utils.FineUIScale.scale;
public class CustomSequenceEditPane extends BasicPane { public class CustomSequenceEditPane extends BasicPane {
java.util.List<String> customSequence; java.util.List<String> customSequence;
JSplitPane jSplitPane; JSplitPane jSplitPane;
JPanel referenceSequencePanel; Column referenceSequencePanel;
JPanel editSequencePanel; Column editSequencePanel;
JTextArea jTextArea; JTextArea jTextArea;
CustomSequenceEditPane(java.util.List<String> customSequence) { CustomSequenceEditPane(java.util.List<String> customSequence) {
@ -60,21 +67,21 @@ public class CustomSequenceEditPane extends BasicPane {
} }
void initReferenceSequencePanel() { void initReferenceSequencePanel() {
referenceSequencePanel = new JPanel(); referenceSequencePanel = new Column();
referenceSequencePanel.setLayout(new BoxLayout(referenceSequencePanel, BoxLayout.Y_AXIS)); UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Reference_Sequence"));
JPanel titlePane = new JPanel(new FlowLayout(FlowLayout.LEFT));
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Reference_Sequence"));
titlePane.add(uiLabel);
referenceSequencePanel.add(titlePane);
UIScrollPane uiScrollPane = new UIScrollPane(getReferenceSequenceList()); UIScrollPane uiScrollPane = new UIScrollPane(getReferenceSequenceList());
uiScrollPane.setPreferredSize(new Dimension(200, 300)); uiScrollPane.setPreferredSize(scale(new Dimension(200, 320)));
uiScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
referenceSequencePanel.add(titleLabel);
referenceSequencePanel.add(uiScrollPane); referenceSequencePanel.add(uiScrollPane);
referenceSequencePanel.setSize(new Dimension(200, 400)); referenceSequencePanel.setSize(scale(new Dimension(200, 400)));
} }
private UIList getReferenceSequenceList() { private UIList getReferenceSequenceList() {
UIList uiList = new UIList(getReferenceSequenceModel()); UIList uiList = new UIList(getReferenceSequenceModel());
new CustomSequenceEditDragSource(uiList, DnDConstants.ACTION_MOVE); new CustomSequenceEditDragSource(uiList, DnDConstants.ACTION_MOVE);
FineUIStyle.setStyle(uiList, FineUIStyle.PURE_LIST);
return uiList; return uiList;
} }
@ -88,20 +95,19 @@ public class CustomSequenceEditPane extends BasicPane {
} }
void initEditSequencePanel() { void initEditSequencePanel() {
editSequencePanel = new JPanel(); editSequencePanel = new Column();
editSequencePanel.setLayout(new BoxLayout(editSequencePanel, BoxLayout.Y_AXIS)); UILabel inputLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Input_Sequence"));
JPanel titlePane = new JPanel(new FlowLayout(FlowLayout.LEFT)); UILabel hintLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Please_Interlace_Sequence_Elements"));
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Input_Sequence")); FineUIStyle.setStyle(hintLabel, FineUIStyle.LABEL_TIP);
titlePane.add(uiLabel);
UILabel uiLabel2 = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Please_Interlace_Sequence_Elements")); JPanel titlePane = FineLayoutBuilder.createHorizontalLayout(5, inputLabel, hintLabel);
uiLabel2.setForeground(Color.lightGray);
titlePane.add(uiLabel2);
editSequencePanel.add(titlePane);
jTextArea = getTextArea(); jTextArea = getTextArea();
UIScrollPane uiScrollPane = new UIScrollPane(jTextArea); UIScrollPane uiScrollPane = new UIScrollPane(jTextArea);
uiScrollPane.setPreferredSize(new Dimension(475, 300)); uiScrollPane.setPreferredSize(scale(new Dimension(475, 320)));
editSequencePanel.add(titlePane);
editSequencePanel.add(uiScrollPane); editSequencePanel.add(uiScrollPane);
editSequencePanel.setSize(new Dimension(475, 300)); editSequencePanel.setSize(scale(new Dimension(475, 320)));
} }

2
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java

@ -49,7 +49,7 @@ public class CustomSequencePane extends JPanel {
triggerOk(CustomSequenceSortExpression.customSequenceToString(customSequence, ","), triggerOk(CustomSequenceSortExpression.customSequenceToString(customSequence, ","),
CustomSequenceSortExpression.isReferenceCustomSequence(customSequence)); CustomSequenceSortExpression.isReferenceCustomSequence(customSequence));
} }
}, FineUIScale.scale(new Dimension(700, 400))).setVisible(true); }, new Dimension(700, 420)).setVisible(true);
} }
}; };
button.addMouseListener(mouseAdapter); button.addMouseListener(mouseAdapter);

Loading…
Cancel
Save