|
|
|
@ -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() |
|
|
|
|