Browse Source

Merge pull request #3201 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '9bc7f8a13c79f9f906272a72da6fa1fc586a814a':
  CHART-17661 多层饼图面板
  REPORT-45880 使用富文本恢复普通文本后文本格式失效
  REPORT-45880 使用富文本恢复普通文本后文本格式失效
  REPORT-45880 使用富文本恢复普通文本后文本格式失效
  REPORT-45473 数据集命名超过16个字符时,关联数据集中不显示数据集名称 【问题原因】之前的逻辑是调用代表数据集名称的UILabel的getPreferredSize()获取width,然后跟常量143去比较,如果超过了143,就将其中内容减短几个字符,加上"...",然后循环接着比较。此时UILabel还没有被添加到panel中,当获取到的width比较贴近143时,添加了之后由于布局变化导致宽度超出143,表现为数据集名称显示丢失 【改动思路】将143缩小为130,差不多是缩小了一个汉字或者两个字母在UILabel中占的宽度,更容易触发判断条件以减短字符然后添加"...",这样UILabel被添加到panel中宽度存在细微变化也不会超过原来的143,数据集名称可以正常显示
research/11.0
superman 4 years ago
parent
commit
8879282017
  1. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  2. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  3. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java
  4. 12
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

2
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -41,7 +41,7 @@ import java.util.Map.Entry;
public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData> {
private static final int MAX_LENTH_OF_DATASET = 143; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...”
private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...”
private static final int MIN_BAR_NUMBER = 10;
private static final int SUB_LENGTH = 4;
private JPanel centerPanel;

19
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -166,6 +166,12 @@ public class PlotFactory {
tooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureTooltipContentPane.class);
}
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>> labelMap = new HashMap<>();
static {
labelMap.put(PiePlot4VanChart.class, VanChartPiePlotLabelPane.class);
labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class);
}
/**
* 监控刷新 自动数据点提示Map
@ -208,10 +214,15 @@ public class PlotFactory {
}
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) {
if (plot instanceof VanChartGaugePlot) {
return new VanChartGaugePlotLabelPane(plot, stylePane);
} else if (plot instanceof PiePlot4VanChart) {
return new VanChartPiePlotLabelPane(plot, stylePane, inCondition);
Class<? extends Plot> key = plot.getClass();
if (labelMap.containsKey(key)) {
try {
Class<? extends VanChartPlotLabelPane> cl = labelMap.get(key);
Constructor<? extends VanChartPlotLabelPane> constructor = cl.getConstructor(Plot.class, VanChartStylePane.class, boolean.class);
return constructor.newInstance(plot, stylePane, inCondition);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return new VanChartPlotLabelPane(plot, stylePane, inCondition);
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java

@ -25,8 +25,8 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane {
private VanChartPlotLabelDetailPane gaugeValueLabelPane;
public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent, boolean inCondition) {
super(plot, parent, inCondition);
}
protected void createLabelPane() {

12
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -573,6 +573,7 @@ public class CellSelection extends Selection {
for (int i = 0; i < removeElementList.size(); i++) {
CellElement element = removeElementList.get(i);
element.setValue(null);
setDefault(element);
}
break;
@ -588,6 +589,17 @@ public class CellSelection extends Selection {
return true;
}
//设置显示内容为default
private void setDefault(CellElement element) {
CellGUIAttr cellGUIAttr = element.getCellGUIAttr();
if (cellGUIAttr != null) {
cellGUIAttr.setShowAsDefault(true);
cellGUIAttr.setShowAsHTML(false);
cellGUIAttr.setShowAsDownload(false);
cellGUIAttr.setShowAsImage(false);
}
}
@Override
public int[] getSelectedColumns() {

Loading…
Cancel
Save