use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.
the class PSTLatexdrawListener method exitPsaxes.
@Override
public void exitPsaxes(final net.sf.latexdraw.parsers.pst.PSTParser.PsaxesContext ctx) {
final IAxes axes = ShapeFactory.INST.createAxes(ShapeFactory.INST.createPoint());
final IPoint gridstart;
final IPoint gridend;
final IPoint position;
if (ctx.p3 == null) {
if (ctx.p2 == null) {
position = ShapeFactory.INST.createPoint();
gridstart = ShapeFactory.INST.createPoint();
gridend = ShapeFactory.INST.createPoint(ctx.pstctx.coordToRawPoint(ctx.p1));
} else {
position = ShapeFactory.INST.createPoint(ctx.pstctx.coordToRawPoint(ctx.p1).multiply(IShape.PPC));
gridstart = ShapeFactory.INST.createPoint();
gridend = ShapeFactory.INST.createPoint(ctx.pstctx.coordToRawPoint(ctx.p2).subtract(ctx.pstctx.coordToRawPoint(ctx.p1)));
}
} else {
position = ShapeFactory.INST.createPoint();
gridstart = ShapeFactory.INST.createPoint(ctx.pstctx.coordToRawPoint(ctx.p2));
gridend = ShapeFactory.INST.createPoint(ctx.pstctx.coordToRawPoint(ctx.p3));
}
setArrows(axes, ctx.pstctx);
setStdGridParams(ctx.pstctx.ox, ctx.pstctx.oy, axes, ctx.pstctx);
setShapeParameters(axes, ctx.pstctx);
axes.setAxesStyle(AxesStyle.getStyle(ctx.pstctx.axesStyle));
axes.setTicksDisplayed(PlottingStyle.getStyle(ctx.pstctx.ticks));
axes.setLabelsDisplayed(PlottingStyle.getStyle(ctx.pstctx.labels));
axes.setTicksStyle(TicksStyle.getStyle(ctx.pstctx.ticksStyle));
axes.setIncrementX(ctx.pstctx.dxIncrement);
axes.setIncrementY(ctx.pstctx.dyIncrement);
axes.setDistLabelsX(ctx.pstctx.dxLabelDist);
axes.setDistLabelsY(ctx.pstctx.dyLabelDist);
axes.setShowOrigin(ctx.pstctx.showOrigin);
axes.setGridEndX(gridend.getX());
axes.setGridEndY(gridend.getY());
axes.setGridStartX(gridstart.getX());
axes.setGridStartY(gridstart.getY());
axes.setPosition(position);
shapes.peek().addShape(axes);
}
use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.
the class LAxes method duplicate.
@Override
public IAxes duplicate() {
final IAxes axes = ShapeFactory.INST.createAxes(getPosition());
axes.copy(this);
return axes;
}
use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.
the class TestParsingPsaxes method testTickStyle.
@Theory
public void testTickStyle(final PlottingStyle style) {
parser("\\psaxes[ticks=" + style.getPSTToken() + "](0,0)(0,0)(2,2)");
final IAxes axes = getShapeAt(0);
assertEquals(style, axes.getTicksDisplayed());
}
use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.
the class TestParsingPsaxes method testAxesstyle.
@Theory
public void testAxesstyle(final AxesStyle style) {
parser("\\psaxes[axesstyle=" + style.getPSTToken() + "](0,0)(0,0)(2,2)");
final IAxes axes = getShapeAt(0);
assertEquals(style, axes.getAxesStyle());
}
use of net.sf.latexdraw.models.interfaces.shape.IAxes in project latexdraw by arnobl.
the class TestParsingPsaxes method testTickStyle.
@Theory
public void testTickStyle(final TicksStyle style) {
parser("\\psaxes[tickstyle=" + style.getPSTToken() + "](0,0)(0,0)(2,2)");
final IAxes axes = getShapeAt(0);
assertEquals(style, axes.getTicksStyle());
}
Aggregations