use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class SelectClasificatorDialog method showModal.
public Row showModal() {
result = null;
rows = Main.dataPlugin.getRecChilds(null, false);
list.setModel(new AbstractListModel() {
public Object getElementAt(final int index) {
final Row row = rows.get(index);
return row.getKod() + " " + row.getName();
}
public int getSize() {
if (rows == null)
return 0;
return rows.size();
}
});
if (active != null) {
final int index = rows.indexOf(active);
list.setSelectedIndex(index);
}
setVisible(true);
rows = null;
Options.saveOptions("selectCLDialog", this);
return result;
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class MatrixProjectionOuner method getRight.
public Vector<Row> getRight(final Row row) {
final Vector<Row> res = new Vector<Row>();
final Vector<Row> functions = Main.dataPlugin.getRecChilds(Main.dataPlugin.getBaseFunction(), true);
for (int i = 0; i < functions.size(); i++) {
final Function f = (Function) functions.get(i);
final Row o = f.getOwner();
if (o.equals(row))
res.add(f);
}
return res;
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class MatrixProjectionStreams method getLeft.
/**
* Повертає набір класифікаторів пов’язаних з елементом класифікатора
* потоків, атрибут обов’язково має бети елементом класифікатора потоків.
*/
public Vector<Row> getLeft(final Row row) {
final Row[] rows = ((Stream) row).getAdded();
final Vector<Row> res = new Vector<Row>();
for (final Row row2 : rows) res.add(row2);
return res;
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class External method paint.
@Override
public void paint(Graphics2D g) {
DataPlugin dp = ((NFunction) function).getDataPlugin();
Row row = dp.findRowByGlobalId(function.getLink());
final class PolygonD extends Polygon {
/**
*/
private static final long serialVersionUID = 113232131232134523L;
public void addPoint(final double x, final double y) {
super.addPoint((int) x, (int) y);
}
}
g.setColor(function.getBackground());
final Rectangle2D rect = movingArea.getBounds(getBounds());
g.fill(rect);
g.setFont(function.getFont());
paintText(g);
if (row != null) {
String string = row.getKod();
movingArea.paintText(g, string, new FRectangle(myBounds.getX() + 3, myBounds.getY() + 3, myBounds.getWidth() - 3, myBounds.getHeight() - 3), Line.LEFT_ALIGN, 0, true);
}
paintBorder(g);
final Stroke tmp = g.getStroke();
g.draw(rect);
double zm = movingArea.getIDoubleOrdinate(2);
g.draw(new Line2D.Double(rect.getX() + zm, rect.getY() + zm, rect.getX() + zm, rect.getY() + rect.getHeight()));
g.draw(new Line2D.Double(rect.getX() + zm, rect.getY() + zm, rect.getX() + rect.getWidth(), rect.getY() + zm));
if (paintTriangle >= 0) {
final PolygonD p = new PolygonD();
p.addPoint(rect.getX() + rect.getWidth() / 2, rect.getY() + rect.getHeight() / 2);
int standoff2 = -1;
switch(paintTriangle) {
case Point.TOP:
{
p.addPoint(rect.getX() + standoff2, rect.getY() + standoff2);
p.addPoint(rect.getX() + rect.getWidth() - standoff2, rect.getY() + standoff2);
}
break;
case Point.LEFT:
{
p.addPoint(rect.getX() + standoff2, rect.getY() + standoff2);
p.addPoint(rect.getX() + standoff2, rect.getY() + rect.getHeight() - standoff2);
}
break;
case Point.RIGHT:
{
p.addPoint(rect.getX() + rect.getWidth() - standoff2, rect.getY() + standoff2);
p.addPoint(rect.getX() + rect.getWidth() - standoff2, rect.getY() + rect.getHeight() - standoff2);
}
break;
case Point.BOTTOM:
{
p.addPoint(rect.getX() + standoff2, rect.getY() + rect.getHeight() - standoff2);
p.addPoint(rect.getX() + rect.getWidth() - standoff2, rect.getY() + rect.getHeight() - standoff2);
}
break;
}
if (p.npoints > 1)
g.fillPolygon(p);
}
g.setStroke(tmp);
}
use of com.ramussoft.pb.Row in project ramus by Vitaliy-Yakovchuk.
the class DFDSRole method onProcessEndBoundsChange.
@Override
public void onProcessEndBoundsChange() {
final FRectangle oldRec = function.getBounds();
myBounds.setTransformNetBounds(MovingArea.NET_LENGTH);
List<PaintSector> list = new ArrayList<PaintSector>();
final SectorRefactor refactor = movingArea.getRefactor();
boolean sectorReplaced = false;
DFDSFunction function = movingArea.findDFDSFunction(this.getBounds());
if (function != null) {
getFunction().setOwner(function.getFunction());
for (int i = 0; i < refactor.getSectorsCount(); i++) {
PaintSector ps = refactor.getSector(i);
Function function2 = ps.getSector().getStart().getFunction();
if (function2 != null && function2.equals(this.function)) {
replaceFunction(ps.getSector().getStart(), ps, list, ps.getStartPoint(), ps.getSector().getStart().getFunctionType(), function, refactor, true);
}
Function function3 = ps.getSector().getEnd().getFunction();
if (function3 != null && function3.equals(this.function)) {
replaceFunction(ps.getSector().getEnd(), ps, list, ps.getEndPoint(), ps.getSector().getEnd().getFunctionType(), function, refactor, false);
}
}
function.justifyRoles();
sectorReplaced = true;
} else {
if (this.getFunction().getOwner() != null) {
DFDSFunction function2 = movingArea.findDFDSFunction(this.getFunction().getOwner());
if (function2 != null && function2.getBounds().intersects(this.getBounds())) {
function2.justifyRoles();
} else
this.function.setBounds(new FRectangle(myBounds));
} else
this.function.setBounds(new FRectangle(myBounds));
}
MemoryData memoryData = new MemoryData();
if (!sectorReplaced) {
for (int i = 0; i < refactor.getSectorsCount(); i++) {
PaintSector sector = refactor.getSector(i);
setAddedSectorPos(oldRec, sector, list);
}
}
for (PaintSector ps : list) PaintSector.save(ps, memoryData, ((NFunction) this.function).getEngine());
long l = this.function.getLink();
if (l >= 0l) {
Stream stream = (Stream) movingArea.getDataPlugin().findRowByGlobalId(l);
if (stream != null) {
Row[] rows = stream.getAdded();
RectangleVisualOptions ops = new RectangleVisualOptions();
ops.bounds = this.function.getBounds();
ops.background = this.function.getBackground();
ops.font = this.function.getFont();
ops.foreground = this.function.getForeground();
for (Row row : rows) if (row != null) {
IDEF0Plugin.setDefaultRectangleVisualOptions(movingArea.getDataPlugin().getEngine(), row.getElement(), ops);
}
}
}
}
Aggregations