use of com.ramussoft.common.AccessRules in project ramus by Vitaliy-Yakovchuk.
the class XMLComponentFramefork method createTableComponentFactory.
private ComponentFactory createTableComponentFactory() {
return new AbstractComponentFactory() {
@Override
public String getType() {
return "Table";
}
@Override
public Component createComponent(Diagram diagram, Engine engine, AccessRules accessRules, Bounds bounds) {
Table label = new Table();
label.setWidth(((XMLDiagram) diagram).getWidthForCompontns());
return label;
}
@Override
public Component getComponent(Engine engine, AccessRules accessRules, Bounds bounds) {
return null;
}
};
}
use of com.ramussoft.common.AccessRules in project ramus by Vitaliy-Yakovchuk.
the class XMLComponentFramefork method createTableColumnFactory.
private ComponentFactory createTableColumnFactory() {
return new AbstractComponentFactory() {
@Override
public String getType() {
return "TableColumn";
}
@Override
public Component createComponent(Diagram diagram, Engine engine, AccessRules accessRules, Bounds bounds) {
TableColumn label = new TableColumn();
label.setWidth(((XMLDiagram) diagram).getWidthForCompontns());
return label;
}
@Override
public Component getComponent(Engine engine, AccessRules accessRules, Bounds bounds) {
return null;
}
};
}
use of com.ramussoft.common.AccessRules 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();
}
Aggregations