|
|
|
@ -1,9 +1,7 @@
|
|
|
|
|
package com.fr.van.chart.designer.style.label; |
|
|
|
|
|
|
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.plugin.chart.type.GaugeStyle; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; |
|
|
|
@ -11,14 +9,12 @@ import com.fr.van.chart.designer.component.label.LabelContentPaneWithPercent;
|
|
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 仪表盘的分类(多指针时)或者百分比标签 |
|
|
|
|
*/ |
|
|
|
|
public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabelDetailPane { |
|
|
|
|
//todo 重新整理这个面板
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 5176535960949074945L; |
|
|
|
|
|
|
|
|
@ -27,15 +23,20 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected double[] getLabelPaneRowSize(Plot plot, double p) { |
|
|
|
|
return hasLabelPosition(plot) ? new double[]{p,p,p} : new double[]{p,p}; |
|
|
|
|
if (hasLabelAlign(plot)) { |
|
|
|
|
return new double[]{p, p, p, p}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (hasLabelPosition(plot)) { |
|
|
|
|
return new double[]{p, p, p}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new double[]{p, p}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void initToolTipContentPane(Plot plot) { |
|
|
|
|
initGaugeStyle(plot); |
|
|
|
|
switch (gaugeStyle){ |
|
|
|
|
switch (getGaugeStyle()) { |
|
|
|
|
case POINTER: |
|
|
|
|
dataLabelContentPane = new LabelContentPaneWithCate(parent, VanChartGaugeCateOrPercentLabelDetailPane.this); |
|
|
|
|
break; |
|
|
|
|
case POINTER_SEMI: |
|
|
|
|
dataLabelContentPane = new LabelContentPaneWithCate(parent, VanChartGaugeCateOrPercentLabelDetailPane.this); |
|
|
|
|
break; |
|
|
|
@ -45,13 +46,13 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected boolean getFontSizeAuto() { |
|
|
|
|
return ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.RING) || ComparatorUtils.equals(getGaugeStyle(), GaugeStyle.SLOT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected boolean hasLabelPosition(Plot plot) { |
|
|
|
|
initGaugeStyle(plot); |
|
|
|
|
switch (gaugeStyle){ |
|
|
|
|
switch (getGaugeStyle()) { |
|
|
|
|
case RING: |
|
|
|
|
return false; |
|
|
|
|
case SLOT: |
|
|
|
|
return false; |
|
|
|
|
default: |
|
|
|
@ -60,67 +61,10 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected double[] getLabelStyleRowSize(double p) { |
|
|
|
|
switch (gaugeStyle){ |
|
|
|
|
case RING: |
|
|
|
|
return new double[]{p, p}; |
|
|
|
|
case SLOT: |
|
|
|
|
return new double[] {p, p}; |
|
|
|
|
default: |
|
|
|
|
return new double[] {p}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { |
|
|
|
|
return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, component); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getLabelStyleComponents(Plot plot) { |
|
|
|
|
initGaugeStyle(plot); |
|
|
|
|
if (gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT) { |
|
|
|
|
UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{text,style}, |
|
|
|
|
new Component[]{textFontPane,null}, |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{textFontPane, null}, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected ChartTextAttrPane initTextFontPane () { |
|
|
|
|
//todo 需要再整理下
|
|
|
|
|
if (gaugeStyle == GaugeStyle.RING || gaugeStyle == GaugeStyle.SLOT){ |
|
|
|
|
return new ChartTextAttrPane(){ |
|
|
|
|
protected double[] getRowSize () { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
return new double[]{p, p}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected Component[][] getComponents(JPanel buttonPane) { |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{null, fontNameComboBox}, |
|
|
|
|
new Component[]{null, buttonPane} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
return new ChartTextAttrPane(){ |
|
|
|
|
protected double[] getRowSize () { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
return new double[]{p, p}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected Component[][] getComponents(JPanel buttonPane) { |
|
|
|
|
UILabel text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{text, fontNameComboBox}, |
|
|
|
|
new Component[]{null, buttonPane} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |