Browse Source

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

bugfix/11.0
Yvan 3 years ago
parent
commit
759e499060
  1. 2
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  3. 5603
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/FormulaTokenMaker.java
  4. 7
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  5. 8
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  6. 29
      designer-base/src/main/java/com/fr/nx/app/designer/utils/CptAndCptxCompatibilityUtil.java
  7. 26
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  8. 20
      designer-base/src/main/resources/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/FormulaTokenMaker.flex
  9. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  10. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  11. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  12. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  13. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  14. 35
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataHelper.java
  15. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  16. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  17. 26
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  18. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  19. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java
  20. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  21. 7
      designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortPane.java
  22. 3
      designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortPane.java
  23. 10
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java
  24. 3
      designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java
  25. 9
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSettingPane.java
  26. 15
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java

2
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -1,6 +1,5 @@
package com.fr.design.extra;
import com.fr.decision.webservice.v10.plugin.helper.category.impl.PluginResourceLoader;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
@ -52,7 +51,6 @@ public class WebViewDlgHelper {
@Override
public void envChanged() {
installHome = PluginStoreConstants.getLocalInstallHome();
PluginResourceLoader.INSTANCE.checkOldShopFile();
}
});
}

2
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -212,7 +212,7 @@ public abstract class UIControlPane extends JControlPane {
}
// 点击"编辑"按钮,弹出面板
class PopupEditDialog extends JDialog {
protected class PopupEditDialog extends JDialog {
private JComponent editPane;
private PopupToolPane popupToolPane;
private static final int WIDTH = 570;

5603
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/FormulaTokenMaker.java

File diff suppressed because it is too large Load Diff

7
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -371,7 +371,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void fireDesignerOpened() {
for (DesignerOpenedListener listener : designerOpenedListenerList) {
listener.designerOpened();
// 捕获下异常 避免造成启动过程监听触发异常导致设计器闪退
try {
listener.designerOpened();
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
designerOpened = true;

8
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -65,6 +65,7 @@ import com.fr.design.write.submit.DBManipulationPane;
import com.fr.event.EventDispatcher;
import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
import com.fr.file.FileFILE;
import com.fr.file.MemFILE;
import com.fr.file.StashedFILE;
import com.fr.form.ui.NoneWidget;
@ -1010,8 +1011,11 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(getEditingFILE().getPath())) {
throw new UnLockedException();
}
// 校验锁定信息是否一致
if (getEditingFILE().exists() && !WorkContext.getCurrent().get(LockInfoOperator.class).isConsistentLock(getEditingFILE().getPath())) {
// 过滤掉本地文件
boolean localFile = getEditingFILE() instanceof FileFILE;
boolean inconsistent = !localFile && getEditingFILE().exists()
&& !WorkContext.getCurrent().get(LockInfoOperator.class).isConsistentLock(getEditingFILE().getPath());
if (inconsistent) {
throw new InconsistentLockException();
}
}

29
designer-base/src/main/java/com/fr/nx/app/designer/utils/CptAndCptxCompatibilityUtil.java

@ -3,7 +3,9 @@ package com.fr.nx.app.designer.utils;
import com.fr.base.extension.FileExtension;
import com.fr.design.mainframe.JTemplate;
import com.fr.file.FILE;
import com.fr.main.FineBook;
import com.fr.main.TemplateWorkBook;
import com.fr.report.core.ReportUtils;
import com.fr.report.report.Report;
import com.fr.report.stable.LayerReportAttr;
import com.fr.report.worksheet.WorkSheet;
@ -30,7 +32,7 @@ public class CptAndCptxCompatibilityUtil {
}
/**
* 判断是不是cptx模板或者开启了新引擎的cpt模板的另存为操作
* 判断是不是cptx模板或者开启了新引擎的cpt模板的另存为操作
**/
private static boolean isSaveAs(JTemplate jTemplate, String oldName, String newName){
return isEngineXEnable(jTemplate.getTarget(), newName) && ((FileExtension.CPTX.matchExtension(oldName) && FileExtension.CPTX.matchExtension(newName)) || (FileExtension.CPT.matchExtension(oldName) && FileExtension.CPT.matchExtension(newName)));
@ -40,7 +42,7 @@ public class CptAndCptxCompatibilityUtil {
* cptx另存为cpt需要修改报表引擎属性
**/
private static boolean setFrEngineAttr(JTemplate jTemplate){
WorkSheet workSheet = gainWorkSheet(jTemplate.getTarget());
WorkSheet workSheet = getFirstWorkSheet(jTemplate.getTarget());
if (workSheet == null){
return false;
}else {
@ -49,8 +51,7 @@ public class CptAndCptxCompatibilityUtil {
layerReportAttr = new LayerReportAttr();
workSheet.setLayerReportAttr(layerReportAttr);
}
layerReportAttr.setClientPaging(true);
layerReportAttr.setEngineState(0);
layerReportAttr.enableEngineX();
return true;
}
}
@ -60,29 +61,17 @@ public class CptAndCptxCompatibilityUtil {
* cptx自动走新引擎非兼容模式cpt需要进行设置
* */
public static boolean isEngineXEnable(Object workBook, String fileName){
WorkSheet workSheet = gainWorkSheet(workBook);
LayerReportAttr layerReportAttr = gainLayerReportAttr(workSheet);
return isEngineXEnable(layerReportAttr, fileName);
}
private static LayerReportAttr gainLayerReportAttr(WorkSheet workSheet){
if (workSheet != null){
LayerReportAttr layerReportAttr = workSheet.getLayerReportAttr();
return layerReportAttr;
} else {
return null;
if (workBook == null || !(workBook instanceof FineBook)){
return false;
}
return ReportUtils.hasEngineXReport4Template((FineBook) workBook) || FileExtension.CPTX.matchExtension(fileName);
}
private static WorkSheet gainWorkSheet(Object workBook){
private static WorkSheet getFirstWorkSheet(Object workBook){
if (workBook == null || !(workBook instanceof TemplateWorkBook)){
return null;
}
Report report = ((TemplateWorkBook) workBook).getReport(0);
return report instanceof WorkSheet ? (WorkSheet)report : null;
}
private static boolean isEngineXEnable(LayerReportAttr layerReportAttr, String fileName){
return (layerReportAttr!= null && layerReportAttr.isClientPaging() && layerReportAttr.getEngineState() == LayerReportAttr.ENGINE_X) || FileExtension.CPTX.matchExtension(fileName);
}
}

26
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -3,6 +3,7 @@
*/
package com.fr.start;
import com.fr.base.extension.FileExtension;
import com.fr.common.report.ReportState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -34,6 +35,7 @@ import com.fr.stable.OperatingSystem;
import com.fr.start.event.LazyStartupEvent;
import com.fr.workspace.base.WorkspaceStatus;
import java.awt.Window;
import java.io.File;
import java.lang.reflect.Method;
@ -121,14 +123,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
File f = new File(arg);
String path = f.getAbsolutePath();
boolean pathends1 = path.endsWith(".cpt")
|| path.endsWith(".xls");
boolean pathends2 = path.endsWith(".xlsx")
|| path.endsWith(".frm");
boolean pathends3 = path.endsWith(".form")
|| path.endsWith(".cht");
boolean pathends4 = pathends1 || pathends2 || pathends3;
if (pathends4 || path.endsWith(".chart")) {
if (isAcceptFilePathEnd(path)) {
file = new FileFILE(f);
}
}
@ -148,6 +143,21 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
}
private boolean isAcceptFilePathEnd(String path) {
FileExtension[] acceptFileExtensions = new FileExtension[]{
FileExtension.CPT, FileExtension.XLS, FileExtension.XLSX, FileExtension.FRM, FileExtension.CHT, FileExtension.VIS
};
for (FileExtension acceptFileExtension : acceptFileExtensions) {
String[] extensions = acceptFileExtension.getExtensions();
for (String extension : extensions) {
if (path.endsWith("." + extension)) {
return true;
}
}
}
return false;
}
private boolean openFile(final DesignerFrame df, boolean isException, FILE file) {
//启动时打开指定文件的接口

20
designer-base/src/main/resources/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/FormulaTokenMaker.flex

@ -590,7 +590,25 @@ FunctionNames = "ABS"|
"COUNTIFS"|
"countifs"|
"SUMIFS"|
"sumifs"
"sumifs"|
"ENDOFMONTH"|
"endofmonth"|
"NUMTOZH"|
"numtozh"|
"MIDCHAR"|
"midchar"|
"ISWORKDAY"|
"isworkday"|
"ENBYSTRNUM"|
"enbystrnum"|
"TEXTGETNUM"|
"textgetnum"|
"GETCHARNUM"|
"getcharnum"|
"GCD"|
"gcd"|
"LCM"|
"lcm"
%state MLC

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -15,3 +15,7 @@ com.fr.design.report.fit.firstColumn=120*20
com.fr.design.report.fit.column=160*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=75*24
com.fr.design.cell.expand.sort.pane=257*185
com.fr.design.sort.rule.item=125*20
com.fr.design.ds.column.sort.pane=250*180
com.fr.design.sort.expand.header.pane=95*10

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -14,3 +14,7 @@ com.fr.design.report.fit.firstColumn=170*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.design.cell.expand.sort.pane=257*170
com.fr.design.sort.rule.item=125*20
com.fr.design.ds.column.sort.pane=250*165
com.fr.design.sort.expand.header.pane=95*10

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -14,3 +14,7 @@ com.fr.design.report.fit.firstColumn=130*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=80*24
com.fr.design.cell.expand.sort.pane=267*165
com.fr.design.sort.rule.item=125*20
com.fr.design.ds.column.sort.pane=250*180
com.fr.design.sort.expand.header.pane=95*10

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -15,3 +15,7 @@ com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*160
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.design.cell.expand.sort.pane=227*155
com.fr.design.sort.rule.item=80*20
com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -14,3 +14,7 @@ com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*160
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24
com.fr.design.cell.expand.sort.pane=227*155
com.fr.design.sort.rule.item=80*20
com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10

35
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataHelper.java

@ -0,0 +1,35 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
/**
* @author shine
* @version 10.0
* Created by shine on 2022/4/6
*/
public class ChartDataHelper {
/**
* 在update数据集分类的时候需要联动update一下样式-坐标轴里面的分层样式设置,来自CHART-22873
*/
public static void updateAxisCategoryStyles(ChartCollection chartCollection) {
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
int size = definition == null ? 1 : definition.getMoreCateSize() + 1;
Plot plot = chartCollection.getSelectedChart().getPlot();
if (plot instanceof VanChartAxisPlot) {
for (VanChartAxis axis : ((VanChartAxisPlot) plot).getXAxisList()) {
axis.clearCategoryStyles();
for (int i = 0; i < size; i++) {
axis.addCategoryStyle(DefaultStyleHelper4Van.dealAxisCheckTheme(new VanChartAxisLabelStyle()));
}
}
}
}
}

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -13,6 +13,7 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -192,7 +193,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
reportDefinition.clearMoreCate();
updateMoreCate(reportDefinition, plot);
collection.updateAxisCategoryStyles();
ChartDataHelper.updateAxisCategoryStyles(collection);
}
}

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -13,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
@ -246,7 +247,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
normal.clearMoreCate();
updateMoreCate(normal, plot);
}
collection.updateAxisCategoryStyles();
ChartDataHelper.updateAxisCategoryStyles(collection);
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {

26
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -5,6 +5,7 @@ import com.fr.base.ChartPreStyleConfig;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartThemeStyleProvider;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.DataSheet;
@ -14,6 +15,7 @@ import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.AttrLabel;
@ -24,6 +26,9 @@ import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.vanchart.VanChart;
import java.util.ArrayList;
import java.util.List;
/**
* @author shine
* @version 10.0
@ -82,7 +87,28 @@ public class DefaultStyleHelper4Van {
}
private static void dealAxisCheckTheme(VanChartAxis axis) {
if (!ChartEditContext.supportTheme()) {
List<ChartThemeStyleProvider> chartThemeStyleProviders = new ArrayList<>();
VanChartRectanglePlot.getAxisChartPreStyleProvider(axis, chartThemeStyleProviders);
for (ChartThemeStyleProvider themeStyleProvider : chartThemeStyleProviders) {
themeStyleProvider.setThemeCustom();
}
}
}
public static VanChartAxisLabelStyle dealAxisCheckTheme(VanChartAxisLabelStyle labelStyle) {
if (!ChartEditContext.supportTheme()) {
labelStyle.getTextAttr().setThemeCustom();
}
return labelStyle;
}
public static VanChartAxis dealAxisDefault(VanChartAxis axis) {
dealAxisCheckTheme(axis);
if (!duchampMode()) {
return axis;
}

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

@ -128,7 +128,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
public void populate(Nameable[] nameableArray) {
//特殊处理,使用instanceof判断,弹出不同的面板
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
if (SwingUtilities.getWindowAncestor(this) instanceof PopupEditDialog) {
popupEditDialog = new HyperDialog(cardPane);
}
super.populate(nameableArray);
@ -136,7 +136,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
protected void popupEditDialog(Point mousePos) {
//特殊处理,处理连续弹窗情况,弹出面板定为方式不同
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
if (SwingUtilities.getWindowAncestor(this) instanceof PopupEditDialog) {
GUICoreUtils.centerWindow(popupEditDialog);
popupEditDialog.setVisible(true);
return;

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

@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox;
@ -125,6 +126,7 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
@Override
public VanChartAxisLabelStyle updateBean() {
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
style.setLabelDisplay(labelDisplayComboBox.updateBean());
TextAttr textAttr = style.getTextAttr();
labelTextAttrPane.update(textAttr);

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

@ -32,6 +32,7 @@ import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -607,6 +608,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
private VanChartAxisLabelStyle getAxisLabelStyle(VanChartAxis axis) {
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
style.setLabelDisplay(axis.getLabelDisplay());
style.setTextAttr(axis.getTextAttr());
style.setAutoLabelGap(axis.isAutoLabelGap());
@ -663,6 +665,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
style = axis.getCategoryStyle(index);
} else {
style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
axis.addCategoryStyle(style);
}
return style;

7
designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortPane.java

@ -1,20 +1,17 @@
package com.fr.design.sort.celldscolumn;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.general.data.TableDataColumn;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.core.sort.common.CellSortAttr;
import javax.swing.*;
public class CellDSColumnSortPane extends AbstractSortPane {
public CellDSColumnSortPane() {
super(220, 150);
//this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
super(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.ds.column.sort.pane"));
}
@Override

3
designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortPane.java

@ -1,6 +1,7 @@
package com.fr.design.sort.cellexpand;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.mainframe.cell.settingpane.CellExpandAttrPane;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.report.cell.TemplateCellElement;
@ -14,7 +15,7 @@ public class CellExpandSortPane extends AbstractSortPane {
CellExpandAttrPane cellExpandAttrPane;
public CellExpandSortPane(CellExpandAttrPane cellExpandAttrPane) {
super(227, 155);
super(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.cell.expand.sort.pane"));
this.cellExpandAttrPane = cellExpandAttrPane;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
}

10
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java

@ -26,6 +26,10 @@ public abstract class AbstractSortPane extends JPanel {
protected String selfSortArea;
protected String defaultHeaderArea;
public AbstractSortPane(Dimension dimension) {
this(dimension.width, dimension.height);
}
public AbstractSortPane(int sortPaneWidth, int sortPaneRightWidth) {
this.sortPaneWidth = sortPaneWidth;
this.sortPaneRightWidth = sortPaneRightWidth;
@ -101,12 +105,12 @@ public abstract class AbstractSortPane extends JPanel {
}
public static UILabel createIntervalUILabel() {
return createIntervalUILabel(PANE_COMPONENT_H_GAP);
return createIntervalUILabel(new Dimension(PANE_COMPONENT_H_GAP, 10));
}
public static UILabel createIntervalUILabel(int vGap) {
public static UILabel createIntervalUILabel(Dimension dimension) {
UILabel uiLabel = new UILabel();
uiLabel.setPreferredSize(new Dimension(vGap, 10));
uiLabel.setPreferredSize(dimension);
return uiLabel;
}
}

3
designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java

@ -6,6 +6,7 @@ import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import javax.swing.*;
@ -85,7 +86,7 @@ public class SortUIExpandablePane extends JPanel {
this.add(iconUiLabel);
tipUILabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Second_Sort"));
this.add(tipUILabel);
this.add(AbstractSortPane.createIntervalUILabel(108));
this.add(AbstractSortPane.createIntervalUILabel( DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.sort.expand.header.pane")));
closeButton = new UILabel(IconUtils.readIcon("/com/fr/design/images/control/close.png"));
closeButton.setPreferredSize(new Dimension(16, 20));

9
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSettingPane.java

@ -4,12 +4,14 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.general.GeneralContext;
import com.fr.report.core.sort.header.SortHeader;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.Locale;
public class HeaderSettingPane extends JPanel {
protected int headerSettingPaneWidth;
@ -36,6 +38,7 @@ public class HeaderSettingPane extends JPanel {
emptyUILabel.setPreferredSize(new Dimension(10, 10));
uiCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Sort_Allow_User_Click_Sort_Order"));
addToolTipText();
uiCheckBox.setPreferredSize(new Dimension(headerSettingPaneRightWidth - 10, AbstractSortPane.PANE_COMPONENT_HEIGHT));
uiCheckBox.addChangeListener(new ChangeListener() {
@Override
@ -49,6 +52,12 @@ public class HeaderSettingPane extends JPanel {
this.add(jPanel);
}
private void addToolTipText() {
if (!Locale.CHINA.equals(GeneralContext.getLocale())) {
uiCheckBox.setToolTipText(Toolkit.i18nText("Fine-Design_Sort_Allow_User_Click_Sort_Order"));
}
}
void initHeaderSortRulePane() {
headerSortRulePane = new HeaderSortRulePane();
this.add(headerSortRulePane);

15
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java

@ -7,6 +7,7 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorControlWindow;
@ -32,6 +33,7 @@ public class HeaderSortRulePane extends JPanel {
UICheckBox desUICheckBox;
UICheckBox nosortUICheckBox;
Color defaultColor = new Color(33, 33, 34);
public static final int ICON_LENGTH = 20;
HeaderSortRulePane() {
initComponents();
@ -57,8 +59,9 @@ public class HeaderSortRulePane extends JPanel {
new Component[]{desUICheckBox = new UICheckBox(SortRule.DES.getDescription()), desIconButton = new IconButton(SortRule.DES)},
new Component[]{nosortUICheckBox = new UICheckBox(SortRule.NO_SORT.getDescription()), nosortIconButton = new IconButton(SortRule.NO_SORT)},
};
double[] rowSize = {HeaderIconBuilder.ICON_LENGTH + 10, HeaderIconBuilder.ICON_LENGTH + 10, HeaderIconBuilder.ICON_LENGTH + 10};
double[] columnSize = {80, HeaderIconBuilder.ICON_LENGTH + 10};
double[] rowSize = {ICON_LENGTH + 10, ICON_LENGTH + 10, ICON_LENGTH + 10};
double[] columnSize =
{DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.sort.rule.item").getWidth(), ICON_LENGTH + 10};
JPanel sortRuleItem = TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, 0);
this.add(sortRuleItem, BorderLayout.CENTER);
initUICheckBoxChange(ascUICheckBox, ascIconButton);
@ -116,10 +119,10 @@ public class HeaderSortRulePane extends JPanel {
jLayeredPane = new JLayeredPane();
iconLabel = getIconLabel();
borderUiLabel = new UILabel();
borderUiLabel.setSize(HeaderIconBuilder.ICON_LENGTH, HeaderIconBuilder.ICON_LENGTH);
borderUiLabel.setSize(ICON_LENGTH, ICON_LENGTH);
borderUiLabel.setOpaque(true);
borderUiLabel.setBackground(Color.WHITE);
iconLabel.setSize(HeaderIconBuilder.ICON_LENGTH, HeaderIconBuilder.ICON_LENGTH);
iconLabel.setSize(ICON_LENGTH, ICON_LENGTH);
iconLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@ -128,7 +131,7 @@ public class HeaderSortRulePane extends JPanel {
}
}
});
jLayeredPane.setPreferredSize(new Dimension(HeaderIconBuilder.ICON_LENGTH, HeaderIconBuilder.ICON_LENGTH));
jLayeredPane.setPreferredSize(new Dimension(ICON_LENGTH, ICON_LENGTH));
jLayeredPane.add(iconLabel, JLayeredPane.POPUP_LAYER);
jLayeredPane.add(borderUiLabel, JLayeredPane.MODAL_LAYER);
this.add(jLayeredPane);
@ -142,7 +145,7 @@ public class HeaderSortRulePane extends JPanel {
Icon getIcon(FineColor fineColor) {
BufferedImage bufferedImage = HeaderIconBuilder.getIcon(sortRule, fineColor);
Icon icon = new ImageIcon(bufferedImage);
Icon icon = new SVGIcon(bufferedImage);
return icon;
}

Loading…
Cancel
Save