/** * Create an instance of {@link LabelStyle} * */ public static LabelStyle createLabelStyle() { return new LabelStyle(); }
/** * fluent setter * @see #setScale(double) * * @param scale * required parameter */ public LabelStyle withScale(final double scale) { this.setScale(scale); return this; }
/** * add a value to the labelStyleObjectExtension property collection * * @param labelStyleObjectExtension * Objects of the following type are allowed in the list: {@link AbstractObject} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public LabelStyle addToLabelStyleObjectExtension(final AbstractObject labelStyleObjectExtension) { this.getLabelStyleObjectExtension().add(labelStyleObjectExtension); return this; }
.withColor(GREEN); LabelStyle labelStyle = new LabelStyle().withScale(0.7); LabelStyle idLabelStyle = new LabelStyle() .withColor("00000000") .withColorMode( ColorMode.NORMAL ) .withScale(1); LineStyle validLineStyle = new LineStyle().withColor(GREEN); LineStyle invalidLineStyle = new LineStyle().withColor(RED);
protected void setLabelStyle(Style style, SimpleFeature feature, TextSymbolizer symbolizer) { LabelStyle ls = style.createAndSetLabelStyle(); double scale = 1; Font font = symbolizer.getFont(); if(font != null && font.getSize() != null) { // we make the scale proportional to the normal font size double size = font.getSize().evaluate(feature, Double.class); scale = Math.round(size / Font.DEFAULT_FONTSIZE * 100) / 100.0; } ls.setScale(scale); Fill fill = symbolizer.getFill(); if (fill != null) { Double opacity = fill.getOpacity().evaluate(feature, Double.class); if (opacity == null || Double.isNaN(opacity)) { opacity = 1.0; } Color color = fill.getColor().evaluate(feature, Color.class); ls.setColor(colorToHex(color, opacity)); } else { ls.setColor("ffffffff"); } }
@Override public LabelStyle clone() { LabelStyle copy; copy = ((LabelStyle) super.clone()); copy.labelStyleSimpleExtension = new ArrayList<Object>((getLabelStyleSimpleExtension().size())); for (Object iter: labelStyleSimpleExtension) { copy.labelStyleSimpleExtension.add(iter); } copy.labelStyleObjectExtension = new ArrayList<AbstractObject>((getLabelStyleObjectExtension().size())); for (AbstractObject iter: labelStyleObjectExtension) { copy.labelStyleObjectExtension.add(iter.clone()); } return copy; }
/** * fluent setter * @see #setLabelStyleObjectExtension(List<AbstractObject>) * * @param labelStyleObjectExtension * required parameter */ public LabelStyle withLabelStyleObjectExtension(final List<AbstractObject> labelStyleObjectExtension) { this.setLabelStyleObjectExtension(labelStyleObjectExtension); return this; }
/** * add a value to the labelStyleSimpleExtension property collection * * @param labelStyleSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public LabelStyle addToLabelStyleSimpleExtension(final Object labelStyleSimpleExtension) { this.getLabelStyleSimpleExtension().add(labelStyleSimpleExtension); return this; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((iconStyle == null)? 0 :iconStyle.hashCode())); result = ((prime*result)+((labelStyle == null)? 0 :labelStyle.hashCode())); result = ((prime*result)+((lineStyle == null)? 0 :lineStyle.hashCode())); result = ((prime*result)+((polyStyle == null)? 0 :polyStyle.hashCode())); result = ((prime*result)+((balloonStyle == null)? 0 :balloonStyle.hashCode())); result = ((prime*result)+((listStyle == null)? 0 :listStyle.hashCode())); result = ((prime*result)+((styleSimpleExtension == null)? 0 :styleSimpleExtension.hashCode())); result = ((prime*result)+((styleObjectExtension == null)? 0 :styleObjectExtension.hashCode())); return result; }
@Override public Style clone() { Style copy; copy = ((Style) super.clone()); copy.iconStyle = ((iconStyle == null)?null:((IconStyle) iconStyle.clone())); copy.labelStyle = ((labelStyle == null)?null:((LabelStyle) labelStyle.clone())); copy.lineStyle = ((lineStyle == null)?null:((LineStyle) lineStyle.clone())); copy.polyStyle = ((polyStyle == null)?null:((PolyStyle) polyStyle.clone())); copy.balloonStyle = ((balloonStyle == null)?null:((BalloonStyle) balloonStyle.clone())); copy.listStyle = ((listStyle == null)?null:((ListStyle) listStyle.clone())); copy.styleSimpleExtension = new ArrayList<Object>((getStyleSimpleExtension().size())); for (Object iter: styleSimpleExtension) { copy.styleSimpleExtension.add(iter); } copy.styleObjectExtension = new ArrayList<AbstractObject>((getStyleObjectExtension().size())); for (AbstractObject iter: styleObjectExtension) { copy.styleObjectExtension.add(iter.clone()); } return copy; }
if (labelStyle.equals(other.labelStyle) == false) { return false;
/** * Encodes a transparent KML LabelStyle */ protected void setDefaultLabelStyle(Style style) { LabelStyle ls = style.createAndSetLabelStyle(); ls.setColor("00ffffff"); }
@Override public LabelStyle clone() { LabelStyle copy; copy = ((LabelStyle) super.clone()); copy.labelStyleSimpleExtension = new ArrayList<Object>((getLabelStyleSimpleExtension().size())); for (Object iter: labelStyleSimpleExtension) { copy.labelStyleSimpleExtension.add(iter); } copy.labelStyleObjectExtension = new ArrayList<AbstractObject>((getLabelStyleObjectExtension().size())); for (AbstractObject iter: labelStyleObjectExtension) { copy.labelStyleObjectExtension.add(iter.clone()); } return copy; }
/** * fluent setter * @see #setLabelStyleObjectExtension(List<AbstractObject>) * * @param labelStyleObjectExtension * required parameter */ public LabelStyle withLabelStyleObjectExtension(final List<AbstractObject> labelStyleObjectExtension) { this.setLabelStyleObjectExtension(labelStyleObjectExtension); return this; }
/** * add a value to the labelStyleSimpleExtension property collection * * @param labelStyleSimpleExtension * Objects of the following type are allowed in the list: {@link Object} * @return * <tt>true</tt> (as general contract of <tt>Collection.add</tt>). */ public LabelStyle addToLabelStyleSimpleExtension(final Object labelStyleSimpleExtension) { this.getLabelStyleSimpleExtension().add(labelStyleSimpleExtension); return this; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = ((prime*result)+((iconStyle == null)? 0 :iconStyle.hashCode())); result = ((prime*result)+((labelStyle == null)? 0 :labelStyle.hashCode())); result = ((prime*result)+((lineStyle == null)? 0 :lineStyle.hashCode())); result = ((prime*result)+((polyStyle == null)? 0 :polyStyle.hashCode())); result = ((prime*result)+((balloonStyle == null)? 0 :balloonStyle.hashCode())); result = ((prime*result)+((listStyle == null)? 0 :listStyle.hashCode())); result = ((prime*result)+((styleSimpleExtension == null)? 0 :styleSimpleExtension.hashCode())); result = ((prime*result)+((styleObjectExtension == null)? 0 :styleObjectExtension.hashCode())); return result; }
@Override public Style clone() { Style copy; copy = ((Style) super.clone()); copy.iconStyle = ((iconStyle == null)?null:((IconStyle) iconStyle.clone())); copy.labelStyle = ((labelStyle == null)?null:((LabelStyle) labelStyle.clone())); copy.lineStyle = ((lineStyle == null)?null:((LineStyle) lineStyle.clone())); copy.polyStyle = ((polyStyle == null)?null:((PolyStyle) polyStyle.clone())); copy.balloonStyle = ((balloonStyle == null)?null:((BalloonStyle) balloonStyle.clone())); copy.listStyle = ((listStyle == null)?null:((ListStyle) listStyle.clone())); copy.styleSimpleExtension = new ArrayList<Object>((getStyleSimpleExtension().size())); for (Object iter: styleSimpleExtension) { copy.styleSimpleExtension.add(iter); } copy.styleObjectExtension = new ArrayList<AbstractObject>((getStyleObjectExtension().size())); for (AbstractObject iter: styleObjectExtension) { copy.styleObjectExtension.add(iter.clone()); } return copy; }
if (labelStyle.equals(other.labelStyle) == false) { return false;
/** * Create an instance of {@link LabelStyle} * */ public static LabelStyle createLabelStyle() { return new LabelStyle(); }
/** * fluent setter * @see #setScale(double) * * @param scale * required parameter */ public LabelStyle withScale(final double scale) { this.setScale(scale); return this; }