use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class BarChartSetupEditor method initAttributes.
private void initAttributes(Engine engine) {
key.removeAllItems();
for (Attribute attribute : engine.getAttributes()) key.addItem(attribute);
orientation.addItem(verticalTitle);
orientation.addItem(horizontalTitle);
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class PieChartSetupEditor method initAttributes.
private void initAttributes(Engine engine) {
key.removeAllItems();
value.removeAllItems();
for (Attribute attribute : engine.getAttributes()) {
key.addItem(attribute);
value.addItem(attribute);
}
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class PieChartSetupEditor method save.
@Override
public void save(Element element) {
ChartSource source = getChartSource();
source.setAttributeProperty(PIE_ATTRIBUTE_KEY, ((Attribute) key.getSelectedItem()));
source.setAttributeProperty(PIE_ATTRIBUTE_VALUE, ((Attribute) value.getSelectedItem()));
super.save(element);
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class PieChartDataPlugin method createChart.
@Override
public JFreeChart createChart(Element element, ChartSource source) {
Attribute key = source.getAttributeProperty(PIE_ATTRIBUTE_KEY);
Attribute value = source.getAttributeProperty(PIE_ATTRIBUTE_VALUE);
if ((key == null) || (value == null))
throw new ChartNotSetupedException();
DefaultPieDataset dataset = new DefaultPieDataset();
for (Element element2 : source.getElements()) {
Object v1 = engine.getAttribute(element2, key);
Object v2 = engine.getAttribute(element2, value);
if ((v1 != null) && (v2 != null))
dataset.setValue(toString(v1), toDouble(v2));
}
return ChartFactory.createPieChart(element.getName(), dataset, true, true, false);
}
use of com.ramussoft.common.Attribute in project ramus by Vitaliy-Yakovchuk.
the class ChartPlugin method createChartSets.
private Qualifier createChartSets() {
Qualifier qualifier = engine.createSystemQualifier();
qualifier.setName(QUALIFIER_CHART_SETS);
Attribute attribute = StandardAttributesPlugin.getAttributeNameAttribute(engine);
qualifier.getAttributes().add(attribute);
qualifier.getSystemAttributes().add(StandardAttributesPlugin.getHierarchicalAttribute(engine));
qualifier.setAttributeForName(attribute.getId());
engine.updateQualifier(qualifier);
return qualifier;
}
Aggregations