Qinghui.Liu
4 years ago
4 changed files with 83 additions and 18 deletions
@ -0,0 +1,58 @@
|
||||
package com.fr.van.chart.designer.component.border; |
||||
|
||||
import com.fr.chart.base.AttrBorder; |
||||
import com.fr.chart.chartglyph.Marker; |
||||
import com.fr.chart.chartglyph.MarkerFactory; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.gui.xcombox.MarkerComboBox; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.utils.gui.UIComponentUtils; |
||||
import com.fr.design.widget.FRWidgetFactory; |
||||
import com.fr.plugin.chart.base.AttrBorderWithShape; |
||||
import com.fr.plugin.chart.marker.type.MarkerType; |
||||
|
||||
import java.awt.Component; |
||||
|
||||
public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane { |
||||
|
||||
private MarkerComboBox shapePane; |
||||
|
||||
protected void initComponents() { |
||||
shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); |
||||
super.initComponents(); |
||||
} |
||||
|
||||
protected Component[][] getUseComponent() { |
||||
return new Component[][]{ |
||||
new Component[]{null, null}, |
||||
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), |
||||
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)}, |
||||
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane}, |
||||
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), |
||||
UIComponentUtils.wrapWithBorderLayoutPane(shapePane)}, |
||||
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()} |
||||
}; |
||||
} |
||||
|
||||
protected double[] getRowSize() { |
||||
double p = TableLayout.PREFERRED; |
||||
return new double[]{p, p, p, p, p}; |
||||
} |
||||
|
||||
public void populate(AttrBorder border) { |
||||
super.populate(border); |
||||
|
||||
if (border instanceof AttrBorderWithShape) { |
||||
shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape()))); |
||||
} |
||||
} |
||||
|
||||
public void update(AttrBorder border) { |
||||
super.update(border); |
||||
|
||||
if (border instanceof AttrBorderWithShape) { |
||||
((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType())); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue