/** * return the default type of the GeoElement * * @param geo a GeoElement * @return the default type */ public int getDefaultType(GeoElement geo) { // all object types that are not specifically supported // should get the default values of a line int type = DEFAULT_LINE; switch (geo.getGeoClassType()) { case GeoElement.GEO_CLASS_POINT: GeoPoint p = (GeoPoint) geo; if (p.getMode() == Kernel.COORD_COMPLEX) { type = DEFAULT_POINT_COMPLEX; } else if (p.isIndependent()) { type = DEFAULT_POINT_FREE; } else { if (p.hasPath()) type = DEFAULT_POINT_ON_PATH; else if (p.hasRegion()) type = DEFAULT_POINT_IN_REGION; else type = DEFAULT_POINT_DEPENDENT; } break; case GeoElement.GEO_CLASS_ANGLE: type = DEFAULT_ANGLE; break; case GeoElement.GEO_CLASS_BOOLEAN: type = DEFAULT_BOOLEAN; break; case GeoElement.GEO_CLASS_CONIC: type = DEFAULT_CONIC; break; case GeoElement.GEO_CLASS_CONICPART: GeoConicPart conicPart = (GeoConicPart) geo; if (conicPart.getConicPartType() == GeoConicPart.CONIC_PART_SECTOR) { type = DEFAULT_CONIC_SECTOR; } else { type = DEFAULT_CONIC; } break; case GeoElement.GEO_CLASS_FUNCTION_NVAR: type = DEFAULT_INEQUALITY; break; case GeoElement.GEO_CLASS_FUNCTION: if (((GeoFunction) geo).isBooleanFunction()) type = DEFAULT_INEQUALITY_1VAR; else type = DEFAULT_FUNCTION; break; case GeoElement.GEO_CLASS_INTERVAL: case GeoElement.GEO_CLASS_FUNCTIONCONDITIONAL: type = DEFAULT_FUNCTION; break; case GeoElement.GEO_CLASS_IMAGE: type = DEFAULT_IMAGE; break; case GeoElement.GEO_CLASS_LIST: type = DEFAULT_LIST; break; case GeoElement.GEO_CLASS_LOCUS: type = DEFAULT_LOCUS; break; case GeoElement.GEO_CLASS_NUMERIC: type = DEFAULT_NUMBER; break; case GeoElement.GEO_CLASS_POLYGON: type = DEFAULT_POLYGON; break; case GeoElement.GEO_CLASS_TEXT: type = DEFAULT_TEXT; break; case GeoElement.GEO_CLASS_VECTOR: type = DEFAULT_VECTOR; break; } return type; }