use of com.ramussoft.common.journal.Journaled in project ramus by Vitaliy-Yakovchuk.
the class QualifiersQualifierAttributesDialog method onOk.
@Override
protected void onOk() {
Qualifier qualifier = StandardAttributesPlugin.getQualifiersQualifier(engine);
qualifier.getAttributes().clear();
for (Row row : view.getSelectedRows()) {
qualifier.getAttributes().add(engine.getAttribute(StandardAttributesPlugin.getAttributeId(engine, row.getElement())));
}
((Journaled) engine).startUserTransaction();
engine.updateQualifier(qualifier);
((Journaled) engine).commitUserTransaction();
super.onOk();
}
use of com.ramussoft.common.journal.Journaled in project ramus by Vitaliy-Yakovchuk.
the class DFDSRoleOptionsDialog method onOk.
@Override
protected void onOk() {
if (!isCanOk()) {
JOptionPane.showMessageDialog(this, ResourceLoader.getString("you_should_enter_name_or_at_least_on_added_elemen"));
return;
}
if (!isOkStreamName()) {
if (JOptionPane.showConfirmDialog(this, ResourceLoader.getString("you_entered_exists_stream_continue"), ResourceLoader.getString("warning"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
return;
}
}
DFDSRole role = (DFDSRole) object;
Journaled journaled = (Journaled) dataPlugin.getEngine();
journaled.startUserTransaction();
Function function = object.getFunction();
function.setFont(fontChooser.getSelFont());
function.setBackground(backgroundColorChooser.getColor());
function.setForeground(foregroundColorChooser.getColor());
role.setAlternativeText(sectorNameEditor.getAlternativeTextField().getText());
Stream stream = sectorRowsEditor.getStream();
if (stream == null) {
stream = sectorNameEditor.findStreamByName();
if (stream == null) {
stream = (Stream) dataPlugin.createRow(dataPlugin.getBaseStream(), true);
}
}
final String t = sectorNameEditor.getArrowName();
if (!t.equals("")) {
if (!t.equals(stream.getName()) && sectorNameEditor.findStreamByName(stream.getName()) != null) {
stream = (Stream) dataPlugin.createRow(dataPlugin.getBaseStream(), true);
}
}
if (t.equals("")) {
if (!stream.isEmptyName()) {
stream = (Stream) dataPlugin.createRow(dataPlugin.getBaseStream(), true);
stream.setEmptyName(true);
}
} else {
stream.setName(t);
}
stream.setRows(sectorRowsEditor.getRows());
role.setStream(stream, ReplaceStreamType.SIMPLE);
// sector.setStreamAddedByRefactor(false);
final Row[] rs = sectorRowsEditor.getRows();
role.setRows(rs);
if (rs != null) {
RectangleVisualOptions ops = new RectangleVisualOptions();
ops.bounds = function.getBounds();
ops.background = function.getBackground();
ops.font = function.getFont();
ops.foreground = function.getForeground();
for (Row row : rs) if (row != null) {
IDEF0Plugin.setDefaultRectangleVisualOptions(dataPlugin.getEngine(), row.getElement(), ops);
}
}
journaled.commitUserTransaction();
setVisible(false);
}
use of com.ramussoft.common.journal.Journaled in project ramus by Vitaliy-Yakovchuk.
the class FunctionOptionsDialog method apptype.
private void apptype() {
Engine e = dataPlugin.getEngine();
if (e instanceof Journaled)
((Journaled) e).startUserTransaction();
function.setFont(getJFontChooser().getSelFont());
function.setBackground(getJColorChooser().getColor());
function.setForeground(getJColorChooser1().getColor());
final JList jList = selectOwner.getJList();
if (jList.getSelectedIndex() == 0)
function.setOwner(null);
else {
function.setOwner((Row) jList.getSelectedValue());
}
function.setType(functionType.getType());
AccessRules rules = dataPlugin.getAccessRules();
Element element = ((NFunction) function).getElement();
for (int index = attributes.size() - 1; index >= 0; index--) {
Attribute attribute = attributes.get(index);
if (rules.canUpdateElement(element.getId(), attribute.getId())) {
Object value = attributeEditors.get(index).getValue();
if (!equals(value, values.get(index)))
e.setAttribute(element, attribute, value);
}
}
if (e instanceof Journaled)
((Journaled) e).commitUserTransaction();
}
use of com.ramussoft.common.journal.Journaled in project ramus by Vitaliy-Yakovchuk.
the class DiagramOptionsDialog method onOk.
@Override
protected void onOk() {
Engine engine = framework.getEngine();
((Journaled) engine).startUserTransaction();
function.setStatus(statusPanel.getStatus());
if (!function.getCreateDate().equals(createDate.getDate()))
function.setCreateDate(createDate.getDate());
if (!function.getRevDate().equals(revDate.getDate()))
function.setRevDate(revDate.getDate());
if (!function.getAuthor().equals(author.getText()))
function.setAuthor(author.getText());
String newSize = String.valueOf(sizesBox.getSelectedItem());
if (horizontalPageCountBox.getSelectedIndex() != 0)
newSize += "x" + horizontalPageCountBox.getSelectedItem();
if (!newSize.equals(function.getPageSize())) {
function.setPageSize(newSize);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
framework.propertyChanged(IDEF0TabView.UPDATE_SIZES);
}
});
}
((Journaled) engine).commitUserTransaction();
super.onOk();
}
Aggregations