use of com.ramussoft.chart.ChartSource in project ramus by Vitaliy-Yakovchuk.
the class PieChartSetupEditor method createComponent.
@Override
public JComponent createComponent(GUIFramework framework, Element element) {
JComponent component = super.createComponent(framework, element);
final ChartSource source = getChartSource();
initAttributes(framework.getEngine());
key.setSelectedItem(source.getAttributeProperty(PIE_ATTRIBUTE_KEY));
value.setSelectedItem(source.getAttributeProperty(PIE_ATTRIBUTE_VALUE));
double[][] size = { { 5, TableLayout.MINIMUM, TableLayout.FILL, TableLayout.MINIMUM, TableLayout.FILL, 5 }, { 5, TableLayout.FILL, 5 } };
TableLayout layout = new TableLayout(size);
layout.setHGap(5);
layout.setVGap(5);
JPanel panel = new JPanel(layout);
panel.add(new JLabel(ChartResourceManager.getString("Chart.key")), "1,1");
panel.add(key, "2,1");
panel.add(new JLabel(ChartResourceManager.getString("Chart.value")), "3,1");
panel.add(value, "4,1");
JPanel panel2 = new JPanel(new BorderLayout());
panel2.add(component, BorderLayout.CENTER);
panel2.add(panel, BorderLayout.SOUTH);
return panel2;
}
use of com.ramussoft.chart.ChartSource in project ramus by Vitaliy-Yakovchuk.
the class AbstractChartSetupEditor method save.
@Override
public void save(Element element) {
component.save();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
ChartSource chartSource = getChartSource();
chartSource.setChartType(type);
chartSource.save(stream);
framework.getEngine().setUndoableStream(getPreferencesPath(element, StandardAttributesPlugin.getAttributeNameAttribute(framework.getEngine())), stream.toByteArray());
}
Aggregations