use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class NDataPlugin method getRecChilds.
private void getRecChilds(Row row, final boolean element, final Vector res) {
Vector<Row> v = getChilds(row, element);
for (Row r : v) {
res.add(r);
getRecChilds(r, element, res);
}
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class AbstractMatrixProjection method getLeftParent.
private void getLeftParent(final Row row, final Vector<Row[]> add) {
if (row.isElement()) {
final Vector v = getLeft(row);
Row[] v1;
for (int i = 0; i < v.size(); i++) {
v1 = new Row[2];
v1[0] = row;
v1[1] = (Row) v.get(i);
add.add(v1);
}
getLeftParent((Row) row.getParent(), add);
}
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class NFunction method getOwner.
public Row getOwner() {
// Row row = dataPlugin.findRowByGlobalId(getLink());
// if (row != null)
// return row;
Row owner = getNativeOwner();
if (getType() >= Function.TYPE_EXTERNAL_REFERENCE)
return owner;
if (owner == null) {
Function par = (Function) getParent();
if (par == null)
return null;
Row ow = null;
if (par.getDecompositionType() == MovingArea.DIAGRAM_TYPE_DFDS) {
for (com.ramussoft.database.common.Row r : ((NFunction) par).getChildren()) {
Function function = (Function) r;
if (function.getType() == TYPE_DFDS_ROLE && this.equals(function.getOwner())) {
Stream stream = (Stream) dataPlugin.findRowByGlobalId(function.getLink());
if (stream != null) {
Row[] rows = stream.getAdded();
if (rows.length > 1) {
ow = null;
break;
} else if (rows.length == 1) {
if (ow != null) {
ow = null;
break;
} else
ow = rows[0];
}
}
}
}
}
if (ow != null)
return ow;
}
if (owner == null && getParentRow() != null)
return ((Function) getParentRow()).getOwner();
return owner;
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class NStream method checkRows.
private void checkRows() {
boolean ok = true;
for (final Row row : getARows()) if (row == null) {
ok = false;
break;
}
if (!ok) {
System.err.println("NULL IN ADDED ROWS");
final Vector<Row> tmp = new Vector<Row>();
for (final Row row : getARows()) if (row != null) {
tmp.add(row);
}
setARows(tmp.toArray(new Row[tmp.size()]));
for (int i = 0; i < getARows().length; i++) getARows()[i] = tmp.get(i);
}
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class NStream method getTitle.
/**
* Метод, який повертає назву стрілки, якщо назва - пустий рядок, то
* повертається набір назв пов’язаних класифікаторів розділених крапкою з
* комою і пробілом, теж саме що викликати метод getTitle("; ").
*
* @return Назва сектора.
*/
public static String getTitle(final Row[] rows) {
StringBuilder sb = new StringBuilder();
final String div = ";\n";
boolean first = true;
for (Row row : rows) {
if (first)
first = false;
else
sb.append(div);
sb.append(row.getName());
String status = row.getAttachedStatus();
if (status != null) {
int i = status.indexOf('|');
if (i >= 0) {
status = status.substring(i + 1);
if (status.trim().length() == 0)
status = null;
}
}
if (status != null) {
sb.append(" (");
sb.append(status);
sb.append(')');
}
}
return sb.toString();
}
Aggregations