use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.
the class HTTPParser method getStreams.
private Vector getStreams(final Function function, final MatrixProjection projection) {
Vector left = projection.getLeft(function);
final Vector x = new Vector();
for (int i = 0; i < left.size(); i++) {
final Sector s = (Sector) left.get(i);
if (s.getStream() != null)
x.add(s.getStream());
}
left = x;
return left;
}
use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.
the class AbstractSector method copyVisual.
public void copyVisual(final int type) {
synchronized (dataPlugin) {
final Vector<Sector> v = new Vector<Sector>();
getConnected(v);
for (int i = 0; i < v.size(); i++) {
v.get(i).setVisualAttributes(getVisualAttributes());
}
}
}
use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.
the class AbstractSector method getStreamChilds.
private void getStreamChilds(final Vector<Sector> v) {
final Stream stream = getStream();
final Vector<Sector> n = new Vector<Sector>(3);
getChilds(getStart().getCrosspoint(), n);
getChilds(getEnd().getCrosspoint(), n);
for (final Sector s : n) {
if ((s.getStream() == null || stream != null && stream.equals(s.getStream())) && (v.indexOf(s) < 0)) {
v.add(s);
((AbstractSector) s).getStreamChilds(v);
}
}
}
use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.
the class DFDObjectDialog method onOk.
@Override
protected void onOk() {
Journaled journaled = (Journaled) dataPlugin.getEngine();
journaled.startUserTransaction();
Function function = object.getFunction();
function.setFont(fontChooser.getSelFont());
function.setBackground(backgroundColorChooser.getColor());
function.setForeground(foregroundColorChooser.getColor());
if (link == null) {
function.setLink(-1);
} else
function.setLink(link.getElement().getId());
Function p = (Function) function.getParent();
List<Sector> list = new ArrayList<Sector>();
if (p != null) {
for (Sector sector : p.getSectors()) {
if (function.equals(sector.getStart().getFunction()))
list.add(sector);
else if (function.equals(sector.getEnd().getFunction()))
list.add(sector);
}
}
for (Sector sector : list) SectorRefactor.fixOwners(sector, dataPlugin);
journaled.commitUserTransaction();
super.onOk();
}
use of com.ramussoft.pb.Sector in project ramus by Vitaliy-Yakovchuk.
the class MatrixProjectionIDEF0 method getRight.
/**
* Метод повертає вектор елементів класифікатора робіт, які пов’язані з
* відповідним елементом класифікатора потоків.
*/
public Vector<Row> getRight(final Row row) {
final Vector<Row> res = new Vector<Row>();
final Object[] functions = Main.dataPlugin.getRecChilds(Main.dataPlugin.getBaseFunction(), true).toArray();
Function f;
Function pF;
final Vector<Function> softs = new Vector<Function>();
if (functionType == -1)
for (final Object element : functions) {
boolean add = true;
f = (Function) element;
for (int j = 0; j < softs.size(); j++) if (Main.dataPlugin.isParent(f, softs.get(j))) {
res.add(f);
add = false;
break;
}
if (add) {
pF = (Function) f.getParentRow();
final Vector v = pF.getSectors();
for (int j = 0; j < v.size(); j++) {
final Sector sector = (Sector) v.get(j);
if (type == MovingPanel.RIGHT) {
if (f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
res.add(f);
if (sector.getStart().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
softs.add(f);
}
} else {
if (sector.getEnd().getFunctionType() == type && f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
res.add(f);
if (sector.getEnd().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
softs.add(f);
}
}
}
}
}
else
for (final Object element : functions) {
f = (Function) element;
if (f.getType() == functionType) {
boolean add = true;
for (int j = 0; j < softs.size(); j++) if (Main.dataPlugin.isParent(f, softs.get(j))) {
res.add(f);
add = false;
break;
}
if (add) {
pF = (Function) f.getParentRow();
final Vector v = pF.getSectors();
for (int j = 0; j < v.size(); j++) {
final Sector sector = (Sector) v.get(j);
if (type == MovingPanel.RIGHT) {
if (f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
res.add(f);
if (sector.getStart().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
softs.add(f);
}
} else {
if (sector.getEnd().getFunctionType() == type && f.equals(sector.getStart().getFunction()) && row.equals(sector.getStream())) {
res.add(f);
if (sector.getEnd().getTunnelSoft() == Crosspoint.TUNNEL_SOFT)
softs.add(f);
}
}
}
}
}
}
return res;
}
Aggregations