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;
}
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();
}
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);
}
};
}
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();
}
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();
}
Aggregations