Browse Source

Merge pull request #3891 in DESIGN/design from release/10.0 to feature/10.0

* commit '6fef7052ad7de2e49a12e9d0e5f9d32f2a977c66':
  CHART-18720  试管型仪表盘用横向状态初始标签面板有问题
  CHART-18720  试管型仪表盘用横向状态初始标签面板有问题
  REPORT-49034 引用JS静态资源文件路径出错
feature/10.0
superman 4 years ago
parent
commit
7dc5bbf172
  1. 4
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  2. 4
      designer-base/src/main/java/com/fr/file/FILEFactory.java
  3. 2
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java
  4. 62
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

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

@ -1158,7 +1158,7 @@ public class FILEChooserPane extends BasicPane {
}; };
} }
if (FILEChooserPane.this.showWebReport) { if (FILEChooserPane.this.showWebReport) {
webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebRootPath()); webReportFILE = new FileNodeFILE(FileNodeFILE.webRootPath);
} }
if (FILEChooserPane.this.showLoc) { if (FILEChooserPane.this.showLoc) {
processSystemFile(); processSystemFile();
@ -1219,7 +1219,7 @@ public class FILEChooserPane extends BasicPane {
} }
if (FILEChooserPane.this.showWebReport) { if (FILEChooserPane.this.showWebReport) {
webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebRootPath()); webReportFILE = new FileNodeFILE(FileNodeFILE.webRootPath);
} }
if (FILEChooserPane.this.showLoc) { if (FILEChooserPane.this.showLoc) {
processSystemFile(); processSystemFile();

4
designer-base/src/main/java/com/fr/file/FILEFactory.java

@ -32,7 +32,7 @@ public class FILEFactory {
return new FileNodeFILE(new FileNode(path.substring(envPath.length() + 1), false)); return new FileNodeFILE(new FileNode(path.substring(envPath.length() + 1), false));
} else if (path.startsWith(WEBREPORT_PREFIX)) { } else if (path.startsWith(WEBREPORT_PREFIX)) {
return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), false), return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), false),
FRContext.getCommonOperator().getWebRootPath()); FileNodeFILE.webRootPath);
} else if (path.startsWith(FILE_PREFIX)) { } else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length()))); return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else { } else {
@ -50,7 +50,7 @@ public class FILEFactory {
fixFILENodeAuth(new FileNode(path.substring(ENV_PREFIX.length()), true)); fixFILENodeAuth(new FileNode(path.substring(ENV_PREFIX.length()), true));
} else if (path.startsWith(WEBREPORT_PREFIX)) { } else if (path.startsWith(WEBREPORT_PREFIX)) {
return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), true), return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), true),
FRContext.getCommonOperator().getWebRootPath()); FileNodeFILE.webRootPath);
} else if (path.startsWith(FILE_PREFIX)) { } else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length()))); return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else { } else {

2
designer-base/src/main/java/com/fr/file/FileNodeFILE.java

@ -32,7 +32,7 @@ import java.util.Arrays;
public class FileNodeFILE implements FILE { public class FileNodeFILE implements FILE {
private static String webRootPath = FRContext.getCommonOperator().getWebRootPath(); public static String webRootPath = FRContext.getCommonOperator().getWebRootPath();
private static String[] supportTypes = FRContext.getFileNodes().getSupportedTypes(); private static String[] supportTypes = FRContext.getFileNodes().getSupportedTypes();
static { static {

62
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType; import com.fr.plugin.chart.type.FontAutoType;
@ -127,15 +126,13 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) {
if (hasLabelAlignPane()) { if (hasLabelAlignPane()) {
return new Component[][]{ return new Component[][]{
new Component[]{getDataLabelContentPane(), null}, new Component[]{getDataLabelContentPane(), null},
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical"), plot), null}, new Component[]{createLabelPositionPane(getVerticalTitle(), plot), null},
new Component[]{createLabelAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal")), null}, new Component[]{createLabelAlignPane(), null},
new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null}, new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null},
}; };
} else { } else {
return new Component[][]{ return new Component[][]{
new Component[]{getDataLabelContentPane(), null}, new Component[]{getDataLabelContentPane(), null},
new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null}, new Component[]{createLabelStylePane(getLabelStyleRowSize(p), columnSize, plot), null},
@ -143,50 +140,37 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
} }
} }
private JPanel createLabelAlignPane(String title) { private JPanel createLabelAlignPane() {
JPanel panel = new JPanel(new BorderLayout()); alignPane = new JPanel(new BorderLayout());
checkAlignPane();
alignPane = new JPanel(); return alignPane;
checkAlignPane(title);
panel.add(alignPane, BorderLayout.CENTER);
return panel;
} }
protected void checkAlignPane(String title) { protected void checkAlignPane() {
if (alignPane == null && !hasLabelAlign(getPlot())) { if (!hasLabelAlignPane()) {
return; return;
} }
if (alignPane != null && !hasLabelAlign(getPlot())) { if (!hasLabelAlign()) {
oldAlignValues = null;
alignPane.removeAll(); alignPane.removeAll();
return; return;
} }
if (alignPane == null && hasLabelAlign(getPlot())) {
alignPane = new JPanel(); if (alignPane.getComponents().length > 0) {
return;
} }
TwoTuple<String[], Integer[]> result = getAlignNamesAndValues(); TwoTuple<String[], Integer[]> result = getAlignNamesAndValues();
String[] names = result.getFirst(); String[] names = result.getFirst();
Integer[] values = result.getSecond(); Integer[] values = result.getSecond();
if (ComparatorUtils.equals(values, oldAlignValues)) { align = new UIButtonGroup<>(names, values);
return;
}
oldAlignValues = values;
align = new UIButtonGroup<Integer>(names, values);
Component[][] comps = new Component[2][2]; Component[][] comps = new Component[2][2];
comps[0] = new Component[]{null, null}; comps[0] = new Component[]{null, null};
comps[1] = new Component[]{new UILabel(title, SwingConstants.LEFT), align}; comps[1] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal"), SwingConstants.LEFT), align};
double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; double[] row = new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED};
double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; double[] col = new double[]{TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
alignPane.removeAll();
alignPane.setLayout(new BorderLayout());
alignPane.add(getLabelPositionPane(comps, row, col), BorderLayout.CENTER); alignPane.add(getLabelPositionPane(comps, row, col), BorderLayout.CENTER);
if (getParentPane() != null) { if (getParentPane() != null) {
@ -214,12 +198,16 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
} }
protected void checkPane() { protected void checkPane() {
String verticalTitle = hasLabelAlign(getPlot()) String verticalTitle = getVerticalTitle();
? Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical")
: Toolkit.i18nText("Fine-Design_Chart_Layout_Position");
checkPositionPane(verticalTitle); checkPositionPane(verticalTitle);
checkAlignPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Horizontal")); checkAlignPane();
}
private String getVerticalTitle() {
return hasLabelAlign()
? Toolkit.i18nText("Fine-Design_Chart_Layout_Vertical")
: Toolkit.i18nText("Fine-Design_Chart_Layout_Position");
} }
protected void checkStyleUse() { protected void checkStyleUse() {
@ -227,8 +215,8 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
textFontPane.setPreferredSize(new Dimension(0, TEXT_FONT_PANE_HEIGHT)); textFontPane.setPreferredSize(new Dimension(0, TEXT_FONT_PANE_HEIGHT));
} }
protected boolean hasLabelAlign(Plot plot) { protected boolean hasLabelAlign() {
return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) plot).getGaugeDetailStyle().isHorizontalLayout(); return getGaugeStyle() == GaugeStyle.THERMOMETER && !((VanChartGaugePlot) getPlot()).getGaugeDetailStyle().isHorizontalLayout();
} }
protected boolean hasLabelAlignPane() { protected boolean hasLabelAlignPane() {
@ -240,7 +228,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
style.setSelectedIndex(1); style.setSelectedIndex(1);
textFontPane.populate(detail.getTextAttr()); textFontPane.populate(detail.getTextAttr());
if (hasLabelAlign(this.getPlot()) && align != null) { if (hasLabelAlign() && align != null) {
align.setSelectedItem(detail.getAlign()); align.setSelectedItem(detail.getAlign());
} }

Loading…
Cancel
Save