Search in sources :

Example 1 with Ordinate

use of com.ramussoft.pb.idef.elements.Ordinate in project ramus by Vitaliy-Yakovchuk.

the class DFDSRole method mouseClicked.

@Override
public void mouseClicked(FloatPoint point) {
    Row owner = getFunction().getOwner();
    if (owner == null)
        super.mouseClicked(point);
    else {
        DFDSFunction function = movingArea.findDFDSFunction(owner);
        if (function == null)
            super.mouseClicked(point);
        else {
            final Ordinate x = new Ordinate(Ordinate.TYPE_X);
            final Ordinate y = new Ordinate(Ordinate.TYPE_Y);
            final Point p = new Point(x, y);
            final SectorRefactor.PerspectivePoint pp = new SectorRefactor.PerspectivePoint();
            pp.point = p;
            pp.setFunction(function.getFunction(), BOTTOM);
            x.setPosition(function.getBounds().getX() + point.getX());
            y.setPosition(getY(x.getPosition(), false, function.getBounds()));
            if (movingArea.getPointChangingType() == SectorRefactor.TYPE_START) {
                pp.type = SectorRefactor.TYPE_START;
                movingArea.getRefactor().setPoint(pp);
                movingArea.doSector();
            } else if (movingArea.getPointChangingType() == SectorRefactor.TYPE_END) {
                pp.type = SectorRefactor.TYPE_END;
                movingArea.getRefactor().setPoint(pp);
                movingArea.doSector();
            }
        }
    }
}
Also used : SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) Row(com.ramussoft.pb.Row) Point(com.ramussoft.pb.idef.elements.Point) FloatPoint(com.dsoft.pb.types.FloatPoint) Ordinate(com.ramussoft.pb.idef.elements.Ordinate)

Example 2 with Ordinate

use of com.ramussoft.pb.idef.elements.Ordinate in project ramus by Vitaliy-Yakovchuk.

the class AbstractClassicTemplate method createInPoint.

private void createInPoint(final MovingArea movingArea, final Function f, final int type, final double xp, final double yp) {
    SectorRefactor.PerspectivePoint pp;
    final Ordinate x = new Ordinate(Ordinate.TYPE_X);
    final Ordinate y = new Ordinate(Ordinate.TYPE_Y);
    final Point p = new Point(x, y);
    pp = new SectorRefactor.PerspectivePoint();
    pp.point = p;
    pp.setFunction(f, type);
    pp.type = SectorRefactor.TYPE_END;
    x.setPosition(xp);
    y.setPosition(yp);
    movingArea.getRefactor().setPoint(pp);
    movingArea.doSector();
}
Also used : SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) Point(com.ramussoft.pb.idef.elements.Point) Ordinate(com.ramussoft.pb.idef.elements.Ordinate)

Example 3 with Ordinate

use of com.ramussoft.pb.idef.elements.Ordinate in project ramus by Vitaliy-Yakovchuk.

the class DFDFunction method mouseClicked.

public void mouseClicked(final FloatPoint point) {
    if (movingArea.getChangingState() == MovingArea.ARROW_CHANGING_STATE) {
        final int type = getTriangle(point);
        final Ordinate x = new Ordinate(Ordinate.TYPE_X);
        final Ordinate y = new Ordinate(Ordinate.TYPE_Y);
        final Point p = new Point(x, y);
        final SectorRefactor.PerspectivePoint pp = new SectorRefactor.PerspectivePoint();
        pp.point = p;
        switch(type) {
            case LEFT:
                {
                    pp.setFunction(getFunction(), LEFT);
                    y.setPosition(getBounds().getY() + point.getY());
                    x.setPosition(getX(y.getPosition(), true, getBounds()));
                }
                break;
            case TOP:
                {
                    pp.setFunction(getFunction(), TOP);
                    x.setPosition(getBounds().getX() + point.getX());
                    y.setPosition(getY(x.getPosition(), true, getBounds()));
                }
                break;
            case BOTTOM:
                {
                    pp.setFunction(getFunction(), BOTTOM);
                    x.setPosition(getBounds().getX() + point.getX());
                    y.setPosition(getY(x.getPosition(), false, getBounds()));
                }
                break;
            case RIGHT:
                {
                    pp.setFunction(getFunction(), RIGHT);
                    y.setPosition(getBounds().getY() + point.getY());
                    x.setPosition(getX(y.getPosition(), false, getBounds()));
                }
                break;
            default:
                return;
        }
        if (movingArea.getPointChangingType() == SectorRefactor.TYPE_START) {
            pp.type = SectorRefactor.TYPE_START;
            movingArea.getRefactor().setPoint(pp);
            movingArea.doSector();
        } else if (movingArea.getPointChangingType() == SectorRefactor.TYPE_END) {
            pp.type = SectorRefactor.TYPE_END;
            movingArea.getRefactor().setPoint(pp);
            movingArea.doSector();
        }
    }
}
Also used : SectorRefactor(com.ramussoft.pb.idef.elements.SectorRefactor) FloatPoint(com.dsoft.pb.types.FloatPoint) Point(com.ramussoft.pb.idef.elements.Point) FloatPoint(com.dsoft.pb.types.FloatPoint) Point(com.ramussoft.pb.idef.elements.Point) Ordinate(com.ramussoft.pb.idef.elements.Ordinate)

Example 4 with Ordinate

use of com.ramussoft.pb.idef.elements.Ordinate in project ramus by Vitaliy-Yakovchuk.

the class IDEF0Object method setAddedSectorPos.

public void setAddedSectorPos(final FRectangle oldRec, final PaintSector sector, List<PaintSector> list) {
    List<Ordinate> ordinates = new ArrayList<Ordinate>();
    if (setAddedSectorPosWC(oldRec, sector, ordinates)) {
        for (Ordinate ordinate : ordinates) {
            addSectors(ordinate, list);
            addSectors(ordinate, list);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) Ordinate(com.ramussoft.pb.idef.elements.Ordinate)

Example 5 with Ordinate

use of com.ramussoft.pb.idef.elements.Ordinate in project ramus by Vitaliy-Yakovchuk.

the class IDEF0Object method addOrdinates.

private void addOrdinates(PaintSector sector, List<Ordinate> ordinates) {
    for (int i = 0; i < sector.getPointCount(); i++) {
        Ordinate xOrdinate = sector.getPoint(i).getXOrdinate();
        addOrdinate(ordinates, xOrdinate);
        Ordinate yOrdinate = sector.getPoint(i).getYOrdinate();
        addOrdinate(ordinates, yOrdinate);
    }
}
Also used : Point(com.ramussoft.pb.idef.elements.Point) FloatPoint(com.dsoft.pb.types.FloatPoint) Ordinate(com.ramussoft.pb.idef.elements.Ordinate)

Aggregations

Ordinate (com.ramussoft.pb.idef.elements.Ordinate)14 Point (com.ramussoft.pb.idef.elements.Point)12 FloatPoint (com.dsoft.pb.types.FloatPoint)10 SectorRefactor (com.ramussoft.pb.idef.elements.SectorRefactor)8 PaintSector (com.ramussoft.pb.idef.elements.PaintSector)3 Crosspoint (com.ramussoft.pb.Crosspoint)2 Function (com.ramussoft.pb.Function)2 Row (com.ramussoft.pb.Row)2 ArrayList (java.util.ArrayList)2 FRectangle (com.dsoft.pb.types.FRectangle)1 MemoryData (com.dsoft.utils.DataLoader.MemoryData)1 Sector (com.ramussoft.pb.Sector)1 AbstractSector (com.ramussoft.pb.data.AbstractSector)1 NFunction (com.ramussoft.pb.data.negine.NFunction)1 NSector (com.ramussoft.pb.data.negine.NSector)1 DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)1 DFDSFunction (com.ramussoft.pb.dfds.visual.DFDSFunction)1 DFDSRole (com.ramussoft.pb.dfds.visual.DFDSRole)1 PerspectivePoint (com.ramussoft.pb.idef.elements.SectorRefactor.PerspectivePoint)1 Vector (java.util.Vector)1