use of com.dsoft.utils.DataLoader.MemoryData in project ramus by Vitaliy-Yakovchuk.
the class PaintSector method savePointOrdinates.
private void savePointOrdinates(List<Ordinate> ordinates) {
List<PaintSector> paintSectors = new ArrayList<PaintSector>();
for (Ordinate ordinate : ordinates) {
for (Point point : ordinate.getPoints()) if (!paintSectors.contains(point.getSector()))
paintSectors.add(point.getSector());
}
MemoryData memoryData = new MemoryData();
Engine engine = getMovingArea().getDataPlugin().getEngine();
for (PaintSector paintSector : paintSectors) save(paintSector, memoryData, engine);
}
use of com.dsoft.utils.DataLoader.MemoryData in project ramus by Vitaliy-Yakovchuk.
the class DFDSFunction method onProcessEndBoundsChange.
@Override
public void onProcessEndBoundsChange() {
FRectangle oldRec = function.getBounds();
myBounds.setTransformNetBounds(MovingArea.NET_LENGTH);
FRectangle newRect = new FRectangle(myBounds);
function.setBounds(newRect);
final SectorRefactor refactor = movingArea.getRefactor();
MemoryData memoryData = new MemoryData();
List<PaintSector> list = new ArrayList<PaintSector>();
for (int i = 0; i < refactor.getSectorsCount(); i++) {
PaintSector sector = refactor.getSector(i);
try {
setAddedSectorPos(oldRec, sector, list);
} catch (Exception e) {
e.printStackTrace();
}
}
for (PaintSector ps : list) PaintSector.save(ps, memoryData, ((NFunction) function).getEngine());
setAddedRolesPos(oldRec, newRect);
}
use of com.dsoft.utils.DataLoader.MemoryData 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);
}
}
}
}
use of com.dsoft.utils.DataLoader.MemoryData in project ramus by Vitaliy-Yakovchuk.
the class IDEF0Object method onProcessEndBoundsChange.
public void onProcessEndBoundsChange(List<PaintSector> notToMove) {
final FRectangle oldRec = function.getBounds();
super.onProcessEndBoundsChange();
function.setBounds(new FRectangle(myBounds));
final SectorRefactor refactor = movingArea.getRefactor();
MemoryData memoryData = new MemoryData();
List<PaintSector> list = new ArrayList<PaintSector>();
for (int i = 0; i < refactor.getSectorsCount(); i++) {
PaintSector sector = refactor.getSector(i);
boolean con = false;
if (notToMove != null)
for (PaintSector ps : notToMove) {
if (ps.getSector().equals(sector.getSector())) {
con = true;
break;
}
}
if (con)
continue;
setAddedSectorPos(oldRec, sector, list);
}
for (PaintSector ps : list) PaintSector.save(ps, memoryData, ((NFunction) function).getEngine());
}
use of com.dsoft.utils.DataLoader.MemoryData in project ramus by Vitaliy-Yakovchuk.
the class MovingArea method setTransparent.
/**
* Змінює прозорість напису для активного сектора.
*/
public void setTransparent() {
final PaintSector sector = ((PaintSector.Pin) activeObject).getSector();
sector.setTransparent(!sector.isTransparent());
startUserTransaction();
PaintSector.save(sector, new MemoryData(), dataPlugin.getEngine());
refactor.setUndoPoint();
}
Aggregations