/** * Recompute all objects. */ public final void updateConstruction() { updateConstruction(true); }
/** * @param rounding * eg "10" for 10dp or "10s" for 10 significant figures */ @Override public void setRounding(String rounding) { app.setRounding(rounding); kernel.updateConstruction(false); app.refreshViews(); kernel.updateConstruction(false); }
@Override protected void setValueSafe(String value, int index) { kernel.setAlgebraStyle(algebraStyles[index]); kernel.updateConstruction(false); } }
@Override protected void setValueSafe(String value, int index) { kernel.setCoordStyle(index); kernel.updateConstruction(false); }
/** * @param app * app * @param id * index of rounding option * @param figures * whether to use significant figures */ public void setRounding(App app, int id, boolean figures) { Kernel kernel = app.getKernel(); int rounding = roundingMenuLookup(id); if (figures) { kernel.setPrintFigures(rounding); } else { kernel.setPrintDecimals(rounding); } kernel.updateConstruction(false); app.refreshViews(); // see ticket 79 kernel.updateConstruction(false); app.setUnsaved(); } }
@Override protected void setValueSafe(String value, int index) { int angleUnit; switch (index) { case 1: angleUnit = Kernel.ANGLE_RADIANT; break; case 2: if (kernel.getApplication().has(Feature.MOB_ANGLE_DEGREES_MINUTES_SECONDS)) { angleUnit = Kernel.ANGLE_DEGREES_MINUTES_SECONDS; } else { angleUnit = Kernel.ANGLE_DEGREE; } break; case 0: default: angleUnit = Kernel.ANGLE_DEGREE; break; } kernel.setAngleUnit(angleUnit); kernel.updateConstruction(false); }
@Override protected final GeoElement[] perform(Command c) throws MyError { int n = c.getArgumentNumber(); switch (n) { case 0: app.getKernel().updateConstruction(true); app.setUnsaved(); return new GeoElement[0]; case 1: GeoElement[] arg = resArgs(c); if (arg[0] instanceof NumberValue) { double val = arg[0].evaluateDouble(); if (DoubleUtil.isInteger(val)) { app.getKernel().updateConstruction(true, (int) val); app.setUnsaved(); return arg; } } throw argErr(c, arg[0]); default: throw argNumErr(c); } } }
/** * Change algebra style value -> desfinition -> description ... * * @param app * application */ public static void toggleAlgebraStyle(App app) { Kernel kernel = app.getKernel(); kernel.setAlgebraStyle((kernel.getAlgebraStyle() + 1) % 3); kernel.setAlgebraStyleSpreadsheet( (kernel.getAlgebraStyleSpreadsheet() + 1) % 3); kernel.updateConstruction(false); /* * if (app.hasOptionsMenu()) { * app.getOptionsMenu(null).updateMenuViewDescription(); } */ app.setUnsaved(); }
/** * Use localized digits for certain languages (Arabic, Hebrew, etc). * * Calls {@link #updateLanguageFlags(String)} to apply the change, but just * if the new flag differs from the current. * * @param useLocalizedDigits * whether localized digits should be used * @param app * used for callback (update construction) */ public void setUseLocalizedDigits(boolean useLocalizedDigits, App app) { if (this.useLocalizedDigits == useLocalizedDigits) { return; } this.useLocalizedDigits = useLocalizedDigits; updateLanguageFlags(getLanguage()); app.getKernel().updateConstruction(false); app.setUnsaved(); if (app.getEuclidianView1() != null) { app.getEuclidianView1().updateBackground(); } }
app.getKernel().updateConstruction(false); app.setUnsaved(); app.storeUndoInfo();
kernel.setUseInternalCommandNames(oldVal2); if (!isGGTOrDefaults && mayZoom) { kernel.updateConstruction(randomize, 1); kernel.setNotifyViewsActive(oldVal);
app.getKernel().updateConstruction(true); app.setUnsaved(); consumed = true;
app.getKernel().updateConstruction(true); app.setUnsaved(); consumed = true;