Search in sources :

Example 56 with Function

use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.

the class ModelParaleler method getRow.

private Row getRow(Row r) {
    if (r == fromDataPlugin.getBaseStream())
        return toDataPlugin.getBaseStream();
    if ((r == null) || (r.getElement() == null))
        return null;
    if ((function != null) && (r.equals(function.getParentRow())))
        return base;
    Row res = rowHash.get(r.getElement().getId());
    if (res == null) {
        res = toDataPlugin.createRow(getRow(getParentRow(r)), r.isElement());
        rowHash.put(r.getElement().getId(), res);
        if (r instanceof Function)
            if (!(res instanceof Function))
                System.out.println(res);
        copyRow(r, res);
    }
    return res;
}
Also used : Function(com.ramussoft.pb.Function) NFunction(com.ramussoft.pb.data.negine.NFunction) Row(com.ramussoft.pb.Row)

Example 57 with Function

use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.

the class DFDSNamePanel method compile.

private void compile(DFDSName name) {
    Row row = dataPlugin.findRowByGlobalId(element.getId());
    if (row instanceof Function) {
        Function function = (NFunction) row;
        dataPlugin.compileDFDSName(name, function);
    }
}
Also used : Function(com.ramussoft.pb.Function) NFunction(com.ramussoft.pb.data.negine.NFunction) NFunction(com.ramussoft.pb.data.negine.NFunction) Row(com.ramussoft.pb.Row)

Example 58 with Function

use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.

the class AbstractCrosspoint method remove1.

public void remove1(final Sector sector) {
    // synchronized (dataPlugin) {
    final boolean b = isDLevel();
    removeData(sector);
    final Sector[] ins = getIns();
    final Sector[] outs = getOuts();
    if (b) {
        if (ins.length == 0 && outs.length == 1) {
            if (outs[0].getEnd().getCrosspoint() == null)
                if (outs[0].getStart().getBorderType() >= 0)
                    outs[0].remove();
                else {
                /*Function function = outs[0].getStart().getFunction();
                        if (function != null
								&& function.getType() == Function.TYPE_DFDS_ROLE) {
							((NFunction) function).remove();
							outs[0].remove();
						}*/
                }
        } else if (ins.length == 1 && outs.length == 0) {
            if (ins[0].getStart().getCrosspoint() == null)
                if (ins[0].getEnd().getBorderType() >= 0)
                    ins[0].remove();
                else {
                    Function function = ins[0].getEnd().getFunction();
                    if (function != null && function.getType() == Function.TYPE_DFDS_ROLE) {
                        ((NFunction) function).remove();
                        ins[0].remove();
                    }
                }
        }
    }
    if (getIns().length == 0 && getOuts().length == 0) {
        dataPlugin.removeCrosspoint(this);
    }
// }
}
Also used : NFunction(com.ramussoft.pb.data.negine.NFunction) Function(com.ramussoft.pb.Function) NFunction(com.ramussoft.pb.data.negine.NFunction) Sector(com.ramussoft.pb.Sector) NSector(com.ramussoft.pb.data.negine.NSector)

Example 59 with Function

use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method outFunctionModel.

private void outFunctionModel(final int format) throws IOException {
    Row row = loadRowById();
    if (row == null || !(row instanceof Function))
        return;
    row = replaceIDEF0Row(row);
    final Function f = (Function) row;
    int imageWidth = IMAGE_WIDTH;
    String s = (String) params.get("w");
    if (s != null) {
        try {
            imageWidth = new Integer(s).intValue();
            if (imageWidth > 2000)
                imageWidth = 2000;
        } catch (final Exception e) {
        }
    }
    int imageHeight = IMAGE_HEIGHT;
    s = (String) params.get("h");
    if (s != null) {
        try {
            imageHeight = new Integer(s).intValue();
            if (imageHeight > 1600)
                imageHeight = 1600;
        } catch (final Exception e) {
        }
    }
    final PIDEF0painter painter = new PIDEF0painter(f, new Dimension(imageWidth, imageHeight), dataPlugin);
    painter.writeToStream(stream, format);
}
Also used : Function(com.ramussoft.pb.Function) MovingFunction(com.ramussoft.pb.idef.visual.MovingFunction) PIDEF0painter(com.ramussoft.pb.print.PIDEF0painter) Row(com.ramussoft.pb.Row) NRow(com.ramussoft.pb.data.negine.NRow) Dimension(java.awt.Dimension) DataException(com.ramussoft.report.data.DataException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) SQLException(java.sql.SQLException) IOException(java.io.IOException)

Example 60 with Function

use of com.ramussoft.pb.Function in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method printRowBase.

private void printRowBase(final Row row) throws IOException {
    htmlStream.print("<canter><h2 class=\"Ramus\">");
    if (row instanceof Function)
        htmlStream.print(MovingFunction.getIDEF0Kod((com.ramussoft.database.common.Row) row) + " " + row.getName());
    else
        htmlStream.print(row.getKod() + ". " + row.getName());
    if (row.isElement()) {
        Element element = StandardAttributesPlugin.getElement(dataPlugin.getEngine(), row.getElement().getQualifierId());
        if (element != null) {
            htmlStream.print(" [");
            printStartATeg("rows/index.html?id=" + element.getId());
            htmlStream.print(element.getName());
            printEndATeg();
            htmlStream.print("]");
        }
    }
    htmlStream.println("</h2></canter>");
}
Also used : Function(com.ramussoft.pb.Function) MovingFunction(com.ramussoft.pb.idef.visual.MovingFunction) Element(com.ramussoft.common.Element)

Aggregations

Function (com.ramussoft.pb.Function)96 NFunction (com.ramussoft.pb.data.negine.NFunction)50 Row (com.ramussoft.pb.Row)36 MovingFunction (com.ramussoft.pb.idef.visual.MovingFunction)27 Crosspoint (com.ramussoft.pb.Crosspoint)25 Sector (com.ramussoft.pb.Sector)25 Stream (com.ramussoft.pb.Stream)21 FloatPoint (com.dsoft.pb.types.FloatPoint)19 NSector (com.ramussoft.pb.data.negine.NSector)18 DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)17 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)17 Vector (java.util.Vector)17 DFDSFunction (com.ramussoft.pb.dfds.visual.DFDSFunction)15 IOException (java.io.IOException)13 FRectangle (com.dsoft.pb.types.FRectangle)11 Point (com.ramussoft.pb.idef.elements.Point)11 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)10 ByteArrayOutputStream (java.io.ByteArrayOutputStream)10 ArrayList (java.util.ArrayList)10 MovingArea (com.ramussoft.pb.idef.visual.MovingArea)8