* @see com.bbn.openmap.omGraphics.OMEllipse
*/
public static OMEllipse read(DataInputStream dis,
LinkProperties propertiesBuffer)
throws IOException {
OMEllipse ellipse = null;
int renderType = dis.readByte();
switch (renderType) {
case RENDERTYPE_LATLON: {
float lat = dis.readFloat();
float lon = dis.readFloat();
double majorAxisSpan = dis.readFloat();
double minorAxisSpan = dis.readFloat();
int units = dis.readByte();
double rotationAngle = dis.readFloat();
Length unit = Length.DECIMAL_DEGREE;
switch (units) {
case 0:
unit = Length.KM;
break;
case 1:
unit = Length.MILE;
break;
case 2:
unit = Length.NM;
break;
default:
break;
}
ellipse = new OMEllipse(new LatLonPoint(lat, lon), majorAxisSpan, minorAxisSpan, unit, rotationAngle);
break;
}
case RENDERTYPE_XY: {
int x = dis.readInt();
int y = dis.readInt();
int majorAxisSpan = dis.readInt();
int minorAxisSpan = dis.readInt();
double rotationAngle = dis.readFloat();
ellipse = new OMEllipse(x, y, majorAxisSpan, minorAxisSpan, rotationAngle);
break;
}
case RENDERTYPE_OFFSET: {
float lat = dis.readFloat();
float lon = dis.readFloat();
int offsetX = dis.readInt();
int offsetY = dis.readInt();
int w = dis.readInt();
int h = dis.readInt();
double rotationAngle = dis.readFloat();
ellipse = new OMEllipse(new LatLonPoint(lat, lon), offsetX, offsetY, w, h, rotationAngle);
break;
}
default: {
Debug.error("LinkEllipse.read: ellipse rendertype unknown.");
break;