Browse Source

完善甘特图标签和提示

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
dd32c9f711
  1. 28
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  2. 54
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java

28
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -190,6 +190,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
this.richTextChangedPercentFormatPane = richTextChangedPercentFormatPane;
}
public AttrTooltipRichText getRichTextAttr() {
return richText;
}
private JPanel createLabelContentPane() {
initDetailPane();
initCenterPane();
@ -605,8 +609,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
}
AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichTextAttr();
populateRichText(attrTooltipContent.getRichTextAttr());
}
protected void populateRichText(AttrTooltipRichText tooltipRichText) {
if (tooltipRichText != null) {
updateLocalRichText(tooltipRichText.getContent(), tooltipRichText.isAuto());
setDirty(false);
@ -636,11 +642,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) {
if (categoryNameFormatPane != null) {
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat());
}
if (seriesNameFormatPane != null) {
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat());
}
if (valueFormatPane != null) {
valueFormatPane.update(attrTooltipContent.getValueFormat());
}
if (percentFormatPane != null) {
percentFormatPane.update(attrTooltipContent.getPercentFormat());
}
if (changedValueFormatPane != null) {
changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat());
}
@ -650,11 +663,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
protected void updateRichEditor(AttrTooltipContent attrTooltipContent) {
if (richTextCategoryNameFormatPane != null) {
richTextCategoryNameFormatPane.update(attrTooltipContent.getRichTextCategoryFormat());
}
if (richTextSeriesNameFormatPane != null) {
richTextSeriesNameFormatPane.update(attrTooltipContent.getRichTextSeriesFormat());
}
if (richTextValueFormatPane != null) {
richTextValueFormatPane.update(attrTooltipContent.getRichTextValueFormat());
richTextValueFormatPane.update(attrTooltipContent.getRichTextPercentFormat());
}
if (richTextPercentFormatPane != null) {
richTextPercentFormatPane.update(attrTooltipContent.getRichTextPercentFormat());
}
if (richTextChangedValueFormatPane != null) {
richTextChangedValueFormatPane.update(attrTooltipContent.getRichTextChangedValueFormat());
}

54
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartGanttTooltipContentPane.java

@ -2,6 +2,12 @@ package com.fr.van.chart.gantt.designer.style.tooltip;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.format.AttrTooltipDurationFormat;
import com.fr.plugin.chart.base.format.AttrTooltipEndTimeFormat;
import com.fr.plugin.chart.base.format.AttrTooltipProcessesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipProgressFormat;
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipStartTimeFormat;
import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
@ -12,6 +18,7 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.Component;
import java.util.Map;
/**
* Created by hufan on 2017/1/13.
@ -115,6 +122,7 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane
@Override
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) {
// fixme 当前的样式面板设计都是基于一个大而全的父类,在子类中组合需要的属性,导致父类的属性多是protected,且子类不能明确获取自己Model的type
if (attrTooltipContent instanceof AttrGanttTooltipContent){
AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent;
processesFormatPane.populate(ganttTooltipContent.getProcessesFormat());
@ -126,6 +134,39 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane
}
}
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
if(attrTooltipContent instanceof AttrGanttTooltipContent){
AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent;
Map<String, String> params = getRichTextAttr().getParams();
AttrTooltipProcessesFormat processesFormat = ganttTooltipContent.getRichTextProcessesFormat();
richTextProcessesFormatPane.populate(processesFormat);
richTextProcessesFormatPane.updateFormatParams(params, processesFormat.getJs());
AttrTooltipSeriesFormat seriesFormat = ganttTooltipContent.getRichTextSeriesFormat();
getRichTextSeriesNameFormatPane().populate(seriesFormat);
getRichTextSeriesNameFormatPane().updateFormatParams(params, seriesFormat.getJs());
AttrTooltipStartTimeFormat startTimeFormat = ganttTooltipContent.getRichTextStartTimeFormat();
richTextStartTimeFormatPane.populate(startTimeFormat);
richTextStartTimeFormatPane.updateFormatParams(params, startTimeFormat.getJs());
AttrTooltipEndTimeFormat endTimeFormat = ganttTooltipContent.getRichTextEndTimeFormat();
richTextEndTimeFormatPane.populate(endTimeFormat);
richTextEndTimeFormatPane.updateFormatParams(params, endTimeFormat.getJs());
AttrTooltipDurationFormat durationFormat = ganttTooltipContent.getRichTextDurationFormat();
richTextDurationFormatPane.populate(durationFormat);
richTextDurationFormatPane.updateFormatParams(params, durationFormat.getJs());
AttrTooltipProgressFormat progressFormat = ganttTooltipContent.getRichTextProgressFormat();
richTextProgressFormatPane.populate(progressFormat);
richTextProgressFormatPane.updateFormatParams(params, progressFormat.getJs());
populateRichText(attrTooltipContent.getRichTextAttr());
}
}
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) {
if (attrTooltipContent instanceof AttrGanttTooltipContent){
AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent;
@ -138,6 +179,19 @@ public class VanChartGanttTooltipContentPane extends VanChartTooltipContentPane
}
}
protected void updateRichEditor(AttrTooltipContent attrTooltipContent) {
if(attrTooltipContent instanceof AttrGanttTooltipContent) {
AttrGanttTooltipContent ganttTooltipContent = (AttrGanttTooltipContent) attrTooltipContent;
richTextProcessesFormatPane.update(ganttTooltipContent.getRichTextProcessesFormat());
getRichTextSeriesNameFormatPane().update(ganttTooltipContent.getRichTextSeriesFormat());
richTextStartTimeFormatPane.update(ganttTooltipContent.getRichTextStartTimeFormat());
richTextEndTimeFormatPane.update(ganttTooltipContent.getRichTextEndTimeFormat());
richTextDurationFormatPane.update(ganttTooltipContent.getRichTextDurationFormat());
richTextProgressFormatPane.update(ganttTooltipContent.getRichTextProgressFormat());
}
}
public boolean isDirty() {
return processesFormatPane.isDirty()
|| getSeriesNameFormatPane().isDirty()

Loading…
Cancel
Save