// boolean direction = p.getDirection();// set back to null at the bottom if you use this line...
FEPointList fepl = p.getFEPointList();
if (fepl.getNumber() > 1)
{
FEPoint current_point;
FEPoint next_point;
// FEPoint[] array = fepl.getPoints();
int increasing;
increasing = (fepl.getPoint(fepl.getNumber() - 2).getX() < fepl
.getPoint(fepl.getNumber() - 1).getX()) ? 1 : -1;
current_point = fepl.getPoint(fepl.getNumber() - 1);
for (int i = 0; i < fepl.getNumber(); i++)
{
int cpx = current_point.getX();
next_point = fepl.getPoint(i);
if (Utils.equalsApprox(current_point.getX(), next_point.getX(),
TOLERANCE))
{
boolean dir = current_point.getY() > next_point.getY();
slider_manager_vertical.add(new Slider(VERTICAL,
Slider.PARALLEL, dir, Math.abs(next_point.getY()
- current_point.getY()), current_point));
}
else
{
if (increasing > 0)
{
if (cpx > next_point.getX())
{
slider_manager_vertical.add(new Slider(VERTICAL,
Slider.INFLECTION, true, Math
.abs(next_point.getY()
- current_point.getY()),
current_point));
}
// else {
// }
}
if (increasing < 0)
{
if (cpx < next_point.getX())
{
slider_manager_vertical.add(new Slider(VERTICAL,
Slider.INFLECTION, true, Math
.abs(next_point.getY()
- current_point.getY()),
current_point));
}
// else {
// }
}
if (cpx > next_point.getX())
{
increasing = -1;
}
if (cpx < next_point.getX())
{
increasing = 1;
}
}
current_point = next_point;
}
increasing = (fepl.getPoint(fepl.getNumber() - 2).getY() < fepl
.getPoint(fepl.getNumber() - 1).getY()) ? 1 : -1;
current_point = fepl.getPoint(fepl.getNumber() - 1);
for (int i = 0; i < fepl.getNumber(); i++)
{
int cpy = current_point.getY();
next_point = fepl.getPoint(i);
if (Utils.equalsApprox(current_point.getY(), next_point.getY(),
TOLERANCE))
{
boolean dir = current_point.getX() > next_point.getX();
slider_manager_horizontal.add(new Slider(HORIZONTAL,
Slider.PARALLEL, dir, Math.abs(next_point.getX()
- current_point.getX()), current_point));
}
else
{
if (increasing > 0)
{
if (cpy > next_point.getY())
{
slider_manager_horizontal.add(new Slider(
HORIZONTAL, Slider.INFLECTION, true, Math
.abs(next_point.getX()
- current_point.getX()),
current_point));
}
// else {
// }
}
if (increasing < 0)
{
if (cpy < next_point.getY())
{
slider_manager_horizontal.add(new Slider(
HORIZONTAL, Slider.INFLECTION, true, Math
.abs(next_point.getX()
- current_point.getX()),
current_point));
}
// else {
// }
}
if (cpy > next_point.getY())
{
increasing = -1;
}
if (cpy < next_point.getY())
{
increasing = 1;
}
}
current_point = next_point;