Search in sources :

Example 16 with Engine

use of com.ramussoft.common.Engine in project ramus by Vitaliy-Yakovchuk.

the class IDEF0Buffer method getStreamsRowSet.

public static RowSet getStreamsRowSet(final Data data) {
    RowSet rowSet = (RowSet) data.get("Streams");
    if (rowSet != null)
        return rowSet;
    com.ramussoft.database.common.RowSet.RowCreater rowCreater = new com.ramussoft.database.common.RowSet.RowCreater() {

        @Override
        public com.ramussoft.database.common.Row createRow(Element aElement, com.ramussoft.database.common.RowSet rowSet, Attribute[] attributes, Object[] objects) {
            return new Stream(aElement, (RowSet) rowSet, attributes, objects, data);
        }
    };
    Engine engine = data.getEngine();
    rowSet = new RowSet(engine, IDEF0Plugin.getBaseStreamQualifier(engine), data, rowCreater);
    data.put("Streams", rowSet);
    return rowSet;
}
Also used : Element(com.ramussoft.common.Element) RowSet(com.ramussoft.report.data.RowSet) Engine(com.ramussoft.common.Engine)

Example 17 with Engine

use of com.ramussoft.common.Engine in project ramus by Vitaliy-Yakovchuk.

the class ChartSourceSelectPanel method changeSourceForTable.

private void changeSourceForTable() {
    Engine engine = framework.getEngine();
    QualifierSource source = chartSource.getQualifierSources().get(0);
    FilterSource source2 = source.getFilterSources().get(0);
    Element element = engine.getElement(Long.parseLong(source2.getValue()));
    source.setQualifier(engine.getQualifier(element.getQualifierId()));
    source.getElementSources().clear();
    ElementSource source3 = chartSource.createElementSource();
    source3.setElement(element);
    source.getElementSources().add(source3);
    source.getFilterSources().clear();
}
Also used : QualifierSource(com.ramussoft.chart.QualifierSource) FilterSource(com.ramussoft.chart.FilterSource) Element(com.ramussoft.common.Element) ElementSource(com.ramussoft.chart.ElementSource) Engine(com.ramussoft.common.Engine)

Example 18 with Engine

use of com.ramussoft.common.Engine in project ramus by Vitaliy-Yakovchuk.

the class TableChartAttributePlugin method getAttributePreferenciesEditor.

@Override
public AttributePreferenciesEditor getAttributePreferenciesEditor() {
    return new AttributePreferenciesEditor() {

        private RowTreeTableComponent component;

        @Override
        public JComponent createComponent(Attribute attribute, Engine engine, AccessRules accessRules) {
            component = new RowTreeTableComponent(engine, ChartPlugin.getCharts(engine), accessRules, new RowRootCreater(), new Attribute[] { StandardAttributesPlugin.getAttributeNameAttribute(engine) }, framework);
            component.setSelectType(SelectType.RADIO);
            return component;
        }

        @Override
        public boolean canApply() {
            return component.getModel().getSelectedRows().size() > 0;
        }

        @Override
        public void apply(Attribute attribute, Engine engine, AccessRules accessRules) {
            Row row = component.getModel().getSelectedRows().get(0);
            TableChartPersistent tcp = new TableChartPersistent();
            tcp.setOtherElementId(row.getElementId());
            engine.setAttribute(null, attribute, tcp);
        }
    };
}
Also used : Attribute(com.ramussoft.common.Attribute) RowTreeTableComponent(com.ramussoft.gui.qualifier.table.RowTreeTableComponent) AccessRules(com.ramussoft.common.AccessRules) RowRootCreater(com.ramussoft.gui.qualifier.table.RowRootCreater) TableChartPersistent(com.ramussoft.chart.core.TableChartPersistent) Row(com.ramussoft.database.common.Row) AttributePreferenciesEditor(com.ramussoft.gui.common.AttributePreferenciesEditor) Engine(com.ramussoft.common.Engine)

Example 19 with Engine

use of com.ramussoft.common.Engine in project ramus by Vitaliy-Yakovchuk.

the class ChartView method close.

@Override
public void close() {
    super.close();
    Engine engine = framework.getEngine();
    engine.removeElementAttributeListener(ChartPlugin.getCharts(engine), diagramNameListener);
    engine.removeStreamListener(streamListener);
    hook.close();
}
Also used : Engine(com.ramussoft.common.Engine)

Example 20 with Engine

use of com.ramussoft.common.Engine in project ramus by Vitaliy-Yakovchuk.

the class CreateChartDialog method onOk.

@Override
protected void onOk() {
    Engine engine = framework.getEngine();
    try {
        ((Journaled) engine).startUserTransaction();
        Element element = chartsView.createChartElement(name.getText());
        editor.save(element);
        ((Journaled) engine).commitUserTransaction();
    } catch (Exception e) {
        ((Journaled) engine).rollbackUserTransaction();
        e.printStackTrace();
        JOptionPane.showMessageDialog(framework.getMainFrame(), e.getLocalizedMessage());
    }
    super.onOk();
}
Also used : Journaled(com.ramussoft.common.journal.Journaled) Element(com.ramussoft.common.Element) Engine(com.ramussoft.common.Engine)

Aggregations

Engine (com.ramussoft.common.Engine)85 Attribute (com.ramussoft.common.Attribute)32 ArrayList (java.util.ArrayList)30 Element (com.ramussoft.common.Element)27 Qualifier (com.ramussoft.common.Qualifier)22 AccessRules (com.ramussoft.common.AccessRules)21 List (java.util.List)19 IEngine (com.ramussoft.common.IEngine)15 Row (com.ramussoft.database.common.Row)13 IOException (java.io.IOException)11 SQLException (java.sql.SQLException)11 PluginFactory (com.ramussoft.common.PluginFactory)8 PluginProvider (com.ramussoft.common.PluginProvider)8 Journaled (com.ramussoft.common.journal.Journaled)8 CachedEngine (com.ramussoft.common.cached.CachedEngine)7 Hashtable (java.util.Hashtable)7 TreeTableNode (com.ramussoft.gui.qualifier.table.TreeTableNode)6 JournaledEngine (com.ramussoft.common.journal.JournaledEngine)5 FileIEngineImpl (com.ramussoft.core.impl.FileIEngineImpl)5 MemoryDatabase (com.ramussoft.database.MemoryDatabase)5