use of com.ramussoft.gui.qualifier.table.RowTreeTable 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);
}
}
Aggregations