use of com.ramussoft.pb.idef.visual.MovingArea in project ramus by Vitaliy-Yakovchuk.
the class PIDEF0painter method createMovingArea.
public static MovingArea createMovingArea(final Dimension d, final DataPlugin dataPlugin, Function activeFunction) {
final MovingArea movingArea = new MovingArea(dataPlugin, activeFunction);
final double zh = (double) d.height / (double) movingArea.MOVING_AREA_HEIGHT;
final double zw = (double) d.width / (double) movingArea.MOVING_AREA_WIDTH;
final double zoom = zw < zh ? zw : zh;
movingArea.setZoom(zoom);
movingArea.setSize(movingArea.getIntOrdinate(movingArea.MOVING_AREA_WIDTH), movingArea.getIntOrdinate(movingArea.CLIENT_HEIGHT));
return movingArea;
}
use of com.ramussoft.pb.idef.visual.MovingArea in project ramus by Vitaliy-Yakovchuk.
the class IDEFPanel method getMovingArea.
/**
* This method initializes movingArea
*
* @return com.jason.clasificators.frames.idf.MovingArea
*/
public MovingArea getMovingArea() {
if (movingArea == null) {
movingArea = new MovingArea(dataPlugin, this) {
@Override
public void setActiveObject(Object activeObject, boolean silent) {
super.setActiveObject(activeObject, silent);
if (!silent)
IDEFPanel.this.setActiveObject(activeObject);
}
};
movingArea.setBackground(DEFAULT_BACKGROUND);
}
return movingArea;
}
use of com.ramussoft.pb.idef.visual.MovingArea in project ramus by Vitaliy-Yakovchuk.
the class ProjectOptionsPanel method update.
private void update(Function function, boolean updateFonts, boolean updateZoom, double percent, GUIFramework framework) {
if (!updateFonts && !updateZoom)
return;
long id = -1l;
if (!dataPlugin.getBaseFunction().equals(function)) {
id = function.getElement().getId();
}
framework.propertyChanged(IDEF0TabView.CLOSE, id);
SectorRefactor sectorRefactor = new SectorRefactor(new MovingArea(dataPlugin, function));
sectorRefactor.updatePageSize(updateFonts, updateZoom, percent, function);
Vector<Row> v = dataPlugin.getChilds(function, true);
for (Row row : v) {
Function function2 = (Function) row;
update(function2, updateFonts, updateZoom, percent, framework);
}
}
use of com.ramussoft.pb.idef.visual.MovingArea in project ramus by Vitaliy-Yakovchuk.
the class ModelParaleler method createSectorsOnUpperLevel.
private void createSectorsOnUpperLevel(NFunction func) {
if (func != null) {
MovingArea area = new MovingArea(toDataPlugin, func);
area.setDataPlugin(toDataPlugin);
SectorRefactor sr = area.getRefactor();
sr.loadFromFunction(func, false);
for (int i = 0; i < sr.getSectorsCount(); i++) {
PaintSector ps = sr.getSector(i);
if (ps.getSector().getStart().getBorderType() >= 0)
sr.createSectorOnIn(ps, true);
if (ps.getSector().getEnd().getBorderType() >= 0)
sr.createSectorOnIn(ps, false);
}
sr.loadFromFunction((NFunction) func.getParentRow(), true);
sr.saveToFunction();
}
}
use of com.ramussoft.pb.idef.visual.MovingArea in project ramus by Vitaliy-Yakovchuk.
the class ModelParaleler method copyFunction.
private void copyFunction(NFunction source, NFunction destination) {
long l = source.getLink();
if (l >= 0) {
Row row = fromDataPlugin.findRowByGlobalId(l);
if (row != null) {
l = getRow(row).getElement().getId();
destination.setLink(l);
}
}
// destination.setName(source.getName());
if (source.getChildCount() > 0) {
SectorRefactor sr = new SectorRefactor(new MovingArea(fromDataPlugin));
sr.loadFromFunction(source, false);
for (int i = 0; i < sr.getSectorsCount(); i++) {
PaintSector ps = sr.getSector(i);
PaintSector.save(ps, new DataLoader.MemoryData(), fromEngine);
ps.setSector(getSector((NSector) ps.getSector()));
}
// sr.saveToFunction(destination);
}
}
Aggregations