public void setDefaultPointSize(int pointSize) { this.pointSize = Math.max(pointSize, 1); Iterator<GeoElement> it = defaultGeoElements.values().iterator(); while (it.hasNext()) { GeoElement geo = (GeoElement) it.next(); switch (geo.getGeoClassType()) { case GeoElement.GEO_CLASS_POINT: ((GeoPoint) geo).setPointSize(pointSize); break; case GeoElement.GEO_CLASS_LIST: ((GeoList) geo).setPointSize(pointSize); break; } } }
/** Fills the list of default geos */ protected void createDefaultGeoElements() { defaultGeoElements = new HashMap<Integer, GeoElement>(); // free point GeoPoint freePoint = new GeoPoint(cons); // freePoint.setLocalVariableLabel(app.getPlain("Point") + strFree); freePoint.setPointSize(EuclidianView.DEFAULT_POINT_SIZE); freePoint.setPointStyle(EuclidianView.POINT_STYLE_DOT); freePoint.setLocalVariableLabel("Point" + strFree); freePoint.setObjColor(colPoint); freePoint.setPointSize(pointSize); defaultGeoElements.put(DEFAULT_POINT_FREE, freePoint); // dependent point GeoPoint depPoint = new GeoPoint(cons); // depPoint.setLocalVariableLabel(app.getPlain("Point") + strDependent); depPoint.setPointSize(EuclidianView.DEFAULT_POINT_SIZE); depPoint.setPointStyle(EuclidianView.POINT_STYLE_DOT); depPoint.setLocalVariableLabel("Point" + strDependent); depPoint.setObjColor(colDepPoint); depPoint.setPointSize(pointSize); defaultGeoElements.put(DEFAULT_POINT_DEPENDENT, depPoint); // point on path GeoPoint pathPoint = new GeoPoint(cons); // pathPoint.setLocalVariableLabel(app.getPlain("PointOn")); pathPoint.setPointSize(EuclidianView.DEFAULT_POINT_SIZE); pathPoint.setPointStyle(EuclidianView.POINT_STYLE_DOT); pathPoint.setLocalVariableLabel("PointOn"); pathPoint.setObjColor(colPathPoint); pathPoint.setPointSize(pointSize); defaultGeoElements.put(DEFAULT_POINT_ON_PATH, pathPoint); // point in region GeoPoint regionPoint = new GeoPoint(cons); // regionPoint.setLocalVariableLabel(app.getPlain("PointOn")); regionPoint.setPointSize(EuclidianView.DEFAULT_POINT_SIZE); regionPoint.setPointStyle(EuclidianView.POINT_STYLE_DOT); regionPoint.setLocalVariableLabel("PointInRegion"); regionPoint.setObjColor(colRegionPoint); defaultGeoElements.put(DEFAULT_POINT_IN_REGION, regionPoint); // complex number (handled like a point) GeoPoint complexPoint = new GeoPoint(cons); complexPoint.setPointSize(EuclidianView.DEFAULT_POINT_SIZE); complexPoint.setPointStyle(EuclidianView.POINT_STYLE_DOT); complexPoint.setLocalVariableLabel("PointOn"); complexPoint.setObjColor(colComplexPoint); complexPoint.setPointSize(pointSize); defaultGeoElements.put(DEFAULT_POINT_COMPLEX, complexPoint); // line GeoLine line = new GeoLine(cons); // line.setLocalVariableLabel(app.getPlain("Line")); line.setLocalVariableLabel("Line"); line.setObjColor(colLine); defaultGeoElements.put(DEFAULT_LINE, line); GeoFunctionNVar inequality = new GeoFunctionNVar(cons, null); // inequality.setLocalVariableLabel("Inequality"); inequality.setObjColor(colInequality); inequality.setAlphaValue(DEFAULT_INEQUALITY_ALPHA); defaultGeoElements.put(DEFAULT_INEQUALITY, inequality); GeoFunction inequality1var = new GeoFunction(cons); // inequality.setLocalVariableLabel("Inequality"); inequality1var.setObjColor(colInequality); inequality1var.setAlphaValue(DEFAULT_INEQUALITY_ALPHA); defaultGeoElements.put(DEFAULT_INEQUALITY_1VAR, inequality1var); // vector GeoVector vector = new GeoVector(cons); vector.setLocalVariableLabel("Vector"); vector.setObjColor(colLine); defaultGeoElements.put(DEFAULT_VECTOR, vector); // polygon GeoPolygon polygon = new GeoPolygon(cons, null); // polygon.setLocalVariableLabel(app.getPlain("Polygon")); polygon.setLocalVariableLabel("Polygon"); polygon.setObjColor(colPolygon); polygon.setAlphaValue(DEFAULT_POLYGON_ALPHA); defaultGeoElements.put(DEFAULT_POLYGON, polygon); // conic GeoConic conic = new GeoConic(cons); // conic.setLocalVariableLabel(app.getPlain("Conic")); conic.setLocalVariableLabel("Conic"); conic.setObjColor(colConic); defaultGeoElements.put(DEFAULT_CONIC, conic); // conic sector GeoConicPart conicSector = new GeoConicPart(cons, GeoConicPart.CONIC_PART_SECTOR); // conicSector.setLocalVariableLabel(app.getPlain("Sector")); conicSector.setLocalVariableLabel("Sector"); conicSector.setObjColor(colPolygon); conicSector.setAlphaValue(DEFAULT_POLYGON_ALPHA); defaultGeoElements.put(DEFAULT_CONIC_SECTOR, conicSector); // number GeoNumeric number = new GeoNumeric(cons); // number.setLocalVariableLabel(app.getPlain("Numeric")); number.setLocalVariableLabel("Numeric"); number.setSliderFixed(true); number.setLabelMode(GeoElement.LABEL_NAME_VALUE); /*we have to set min/max/increment/speed here because SetEuclideanVisible takes these from default geo*/ number.setIntervalMax(GeoNumeric.DEFAULT_SLIDER_MAX); number.setIntervalMin(GeoNumeric.DEFAULT_SLIDER_MIN); number.setAnimationStep(GeoNumeric.DEFAULT_SLIDER_INCREMENT); number.setAnimationSpeed(GeoNumeric.DEFAULT_SLIDER_SPEED); defaultGeoElements.put(DEFAULT_NUMBER, number); // angle GeoAngle angle = new GeoAngle(cons); // angle.setLocalVariableLabel(app.getPlain("Angle")); angle.setLocalVariableLabel("Angle"); angle.setSliderFixed(true); angle.setObjColor(colAngle); angle.setAlphaValue(DEFAULT_ANGLE_ALPHA); angle.setArcSize(angleSize); /*we have to set min/max/increment/speed here because SetEuclideanVisible takes these from default geo*/ angle.setIntervalMax(GeoAngle.DEFAULT_SLIDER_MAX); angle.setIntervalMin(GeoAngle.DEFAULT_SLIDER_MIN); angle.setAnimationStep(GeoAngle.DEFAULT_SLIDER_INCREMENT); angle.setAnimationSpeed(GeoAngle.DEFAULT_SLIDER_SPEED); defaultGeoElements.put(DEFAULT_ANGLE, angle); // function GeoFunction function = new GeoFunction(cons); // function.setLocalVariableLabel(app.getPlain("Function")); function.setLocalVariableLabel("Function"); function.setObjColor(colFunction); defaultGeoElements.put(DEFAULT_FUNCTION, function); // locus GeoLocus locus = new GeoLocus(cons); // locus.setLocalVariableLabel(app.getPlain("Locus")); locus.setLocalVariableLabel("Locus"); locus.setObjColor(colLocus); locus.setLabelVisible(false); defaultGeoElements.put(DEFAULT_LOCUS, locus); // text GeoText text = new GeoText(cons); // text.setLocalVariableLabel(app.getPlain("Text")); text.setLocalVariableLabel("Text"); defaultGeoElements.put(DEFAULT_TEXT, text); // image GeoImage img = new GeoImage(cons); // img.setLocalVariableLabel(app.getPlain("Image")); img.setLocalVariableLabel("Image"); defaultGeoElements.put(DEFAULT_IMAGE, img); // boolean GeoBoolean bool = new GeoBoolean(cons); // bool.setLocalVariableLabel(app.getPlain("Boolean")); bool.setLocalVariableLabel("Boolean"); defaultGeoElements.put(DEFAULT_BOOLEAN, bool); // list GeoList list = new GeoList(cons); // list.setLocalVariableLabel(app.getPlain("List")); list.setShowAllProperties(true); // show all properties in the defaults dialog list.setLocalVariableLabel("List"); list.setObjColor(colList); list.setAlphaValue(-1); // wait until we have an element in the list // then we will use the alphaValue of the first element in the list // see GeoList.setAlphaValue() and getAlphaValue() defaultGeoElements.put(DEFAULT_LIST, list); }