/** * Returns the ConstructionElement for the given construction index. * * @param index * construction index * @return corresponding element */ public ConstructionElement getConstructionElement(int index) { return cons.getConstructionElement(index); }
private int getPreviousBreakpoint(int initStep) { int step = initStep; // go to previous breakpoint while (step >= 0) { if (cons.getConstructionElement(step).isConsProtocolBreakpoint()) { return step; } step--; } return -1; }
private int getNextBreakpoint(int initStep) { int step = initStep; int lastStep = getLastConstructionStep(); // go to next breakpoint while (step <= lastStep) { if (cons.getConstructionElement(step).isConsProtocolBreakpoint()) { return step; } step++; } return lastStep; }
/** * * @return number of breakpoints */ public int getBreakpointSteps() { int count = 0; int step = 0; int lastStep = getLastConstructionStep(); while (step <= lastStep) { if (cons.getConstructionElement(step).isConsProtocolBreakpoint()) { count++; } step++; } return count; }
/** * * @param breakpoint * breakpoint number * @return actual construction step for breakpoint */ public int getBreakpointStep(int breakpoint) { if (breakpoint <= 0) { return 0; } int count = 0; int step = 0; int lastStep = getLastConstructionStep(); while (step <= lastStep) { if (cons.getConstructionElement(step).isConsProtocolBreakpoint()) { count++; if (count == breakpoint) { return step; } } step++; } return lastStep; }
/** * @param step * raw step number * @return closest step number showable in construction protocol */ public int getClosestStep(int step) { if (cons.showOnlyBreakpoints()) { return getPreviousBreakpoint(step); } ConstructionElement prev = cons.getConstructionElement(step); /* * if (prev instanceof GeoElement && ((GeoElement) * prev).getCorrespondingCasCell() != null) { step--; } */ if (prev instanceof GeoCasCell && ((GeoCasCell) prev).getTwinGeo() != null && ((GeoCasCell) prev).getTwinGeo().isAlgebraVisible()) { return step - 1; } return step; }
GeoElementND[] geos = construction.getConstructionElement(step) .getGeoElements(); for (int j = 0; j < geos.length; j++) {
/** * Sets construction step to next step of construction protocol. Note: * showOnlyBreakpoints() is important here */ @Override public void nextStep() { int step = cons.getStep() + 1; if (cons.showOnlyBreakpoints()) { setConstructionStep(getNextBreakpoint(step)); } else { ConstructionElement next = cons.getConstructionElement(step); if (next instanceof GeoElement && ((GeoElement) next).getCorrespondingCasCell() != null) { step++; } setConstructionStep(step); } }
protected void drawAllElements() { boolean increment = (euclidianView.getShowGrid() || euclidianView.getShowXaxis() || euclidianView.getShowYaxis()); for (int step = 0; step < construction.steps(); step++) { if (increment) { beamerSlideNumber = step + 2; } else { beamerSlideNumber = step + 1; } GeoElementND[] geos = construction.getConstructionElement(step) .getGeoElements(); for (int j = 0; j < geos.length; j++) { GeoElement g = geos[j].toGeoElement(); drawGeoElement(g, false, false); } } }
protected void drawAllInDependentElements() { boolean increment = (euclidianView.getShowGrid() || euclidianView.getShowXaxis() || euclidianView.getShowYaxis()); for (int step = 0; step < construction.steps(); step++) { if (increment) { beamerSlideNumber = step + 2; } else { beamerSlideNumber = step + 1; } GeoElementND[] geos = construction.getConstructionElement(step) .getGeoElements(); for (int j = 0; j < geos.length; j++) { GeoElement g = geos[j].toGeoElement(); if (g.isIndependent()) { drawGeoElement(g, false, false); } } } }
ce = cons.getConstructionElement(i); if (geoslocal.contains(ce)) { ce.getXML(false, copiedXML); ce = cons.getConstructionElement(i); if (geoslocalsw.contains(ce)) { ce.getXML(false, copiedXMLforSameWindow);