Search in sources :

Example 41 with Attribute

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);
}
Also used : Attribute(com.ramussoft.common.Attribute)

Example 42 with Attribute

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);
    }
}
Also used : Attribute(com.ramussoft.common.Attribute)

Example 43 with 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);
}
Also used : ChartSource(com.ramussoft.chart.ChartSource) Attribute(com.ramussoft.common.Attribute)

Example 44 with Attribute

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);
}
Also used : DefaultPieDataset(org.jfree.data.general.DefaultPieDataset) Attribute(com.ramussoft.common.Attribute) Element(com.ramussoft.common.Element) ChartNotSetupedException(com.ramussoft.chart.exception.ChartNotSetupedException)

Example 45 with Attribute

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;
}
Also used : Attribute(com.ramussoft.common.Attribute) Qualifier(com.ramussoft.common.Qualifier)

Aggregations

Attribute (com.ramussoft.common.Attribute)203 Qualifier (com.ramussoft.common.Qualifier)72 Element (com.ramussoft.common.Element)70 ArrayList (java.util.ArrayList)53 Engine (com.ramussoft.common.Engine)32 List (java.util.List)20 Row (com.ramussoft.database.common.Row)19 Hashtable (java.util.Hashtable)19 SQLException (java.sql.SQLException)16 AttributeType (com.ramussoft.common.AttributeType)15 FindObject (com.ramussoft.common.attribute.FindObject)11 AttributeEvent (com.ramussoft.common.event.AttributeEvent)11 ResultSet (java.sql.ResultSet)11 AttributePlugin (com.ramussoft.gui.common.AttributePlugin)10 AccessRules (com.ramussoft.common.AccessRules)9 Transaction (com.ramussoft.common.persistent.Transaction)9 HierarchicalPersistent (com.ramussoft.core.attribute.simple.HierarchicalPersistent)9 RowMapper (com.ramussoft.jdbc.RowMapper)9 Row (com.ramussoft.pb.Row)9 ImageIcon (javax.swing.ImageIcon)9