Search in sources :

Example 6 with MovingArea

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;
}
Also used : MovingArea(com.ramussoft.pb.idef.visual.MovingArea)

Example 7 with 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;
}
Also used : MovingArea(com.ramussoft.pb.idef.visual.MovingArea)

Example 8 with 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);
    }
}
Also used : MovingArea(com.ramussoft.pb.idef.visual.MovingArea) SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) Function(com.ramussoft.pb.Function) Row(com.ramussoft.pb.Row)

Example 9 with MovingArea

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();
    }
}
Also used : MovingArea(com.ramussoft.pb.idef.visual.MovingArea) SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) PaintSector(com.ramussoft.pb.idef.elements.PaintSector)

Example 10 with MovingArea

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);
    }
}
Also used : MovingArea(com.ramussoft.pb.idef.visual.MovingArea) SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) DataLoader(com.dsoft.utils.DataLoader) NSector(com.ramussoft.pb.data.negine.NSector) PaintSector(com.ramussoft.pb.idef.elements.PaintSector) Row(com.ramussoft.pb.Row)

Aggregations

MovingArea (com.ramussoft.pb.idef.visual.MovingArea)16 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)9 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)9 Function (com.ramussoft.pb.Function)8 Row (com.ramussoft.pb.Row)6 Stream (com.ramussoft.pb.Stream)3 MovingLabel (com.ramussoft.pb.idef.visual.MovingLabel)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 Crosspoint (com.ramussoft.pb.Crosspoint)2 NSector (com.ramussoft.pb.data.negine.NSector)2 Pin (com.ramussoft.pb.idef.elements.PaintSector.Pin)2 MovingFunction (com.ramussoft.pb.idef.visual.MovingFunction)2 Dimension (java.awt.Dimension)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2 Vector (java.util.Vector)2 FRectangle (com.dsoft.pb.types.FRectangle)1 FloatPoint (com.dsoft.pb.types.FloatPoint)1 DataLoader (com.dsoft.utils.DataLoader)1