io.github.mvpotter.model.polyline.Polyline Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yandex-maps-static-api Show documentation
Show all versions of yandex-maps-static-api Show documentation
Library for working with Yandex Maps Static API 1.x
The newest version!
/*
* Created with IntelliJ IDEA.
* User: michaelpotter
* Date: 02/02/14
* Time: 22:06
*/
package io.github.mvpotter.model.polyline;
import java.awt.*;
/**
* Polyline for representation on the map.
* Description: http://api.yandex.ru/maps/doc/staticapi/1.x/dg/concepts/polylines.xml
*/
public class Polyline {
private static final Color DEFAULT_COLOR = new Color(136, 34, 221, 192);
private static final int DEFAULT_WIDTH = 5;
protected Color color = DEFAULT_COLOR;
protected int width = DEFAULT_WIDTH;
/**
* Sets polyline color.
*
* @param color color
*/
public void setColor(final Color color) {
if (color == null) {
this.color = DEFAULT_COLOR;
} else {
this.color = color;
}
}
/**
* Sets polyline width.
*
* @param width width
*/
public void setWidth(final int width) {
if (width < 0) {
this.width = DEFAULT_WIDTH;
}
this.width = width;
}
/**
* Returns polyline color.
*
* @return color
*/
public Color getColor() {
return color;
}
/**
* Returns polyline width.
*
* @return width
*/
public int getWidth() {
return width;
}
}