Browse Source

REPORT-113994 【NewUI】设计器样式翻新-图表

newui
Levy.Xie-解安森 4 months ago
parent
commit
28eede8586
  1. 44
      designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java
  2. 22
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  3. 51
      designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java
  4. 13
      designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java
  5. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  6. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java
  7. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java
  8. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java
  9. 26
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartGanttTimeLinePane.java
  10. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  11. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java
  12. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java
  13. 16
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartMarkerBackgroundPane.java
  14. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java
  15. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java
  16. 101
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  17. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  18. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java
  19. 70
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  20. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java
  21. 37
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java
  22. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java
  23. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java
  24. 34
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java
  25. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java
  26. 46
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java
  27. 31
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartGantPlotAreaBackgroundPane.java
  28. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java
  29. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  30. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  31. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java
  32. 47
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  33. 2
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/VanChartGanttDataAndLinkPane.java
  34. 6
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java
  35. 6
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java
  36. 20
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java
  37. 33
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java
  38. 6
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataProjectPane.java
  39. 16
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java
  40. 9
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java
  41. 29
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java
  42. 30
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java
  43. 14
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java
  44. 12
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java
  45. 10
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePaneWithPosition.java
  46. 38
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java
  47. 25
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java
  48. 47
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java
  49. 21
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java
  50. 17
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  51. 19
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java
  52. 10
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java
  53. 25
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java
  54. 28
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java
  55. 11
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotReportDataContentPane.java
  56. 14
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotTableDataContentPane.java
  57. 12
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java
  58. 13
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java
  59. 2
      designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java
  60. 71
      designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java
  61. 1
      designer-realize/src/main/java/com/fr/design/mainframe/cell/QuickEditorRegion.java
  62. 20
      designer-realize/src/main/java/com/fr/design/report/RichTextPane.java
  63. 5
      designer-realize/src/main/java/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java

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

@ -0,0 +1,44 @@
package com.fine.theme.utils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.stable.Constants;
import javax.swing.Icon;
/**
* 设计器典型组件组合工厂
*
* @author Levy.Xie
* @since 11.0
* Created on 2024/07/26
*/
public class FineComponentsFactory {
/**
* 创建水平对齐按钮组
*
* @return 组件
*/
public static UIButtonGroup<Integer> createHorizontalAlignmentButtonGroup() {
Icon[][] alignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
{new LazyIcon("h_center"), new LazyIcon("h_center").white()},
{new LazyIcon("h_right"), new LazyIcon("h_right").white()}};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
return new UIButtonGroup<>(alignmentIconArray, alignment);
}
/**
* 创建垂直对齐按钮组
*
* @return 组件
*/
public static UIButtonGroup<Integer> createVerticalAlignmentButtonGroup() {
Icon[][] alignmentIconArray = {{new LazyIcon("v_top"), new LazyIcon("v_top").white()},
{new LazyIcon("v_center"), new LazyIcon("v_center").white()},
{new LazyIcon("v_bottom"), new LazyIcon("v_bottom").white()}};
Integer[] alignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM};
return new UIButtonGroup<>(alignmentIconArray, alignment);
}
}

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

@ -5,6 +5,7 @@ import com.fine.swing.ui.layout.Layouts;
import com.fine.swing.ui.layout.Row;
import com.fine.swing.ui.layout.Spacer;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.collections.combination.Pair;
@ -131,15 +132,32 @@ public class FineLayoutBuilder {
* @param elements 面板元素
* @return 面板
*/
public static Column createVerticalLayout(int spacing, JPanel... elements) {
public static Column createVerticalLayout(int spacing, Component... elements) {
Column column = new Column();
column.setSpacing(spacing);
for (JPanel element : elements) {
for (Component element : elements) {
column.add(element);
}
return column;
}
/**
* 创建水平布局面板
*
* @param spacing 间距
* @param elements 面板元素
* @return 面板
*/
public static Row createHorizontalLayout(int spacing, double[] weight, Component... elements) {
Row row = new Row();
row.setSpacing(spacing);
for (int i = 0; i < elements.length; i++) {
Layouts.populate(row, cell(elements[i]).weight(weight[i]));
}
return row;
}
/**
* 组件包装于BorderLayout中
*

51
designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java

@ -13,11 +13,11 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
@ -28,16 +28,11 @@ import com.fr.stable.Constants;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.Vector;
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.row;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* Pane to edit Font.
@ -66,7 +61,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private UIToggleButton isShadowCheckBox;
private UIToggleButton superPane;
private UIToggleButton subPane;
private ReactiveCardPane styleContainer;
private UIToolbar styleToolbar;
public FRFontPane() {
this.initComponents();
@ -111,7 +106,6 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
int line = frFont.getUnderline();
if (line == Constants.LINE_NONE) {
underline.setSelected(false);
styleContainer.removeAll();
} else {
underline.setSelected(true);
this.underlineCombo.setSelectedLineStyle(line);
@ -129,7 +123,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
this.superPane.setSelected(false);
this.subPane.setSelected(false);
}
styleContainer.select(underline.isSelected() ? "showLine" : "hideLine").populate();
underlineCombo.setVisible(underline.isSelected());
}
/**
@ -239,41 +233,35 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
isShadowCheckBox = new UIToggleButton(new LazyIcon("shadow"));
superPane = new UIToggleButton(new LazyIcon("super"));
subPane = new UIToggleButton(new LazyIcon("sub"));
styleContainer = ReactiveCardPane.create()
.addSupplier("showLine", this::createContentWithLine)
.addSupplier("hideLine", this:: createContentNoLine);
styleToolbar = createToolbar();
initAllNames();
setToolTips();
initListeners();
styleContainer.select("hideLine").populate();
underlineCombo.setVisible(false);
this.setLayout(new BorderLayout());
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(fontNameComboBox),
row(5,
cell(fontSizeStyleComboBox).weight(1),
cell(fontSizeComboBox).weight(1)),
cell(styleContainer)
cell(styleToolbar),
cell(underlineCombo)
).getComponent(), BorderLayout.CENTER);
DefaultValues defaultValues = FRContext.getDefaultValues();
populateBean(defaultValues.getFRFont());
}
private Component createContentNoLine() {
return createFontButtonRow().getComponent();
}
private Component createContentWithLine() {
return column(LayoutConstants.VERTICAL_GAP,
createFontButtonRow(),
cell(underlineCombo)
).getComponent();
}
private Cell<?> createFontButtonRow() {
return row(3, cell(colorSelectPane), cell(underline), cell(isStrikethroughCheckBox), cell(isShadowCheckBox),
cell(superPane), cell(subPane));
private UIToolbar createToolbar() {
UIToolbar toolbar = new UIToolbar();
toolbar.add(colorSelectPane);
toolbar.add(underline);
toolbar.add(isStrikethroughCheckBox);
toolbar.add(isShadowCheckBox);
toolbar.add(superPane);
toolbar.add(subPane);
return toolbar;
}
private void initAllNames() {
@ -303,12 +291,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
}
private void initListeners() {
underline.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
styleContainer.select(underline.isSelected() ? "showLine" : "hideLine").populate();
}
});
underline.addChangeListener(e -> underlineCombo.setVisible(underline.isSelected()));
}
/**

13
designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.predefined.ui.detail;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.Utils;
@ -7,14 +8,11 @@ import com.fr.chart.base.ChartConstants;
import com.fr.config.predefined.ColorFillStyle;
import com.fr.config.predefined.PredefinedColorStyle;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icombobox.ColorSchemeComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.background.gradient.FixedGradientBarNoTheme;
import com.fr.design.style.color.ColorAdjustPane;
import com.fr.stable.StringUtils;
@ -158,14 +156,7 @@ public class ColorFillStylePane extends BasicBeanPane<ColorFillStyle> {
}
protected JPanel getContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = 155;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(contentPaneComponents(), rowSize, columnSize, 12, LayoutConstants.VGAP_LARGE);
return panel;
return FineLayoutBuilder.compatibleTableLayout(10, contentPaneComponents(), new double[]{1.2, 3});
}
protected Component[][] contentPaneComponents() {

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.TableData;
import com.fr.chart.chartattr.Chart;
@ -22,6 +23,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private static final long serialVersionUID = 4740461028440155147L;
private DatabaseTableDataPane tableDataPane;
private AbstractTableDataContentPane dataContentPane;
protected Column centerPane;
private ChartDataPane parent;
@ -44,7 +46,10 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
checkBoxUse();
}
};
this.add(tableDataPane, BorderLayout.NORTH);
centerPane = new Column();
centerPane.setSpacing(10);
centerPane.add(tableDataPane);
this.add(centerPane, BorderLayout.CENTER);
}
/**
@ -116,7 +121,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
}
dataContentPane = contentPane;
if(dataContentPane != null) {
add(dataContentPane, BorderLayout.CENTER);
centerPane.add(dataContentPane);
}
}

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.TextAttr;
import com.fr.design.gui.ibutton.UIButtonGroup;
@ -37,13 +38,9 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane {
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Chart_Custom")});
double f = TableLayout.FILL;
double e = getEdithAreaWidth();
double p = TableLayout.PREFERRED;
double[] columnSize = {f, e};
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT);
JPanel preButtonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][]{new Component[]{text, preButton}}, new double[]{p}, columnSize);
textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
JPanel preButtonPane = FineLayoutBuilder.compatibleTableLayout(10, new Component[][]{new Component[]{text, preButton}}, new double[]{1.2, 3});
textFontPane = FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
panel.add(preButtonPane, BorderLayout.CENTER);
panel.add(textFontPane, BorderLayout.SOUTH);
return panel;

11
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java

@ -1,14 +1,13 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.GradientStyle;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.type.GradientType;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -37,17 +36,11 @@ public class VanChartBeautyPane extends BasicBeanPane<GradientStyle> {
gradientTypeBox = new UIButtonGroup(names);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(labelName()), gradientTypeBox},
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected String[] getNameArray() {

8
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

@ -10,8 +10,6 @@ import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -36,12 +34,6 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe
this.add(getContentPane(), BorderLayout.CENTER);
}
protected JPanel getContentPane() {
JPanel contentPane = super.getContentPane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
return contentPane;
}
protected Component[][] contentPaneComponents() {
return new Component[][]{
new Component[]{null, null},

26
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartGanttTimeLinePane.java

@ -1,17 +1,15 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
@ -27,13 +25,12 @@ public class VanChartGanttTimeLinePane extends JPanel {
public VanChartGanttTimeLinePane() {
this.setLayout(new BorderLayout());
this.add(createSwitchButtonPane(), BorderLayout.NORTH);
this.add(createCenterPane(), BorderLayout.CENTER);
this.add(FineLayoutBuilder.createVerticalLayout(10,
createSwitchButtonPane(), createCenterPane()
));
}
private JPanel createSwitchButtonPane() {
double[] columnSize = {TableLayout.PREFERRED, TableLayout.FILL};
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED};
String[] array = new String[]{Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Not_Show"), Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Show")};
switchButton = new UIButtonGroup<>(array);
switchButton.addChangeListener(new ChangeListener() {
@ -42,25 +39,20 @@ public class VanChartGanttTimeLinePane extends JPanel {
setCenterPaneVisibility();
}
});
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Current_Line"), SwingConstants.LEFT);
return TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][] {
new Component[]{null, null},
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Current_Line"));
return FineLayoutBuilder.compatibleTableLayout(10, new Component[][] {
new Component[] {text, switchButton}
}, rowSize, columnSize);
}, new double[]{1.2, 3});
}
private JPanel createCenterPane() {
double[] columnSize = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
colorSelect = new ColorSelectBoxWithOutTransparent(100);
opacity = new UINumberDragPaneWithPercent(0, 100);
centerPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][] {
new Component[]{null, null},
centerPane = FineLayoutBuilder.compatibleTableLayout(10, new Component[][] {
new Component[] {new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), colorSelect},
new Component[] {new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), opacity}
}, rowSize, columnSize);
}, new double[]{1.2, 3});
centerPane.setVisible(false);

13
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java

@ -1,6 +1,6 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.light.ui.FineButtonBorder;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -9,12 +9,9 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Nameable;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
@ -51,7 +48,6 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
public VanChartUIListControlPane() {
super();
this.setBorder(null);
getToolBar().setBorder(new FineButtonBorder());
iniListener();
}
@ -104,15 +100,10 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
@Override
protected JPanel getLeftTopPane(UIToolbar topToolBar) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(getAddItemText()), topToolBar},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
}
@Override

11
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.component.background;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.background.ImageBackground;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.dialog.BasicPane;
@ -9,7 +10,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
@ -17,7 +17,6 @@ import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
import com.fr.general.Background;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -72,13 +71,7 @@ public class VanChartBackgroundPane extends BasicPane {
}
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, getPaneComponents(), new double[]{1.2, 3});
}
protected void initComponents() {

21
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java

@ -1,16 +1,10 @@
package com.fr.van.chart.designer.component.background;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.Component;
/**
@ -27,21 +21,6 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro
super(hasAuto);
}
@Override
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH};
double[] rowSize = {p, p, p};
JPanel tableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize,
TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_MEDIUM);
tableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 4, 0));
return tableLayoutPane;
}
@Override
protected void initList() {
paneList.add(new NullBackgroundQuickPane() {

16
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartMarkerBackgroundPane.java

@ -2,15 +2,10 @@ package com.fr.van.chart.designer.component.background;
import com.fr.base.background.ColorBackground;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.Component;
/**
@ -19,17 +14,6 @@ import java.awt.Component;
public class VanChartMarkerBackgroundPane extends VanChartBackgroundPane {
private static final long serialVersionUID = -1032221277140976934L;
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{null, null},

17
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.component.marker;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartglyph.Marker;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
@ -8,7 +9,6 @@ import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -71,17 +71,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
public VanChartCommonMarkerPane() {
markerTypeComboBox = new MarkerComboBox(getMarkers());
markerFillColor = new VanChartMarkerBackgroundPane() {
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = getColumnSize()[1];
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{null, null},
@ -94,8 +83,8 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
double p = TableLayout.PREFERRED;
markerTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(getMarkerTypeComponent(), new double[]{p}, getColumnSize());
markerConfigPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getMarkerConfigComponent(), new double[]{p, p}, getColumnSize());
markerTypePane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerTypeComponent(), new double[]{1.2, 3});
markerConfigPane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerConfigComponent(), new double[]{1.2, 3});
markerTypeComboBox.addActionListener(new ActionListener() {
@Override

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

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.other;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
@ -9,23 +10,19 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -57,7 +54,6 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
protected JPanel createContentPane() {
JPanel content = new JPanel(new BorderLayout(0, 6));
moreLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
moreLabel.addChangeListener(new ChangeListener() {
@Override
@ -82,34 +78,27 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
jPanel.add(autoTooltip, BorderLayout.CENTER);
jPanel.add(tooltipSet, BorderLayout.EAST);
JPanel moreLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label"), moreLabel);
JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")), moreLabel);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, 20};
double[] column = {f, 20};
double[] rowSize = {p};
Component[][] components = initComponent(jPanel);
JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 1.2, 1.2, 0.6});
contentPane = new JPanel(new BorderLayout());
contentPane.add(panel1, BorderLayout.CENTER);
Component[][] AutoTooltipComponent = initAutoTooltipComponent();
JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(AutoTooltipComponent, rowSize, column);
panel2.setBorder(BorderFactory.createEmptyBorder(10, 0,0,0));
JPanel panel2 = FineLayoutBuilder.compatibleTableLayout(10, AutoTooltipComponent, new double[]{1.2, 2, 1});
contentPane.add(panel2, BorderLayout.SOUTH);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 72,0,0));
content.add(moreLabelPane, BorderLayout.NORTH);
content.add(contentPane, BorderLayout.CENTER);
return content;
return FineLayoutBuilder.createVerticalLayout(10, moreLabelPane, contentPane);
}
protected Component[][] initComponent(JPanel autoTooltipPane){
return new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")), autoRefreshTime, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds"))},
new Component[]{autoTooltip,null, tooltipSet},
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")),
autoRefreshTime, new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds"))},
new Component[]{null, autoTooltip, null, tooltipSet},
};
}
@ -117,13 +106,12 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
protected Component[][] initAutoTooltipComponent () {
return new Component[][]{
new Component[]{autoTooltip, tooltipSet},
new Component[]{null, autoTooltip, tooltipSet},
};
}
private void initTooltipSet() {
tooltipSet = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
tooltipSet.setPreferredSize(new Dimension(20, 20));
tooltipSet = new UIButton(new LazyIcon("tool_config"));
tooltipSet.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

101
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.designer.other;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.Chart;
@ -7,6 +9,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.LargeDataModeType;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -20,7 +23,6 @@ import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -48,11 +50,9 @@ import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
@ -127,30 +127,23 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
protected JPanel getInteractivePane(VanChartPlot plot) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p, p};
Component[][] components = ChartEditContext.normalMode() ? new Component[][]{
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null},
new Component[]{createToolBarPane(), null},
//大数据模式 恢复用注释。取消注释。
//new Component[]{createLargeDataModePane(), null},
new Component[]{createAnimationPane(), null},
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null},
new Component[]{createAxisRotationPane(plot), null},
new Component[]{createZoomPane(plot), null},
new Component[]{createAutoRefreshPane(plot), null},
new Component[]{createHyperlinkPane(), null}
} : new Component[][]{
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null},
new Component[]{createToolBarPane(), null},
new Component[]{createAnimationPane(), null},
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null},
new Component[]{createZoomPane(plot), null}
new Component[]{createAxisRotationPane(plot), null},
new Component[]{createZoomPane(plot, false), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0});
}
//大数据模式 恢复用注释。取消注释。
@ -192,27 +185,25 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
protected JPanel createZoomPane(VanChartPlot plot) {
//图表缩放新设计 恢复用注释。取消注释。
// zoomPane = createZoomPane();
// if (zoomPane == null) {
// return null;
// }
// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane);
return this.createZoomPane(plot, true);
}
//图表缩放新设计 恢复用注释。删除下面方法体所有代码。
protected JPanel createZoomPane(VanChartPlot plot, boolean withUnderline) {
if (!plot.isSupportZoomDirection()) {
return null;
}
zoomWidget = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Open_Zoom_Control"));
zoomGesture = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget"), zoomWidget);
JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture"), zoomGesture);
JPanel zoomWidgetPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget")), zoomWidget);
JPanel zoomGesturePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture")), zoomGesture);
zoomType = new UIButtonGroup(getNameArray(), getValueArray());
zoomTypePane = getZoomTypePane(zoomType);
JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, plot);
zoomWidget.addActionListener((event) -> checkZoomPane());
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel, withUnderline);
}
private void createChangeEnablePane(VanChartRectanglePlot plot) {
@ -235,17 +226,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
centerPane.add(scaleAxisPane, scaleAxis);
centerPane.add(scrollPane, scroll);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] row = {p, p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Control_Type")), controlType},
new Component[]{centerPane, null}
};
changeEnablePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
changeEnablePane.setBorder(BorderFactory.createEmptyBorder(5, 12, 0, 0));
changeEnablePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
controlType.addActionListener((event) -> checkCardPane());
}
@ -259,14 +244,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_From")), from},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_To")), to},
};
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] row = {p, p, p};
JPanel resizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
return resizePane;
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
@ -274,11 +252,6 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
VanChartAxis vanChartAxis = plot.getCategoryAxisList().get(0);
AxisType axisType = vanChartAxis.getAxisType();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] row = {p};
Component[][] components;
if (axisType == AxisType.AXIS_CATEGORY) {
categoryNum = new UnsignedIntUISpinner(1, Double.MAX_VALUE, 1);
@ -291,7 +264,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Scaling")), scaling},
};
}
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected void checkCardPane() {
@ -312,13 +285,14 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, VanChartPlot plot) {
JPanel panel = new JPanel(new BorderLayout(0, 4));
Column panel = new Column();
panel.setSpacing(10);
if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件
createChangeEnablePane((VanChartRectanglePlot) plot);
panel.add(zoomWidgetPane, BorderLayout.NORTH);
panel.add(changeEnablePane, BorderLayout.CENTER);
panel.add(zoomWidgetPane);
panel.add(changeEnablePane);
}
panel.add(zoomTypePane, BorderLayout.SOUTH);
panel.add(zoomTypePane);
return panel;
}
@ -430,7 +404,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return null;
}
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) {
private JPanel createAxisRotationPane(VanChartPlot plot) {
if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)) {
return null;
}
@ -449,12 +423,12 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel, true);
}
protected JPanel createToolBarPane(double[] row, double[] col) {
protected JPanel createToolBarPane() {
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort"));
exportImages = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Export_Image"));
fullScreenDisplay = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_FullScreen_Display"));
@ -462,8 +436,8 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
Component[][] components = createToolBarComponents();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel, true);
}
protected double[] getToolBarRowSize() {
@ -492,24 +466,19 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected JPanel createAnimationPane() {
isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
chartAnimationLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{chartAnimationLabel, isChartAnimation}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel, true);
}
protected JPanel createAutoRefreshPane(VanChartPlot plot) {
autoRefreshPane = getMoreLabelPane(plot);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"), autoRefreshPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"), autoRefreshPane, true);
}
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
@ -519,7 +488,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected JPanel createHyperlinkPane() {
superLink = new VanChartHyperLinkPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink);
}
private void checkLargeDataMode() {

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -1,6 +1,6 @@
package com.fr.van.chart.designer.style;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
@ -33,7 +33,6 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
@ -144,11 +143,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
private JPanel createTitlePositionPane() {
Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
{new LazyIcon("h_center"), new LazyIcon("h_center").white()},
{new LazyIcon("h_right"), new LazyIcon("h_right").white()}};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
alignmentPane = new UIButtonGroup<>(hAlignmentIconArray, alignment);
alignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup();
customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position"));
UIComponentUtils.setLineWrap(customFloatPositionButton);
customFloatPositionButton.setEventBannded(true);

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

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.chart.chartattr.Axis;
import com.fr.design.beans.FurtherBasicBeanPane;
@ -16,7 +17,6 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
@ -58,9 +58,8 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
}
protected void initLayout() {
this.setLayout(new BorderLayout(0,6));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Type"), jcb);
northPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);

70
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -1,13 +1,15 @@
package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Title;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -40,7 +42,6 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.axis.component.VanChartCategoryStylePaneWithCheckBox;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
@ -143,10 +144,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
double[] column = {f, s};
double[] rowSize = {p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, column, isXAxis), null},
new Component[]{createLabelPane(new double[]{p, p, p}, column), null},
new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null},
new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null},
new Component[]{createTitlePane(isXAxis), null},
new Component[]{createLabelPane(), null},
new Component[]{createLineStylePane(), null},
new Component[]{createAxisPositionPane(isXAxis), null},
new Component[]{createDisplayStrategy(), null},
new Component[]{createValueStylePane(), null},
};
@ -154,7 +155,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
protected JPanel createTitlePane(double[] row, double[] col, boolean isXAxis) {
protected JPanel createTitlePane(boolean isXAxis) {
showTitle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")});
titleAlignPane = isXAxis ? getXAxisTitleAlignPane() : getYAxisTitleAlignPane();
titleAlignPane.setSelectedItem(Constants.CENTER);
@ -179,10 +180,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
UIComponentUtils.wrapWithBorderLayoutPane(titleTextRotation)
},
};
titlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
titlePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
titlePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
JPanel showTitlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Title"), showTitle);
JPanel showTitlePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Title")), showTitle);
showTitle.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -194,44 +195,34 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
jPanel.add(showTitlePane, BorderLayout.NORTH);
jPanel.add(titlePane, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel);
return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel, true);
}
private UIButtonGroup<Integer> getXAxisTitleAlignPane() {
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
return new UIButtonGroup<Integer>(alignmentIconArray, alignment);
return FineComponentsFactory.createHorizontalAlignmentButtonGroup();
}
private UIButtonGroup<Integer> getYAxisTitleAlignPane() {
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png")};
Integer[] alignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM};
return new UIButtonGroup<Integer>(alignmentIconArray, alignment);
return FineComponentsFactory.createVerticalAlignmentButtonGroup();
}
protected JPanel createLabelPane(double[] row, double[] col) {
protected JPanel createLabelPane() {
initLabelComponents();
labelPane = new VanChartAxisStyleSettingPane(showLabelDisplay(), getChartTextAttrPane());
wholeDisplayLabelPanel = new VanChartAxisStyleSettingPane(showLabelDisplay(), getChartTextAttrPane());
wholeDisplayLabelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
addComponentsListener();
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel);
JPanel showLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel);
JPanel labelContentPane = createLabelContentPane();
JPanel labelPane = new JPanel(new BorderLayout());
labelPane.add(showLabelPane, BorderLayout.NORTH);
labelPane.add(labelContentPane, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane);
return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane, true);
}
private void initLabelComponents() {
@ -298,7 +289,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
*/
private JPanel createCategoryStylePane() {
categoryStylePane = new JPanel(new BorderLayout());
categoryStylePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
// categoryStylePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
return categoryStylePane;
}
@ -316,7 +307,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
return VanChartAxisPaneHelper.createAxisTextAttrPane();
}
protected JPanel createLineStylePane(double[] row, double[] col) {
protected JPanel createLineStylePane() {
axisLineStyle = createLineComboBox();
axisLineColor = new ColorSelectBoxWithThemeStyle(100);
String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")};
@ -324,8 +315,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
mainTick = new UIButtonGroup<AxisTickLineType>(strings, values);
secondTick = new UIButtonGroup<AxisTickLineType>(strings, values);
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getLineStylePaneComponents(), row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Axis_Line_Style"), panel);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, getLineStylePaneComponents(), new double[]{1.2, 3});
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Axis_Line_Style"), panel, true);
}
protected LineComboBox createLineComboBox() {
@ -342,7 +333,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
};
}
protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis) {
protected JPanel createAxisPositionPane(boolean isXAxis) {
position = new UIButtonGroup<Integer>(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis));
reversed = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
Component[][] components = new Component[][]{
@ -354,8 +345,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_AxisReversed")), reversed},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel, true);
}
private String[] getAxisPositionNameArray(boolean isXAxis) {
@ -393,11 +384,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel, true);
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane();
// return limitPane;
}
protected JPanel createValueStylePane() {
@ -413,16 +401,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
centerPane.add(valueFormat, Toolkit.i18nText("Fine-Design_Chart_Common"));
centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format"), SwingConstants.LEFT), valueFormatStyle},
new Component[]{null, centerPane},
};
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
valueFormatStyle.addActionListener(new ActionListener() {

22
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.design.chart.ChartSwingUtils;
@ -7,6 +8,7 @@ import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.editor.DateEditor;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
@ -15,7 +17,6 @@ import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -61,24 +62,17 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
@Override
protected JPanel createContentPane(boolean isXAxis){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] column = {f, s};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createTitlePane(new double[]{p, p, p, p, p,p}, column, isXAxis),null},
new Component[]{createLabelPane(new double[]{p, p, p}, column),null},
new Component[]{createTitlePane(isXAxis),null},
new Component[]{createLabelPane(),null},
new Component[]{createValueDefinition(),null},
new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null},
new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis),null},
new Component[]{createLineStylePane(),null},
new Component[]{createAxisPositionPane(isXAxis),null},
new Component[]{createDisplayStrategy(),null},
new Component[]{createValueStylePane(),null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
protected boolean showLabelDisplay() {
@ -87,7 +81,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane {
private JPanel createValueDefinition(){
timeMinMaxValuePane = new TimeMinMaxValuePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane, true);
}
@Override

37
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java

@ -1,13 +1,13 @@
package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.chart.base.ChartBaseUtils;
import com.fr.design.chart.ChartSwingUtils;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.stable.StringUtils;
@ -42,35 +42,28 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
@Override
protected JPanel createContentPane(boolean isXAxis){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] column = {f, s};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, column, isXAxis), null},
new Component[]{createLabelPane(new double[]{p, p, p}, column), null},
new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null},
new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null},
new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null},
new Component[]{createTitlePane(isXAxis), null},
new Component[]{createLabelPane(), null},
new Component[]{createMinMaxValuePane(), null},
new Component[]{createLineStylePane(), null},
new Component[]{createAxisPositionPane(isXAxis), null},
new Component[]{createDisplayStrategy(), null},
new Component[]{createValueStylePane(), null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected boolean showLabelDisplay() {
return false;
}
protected JPanel createMinMaxValuePane(double[] row, double[] col){
JPanel panel = createCommenValuePane(row,col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel);
protected JPanel createMinMaxValuePane(){
JPanel panel = createCommenValuePane();
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel, true);
}
protected JPanel createCommenValuePane(double[] row, double[] col){
protected JPanel createCommenValuePane(){
initMinMaxValuePane();
logBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_LogBase_Value"));
@ -82,10 +75,6 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
});
ChartSwingUtils.addListener(logBox, logBaseField);
// JPanel logPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
// logPane.add(logBox);
// logPane.add(logBaseField);
logPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Log_Base_Value"), logBaseField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
@ -108,7 +97,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
}
});
return TableLayoutHelper.createTableLayoutPane(components, row, col);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected void initMinMaxValuePane() {

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

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.style.axis.component;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
@ -13,7 +14,6 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.van.chart.designer.style.axis.VanChartAxisPane;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JPanel;
@ -57,15 +57,13 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
this.parent = vanChartAxisPane;
this.setLayout(new BorderLayout());
addButton = new AddButton(BaseUtils.readIcon("/com/fr/design/images/control/addPopup.png"));
addButton = new AddButton(new LazyIcon("add_popup"));
JPanel eastPane = new JPanel(new BorderLayout());
eastPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 20));
eastPane.add(addButton, BorderLayout.NORTH);
addButton.setVisible(false);
this.add(eastPane, BorderLayout.EAST);
buttonPane = new JPanel();
buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 0));
this.add(buttonPane, BorderLayout.CENTER);
itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX);

17
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java

@ -1,13 +1,11 @@
package com.fr.van.chart.designer.style.axis.radar;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.VanChartBaseAxisPane;
import javax.swing.JPanel;
@ -22,20 +20,13 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane {
protected JPanel createContentPane(boolean isXAxis){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] column = {f, s};
double[] rowSize = {p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createLabelPane(new double[]{p, p, p}, column),null},
new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null},
new Component[]{createLabelPane(),null},
new Component[]{createLineStylePane(),null},
new Component[]{createValueStylePane(),null},
};
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1});
}
protected boolean showLabelDisplay() {

34
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java

@ -1,19 +1,17 @@
package com.fr.van.chart.designer.style.axis.radar;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutSecTick;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
@ -33,21 +31,14 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
protected JPanel createContentPane(boolean isXAxis) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] column = {f, s};
double[] rowSize = {p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createLabelPane(new double[]{p, p, p}, column), null},
new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null},
new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null},
new Component[]{createLabelPane(), null},
new Component[]{createMinMaxValuePane(), null},
new Component[]{createLineStylePane(), null},
new Component[]{createValueStylePane(), null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected LineComboBox createLineComboBox() {
@ -55,16 +46,11 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
}
@Override
protected JPanel createMinMaxValuePane(double[] row, double[] col) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
protected JPanel createMinMaxValuePane() {
valueStyle = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count"),
Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")});
JPanel commenPane = createCommenValuePane(new double[]{p, p, p}, columnSize);
JPanel commenPane = createCommenValuePane();
tableDataPane = new RadarTableDataPane();
centerPane = new JPanel(new CardLayout());
@ -81,9 +67,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane {
}
});
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel;
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), contentPane, true);
}
protected Component[][] getLineStylePaneComponents() {

6
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java

@ -1,6 +1,5 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
@ -16,7 +15,6 @@ import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* 属性表, 图表样式-背景界面.
@ -35,10 +33,10 @@ public class VanChartAreaPane extends ThirdTabPane<VanChart> implements AutoSele
protected void initLayout() {
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) {
if (nameArray.length > 1) {
this.add(cell(tabPane).getComponent(), BorderLayout.NORTH);
this.add(tabPane, BorderLayout.NORTH);
}
}
this.add(centerPane, BorderLayout.CENTER);

46
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java

@ -1,12 +1,13 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
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.style.ColorSelectBoxWithThemeStyle;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils;
@ -17,7 +18,6 @@ import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.LineTypeComboBox;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
@ -59,19 +59,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED});
verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{createGridLinePane()},
new Component[]{createAlertLinePane()},
new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{f, s})},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = FineLayoutBuilder.createVerticalLayout(0,
createGridLinePane(), createAlertLinePane(), createIntervalPane()
);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
}
@ -79,12 +69,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
protected JPanel createGridLinePane() {
initGridLineComponents();
JPanel panel = new JPanel(new BorderLayout(0, 4));
JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), true), BorderLayout.NORTH);
panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), false), BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel, true);
}
protected void initGridLineComponents() {
@ -127,9 +117,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
LineTypeComboBox lineTypeComboBox = isHorizontal ? horizonLineType : verticalLineType;
JPanel colorSelectPane = isHorizontal ? horizontalColorPane : verticalColorPane;
JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(title, lineTypeComboBox);
JPanel lineTypePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), lineTypeComboBox);
JPanel singleGridLinePane = new JPanel(new BorderLayout());
JPanel singleGridLinePane = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
singleGridLinePane.add(lineTypePane, BorderLayout.NORTH);
singleGridLinePane.add(colorSelectPane, BorderLayout.CENTER);
@ -139,22 +129,19 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
protected JPanel createAlertLinePane() {
alertLine = getAlertLinePane();
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Alert_Line"), alertLine);
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel;
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Alert_Line"), alertLine, true);
}
protected AlertLineListControlPane getAlertLinePane() {
return new AlertLineListControlPane();
}
protected JPanel createIntervalPane(double[] row, double[] col) {
protected JPanel createIntervalPane() {
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Default_Interval"), Toolkit.i18nText("Fine-Design_Chart_Custom_Interval_Background")});
horizontalColorBackground = new ColorSelectBox(100);
verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents();
JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
defaultPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel defaultPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
customIntervalBackground = getBackgroundListControlPane();
cardLayout = new CardLayout();
@ -168,12 +155,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
});
JPanel intervalPane = new JPanel(new BorderLayout(0, 6));
JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Interval_Background"), isDefaultIntervalBackground);
JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Interval_Background")), isDefaultIntervalBackground);
intervalPane.add(panel1, BorderLayout.NORTH);
intervalPane.add(centerPane, BorderLayout.CENTER);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Interval_Background"), intervalPane);
intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel;
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Interval_Background"), intervalPane);
}
protected BackgroundListControlPane getBackgroundListControlPane() {

31
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartGantPlotAreaBackgroundPane.java

@ -1,15 +1,14 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.UILabel;
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.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -26,16 +25,8 @@ public class VanChartGantPlotAreaBackgroundPane extends VanChartAreaBackgroundPa
@Override
protected JPanel createContentPane() {
JPanel contentPane = new JPanel(new BorderLayout());
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{createAxisBorderPane()},
new Component[]{createContentBorderPane()}
};
contentPane.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER);
contentPane.add(FineLayoutBuilder.createVerticalLayout(
0, createAxisBorderPane(), createContentBorderPane()), BorderLayout.CENTER);
return contentPane;
}
@ -69,34 +60,28 @@ public class VanChartGantPlotAreaBackgroundPane extends VanChartAreaBackgroundPa
private JPanel createAxisBorderPane() {
axisColorPane = new ColorSelectBoxWithOutTransparent(100);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(
return new UIExpandablePane(
Toolkit.i18nText("Fine-Design_Chart_Gant_Axis_Border"),
createBorderPane(axisColorPane)
createBorderPane(axisColorPane), true
);
}
private JPanel createContentBorderPane() {
contentColorPane = new ColorSelectBoxWithOutTransparent(100);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(
return new UIExpandablePane(
Toolkit.i18nText("Fine-Design_Chart_Gant_Content_Border"),
createBorderPane(contentColorPane)
);
}
private JPanel createBorderPane(ColorSelectBoxWithOutTransparent colorPane) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")),
colorPane
}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
}

10
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java

@ -68,16 +68,6 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane
protected JPanel createLabelBackgroundPane() {
VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() {
@Override
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
@Override
protected Component[][] getPaneComponents() {
return new Component[][]{

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -204,7 +204,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) {
return new UIExpandablePane(title, panel);
return new UIExpandablePane(title, panel, true);
}
protected TwoTuple<String[], Integer[]> getPositionNamesAndValues() {

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

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.base.chart.chartdata.model.LargeDataModel;
@ -105,7 +106,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
scrollPane.setViewportView(getContentInPlotType());
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
}
return column(
return column(10,
cell(getColorPane()), cell(getContentInPlotType())
).getComponent();
}
@ -125,7 +126,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//获取颜色面板
protected JPanel getColorPane() {
JPanel panel = new JPanel(new BorderLayout());
JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
stylePane = createStylePane();
vanChartFillStylePane = getVanChartFillStylePane();
if (vanChartFillStylePane != null) {
@ -205,7 +206,8 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
checkLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup);
JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), largeDataModelGroup);
return createLargeDataModelPane(panel);
}
@ -227,8 +229,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
}
protected JPanel createLargeDataModelPane(JPanel jPanel) {
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel);
return panel;
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel, true);
}
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() {

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java

@ -7,12 +7,10 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
@ -93,11 +91,6 @@ public class VanChartPlotTooltipPane extends BasicPane {
showAllSeries = new UICheckBox(getShowAllSeriesLabelText());
followMouse = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Mouse"),
Toolkit.i18nText("Fine-Design_Chart_Not_Follow_Mouse")});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = { p,p,p};
Component[][] components = new Component[3][2];
components[0] = new Component[]{null,null};
components[1] = new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Prompt_Box")), UIComponentUtils.wrapWithBorderLayoutPane(followMouse)};
@ -105,7 +98,7 @@ public class VanChartPlotTooltipPane extends BasicPane {
if(plot.isSupportTooltipSeriesType() && hasTooltipSeriesType()){
components[2] = new Component[]{showAllSeries,null};
}
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
}

47
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -1,11 +1,12 @@
package com.fr.van.chart.drillmap.designer.other;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.DrillMapTools;
import com.fr.chart.chartattr.Chart;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
@ -16,11 +17,9 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
/**
@ -36,26 +35,21 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
@Override
protected JPanel getInteractivePane(VanChartPlot plot) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p};
Component[][] components = ChartEditContext.normalMode() ? new Component[][]{
new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null},
new Component[]{createToolBarPane(), null},
new Component[]{createAnimationPane(), null},
new Component[]{createZoomPane(plot), null},
new Component[]{createDrillToolsPane(), null},
new Component[]{createAutoRefreshPane(plot), null},
new Component[]{createHyperlinkPane(), null}
} : new Component[][]{
new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null},
new Component[]{createToolBarPane(), null},
new Component[]{createAnimationPane(), null},
new Component[]{createZoomPane(plot), null},
new Component[]{createDrillToolsPane(), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private JPanel createDrillToolsPane() {
@ -65,12 +59,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
@Override
protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {e};
double[] rowSize = {p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
}
@Override
@ -96,10 +85,6 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
};
catalogSuperLink = new VanChartCatalogHyperLinkPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p, p};
Component[][] components = ChartEditContext.duchampMode() ? new Component[][]{
new Component[]{null},
new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)},
@ -112,11 +97,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
new Component[]{selectBackgroundPane},
new Component[]{catalogSuperLink}
};
drillPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
drillPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
JPanel panel = new JPanel(new BorderLayout());
panel.add(openOrClosePane, BorderLayout.NORTH);
panel.add(drillPane, BorderLayout.CENTER);
JPanel panel = FineLayoutBuilder.createVerticalLayout(10, openOrClosePane, drillPane);
openOrClose.addChangeListener(new ChangeListener() {
@Override
@ -124,16 +107,14 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
checkEnable();
}
});
JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Drill"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel1;
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Drill"), panel);
}
private JPanel createTitlePane(String title, Component component) {
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, component, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
panel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
return panel;
Component[][] components = new Component[][]{
new Component[]{new UILabel(title), component}
};
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
}
private void checkEnable() {

2
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/VanChartGanttDataAndLinkPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.gantt.designer.data;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
@ -55,6 +56,7 @@ public class VanChartGanttDataAndLinkPane extends MultiTabPane<ChartCollection>
paneList = initPaneList();
initComponents();
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
}
private void initComponents(){

6
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java

@ -1,11 +1,11 @@
package com.fr.van.chart.gantt.designer.data.data;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.van.chart.gantt.designer.data.data.component.GanttReportDataContentPane;
import com.fr.van.chart.gantt.designer.data.data.component.GanttReportDataProjectPane;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
/**
@ -14,12 +14,10 @@ import java.awt.BorderLayout;
public class GanttPlotReportDataContentPane extends AbstractReportDataContentPane {
private GanttReportDataProjectPane projectPane;
private GanttReportDataContentPane contentPane;
private static final int V_GAP = 7;
public GanttPlotReportDataContentPane() {
initComponent();
this.setLayout(new BorderLayout(0, V_GAP));
projectPane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.add(projectPane, BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER);
}

6
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java

@ -1,11 +1,11 @@
package com.fr.van.chart.gantt.designer.data.data;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.van.chart.gantt.designer.data.data.component.GanttTableDataContentPane;
import com.fr.van.chart.gantt.designer.data.data.component.GanttTableDataProjectPane;
import javax.swing.BorderFactory;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.util.List;
@ -16,12 +16,10 @@ import java.util.List;
public class GanttPlotTableDataContentPane extends AbstractTableDataContentPane {
private GanttTableDataProjectPane projectPane;
private GanttTableDataContentPane contentPane;
private static final int V_GAP = 7;
public GanttPlotTableDataContentPane() {
initComponent();
this.setLayout(new BorderLayout(0, V_GAP));
projectPane.setBorder(BorderFactory.createEmptyBorder(0,17,0,15));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.add(projectPane, BorderLayout.NORTH);
this.add(new JSeparator(), BorderLayout.CENTER);
this.add(contentPane, BorderLayout.SOUTH);

20
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java

@ -6,13 +6,15 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionListener;
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;
/**
* Created by hufan on 2017/1/10.
*/
@ -20,8 +22,6 @@ public abstract class ComboBoxWithButtonPane extends JPanel {
private UIComboBox comboBoxName;
private UIButton button;
private int index = 0;
private static final int H_GAP = 5;
private static final int LEFT_GAP = 7;
private UIObserverListener listener;
public ComboBoxWithButtonPane() {
@ -31,20 +31,16 @@ public abstract class ComboBoxWithButtonPane extends JPanel {
public ComboBoxWithButtonPane(int index) {
this.index = index;
comboBoxName = new UIComboBox();
comboBoxName.setPreferredSize(new Dimension(80,20));
button = new UIButton(getButtonIcon());
button.setPreferredSize(new Dimension(20, 20));
button.addActionListener(getButtonListener());
UILabel title = new UILabel(getTitleText());
title.setPreferredSize(new Dimension(80, 20));
this.setLayout(new BorderLayout(H_GAP, 0));
this.add(comboBoxName, BorderLayout.CENTER);
this.add(button, BorderLayout.EAST);
this.add(title, BorderLayout.WEST);
this.setBorder(BorderFactory.createEmptyBorder(0, LEFT_GAP, 0, 0));
this.setLayout(new BorderLayout());
this.add(row(
cell(title).weight(1.2), cell(comboBoxName).weight(2.4), flex(0.1), cell(button).weight(0.5)
).getComponent());
}
protected abstract String getTitleText();

33
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java

@ -1,21 +1,23 @@
package com.fr.van.chart.gantt.designer.data.data.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.gantt.data.VanGanttReportDefinition;
import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
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;
/**
* Created by hufan on 2017/1/11.
@ -29,13 +31,11 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{
private TinyFormulaPane linkID;
public GanttReportDataContentPane() {
this.setLayout(new BorderLayout());
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
initAllComponent();
JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(10,24,0,15));
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));
}
@ -57,25 +57,16 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{
return new DefaultTinyFormulaPane() {
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(4, 0));
this.setLayout(new BorderLayout());
UILabel label = new UILabel(title);
label.setPreferredSize(new Dimension(75, 20));
this.add(label, BorderLayout.WEST);
formulaTextField.setPreferredSize(new Dimension(100, 20));
this.add(formulaTextField, BorderLayout.CENTER);
this.add(formulaTextFieldButton, BorderLayout.EAST);
this.add(row(
cell(label).weight(1.2), cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5)
).getComponent());
}
};
}
private JPanel getContentPane(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{seriesName},
new Component[]{startTime},
@ -85,7 +76,7 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{
new Component[]{linkID}
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
@Override

6
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataProjectPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.gantt.designer.data.data.component;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.event.UIObserver;
@ -25,7 +27,7 @@ public class GanttReportDataProjectPane extends AbstractReportDataContentPane im
private List<TinyFormulaWithButtonPane> processPaneList = new ArrayList<TinyFormulaWithButtonPane>();
public GanttReportDataProjectPane() {
firstProcessPane = new TinyFormulaWithButtonPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Project_Name"), "/com/fr/design/images/buttonicon/add.png") {
firstProcessPane = new TinyFormulaWithButtonPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Project_Name"), new LazyIcon("add")) {
@Override
protected void buttonEvent(TinyFormulaWithButtonPane pane) {
addProcessPane();
@ -38,7 +40,7 @@ public class GanttReportDataProjectPane extends AbstractReportDataContentPane im
};
firstProcessPane.registerChangeListener(listener);
this.setLayout(new BorderLayout(0, 7));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.add(firstProcessPane, BorderLayout.NORTH);
if (center != null) {

16
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java

@ -1,11 +1,10 @@
package com.fr.van.chart.gantt.designer.data.data.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.ComparatorUtils;
@ -13,11 +12,9 @@ import com.fr.plugin.chart.gantt.data.VanGanttTableDefinition;
import com.fr.stable.StringUtils;
import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
/**
@ -36,10 +33,7 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{
public GanttTableDataContentPane() {
this.setLayout(new BorderLayout());
initAllComponent();
JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));
this.add(getContentPane(), BorderLayout.CENTER);
}
@ -62,10 +56,6 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{
}
private JPanel getContentPane(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p};
double[] col = {p,f};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesComboBox},
@ -76,7 +66,7 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Task_ID")), taskIDComboBox}
};
return TableLayoutHelper.createGapTableLayoutPane(components, row, col,24,6);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
@Override

9
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.gantt.designer.data.data.component;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.event.UIObserver;
@ -44,7 +45,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl
@Override
protected Icon getButtonIcon(){
return BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png");
return new LazyIcon("add");
}
@Override
protected ActionListener getButtonListener(){
@ -58,7 +59,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl
}
};
this.setLayout(new BorderLayout(0, V_GAP));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
if (center != null) {
this.add(center, BorderLayout.CENTER);
@ -93,7 +94,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl
@Override
protected Icon getButtonIcon() {
return BaseUtils.readIcon("/com/fr/design/images/buttonicon/delete.png");
return new LazyIcon("delete");
}
@Override

29
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java

@ -1,20 +1,25 @@
package com.fr.van.chart.gantt.designer.data.data.component;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.svg.IconUtils;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.UIEditLabel;
import com.fr.general.IOUtils;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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;
/**
* Created by hufan on 2017/1/11.
*/
@ -26,10 +31,10 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse
protected UIObserverListener listener;
public TinyFormulaWithButtonPane(String text) {
this(text, "/com/fr/design/images/buttonicon/delete.png");
this(text, new LazyIcon("delete"));
}
public TinyFormulaWithButtonPane(String text, String iconUrl) {
public TinyFormulaWithButtonPane(String text, Icon icon) {
editLabel = new UIEditLabel(text,SwingConstants.LEFT){
protected void doAfterMousePress(){
clearAllBackground();
@ -40,19 +45,19 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse
return false;
}
};
editLabel.setPreferredSize(new Dimension(80,20));
tinyFormulaPane = new DefaultTinyFormulaPane();
UIButton button = new UIButton(IOUtils.readIcon(iconUrl));
button.setPreferredSize(new Dimension(20, 20));
UIButton button = new UIButton(icon);
button.addActionListener(initButtonListener(this));
this.setLayout(new BorderLayout());
this.add(row(
cell(editLabel).weight(1.2), cell(tinyFormulaPane).weight(2.4), flex(0.1), cell(button).weight(0.5)
).getComponent());
}
this.setLayout(new BorderLayout(4, 0));
this.add(editLabel, BorderLayout.WEST);
this.add(tinyFormulaPane, BorderLayout.CENTER);
this.add(button, BorderLayout.EAST);
public TinyFormulaWithButtonPane(String text, String iconUrl) {
this(text, IconUtils.readIcon(iconUrl));
}
private ActionListener initButtonListener(final TinyFormulaWithButtonPane pane){

30
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java

@ -1,21 +1,21 @@
package com.fr.van.chart.gantt.designer.data.link;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.gantt.data.VanGanttLinkReportDefinition;
import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.*;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* Created by hufan on 2017/1/12.
@ -29,7 +29,6 @@ public class GanttLinkReportDataContentPane extends AbstractReportDataContentPan
this.setLayout(new BorderLayout());
initAllComponent();
JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
this.add(panel, BorderLayout.CENTER); }
private void initAllComponent() {
@ -44,32 +43,23 @@ public class GanttLinkReportDataContentPane extends AbstractReportDataContentPan
return new DefaultTinyFormulaPane() {
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(4, 0));
UILabel label = new UILabel(title );
label.setPreferredSize(new Dimension(75, 20));
this.add(label, BorderLayout.WEST);
formulaTextField.setPreferredSize(new Dimension(100, 20));
this.add(formulaTextField, BorderLayout.CENTER);
this.add(formulaTextFieldButton, BorderLayout.EAST);
this.setLayout(new BorderLayout());
UILabel label = new UILabel(title);
this.add(row(
cell(label).weight(1.2), cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5)
).getComponent());
}
};
}
private JPanel getContentPane(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{startTaskID},
new Component[]{endTaskID},
new Component[]{linkType}
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
@Override

14
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java

@ -1,22 +1,19 @@
package com.fr.van.chart.gantt.designer.data.link;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.gantt.data.VanGanttLinkTableDefinition;
import com.fr.stable.StringUtils;
import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
/**
@ -31,9 +28,7 @@ public class GanttLinkTableDataContentPane extends AbstractTableDataContentPane
this.setLayout(new BorderLayout());
initAllComponent();
JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));
}
@ -47,18 +42,13 @@ public class GanttLinkTableDataContentPane extends AbstractTableDataContentPane
}
private JPanel getContentPane(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p};
double[] col = {p,f};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Task_ID")), startTaskIDComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Task_ID")), endTaskIDComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Link_Type")), linkTypeComboBox}
};
return TableLayoutHelper.createGapTableLayoutPane(components, row, col,24,6);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
@Override

12
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java

@ -1,16 +1,14 @@
package com.fr.van.chart.gantt.designer.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.gantt.attr.GanttAxisStyleAttr;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -39,15 +37,9 @@ public class GanttAxisStylePane extends BasicBeanPane<GanttAxisStyleAttr> {
public GanttAxisStylePane() {
initComponents();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p, p, p, p};
double[] col = {f, e};
Component[][] components = getUsedComponents();
JPanel content = TableLayoutHelper.createTableLayoutPane(components, row, col);
JPanel content = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(content, BorderLayout.CENTER);

10
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePaneWithPosition.java

@ -1,14 +1,12 @@
package com.fr.van.chart.gantt.designer.style.axis;
import com.fr.base.BaseUtils;
import com.fine.theme.utils.FineComponentsFactory;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.gantt.attr.GanttAxisStyleAttr;
import com.fr.plugin.chart.gantt.attr.GanttAxisStyleAttrWithPosition;
import com.fr.stable.Constants;
import javax.swing.Icon;
import java.awt.Component;
/**
@ -22,11 +20,7 @@ public class GanttAxisStylePaneWithPosition extends GanttAxisStylePane {
protected void initComponents() {
super.initComponents();
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
alignmentPane = new UIButtonGroup<>(alignmentIconArray, alignment);
alignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup();
}
protected Component[][] getUsedComponents() {

38
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java

@ -1,17 +1,16 @@
package com.fr.van.chart.gantt.designer.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.plugin.chart.gantt.attr.GanttProcessAxis;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -32,20 +31,12 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> {
@Override
protected JPanel createContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createHorizontalProportionPane()},
new Component[]{createHorizontalHeaderPane()},
new Component[]{createVerticalHeaderPane()},
new Component[]{createBodyPane()}
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
return FineLayoutBuilder.createVerticalLayout(0,
createHorizontalProportionPane(),
createHorizontalHeaderPane(),
createVerticalHeaderPane(),
createBodyPane()
);
}
protected void layoutContentPane() {
@ -56,19 +47,19 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> {
private Component createBodyPane() {
bodyPane = new GanttAxisStylePaneWithPosition();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), bodyPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), bodyPane);
}
private Component createHorizontalHeaderPane() {
horizontalHeaderPane = new GanttAxisStylePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Table"), horizontalHeaderPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Table"), horizontalHeaderPane, true);
}
private Component createVerticalHeaderPane() {
verticalHeaderPane = new GanttAxisStylePaneWithPosition();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Vertical_Table"), verticalHeaderPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Vertical_Table"), verticalHeaderPane, true);
}
private Component createHorizontalProportionPane() {
@ -91,9 +82,10 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> {
}
});
JPanel jPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Proportion"), panel);
JPanel jPanel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Proportion")), panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Function_Percent"), jPanel);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Function_Percent"), jPanel, true);
}
private void checkoutPaneVisible() {
@ -119,7 +111,7 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane<VanChart> {
@Override
public void updateBean(VanChart vanChart){
VanChartGanttPlot ganttPlot = (VanChartGanttPlot) vanChart.getPlot();
VanChartGanttPlot ganttPlot = vanChart.getPlot();
GanttProcessAxis processAxis = new GanttProcessAxis();
processAxis.setCustomProportion(typeButton.getSelectedIndex() == 1);

25
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java

@ -1,17 +1,16 @@
package com.fr.van.chart.gantt.designer.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.plugin.chart.gantt.attr.GanttTimeAxis;
import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.Component;
@ -35,10 +34,6 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane<VanChart> {
@Override
protected JPanel createContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createConditionConfigPane()},
@ -46,7 +41,7 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane<VanChart> {
new Component[]{createDownHeadPane()},
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
}
protected void layoutContentPane() {
@ -57,13 +52,13 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane<VanChart> {
private Component createDownHeadPane() {
downHeadPane = new GanttAxisStylePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Down_Head_Table"),downHeadPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Down_Head_Table"),downHeadPane);
}
private Component createUpHeadPane() {
upHeadPane = new GanttAxisStylePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Up_Head_Table"),upHeadPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Up_Head_Table"),upHeadPane, true);
}
private Component createConditionConfigPane() {
@ -71,12 +66,6 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane<VanChart> {
initialLevel = new UIComboBox(ZOOM_LEVELS);
weekendTooltip = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p, p, p, p};
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Zoom")), timeZoom},
@ -84,9 +73,9 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane<VanChart> {
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Weekend_Tooltip")), weekendTooltip}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Condition_Config"),panel);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Condition_Config"),panel, true);
}
@Override

47
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java

@ -1,19 +1,18 @@
package com.fr.van.chart.gantt.designer.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
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.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
import com.fr.van.chart.designer.component.VanChartGanttTimeLinePane;
import com.fr.van.chart.designer.component.VanChartMarkerPane;
@ -40,49 +39,33 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane {
@Override
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createGanntStylePane()},
new Component[]{createLinkLinePane()},
new Component[]{createMarkerPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createGuideLinePane()}
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
contentPane = FineLayoutBuilder.createVerticalLayout(0,
createGanntStylePane(),
createLinkLinePane(),
createLargeDataModelPane(),
createGuideLinePane()
);
return contentPane;
}
private JPanel createGanntStylePane(){
seriesNewLine = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_New_Line"),seriesNewLine);
JPanel ganntStylePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Pattern"), panel);
return ganntStylePane;
JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_New_Line")), seriesNewLine);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Pattern"), panel, true);
}
private JPanel createLinkLinePane(){
lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
colorSelect = new ColorSelectBoxWithOutTransparent(100);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] col = {f, e};
double[] row = {p,p,p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), colorSelect}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
JPanel linkLinePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Link_Line"), panel);
return linkLinePane;
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Link_Line"), panel, true);
}
//标记点类型
@ -98,12 +81,12 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane {
return new VanChartImageMarkerWithoutWidthAndHeightPane();
}
};
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gannt_Marker"), markerPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gannt_Marker"), markerPane, true);
}
protected JPanel createGuideLinePane() {
timeLinePane = new VanChartGanttTimeLinePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Identify"), timeLinePane);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Identify"), timeLinePane);
}
@Override

21
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java

@ -1,8 +1,9 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Parameter;
import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListCache;
@ -11,18 +12,14 @@ import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree;
import com.fr.workspace.WorkContext;
@ -123,7 +120,7 @@ public class GeoUrlPane extends JPanel implements UIObserver {
boolean hasRefreshButton = !WorkContext.getCurrent().isLocal();
UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png"));
UIButton button = new UIButton(new LazyIcon("refresh"));
button.setToolTipText(Toolkit.i18nText("Fine-Design_Chart_Update_Remote_Map_JSON"));
button.addActionListener(new ActionListener() {
@Override
@ -133,23 +130,17 @@ public class GeoUrlPane extends JPanel implements UIObserver {
}
});
double p = TableLayout.PREFERRED;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double f = TableLayout.FILL;
double[] rowSize = {p, p};
double[] columnSize = hasRefreshButton ? new double[]{d + 10, e - 20, 20} : new double[]{f, e};
Component[] comps = hasRefreshButton
? new Component[]{sourceTitleLabel, sourceComboBox, button}
: new Component[]{sourceTitleLabel, sourceComboBox};
double hGap = hasRefreshButton ? 0 : TableLayout4VanChartHelper.COMPONENT_INTERVAL;
double[] weight = hasRefreshButton ? new double[]{1.2, 2.5, 0.5} : new double[]{1.2, 3};
Component[][] components = new Component[][]{
new Component[]{null, null},
comps,
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, hGap, LayoutConstants.VGAP_LARGE);
return FineLayoutBuilder.compatibleTableLayout(0, components, weight);
}
protected UILabel createSourceTitleLabel() {

17
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Utils;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -8,8 +9,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils;
@ -20,9 +19,7 @@ import com.fr.plugin.chart.map.server.MapLayerConfigManager;
import com.fr.plugin.chart.type.GISLayerType;
import com.fr.plugin.chart.type.GaoDeGisType;
import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import javax.swing.event.PopupMenuEvent;
@ -123,22 +120,12 @@ public class GisLayerPane extends JPanel implements UIObserver {
layerPaneCheckPane.add(standardLayers, "standard");
layerPaneCheckPane.add(customLayers, "custom");
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p, p, p};
double[] col = {f, e};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gis_Layer")), gisButton},
new Component[]{null, layerPaneCheckPane},
new Component[]{layerCardPane, null},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel;
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private void initLayerCardPane() {

19
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java

@ -1,18 +1,17 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.base.ViewCenter;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.stable.ArrayUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -76,30 +75,22 @@ public class MapStatusPane extends JPanel {
longitude = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1, 0.0);
latitude = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1, 0.0);
double p = TableLayout.PREFERRED;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] rowSize = {p, p, p};
double[] columnSize = {d, e};
double[] column = {d, s};
Component[][] comps = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), zoomLevel},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_View_Center")), viewCenterCom},
};
levelAndCenterPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, columnSize);
levelAndCenterPane = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3});
Component[][] longAndLatComps = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitude},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitude}
};
longAndLatPane = TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps, rowSize, column);
longAndLatPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
longAndLatPane = FineLayoutBuilder.compatibleTableLayout(10, longAndLatComps, new double[]{1.2, 3});
longAndLatPane.setVisible(false);
this.setLayout(new BorderLayout(0, 6));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.add(levelAndCenterPane, BorderLayout.NORTH);
this.add(longAndLatPane, BorderLayout.CENTER);

10
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java

@ -1,10 +1,9 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -22,18 +21,13 @@ public class TileLayerPane extends JPanel {
public TileLayerPane() {
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH - 3};
customTileLayer = new UITextArea();
attribution = new UITextArea();
Component[][] comps = new Component[][]{
new Component[]{new UILabel("url"), customTileLayer},
new Component[]{new UILabel("Attribution"), attribution}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE);
panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);

25
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java

@ -1,15 +1,14 @@
package com.fr.van.chart.map.designer.type;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -33,26 +32,18 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
initGisLayerPane();
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
double p = TableLayout.PREFERRED;
double[] columnSize = {230};
double[] rowSize = {p, p, p, p, p, p, p, p};
JPanel panel = FineLayoutBuilder.createVerticalLayout(10, geoUrlPane, gisLayerPane);
JPanel panel = new JPanel(new BorderLayout());
JPanel basePane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), panel, true);
panel.add(geoUrlPane, BorderLayout.NORTH);
panel.add(gisLayerPane, BorderLayout.CENTER);
JPanel basePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Report_Basic"), panel);
JPanel mapStatusPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Map_Init_Status"), mapStatusPane);
JPanel mapStatusPaneWithTitle = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Map_Init_Status"), mapStatusPane);
Component[][] comps = new Component[][]{
new Component[]{basePane},
new Component[]{mapStatusPaneWithTitle}
};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize);
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, comps, new double[]{1});
this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
this.add(contentPane, BorderLayout.CENTER);
}

28
designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.multilayer.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.event.UIObserver;
@ -9,19 +11,15 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.multilayer.data.MultiPieReportDataDefinition;
import com.fr.stable.AssistUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
@ -57,19 +55,13 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent
contentPane = new JPanel();
contentPane.setLayout(new BorderLayout(0, 5));
contentPane.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
contentPane.add(north, BorderLayout.NORTH);
contentPane.add(center, BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createEmptyBorder(0,20,4,10));
}
private JPanel createNorthPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize_north = {f, COMPONENT_WIDTH};
double[] rowSize_north = {p, p, p};
levelNumEdit = new UISpinner(1, 15, 1, levelNum){
@Override
protected void fireStateChanged() {
@ -90,7 +82,6 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent
};
nameField = new UITextField();
nameField.setPreferredSize(new Dimension(WD, HT));
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name")), nameField},
@ -98,7 +89,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit},
};
return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north);
return FineLayoutBuilder.compatibleTableLayout(10, components_north, new double[]{1.2, 3});
}
private void refreshCenterPane(){
@ -119,16 +110,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent
}
private JPanel createCenterPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize_center = {f, COMPONENT_WIDTH};
double[] rowSize_center = new double[levelNum + 2];
initLevelNameList();
for (int i = 0; i < levelNum + 2; i++){
rowSize_center[i] = p;
}
Component[][] components_center = new Component[levelNum + 2][];
for (int i = 0; i < levelNum; i++){
@ -142,7 +124,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent
registerListener4Center();
return TableLayoutHelper.createTableLayoutPane(components_center,rowSize_center,columnSize_center);
return FineLayoutBuilder.compatibleTableLayout(10, components_center,new double[]{1.2, 3});
}
/**

11
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotReportDataContentPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.structure.desinger.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.formula.DefaultTinyFormulaPane;
@ -7,12 +8,9 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
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.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.structure.data.StructureReportDefinition;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -29,10 +27,6 @@ public class StructurePlotReportDataContentPane extends AbstractReportDataConten
private TinyFormulaPane nodeValue;
public StructurePlotReportDataContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p, p};
nodeName = new DefaultTinyFormulaPane();
nodeID = new DefaultTinyFormulaPane();
@ -48,8 +42,7 @@ public class StructurePlotReportDataContentPane extends AbstractReportDataConten
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value")), nodeValue},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6);
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2,3});
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);

14
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotTableDataContentPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.structure.desinger.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.data.util.function.AbstractDataFunction;
@ -7,18 +8,14 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
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.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.structure.data.StructureTableDefinition;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
/**
* Created by shine on 2017/2/15.
@ -32,11 +29,6 @@ public class StructurePlotTableDataContentPane extends AbstractTableDataContentP
private CalculateComboBox calculateCombox;
public StructurePlotTableDataContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p, p, p, p, p, p};
nodeName = new UIComboBox();
nodeId = new UIComboBox();
parenrId = new UIComboBox();
@ -53,11 +45,9 @@ public class StructurePlotTableDataContentPane extends AbstractTableDataContentP
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6);
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));
}

12
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java

@ -1,17 +1,15 @@
package com.fr.van.chart.wordcloud.designer.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.wordcloud.data.WordCloudReportDefinition;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -26,10 +24,6 @@ public class WordCloudPlotReportDataContentPane extends AbstractReportDataConten
private TinyFormulaPane wordValue;
public WordCloudPlotReportDataContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = { p, p, p};
name = new UITextField();
wordName = new DefaultTinyFormulaPane();
@ -41,9 +35,7 @@ public class WordCloudPlotReportDataContentPane extends AbstractReportDataConten
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Word_Value")), wordValue}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6);
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);

13
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java

@ -1,23 +1,20 @@
package com.fr.van.chart.wordcloud.designer.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.data.util.function.AbstractDataFunction;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.wordcloud.data.WordCloudTableDefinition;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
/**
@ -31,10 +28,6 @@ public class WordCloudPlotTableDataContentPane extends AbstractTableDataContentP
private CalculateComboBox calculateCombox;
public WordCloudPlotTableDataContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = { p, p, p, p};
name = new UITextField();
wordName = new UIComboBox();
@ -49,12 +42,10 @@ public class WordCloudPlotTableDataContentPane extends AbstractTableDataContentP
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
this.setLayout(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));
}

2
designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java

@ -13,7 +13,6 @@ import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyECBlock;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ProductConstants;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
@ -66,7 +65,6 @@ public class DSColumnCellEditor extends AbstractCellEditor implements DialogActi
dsColumnPane.putElementcase(grid.getElementCasePane());
dsColumnPane.putCellElement(cellElement);
BasicDialog dsColumnDialog = this.dsColumnPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(grid), null, DSColumnPane.DEFAULT_DIMENSION);
dsColumnDialog.addDialogActionListener(this);
try {

71
designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java

@ -3,25 +3,23 @@
*/
package com.fr.design.cell.editor;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.form.util.FontTransformUtil;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.fun.DefaultValueAdjustProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.report.RichTextEditingPane;
import com.fr.design.style.color.UIToolbarColorButton;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.DesignUtils;
import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.cellattr.core.RichTextConverter;
@ -43,9 +41,8 @@ import javax.swing.text.MutableAttributeSet;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyledDocument;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -54,6 +51,9 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
*
*
@ -61,8 +61,6 @@ import java.awt.event.MouseListener;
*/
public class RichTextToolBar extends BasicPane {
private static final Dimension BUTTON_SIZE = new Dimension(24, 20);
/**
* 富文本字体下拉框默认首选字体 非设计器UI界面字体
*/
@ -78,6 +76,7 @@ public class RichTextToolBar extends BasicPane {
private UIToggleButton superPane;
private UIToggleButton subPane;
private UIToggleButton formulaPane;
private UIToolbar toolbar;
//外部传进来的
private RichTextEditingPane textPane;
@ -105,58 +104,44 @@ public class RichTextToolBar extends BasicPane {
}
private void initAllButton() {
toolbar = new UIToolbar();
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
fontNameComboBox.setPreferredSize(new Dimension(144, 20));
fontSizeComboBox = new UIComboBox(FRFontPane.getFontSizes());
colorSelectPane = new UIToolbarColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
colorSelectPane = new UIToolbarColorButton(new LazyIcon("foreground"));
colorSelectPane.set4Toolbar();
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"));
superPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sup.png"));
subPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sub.png"));
formulaPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(new LazyIcon("italic"));
underline = new UIToggleButton(new LazyIcon("underline"));
superPane = new UIToggleButton(new LazyIcon("super"));
subPane = new UIToggleButton(new LazyIcon("sub"));
formulaPane = new UIToggleButton(new LazyIcon("formula"));
//名字
initAllNames();
//悬浮提示
setToolTips();
//样式
setAllButtonStyle();
//设置ToolBar
addIntoToolBar();
//绑定监听器
bindListener();
}
private void setAllButtonStyle() {
setButtonStyle(bold);
setButtonStyle(italic);
setButtonStyle(underline);
setButtonStyle(subPane);
setButtonStyle(superPane);
setButtonStyle(formulaPane);
private void addIntoToolBar() {
toolbar.add(bold);
toolbar.add(italic);
toolbar.add(underline);
toolbar.add(subPane);
toolbar.add(superPane);
toolbar.add(formulaPane);
}
private void setButtonStyle(UIButton button) {
button.setNormalPainted(false);
button.setBackground(null);
button.setOpaque(false);
button.setPreferredSize(BUTTON_SIZE);
button.setBorderPaintedOnlyWhenPressed(true);
}
private void addToToolBar() {
this.setLayout(new FlowLayout(FlowLayout.LEFT));
this.add(fontNameComboBox);
this.add(fontSizeComboBox);
this.add(bold);
this.add(italic);
this.add(underline);
this.add(colorSelectPane);
this.add(superPane);
this.add(subPane);
this.add(formulaPane);
this.setLayout(new BorderLayout());
this.add(row(10,
cell(fontNameComboBox).weight(0.3),cell(fontSizeComboBox).weight(0.1), cell(toolbar).weight(0.6)
).getComponent());
}
private void bindListener() {

1
designer-realize/src/main/java/com/fr/design/mainframe/cell/QuickEditorRegion.java

@ -33,7 +33,6 @@ public class QuickEditorRegion extends JPanel {
if (EMPTY == null) {
EMPTY = new JPanel(new BorderLayout());
UILabel content = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None_Message_Property_Table") + "!");
content.setBorder(BorderFactory.createEmptyBorder(0, 70, 0, 0));
EMPTY.add(content, BorderLayout.CENTER);
}
return EMPTY;

20
designer-realize/src/main/java/com/fr/design/report/RichTextPane.java

@ -1,11 +1,11 @@
package com.fr.design.report;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.fr.base.BaseFormula;
import com.fr.base.Style;
import com.fr.design.cell.editor.RichTextToolBar;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
@ -20,7 +20,6 @@ import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultStyledDocument;
@ -33,6 +32,9 @@ import java.awt.Font;
import java.math.BigDecimal;
import java.util.Iterator;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class RichTextPane extends BasicPane {
//12号字体有个奇怪的bug, 字体下部分渲染会截断一部分, 换其他字体没问题, 字体改大小也没问题.
@ -48,17 +50,13 @@ public class RichTextPane extends BasicPane {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setLayout(new BorderLayout());
textPane = new RichTextEditingPane();
textPane.setBorder(new FlatRoundBorder());
textPane.setBackground(FineUIUtils.getUIColor("background.normal", "background"));
textPane.setFont(DEFAUL_FONT);
toolBar = new RichTextToolBar(textPane);
northPane.add(toolBar);
JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
southPane.add(new UIScrollPane(textPane));
this.add(southPane, BorderLayout.CENTER);
this.add(northPane, BorderLayout.NORTH);
this.add(column(10, cell(toolBar), cell(textPane).weight(1)).getComponent());
}
@Override

5
designer-realize/src/main/java/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java

@ -1,5 +1,6 @@
package com.fr.quickeditor.chartquick;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
@ -9,13 +10,13 @@ import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.Elem;
import java.awt.*;
import java.awt.BorderLayout;
public class FloatChartQuickEditor extends QuickEditor<ElementCasePane> {
public FloatChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
}
@Override

Loading…
Cancel
Save