/** * String representation of object. * * @return string representation of object * @since 1.8.0 */ @Override public String toString() { return getCacheId(); }
/** * Calculate object hash code. * * @return hash code * @since 1.8.0 */ @Override public int hashCode() { int result = circle != null ? circle.hashCode() : 0; result = PRIME * result + (rect != null ? rect.hashCode() : 0); result = PRIME * result + (image != null ? image.hashCode() : 0); return result; } }
/** * Copy constructor. Creates a deep copy of the specified {@link SymbolInfo} object. * * @param other the symbol to copy * @since 1.10.0 */ public SymbolInfo(SymbolInfo other) { if (other.getCircle() != null) { setCircle(new CircleInfo()); getCircle().setR(other.getCircle().getR()); } if (other.getRect() != null) { setRect(new RectInfo()); getRect().setH(other.getRect().getH()); getRect().setW(other.getRect().getW()); } if (other.getImage() != null) { setImage(new ImageInfo()); getImage().setHeight(other.getImage().getHeight()); getImage().setWidth(other.getImage().getWidth()); getImage().setHref(other.getImage().getHref()); getImage().setSelectionHref(other.getImage().getSelectionHref()); } }
private float getSymbolHeight(InternalFeature f) { SymbolInfo info = f.getStyleInfo().getSymbol(); if (info.getCircle() != null) { return 2 * info.getCircle().getR(); } else { return info.getRect().getH(); } }
private void drawPoint(Coordinate coord, SymbolInfo symbol) { if (symbol.getImage() != null) { try { Image pointImage = Image.getInstance(symbol.getImage().getHref()); //template.addImage(image, width, 0, 0, height, x, y) template.addImage(pointImage, symbol.getImage().getWidth(), 0, 0, symbol.getImage().getHeight() , origX + (float) coord.x, origY + (float) coord.y); } catch (Exception ex) { // NOSONAR log.error("Not able to create POINT image for rendering", ex); } } else if (symbol.getCircle() != null) { float radius = symbol.getCircle().getR(); template.circle(origX + (float) coord.x, origY + (float) coord.y, radius); } else if (symbol.getRect() != null) { float width = symbol.getRect().getW(); float height = symbol.getRect().getW(); template.rectangle(origX + (float) coord.x - (width / 2), origY + (float) coord.y - (height / 2), width, height); } }
/** * Are the two objects equal? * * @param o object to compare * @return true when objects are equal * @since 1.8.0 */ @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SymbolInfo)) { return false; } SymbolInfo that = (SymbolInfo) o; if (circle != null ? !circle.equals(that.circle) : that.circle != null) { return false; } if (image != null ? !image.equals(that.image) : that.image != null) { return false; } if (rect != null ? !rect.equals(that.rect) : that.rect != null) { return false; } return true; }
} else if (symbol.getRect() != null) { MarkInfo rect = createMark(WKN_RECT, fill, stroke); graphic = createGraphic(rect, (int) symbol.getRect().getH()); } else { ExternalGraphicInfo image = createExternalGraphic(symbol.getImage().getHref());