|
|
@ -7,6 +7,13 @@ import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.plugin.chart.base.AttrTooltipContent; |
|
|
|
import com.fr.plugin.chart.base.AttrTooltipContent; |
|
|
|
import com.fr.plugin.chart.base.AttrTooltipRichText; |
|
|
|
import com.fr.plugin.chart.base.AttrTooltipRichText; |
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; |
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataMaxFormat; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataMedianFormat; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataMinFormat; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataNumberFormat; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataOutlierFormat; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataQ1Format; |
|
|
|
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipDataQ3Format; |
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipFormat; |
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipFormat; |
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; |
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; |
|
|
|
import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; |
|
|
|
import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; |
|
|
@ -48,6 +55,9 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { |
|
|
|
private JPanel dataNumberPane; |
|
|
|
private JPanel dataNumberPane; |
|
|
|
private JPanel dataOutlierPane; |
|
|
|
private JPanel dataOutlierPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel richTextNumberPane; |
|
|
|
|
|
|
|
private JPanel richTextOutlierPane; |
|
|
|
|
|
|
|
|
|
|
|
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { |
|
|
|
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { |
|
|
|
super(parent, showOnPane); |
|
|
|
super(parent, showOnPane); |
|
|
|
checkFormatVisible(isDetailed); |
|
|
|
checkFormatVisible(isDetailed); |
|
|
@ -145,6 +155,16 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { |
|
|
|
return commonPanel; |
|
|
|
return commonPanel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createRichFormatPanel() { |
|
|
|
|
|
|
|
JPanel richFormatPanel = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
richFormatPanel.add(createRichTextCateAndSeriesPane(), BorderLayout.NORTH); |
|
|
|
|
|
|
|
richFormatPanel.add(createRichTextDataNumberPane(), BorderLayout.CENTER); |
|
|
|
|
|
|
|
richFormatPanel.add(createRichTextDataDetailPane(), BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return richFormatPanel; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getRichTextComponents() { |
|
|
|
protected Component[][] getRichTextComponents() { |
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{getRichTextCategoryNameFormatPane(), null}, |
|
|
|
new Component[]{getRichTextCategoryNameFormatPane(), null}, |
|
|
@ -229,6 +249,72 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { |
|
|
|
return detailPane; |
|
|
|
return detailPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createRichTextCateAndSeriesPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] cateAndSeries = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{null, getRichTextCategoryNameFormatPane()}, |
|
|
|
|
|
|
|
new Component[]{null, getRichTextSeriesNameFormatPane()} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createRichTextDataNumberPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] dataNumber = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{null, richTextNumber}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
richTextNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return richTextNumberPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createRichTextDataDetailPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel detailPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] richTextDetail = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{null, richTextMax}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(getLabelContentTitle()), richTextQ3}, |
|
|
|
|
|
|
|
new Component[]{null, richTextMedian}, |
|
|
|
|
|
|
|
new Component[]{null, richTextQ1}, |
|
|
|
|
|
|
|
new Component[]{null, richTextMin} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] dataOutlier = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{null, richTextOutlier}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
richTextOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detailPane.add(TableLayoutHelper.createTableLayoutPane(richTextDetail, new double[]{p, p, p, p, p, p}, columnSize), BorderLayout.NORTH); |
|
|
|
|
|
|
|
detailPane.add(richTextOutlierPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return detailPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isDirty() { |
|
|
|
public boolean isDirty() { |
|
|
|
return getCategoryNameFormatPane().isDirty() |
|
|
|
return getCategoryNameFormatPane().isDirty() |
|
|
|
|| getSeriesNameFormatPane().isDirty() |
|
|
|
|| getSeriesNameFormatPane().isDirty() |
|
|
@ -291,26 +377,48 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { |
|
|
|
if (attrTooltipContent instanceof AttrBoxTooltipContent) { |
|
|
|
if (attrTooltipContent instanceof AttrBoxTooltipContent) { |
|
|
|
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; |
|
|
|
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; |
|
|
|
|
|
|
|
|
|
|
|
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ |
|
|
|
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = getFormatPaneGroup(); |
|
|
|
|
|
|
|
AttrTooltipFormat[] formatGroup = getFormatGroup(boxTooltipContent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populateRichTextFormat(formatPaneGroup, formatGroup); |
|
|
|
|
|
|
|
populateRichText(attrTooltipContent.getRichTextAttr()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkRichEditorState(attrTooltipContent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private VanChartFormatPaneWithoutCheckBox[] getFormatPaneGroup() { |
|
|
|
|
|
|
|
if (detailed) { |
|
|
|
|
|
|
|
return new VanChartFormatPaneWithoutCheckBox[]{ |
|
|
|
richTextNumber, richTextMax, richTextQ3, richTextMedian, |
|
|
|
richTextNumber, richTextMax, richTextQ3, richTextMedian, |
|
|
|
richTextQ1, richTextMin, richTextOutlier |
|
|
|
richTextQ1, richTextMin, richTextOutlier |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ |
|
|
|
return new VanChartFormatPaneWithoutCheckBox[]{ |
|
|
|
boxTooltipContent.getRichTextNumber(), |
|
|
|
richTextMax, richTextQ3, richTextMedian, richTextQ1, richTextMin |
|
|
|
boxTooltipContent.getRichTextMax(), |
|
|
|
|
|
|
|
boxTooltipContent.getRichTextQ3(), |
|
|
|
|
|
|
|
boxTooltipContent.getRichTextMedian(), |
|
|
|
|
|
|
|
boxTooltipContent.getRichTextQ1(), |
|
|
|
|
|
|
|
boxTooltipContent.getRichTextMin(), |
|
|
|
|
|
|
|
boxTooltipContent.getRichTextOutlier() |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
populateRichTextFormat(formatPaneGroup, formatGroup); |
|
|
|
private AttrTooltipFormat[] getFormatGroup(AttrBoxTooltipContent boxTooltipContent) { |
|
|
|
populateRichText(attrTooltipContent.getRichTextAttr()); |
|
|
|
AttrTooltipDataNumberFormat richTextNumber = boxTooltipContent.getRichTextNumber(); |
|
|
|
|
|
|
|
AttrTooltipDataMaxFormat richTextMaxFormat = boxTooltipContent.getRichTextMax(); |
|
|
|
|
|
|
|
AttrTooltipDataQ3Format richTextQ3Format = boxTooltipContent.getRichTextQ3(); |
|
|
|
|
|
|
|
AttrTooltipDataMedianFormat richTextMedianFormat = boxTooltipContent.getRichTextMedian(); |
|
|
|
|
|
|
|
AttrTooltipDataQ1Format richTextQ1Format = boxTooltipContent.getRichTextQ1(); |
|
|
|
|
|
|
|
AttrTooltipDataMinFormat richTextMinFormat = boxTooltipContent.getRichTextMin(); |
|
|
|
|
|
|
|
AttrTooltipDataOutlierFormat richTextOutlierFormat = boxTooltipContent.getRichTextOutlier(); |
|
|
|
|
|
|
|
|
|
|
|
checkRichEditorState(attrTooltipContent); |
|
|
|
if (detailed) { |
|
|
|
|
|
|
|
return new AttrTooltipFormat[]{ |
|
|
|
|
|
|
|
richTextNumber, richTextMaxFormat, richTextQ3Format, richTextMedianFormat, |
|
|
|
|
|
|
|
richTextQ1Format, richTextMinFormat, richTextOutlierFormat |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new AttrTooltipFormat[]{ |
|
|
|
|
|
|
|
richTextMaxFormat, richTextQ3Format, richTextMedianFormat, richTextQ1Format, richTextMinFormat |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
|
|
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
|
@ -354,5 +462,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { |
|
|
|
|
|
|
|
|
|
|
|
dataNumberPane.setVisible(detailed); |
|
|
|
dataNumberPane.setVisible(detailed); |
|
|
|
dataOutlierPane.setVisible(detailed); |
|
|
|
dataOutlierPane.setVisible(detailed); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
richTextNumberPane.setVisible(detailed); |
|
|
|
|
|
|
|
richTextOutlierPane.setVisible(detailed); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|