/** * wrapper round Stylefactory Method * * @param x - an Expression representing the x coordinate of the anchor * @param y - an Expression representing the y coordinate of the anchor * @return the AnchorPoint created */ public AnchorPoint createAnchorPoint(Expression x, Expression y) { return sf.createAnchorPoint(x, y); }
/** * wrapper round Stylefactory Method * * @param x - the x coordinate of the anchor * @param y - the y coordinate of the anchor * @return the AnchorPoint created */ public AnchorPoint createAnchorPoint(double x, double y) { return sf.createAnchorPoint(literalExpression(x), literalExpression(y)); }
public void visit(AnchorPoint ap) { Expression x = copy(ap.getAnchorPointX()); Expression y = copy(ap.getAnchorPointY()); AnchorPoint copy = sf.createAnchorPoint(x, y); if (STRICT && !copy.equals(ap)) { throw new IllegalStateException("Was unable to duplicate provided AnchorPoint:" + ap); } pages.push(copy); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression x = (Expression) node.getChildValue("AnchorPointX"); Expression y = (Expression) node.getChildValue("AnchorPointY"); return styleFactory.createAnchorPoint(x, y); } }
AnchorPoint dap = factory.createAnchorPoint(x, y);
/** * Create a PointPlacement object. * * @param horizAlign horizontal alignment (0 to 1) * @param vertAlign vertical alignment (0 to 1) * @param rotation rotation angle in degrees * @return a new PointPlacement object */ public static PointPlacement getPlacement( double horizAlign, double vertAlign, double rotation) { AnchorPoint anchorPoint = sf.createAnchorPoint(ff.literal(horizAlign), ff.literal(vertAlign)); return sf.createPointPlacement(anchorPoint, null, ff.literal(rotation)); }
/** Parses an anchor tuple. */ public static AnchorPoint anchor(Object value, Factory factory) { Tuple t = null; try { t = Tuple.of(2).parse(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("Bad anchor: '%s', must be of form (<x>,<y>)", value), e); } Expression x = t.at(0) != null ? expression(t.strAt(0), factory) : factory.filter.literal(0); Expression y = t.at(1) != null ? expression(t.strAt(1), factory) : factory.filter.literal(0); return factory.style.createAnchorPoint(x, y); }
public void testAnchorPoint() { AnchorPoint anchorPoint = styleFactory.createAnchorPoint(filterFactory.literal(1), filterFactory.literal(2)); AnchorPoint clone = (AnchorPoint) ((Cloneable) anchorPoint).clone(); assertClone(anchorPoint, clone); AnchorPoint other = styleFactory.createAnchorPoint(filterFactory.literal(3), filterFactory.literal(4)); assertEqualsContract(clone, other, anchorPoint); }
public void testAnchorPoint() { AnchorPoint anchorPoint = sf.createAnchorPoint(ff.literal(1), ff.literal(2)); anchorPoint.accept(visitor); AnchorPoint clone = (AnchorPoint) visitor.getCopy(); assertCopy(anchorPoint, clone); AnchorPoint other = sf.createAnchorPoint(ff.literal(3), ff.literal(4)); assertEqualsContract(clone, other, anchorPoint); }
/** * wrapper round Stylefactory Method * * @param x - an Expression representing the x coordinate of the anchor * @param y - an Expression representing the y coordinate of the anchor * * @return the AnchorPoint created */ public AnchorPoint createAnchorPoint(Expression x, Expression y) { return sf.createAnchorPoint(x, y); }
/** * wrapper round Stylefactory Method * * @param x - an Expression representing the x coordinate of the anchor * @param y - an Expression representing the y coordinate of the anchor * * @return the AnchorPoint created */ public AnchorPoint createAnchorPoint(Expression x, Expression y) { return sf.createAnchorPoint(x, y); }
public void testTextSymbolizer() { TextSymbolizer textSymb = styleFactory.createTextSymbolizer(); Expression offset = filterFactory.literal(10); textSymb.setLabelPlacement(styleFactory.createLinePlacement(offset)); TextSymbolizer clone = (TextSymbolizer) ((Cloneable) textSymb).clone(); assertClone(textSymb, clone); TextSymbolizer notEq = styleFactory.getDefaultTextSymbolizer(); Expression ancX = filterFactory.literal(10); Expression ancY = filterFactory.literal(10); AnchorPoint ancPoint = styleFactory.createAnchorPoint(ancX, ancY); LabelPlacement placement = styleFactory.createPointPlacement(ancPoint, null, null); notEq.setLabelPlacement(placement); assertEqualsContract(clone, notEq, textSymb); }
sf.createAnchorPoint(ff.literal(0.75), ff.literal(0.25)), sf.createDisplacement(ff.literal(10), ff.literal(15)), ff.literal(90));
/** * wrapper round Stylefactory Method * * @param x - the x coordinate of the anchor * @param y - the y coordinate of the anchor * * @return the AnchorPoint created */ public AnchorPoint createAnchorPoint(double x, double y) { return sf.createAnchorPoint(literalExpression(x), literalExpression(y)); }
/** * wrapper round Stylefactory Method * * @param x - the x coordinate of the anchor * @param y - the y coordinate of the anchor * * @return the AnchorPoint created */ public AnchorPoint createAnchorPoint(double x, double y) { return sf.createAnchorPoint(literalExpression(x), literalExpression(y)); }
public void visit(AnchorPoint ap) { Expression x = copy( ap.getAnchorPointX() ); Expression y = copy( ap.getAnchorPointY() ); AnchorPoint copy = sf.createAnchorPoint(x, y); if( STRICT && !copy.equals( ap)){ throw new IllegalStateException("Was unable to duplicate provided AnchorPoint:"+ap); } pages.push(copy); }
public void testTextSymbolizer() { TextSymbolizer textSymb = sf.createTextSymbolizer(); Expression offset = ff.literal(10); textSymb.setLabelPlacement(sf.createLinePlacement(offset)); textSymb.accept(visitor); TextSymbolizer clone = (TextSymbolizer) visitor.getCopy(); assertCopy(textSymb, clone); assertEqualsContract(textSymb, clone); TextSymbolizer notEq = sf.getDefaultTextSymbolizer(); Expression ancX = ff.literal(10); Expression ancY = ff.literal(10); AnchorPoint ancPoint = sf.createAnchorPoint(ancX, ancY); LabelPlacement placement = sf.createPointPlacement(ancPoint, null, null); notEq.setLabelPlacement(placement); assertEqualsContract(clone, notEq, textSymb); }
public void testTextSymbolizerWithUOM() { TextSymbolizer textSymb = sf.createTextSymbolizer(); textSymb.setUnitOfMeasure(UomOgcMapping.METRE.getUnit()); Expression offset = ff.literal(10); textSymb.setLabelPlacement(sf.createLinePlacement(offset)); textSymb.accept(visitor); TextSymbolizer clone = (TextSymbolizer) visitor.getCopy(); assertCopy(textSymb, clone); assertEqualsContract(textSymb, clone); TextSymbolizer notEq = sf.getDefaultTextSymbolizer(); Expression ancX = ff.literal(10); Expression ancY = ff.literal(10); AnchorPoint ancPoint = sf.createAnchorPoint(ancX, ancY); LabelPlacement placement = sf.createPointPlacement(ancPoint, null, null); notEq.setLabelPlacement(placement); assertEqualsContract(clone, notEq, textSymb); }
/** * Create a PointPlacement object. * * @param horizAlign horizontal alignment (0 to 1) * @param vertAlign vertical alignment (0 to 1) * @param rotation rotation angle in degrees * * @return a new PointPlacement object */ public static PointPlacement getPlacement( double horizAlign, double vertAlign, double rotation ) { AnchorPoint anchorPoint = sf.createAnchorPoint(ff.literal(horizAlign), ff.literal(vertAlign)); return sf.createPointPlacement(anchorPoint, null, ff.literal(rotation)); }
Font font = (labelFont == null ? sf.getDefaultFont() : labelFont); Fill labelFill = sf.createFill(ff.literal(Color.BLACK)); AnchorPoint anchor = sf.createAnchorPoint(ff.literal(0.5), ff.literal(0.0)); Displacement disp = sf.createDisplacement(ff.literal(0), ff.literal(5)); LabelPlacement placement = sf.createPointPlacement(anchor, disp, ff.literal(0));