use of com.ramussoft.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class ModelPropertiesDialog method setupAttribute.
public void setupAttribute() {
TreeTableNode node = component.getTable().getSelectedNode();
if (node == null)
return;
Row row = node.getRow();
if (row == null)
return;
AttributePreferenciesDialog d = new AttributePreferenciesDialog(framework, this);
Attribute attribute = engine.getAttribute((Long) row.getAttribute(attributeId));
d.setAttribute(attribute);
d.getOKButton().setEnabled(rules.canUpdateAttribute(attribute.getId()));
d.setVisible(true);
}
use of com.ramussoft.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class ModelsNode method createR2Children.
public static Vector<TreeTableNode> createR2Children(Row root) {
Vector<TreeTableNode> res = new Vector<TreeTableNode>();
for (Row row : root.getChildren()) {
RowNode node = new FunctionNode(createR2Children(row), row);
node.setParent();
res.add(node);
}
return res;
}
use of com.ramussoft.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class ModelsPanel method openDiagram.
public void openDiagram() {
RowTreeTable table = tree.getTable();
final List<OpenDiagram> models = new ArrayList<OpenDiagram>();
Qualifier modelTree = IDEF0Plugin.getModelTree(engine);
for (int i : table.getSelectedRows()) {
if (i >= 0) {
TreePath path = table.getPathForRow(i);
if (path != null) {
TreeTableNode node = (TreeTableNode) path.getLastPathComponent();
if (node != null) {
Row row = node.getRow();
if (row != null) {
if (row.getElement().getQualifierId() == modelTree.getId()) {
Long id = (Long) row.getAttribute(StandardAttributesPlugin.getAttributeQualifierId(engine));
if (id != null) {
Qualifier model = engine.getQualifier(id);
if (model != null) {
OpenDiagram openDiagram = new OpenDiagram(model, -1l);
models.add(openDiagram);
}
}
} else {
if (row.getChildCount() <= 0)
row = row.getParent();
OpenDiagram openDiagram = new OpenDiagram(row.getRowSet().getQualifier(), row.getElementId());
models.add(openDiagram);
}
}
}
}
}
}
if (models.size() > 0) {
if (engine.getPluginProperty("IDEF0", "DataPlugin") == null) {
framework.showAnimation(GlobalResourcesManager.getString("Wait.DataLoading"));
Thread thread = new Thread() {
@Override
public void run() {
NDataPluginFactory.getDataPlugin(null, engine, framework.getAccessRules());
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
openDiagrams(models);
framework.hideAnimation();
}
});
}
};
thread.start();
} else
openDiagrams(models);
}
}
use of com.ramussoft.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class AttributePullView method setupAttribute.
private void setupAttribute() {
AttributePreferenciesDialog dialog = new AttributePreferenciesDialogWithQualifierSet(framework);
TreeTableNode node = table.getSelectedNode();
if (node == null)
return;
Row row = node.getRow();
Attribute attribute = engine.getAttribute((Long) row.getAttribute(attributeId));
dialog.setAttribute(attribute);
dialog.getOKButton().setEnabled(rules.canUpdateAttribute(attribute.getId()));
dialog.setVisible(true);
}
use of com.ramussoft.gui.qualifier.table.TreeTableNode in project ramus by Vitaliy-Yakovchuk.
the class AttributePullView method refreshActions.
private void refreshActions() {
createAttributeAction.setEnabled(rules.canCreateAttribute());
if (table.getTreeSelectionModel().getSelectionPath() == null) {
deleteAttributeAction.setEnabled(false);
attributePreferencesAction.setEnabled(false);
} else {
boolean e = true;
boolean e1 = true;
TreePath[] paths = table.getTreeSelectionModel().getSelectionPaths();
for (TreePath path : paths) {
Row row = ((TreeTableNode) path.getLastPathComponent()).getRow();
if (row == null) {
e = false;
e1 = false;
break;
}
if (row.getChildCount() > 0) {
e = false;
break;
}
Long long1 = (Long) row.getAttribute(attributeId);
if (long1 == null)
break;
long attrId = long1;
if (!rules.canDeleteAttribute(attrId)) {
e = false;
break;
}
if (!rules.canUpdateAttribute(attrId)) {
e1 = false;
break;
}
}
deleteAttributeAction.setEnabled(e);
attributePreferencesAction.setEnabled(e1);
}
}
Aggregations