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();
}
}
}
}
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();
}
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();
}
}
}
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);
}
}
}
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);
}
}
Aggregations