use of com.ramussoft.pb.types.GlobalId in project ramus by Vitaliy-Yakovchuk.
the class PaintSector method loadFromStreamOld.
public static PaintSector loadFromStreamOld(final InputStream stream, final int version, final MovingArea area, final DataLoader.MemoryData memoryData, final DataPlugin dataPlugin, final GlobalId newId) throws IOException {
final PaintSector sector = new PaintSector(area);
DataLoader.readString(stream);
DataLoader.readString(stream);
sector.showTilda = DataLoader.readBoolean(stream);
final int l = DataLoader.readInteger(stream);
sector.points = new Point[l];
for (int i = 0; i < l; i++) {
final Point p = new Point();
// p.setSector(sector);
p.loadFromStreamOld(stream, memoryData, dataPlugin);
sector.points[i] = p;
}
GlobalId id = new GlobalId();
id.loadFromStream(stream);
if (newId != null)
id = newId;
sector.sector = dataPlugin.findSectorByGlobalId(id);
if (sector.sector == null) {
if (!DataLoader.readBoolean(stream)) {
DataLoader.readFRectangle(stream);
DataLoader.readBoolean(stream);
if (sector.showTilda)
DataLoader.readDouble(stream);
}
return null;
}
sector.sector.reload();
sector.loadVisuals();
sector.setSectorPoints();
if (DataLoader.readBoolean(stream))
sector.text = null;
else {
sector.createText();
if (sector.text == null) {
DataLoader.readFRectangle(stream);
DataLoader.readBoolean(stream);
if (sector.showTilda)
DataLoader.readDouble(stream);
} else {
sector.text.setBounds(DataLoader.readFRectangle(stream));
sector.text.setTransparent(DataLoader.readBoolean(stream));
if (sector.showTilda)
sector.tildaPos.setPos(DataLoader.readDouble(stream));
}
}
return sector;
}
use of com.ramussoft.pb.types.GlobalId in project ramus by Vitaliy-Yakovchuk.
the class NFunction method getOwners.
public Row[] getOwners() {
Function function = (Function) getParentRow();
if (function.getDecompositionType() == MovingArea.DIAGRAM_TYPE_DFDS) {
if (function != null) {
List<Row> res = new ArrayList<Row>();
int c = function.getChildCount();
for (int i = 0; i < c; i++) {
Function function2 = (Function) function.getChildAt(i);
if (function2.getType() == Function.TYPE_DFDS_ROLE && this.equals(function2.getOwner())) {
Stream stream = (Stream) dataPlugin.findRowByGlobalId(function2.getLink());
if (stream != null) {
for (Row row : stream.getAdded()) if (!res.contains(row))
res.add(row);
}
}
}
Row[] rows = res.toArray(new Row[res.size()]);
RowFactory.sortByName(rows);
return rows;
}
}
String s = dataPlugin.getProperty(DataPlugin.PROPERTY_OUNERS);
if (s == null)
s = "";
final StringTokenizer st = new StringTokenizer(s);
final Vector<GlobalId> ids = new Vector<GlobalId>();
while (st.hasMoreTokens()) {
ids.add(GlobalId.convert(st.nextToken()));
}
final MatrixProjection projection = dataPlugin.getProjection(MatrixProjection.TYPE_IDEF0, "BOTTOM");
final Vector left = projection.getLeft(this);
final Vector<Row> res = new Vector<Row>();
Row[] rows;
for (int i = 0; i < left.size(); i++) {
final Stream r = (Stream) left.get(i);
if ((rows = r.getAdded()).length == 0)
addRow(res, ids, r);
else
for (final Row element2 : rows) addRow(res, ids, element2);
}
rows = res.toArray(new Row[res.size()]);
RowFactory.sortByName(rows);
return rows;
}
use of com.ramussoft.pb.types.GlobalId in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method loadRowById.
private Row loadRowById() {
final String sId = (String) params.get("id");
if (sId == null) {
return null;
}
final GlobalId id = GlobalId.convert(sId);
if (id == null) {
return null;
}
return dataPlugin.findRowByGlobalId(id);
}
use of com.ramussoft.pb.types.GlobalId in project ramus by Vitaliy-Yakovchuk.
the class Point method loadFromStreamOld.
public void loadFromStreamOld(final InputStream stream, final DataLoader.MemoryData memoryData, DataPlugin dataPlugin) throws IOException {
xOrdinate = DataLoader.readOrdinate(stream, memoryData);
yOrdinate = DataLoader.readOrdinate(stream, memoryData);
yOrdinate.addPoint(this);
xOrdinate.addPoint(this);
type = DataLoader.readInteger(stream);
// borderTypeO =
// old
DataLoader.readInteger(stream);
final GlobalId id = new GlobalId();
//
id.loadFromStream(stream);
if (id.getLocalId() >= 0) {
// old
// functionO = (Function)
dataPlugin.findRowByGlobalId(id);
// functionTypeO =
DataLoader.readInteger(stream);
}
}
use of com.ramussoft.pb.types.GlobalId in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method getSelRows.
private Row[] getSelRows(Qualifier clasificator) {
final Enumeration e = params.keys();
Vector v = new Vector();
final String base = params.get("base");
if (base == null) {
while (e.hasMoreElements()) {
final Object key = e.nextElement();
final GlobalId id = GlobalId.convert(key.toString());
if (id != null) {
if (!params.get(key).equals("")) {
final Row r = dataPlugin.findRowByGlobalId(id);
if (r != null)
v.add(r);
}
}
}
final Vector rec = dataPlugin.getRecChildren(clasificator);
final Vector res = new Vector();
Object tmp;
for (int i = 0; i < rec.size(); i++) if (v.indexOf(tmp = rec.get(i)) >= 0)
res.add(tmp);
v = res;
} else {
try {
final Row row = dataPlugin.findRowByGlobalId(GlobalId.convert(base));
v = dataPlugin.getRecChilds(row, true);
v.insertElementAt(row, 0);
} catch (final Exception ex) {
}
}
final Row[] rows = new Row[v.size()];
for (int i = 0; i < rows.length; i++) rows[i] = (Row) v.get(i);
return rows;
}
Aggregations