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. 64
      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) {
webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebRootPath());
webReportFILE = new FileNodeFILE(FileNodeFILE.webRootPath);
}
if (FILEChooserPane.this.showLoc) {
processSystemFile();
@ -1219,7 +1219,7 @@ public class FILEChooserPane extends BasicPane {
}
if (FILEChooserPane.this.showWebReport) {
webReportFILE = new FileNodeFILE(FRContext.getCommonOperator().getWebRootPath());
webReportFILE = new FileNodeFILE(FileNodeFILE.webRootPath);
}
if (FILEChooserPane.this.showLoc) {
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));
} else if (path.startsWith(WEBREPORT_PREFIX)) {
return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), false),
FRContext.getCommonOperator().getWebRootPath());
FileNodeFILE.webRootPath);
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} else {
@ -50,7 +50,7 @@ public class FILEFactory {
fixFILENodeAuth(new FileNode(path.substring(ENV_PREFIX.length()), true));
} else if (path.startsWith(WEBREPORT_PREFIX)) {
return new FileNodeFILE(new FileNode(path.substring(WEBREPORT_PREFIX.length()), true),
FRContext.getCommonOperator().getWebRootPath());
FileNodeFILE.webRootPath);
} else if (path.startsWith(FILE_PREFIX)) {
return new FileFILE(new java.io.File(path.substring(FILE_PREFIX.length())));
} 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 {
private static String webRootPath = FRContext.getCommonOperator().getWebRootPath();
public static String webRootPath = FRContext.getCommonOperator().getWebRootPath();
private static String[] supportTypes = FRContext.getFileNodes().getSupportedTypes();
static {

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

Loading…
Cancel
Save