/** * wrapper round Stylefactory Method * * @param offset - an Expression representing the distance between the line and the label * @return the LinePlacement created */ public LinePlacement createLinePlacement(Expression offset) { return sf.createLinePlacement(offset); }
/** * wrapper round Stylefactory Method * * @param offset - the distance between the line and the label * @return the LinePlacement created */ public LinePlacement createLinePlacement(double offset) { return sf.createLinePlacement(literalExpression(offset)); }
protected PlacementParser() { super(TextParser.this.factory); point = factory.style.createPointPlacement(null, null, null); line = factory.style.createLinePlacement(null); }
/** Internal parse method - made protected for unit testing */ protected LinePlacement parseLinePlacement(Node root) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("parsing linePlacement"); } Expression offset = ff.literal(0.0); NodeList children = root.getChildNodes(); final int length = children.getLength(); for (int i = 0; i < length; i++) { Node child = children.item(i); if ((child == null) || (child.getNodeType() != Node.ELEMENT_NODE)) { continue; } String childName = child.getLocalName(); if (childName == null) { childName = child.getNodeName(); } if (childName.equalsIgnoreCase("PerpendicularOffset")) { offset = parseCssParameter(child); } } LinePlacement dlp = factory.createLinePlacement(offset); return dlp; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression offset = null; if (node.hasChild("PerpendicularOffset")) { offset = (Expression) node.getChildValue("PerpendicularOffset"); } return styleFactory.createLinePlacement(offset); } }
public void visit(LinePlacement lp) { Expression offset = copy(lp.getPerpendicularOffset()); LinePlacement copy = sf.createLinePlacement(offset); copy.setAligned(lp.isAligned()); copy.setGap(copy(lp.getGap())); copy.setGeneralized(lp.isGeneralizeLine()); copy.setInitialGap(copy(lp.getInitialGap())); copy.setRepeated(lp.isRepeated()); if (STRICT && !copy.equals(lp)) { throw new IllegalStateException("Was unable to duplicate provided LinePlacement:" + lp); } pages.push(copy); }
public void testLinePlacement() throws Exception { LinePlacement linePlacement = styleFactory.createLinePlacement(filterFactory.literal(12)); LinePlacement clone = (LinePlacement) ((Cloneable) linePlacement).clone(); assertClone(linePlacement, clone); LinePlacement other = styleFactory.createLinePlacement(filterFactory.property("NAME")); assertEqualsContract(clone, other, linePlacement); }
/** * getValue ... * * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element, * org.geotools.xml.schema.ElementValue[], org.xml.sax.Attributes, java.util.Map) * @param element * @param value * @param attrs1 * @param hints * @throws OperationNotSupportedException */ public Object getValue( Element element, ElementValue[] value, Attributes attrs1, Map hints) { Expression offset = null; for (int i = 0; i < value.length; i++) { if ((value[i] == null) || value[i].getElement() == null) { continue; } Element e = value[i].getElement(); if (elems[PERPENDICULAROFFSET].getName().equals(e.getName())) offset = (Expression) value[i].getValue(); } LinePlacement dlp = StyleFactoryFinder.createStyleFactory().createLinePlacement(offset); return dlp; } }
public void testLinePlacement() throws Exception { LinePlacement linePlacement = sf.createLinePlacement(ff.literal(12)); linePlacement.accept(visitor); LinePlacement clone = (LinePlacement) visitor.getCopy(); ; assertCopy(linePlacement, clone); LinePlacement other = sf.createLinePlacement(ff.property("NAME")); assertEqualsContract(clone, other, linePlacement); }
/** * wrapper round Stylefactory Method * * @param offset - an Expression representing the distance between the line and the label * * @return the LinePlacement created */ public LinePlacement createLinePlacement(Expression offset) { return sf.createLinePlacement(offset); }
/** * wrapper round Stylefactory Method * * @param offset - an Expression representing the distance between the line and the label * * @return the LinePlacement created */ public LinePlacement createLinePlacement(Expression offset) { return sf.createLinePlacement(offset); }
featureStyle.rules().add(rule); LabelPlacement place = sf.createLinePlacement(ff.literal(10));
/** * wrapper round Stylefactory Method * * @param offset - the distance between the line and the label * * @return the LinePlacement created */ public LinePlacement createLinePlacement(double offset) { return sf.createLinePlacement(literalExpression(offset)); }
/** * wrapper round Stylefactory Method * * @param offset - the distance between the line and the label * * @return the LinePlacement created */ public LinePlacement createLinePlacement(double offset) { return sf.createLinePlacement(literalExpression(offset)); }
protected PlacementParser() { super(TextParser.this.factory); point = factory.style.createPointPlacement(null, null, null); line = factory.style.createLinePlacement(null); }
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); }
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); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression offset = null; if (node.hasChild("PerpendicularOffset")) { offset = (Expression) node.getChildValue("PerpendicularOffset"); } return styleFactory.createLinePlacement(offset); } }
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); }
public void visit(LinePlacement lp) { Expression offset = copy( lp.getPerpendicularOffset()); LinePlacement copy = sf.createLinePlacement(offset); copy.setAligned( lp.isAligned() ); copy.setGap( copy(lp.getGap()) ); copy.setGeneralized( lp.isGeneralizeLine() ); copy.setInitialGap( copy(lp.getInitialGap()) ); copy.setRepeated( lp.isRepeated() ); if( STRICT && !copy.equals( lp )){ throw new IllegalStateException("Was unable to duplicate provided LinePlacement:"+lp ); } pages.push(copy); }