Commits

Anonymous committed 158219a Draft

fixed axes and plot box

Comments (0)

Files changed (8)

src/main/java/org/xmlcml/graphics/control/page/Axis.java

 import org.xmlcml.euclid.Real2Array;
 import org.xmlcml.euclid.Real2Range;
 import org.xmlcml.euclid.RealArray;
+import org.xmlcml.euclid.RealRange;
 import org.xmlcml.euclid.Transform2;
 import org.xmlcml.graphics.paths.ComplexLine;
 import org.xmlcml.graphics.paths.ComplexLine.CombType;
 	private String axisUnits = null;
 	private CombType combType;
 	private List<SVGElement> texts;
-	private Double boxThickness = 40.;
-	private Double boxLengthExtension = 10.;
+	private Double boxThickness;
+	private Double boxLengthExtension;
 	private AxisAnalyzer axisAnalyzer;
 	private TextAnalyzer textAnalyzer;
 	private String id;
 	private CMLArray majorTickMarkValues;
 	private CMLScalar scalar;
 	
-	private LineOrientation orientation;
+	private LineOrientation lineOrientation;
 	
 	private Real2 lowestMajorTickInPixels;
 	private Real2 highestMajorTickInPixels;
 	private Double highestTickMarkValue;
 
 	private List<SVGText> numericTexts;
+	private List<SVGText> nonNumericTexts;
 
-	private List<SVGText> nonNumericTexts;
+	private Double arraySpacingInValues;
+	private RealRange axisRangeInPixels;
+	private Double lowestAxisValue;
+	private Double highestAxisValue;
+
+	private Double pixelToValueScale;
 
 
 	public Axis(AxisAnalyzer axisAnalyzer) {
 		this.axisAnalyzer = axisAnalyzer;
+		this.boxLengthExtension = axisAnalyzer.getBoxLengthExtension();
+		this.boxThickness = axisAnalyzer.getBoxThickness();
+	}
+
+	public Double getBoxThickness() {
+		return boxThickness;
+	}
+
+	public void setBoxThickness(Double boxThickness) {
+		this.boxThickness = boxThickness;
 	}
 
 	public CombType getCombType() {
 	}
 	
 	public LineOrientation getOrientation() {
-		if (complexLine != null) {
-			orientation = complexLine.getBackboneOrientation();
+		if (lineOrientation == null) {
+			if (complexLine != null) {
+				lineOrientation = complexLine.getBackboneOrientation();
+			}
 		}
-		return orientation;
+		return lineOrientation;
 	}
 
 	public List<Joint> getMinorTickJointList() {
 	 */
 	public void processScaleValuesAndTitles(SVGElement container) {
 		texts = SVGUtil.getQuerySVGElements(container, ".//svg:text");
-		LOG.debug("TEXTS "+texts.size());
 		Real2Range textBox = getTextBox(complexLine.getBackbone());
-		LOG.debug("TEXT BOX "+textBox);
 		BoxEdge edge = (LineOrientation.HORIZONTAL.equals(getOrientation())) ? BoxEdge.XMIN : BoxEdge.YMIN;
 		List<SVGElement> sortedTexts = BoundingBoxManager.getElementsSortedByEdge(texts, edge);
-		LOG.debug("SORTED "+sortedTexts.size());
 		List<SVGText> boundedTexts = getTextsInBox(textBox, sortedTexts); 
-		LOG.debug("BOUNDED "+boundedTexts.size());
-		if (LineOrientation.HORIZONTAL.equals(orientation)) {
+		ensureTickmarks();
+		if (LineOrientation.HORIZONTAL.equals(lineOrientation)) {
 			List<SVGText> horizontalTexts = getTexts(boundedTexts, LineOrientation.HORIZONTAL);
 			analyzeHorizontalAxis(horizontalTexts);
-		} else if (LineOrientation.VERTICAL.equals(orientation)) {
-			List<SVGText> verticalTexts = getTexts(boundedTexts, LineOrientation.VERTICAL);
+		} else if (LineOrientation.VERTICAL.equals(lineOrientation)) {
+			List<SVGText> verticalTexts = getTexts(boundedTexts, LineOrientation.HORIZONTAL);
 			analyzeVerticalAxis(verticalTexts);
 			for (SVGText rotatedText : verticalTexts) {
 				LOG.trace("ROT "+rotatedText.getValue()+" .. "+
 		}
 	}
 
-	private void transformArrayFromPixelsToScale() {
+	private void transformArrayFromPixelsToScale(List<SVGPolyline> polylines) {
 		getOrientation();
 		SVGElement parentSVG = (SVGElement)complexLine.getBackbone().getParent();
 		if (parentSVG == null) {
-			LOG.debug("NULL SVG PARENT");
+			LOG.trace("NULL SVG PARENT");
 		} else {
-			LOG.debug("++++ OK SVG PARENT");
+			ensureTickmarks();
 			SVGElement parent = (SVGElement) parentSVG.getParent();
-			List<SVGElement> polylineElements = SVGUtil.getQuerySVGElements(parent, "./svg:g/svg:polyline");
-			List<SVGPolyline> polylines = SVGPolyline.extractPolylines(polylineElements);
-			ensureTickmarks();
-			LOG.debug(("POLYLINES "+polylines.size()));
 			for (SVGPolyline polyline : polylines) {
-				LOG.debug("Polyline "+polyline.getBoundingBox());
 				Real2Array polylineCoords = polyline.getReal2Array();
-				RealArray polylineAxisPixelCoords = (LineOrientation.HORIZONTAL.equals(orientation)) ?
+				RealArray polylineAxisPixelCoords = (LineOrientation.HORIZONTAL.equals(lineOrientation)) ?
 						polylineCoords.getXArray() : polylineCoords.getYArray();
 				RealArray polylineValueCoords = polylineAxisPixelCoords.createScaledArrayToRange(
 					lowestMajorTickCoordInPixels, highestMajorTickCoordInPixels, lowestTickMarkValue, highestTickMarkValue);
 				Double range = polylineValueCoords.getRange().getRange();
 				int places = (int) Math.max(0, 6 - (Math.log10(range)-0.5));
 				polylineValueCoords.format(places);
-				LOG.debug("SCALED "+polylineValueCoords);
-	
 			}
-			LOG.trace("POLY "+polylines.size()+ " ... "+complexLine.getBackbone().getBoundingBox());
 		}
 	}
 
 	private void ensureTickmarks() {
 		if (lowestMajorTickCoordInPixels == null) {
+			getOrientation();
 			getLowestMajorTickCoordinateInPixels();
 			getHighestMajorTickCoordinateInPixels();
 			getLowestMajorTickPointInPixels();
 			getLowestTickMarkValue();
 			getHighestMajorTickPointInPixels();
 			getHighestTickMarkValue();
+			getHighestAndLowestAxisValues();
 		}
 	}
 
 	
 	private Double getLowestMajorTickCoordinateInPixels() {
 		Real2 point = getLowestMajorTickPointInPixels();
-		lowestMajorTickCoordInPixels = (LineOrientation.HORIZONTAL.equals(orientation)) ? point.getX() : point.getY();
+		LOG.trace("LowestTick "+point+ "orientation "+lineOrientation);
+		lowestMajorTickCoordInPixels = (LineOrientation.HORIZONTAL.equals(lineOrientation)) ? point.getX() : point.getY();
 		return lowestMajorTickCoordInPixels;
 	}
 	
 	private Double getHighestMajorTickCoordinateInPixels() {
 		Real2 point = getHighestMajorTickPointInPixels();
-		highestMajorTickCoordInPixels = (LineOrientation.HORIZONTAL.equals(orientation)) ? point.getX() : point.getY();
+		LOG.trace("HighestTick "+point+ "orientation "+lineOrientation);
+		highestMajorTickCoordInPixels = (LineOrientation.HORIZONTAL.equals(lineOrientation)) ? point.getX() : point.getY();
 		return highestMajorTickCoordInPixels;
 	}
 	
-	private void mapScaleNumbersToTicks() {
-		int size = majorTickMarkValues.getSize();
-		LOG.debug("FOUND AXIS: "+size);
-		Double arraySpacingInPixels = null;
-		if (CMLConstants.XSD_INTEGER.equals(majorTickMarkValues.getDataType())) {
-			arraySpacingInPixels = ((double) majorTickMarkValues.getInts()[size-1] - (double) majorTickMarkValues.getInts()[0])  / (double )(size - 1);
-		} else if (CMLConstants.XSD_DOUBLE.equals(majorTickMarkValues.getDataType())) {
-			arraySpacingInPixels = ((double) majorTickMarkValues.getDoubles()[size-1] - (double) majorTickMarkValues.getDoubles()[0])  / (double )(size - 1);
+	private void getArraySpacingInValues() {
+		if (arraySpacingInValues == null) {
+			int size = majorTickMarkValues.getSize();
+			if (CMLConstants.XSD_INTEGER.equals(majorTickMarkValues.getDataType())) {
+				arraySpacingInValues = ((double) majorTickMarkValues.getInts()[size-1] - (double) majorTickMarkValues.getInts()[0])  / (double )(size - 1);
+			} else if (CMLConstants.XSD_DOUBLE.equals(majorTickMarkValues.getDataType())) {
+				arraySpacingInValues = ((double) majorTickMarkValues.getDoubles()[size-1] - (double) majorTickMarkValues.getDoubles()[0])  / (double )(size - 1);
+			} 
+			LOG.trace("SCALE/TICK "+arraySpacingInValues);
 		}
-		LOG.debug("SCALE/TICK "+arraySpacingInPixels);
+	}
+	
+	private void getHighestAndLowestAxisValues() {
+		if (lowestTickMarkValue != null) {
+			getArraySpacingInValues();
+			getAxisRangeInPixels();
+			ensureTickmarks();
+			getPixelToValueScale();
+			if (lowestTickMarkValue != null && highestTickMarkValue != null) {
+				double axisMin = axisRangeInPixels.getMin();
+				lowestAxisValue = (axisMin - lowestMajorTickCoordInPixels) / (pixelToValueScale) + lowestTickMarkValue;
+				LOG.trace(" axisMin: "+axisMin+" lowestMajorTick "+lowestMajorTickCoordInPixels+" arraySpacingInPixels "+
+				      arraySpacingInValues+" lowestTickMarkValue "+lowestTickMarkValue);
+				LOG.trace("lowestAxisValue: "+lowestAxisValue);
+				double axisMax = axisRangeInPixels.getMax();
+				highestAxisValue = (axisMax - highestMajorTickCoordInPixels) / (pixelToValueScale) + highestTickMarkValue;
+				LOG.trace(" axisMax: "+axisMax+" highestMajorTick "+highestMajorTickCoordInPixels+" arraySpacingInPixels "+
+				      arraySpacingInValues+" highestTickMarkValue "+highestTickMarkValue);
+				LOG.trace("highestAxisValue: "+highestAxisValue);
+			}
+		}
+	}
+
+	private double getPixelToValueScale() {
+		if (pixelToValueScale == null) {
+			ensureTickmarks();
+			if (lowestTickMarkValue != null && lowestMajorTickCoordInPixels != null) {
+				pixelToValueScale = (highestMajorTickCoordInPixels - lowestMajorTickCoordInPixels) / (highestTickMarkValue - lowestTickMarkValue);
+			}
+		}
+		return pixelToValueScale;
 	}
 
 	private void analyzeHorizontalAxis(List<SVGText> ySortedTexts) {
 	}
 
 	private void mapTickPositionsToValues() {
-		if (majorTickMarkValues.getSize() == majorTickJointList.size()) {
-			mapScaleNumbersToTicks();
-			transformArrayFromPixelsToScale();
-		} else {
-			LOG.debug("ARRAY: "+majorTickMarkValues.getSize()+ " != "+majorTickJointList.size());
+		if (majorTickMarkValues != null && majorTickJointList != null) {
+			if (majorTickMarkValues.getSize() == majorTickJointList.size()) {
+				getArraySpacingInValues();
+				// this should be elsewhere
+				List<SVGPolyline> polylines = SVGPolyline.extractPolylines(SVGUtil.getQuerySVGElements(null, "./svg:g/svg:polyline"));
+				transformArrayFromPixelsToScale(polylines);
+			} else {
+				LOG.debug("ARRAY: "+majorTickMarkValues.getSize()+ " != "+majorTickJointList.size());
+			}
 		}
 	}
 	
 		createNumericAndNonNumericTexts(texts);
 		Integer y = null;
 		Double numericYCoord = TextAnalyzer.getCommonYCoordinate(numericTexts, axisAnalyzer.eps);
-		LOG.debug("Y COORD "+numericYCoord);
 		if (numericYCoord != null) {
 			majorTickMarkValues = createNumericValues(numericTexts);
-			LOG.debug("HOR AXIS "+majorTickMarkValues);
 		}
 		Double nonNumericYCoord = TextAnalyzer.getCommonYCoordinate(nonNumericTexts, axisAnalyzer.eps);
-		if (nonNumericYCoord != null && nonNumericTexts.size() == 1) {
+		if (nonNumericYCoord != null && nonNumericTexts.size() > 0) {
 			axisLabel = nonNumericTexts.get(0).getValue();
 		}
 	}
 
 	/** texts should have already have been grouped into words
-	 * 
+	 * assuming horizontal scale values at present
 	 * @param texts
 	 */
 	private void processVerticalScaleValuesAndScaleTitle(List<SVGText> texts) {
+		
 		createNumericAndNonNumericTexts(texts);
 		Integer y = null;
 		Double numericRightXCoord = TextAnalyzer.getCommonRightXCoordinate(numericTexts, TextAnalyzer.TEXT_EPS);
-		LOG.debug("Y COORD "+numericRightXCoord);
 		Double numericLeftXCoord = TextAnalyzer.getCommonLeftXCoordinate(numericTexts, TextAnalyzer.TEXT_EPS);
-		LOG.debug("Y COORD "+numericLeftXCoord);
 		if (numericRightXCoord != null || numericLeftXCoord != null) {
 			majorTickMarkValues = createNumericValues(numericTexts);
-			LOG.debug("VERT AXIS "+majorTickMarkValues);
 		}
 		Double nonNumericYCoord = TextAnalyzer.getCommonYCoordinate(nonNumericTexts, axisAnalyzer.eps);
 		if (nonNumericYCoord != null && nonNumericTexts.size() == 1) {
 				if (text.query("@"+TextAnalyzer.NUMBER).size() > 0) {
 					numericTexts.add(text);
 				} else {
-					nonNumericTexts.add(text);
+					if (text.getValue().trim().length() != 0) {
+						nonNumericTexts.add(text);
+					}
 				}
 			}
 			LOG.debug("NUMERIC "+numericTexts.size()+" NON-NUM "+nonNumericTexts.size());
 		return textAnalyzer;
 	}
 
-	private void ensureTextAnalyzer() {
-		if (textAnalyzer == null) {
-			textAnalyzer = new TextAnalyzer(axisAnalyzer.getPageAnalyzer());
-		}
-	}
-
 	private List<SVGText> getTexts(List<SVGText> textList, LineOrientation orientation) {
 		List<SVGText> subTextList = new ArrayList<SVGText>();
 		for (SVGText text : textList) {
 
 	private List<SVGText> getTextsInBox(Real2Range textBox, List<SVGElement> sortedTexts) {
 		// crude at present
-		LOG.debug("TEXT BOX: "+textBox);
 		List<SVGText> textList = new ArrayList<SVGText>();
 		for (int i = 0; i < sortedTexts.size(); i++) {
 			Real2Range bb = sortedTexts.get(i).getBoundingBox();
-			LOG.debug("BB "+bb+ "V "+sortedTexts.get(i).getValue());
 			if (bb.intersectionWith(textBox) != null) {
 				if (textBox.includes(bb)) {
 					textList.add((SVGText)sortedTexts.get(i));
 			double y0 = backbone.getXY(0).getY();
 			double y1 = backbone.getXY(1).getY();
 			double x = backbone.getXY(0).getX();
-			textBox = new Real2Range(new Real2(x - boxThickness, y0 - boxLengthExtension), new Real2(x, y1 + boxLengthExtension));
+			textBox = new Real2Range(
+					new Real2(x - boxThickness, y0 - boxLengthExtension), 
+					new Real2(x, y1 + boxLengthExtension));
 		}
 		return textBox;
 	}
+	
 
 	public String getId() {
 		return this.id;
 
 	public RealArray createScaledArrayToRange(RealArray polylinePixelCoords) {
 		ensureTickmarks();
-		LOG.debug("TICKS");
 		RealArray realArray =  polylinePixelCoords.createScaledArrayToRange(
 				lowestMajorTickCoordInPixels, highestMajorTickCoordInPixels, lowestTickMarkValue, highestTickMarkValue);
-		LOG.debug("SCALED");
 		return realArray;
 	}
 	
 
 	public String toString() {
 		String s = "\n";
-		s += tickDetail("major", majorTickSpacingInPixels, majorTickJointList)+"\n";
+		ensureTickmarks();
 		if (majorTickMarkValues != null) {
+			s += tickDetail("major", majorTickSpacingInPixels, majorTickJointList)+"\n";
 			int nValues = majorTickMarkValues.getSize();
 			s += " "+nValues+" major values "+getLowestTickMarkValue()+" ... "+(nValues-1)+" gaps ... "+
-			" "+majorTickMarkValues.getElementAt(nValues-1).getValue()+"\n";
+			" "+getHighestTickMarkValue()+"\n";
 		}
-		s += tickDetail("minor", minorTickSpacingInPixels, minorTickJointList)+"\n";
+		if (minorTickSpacingInPixels != null) {
+			s += tickDetail("minor", minorTickSpacingInPixels, minorTickJointList)+"\n";
+		}
+		getHighestAndLowestAxisValues();
+		if (lowestAxisValue != null) {
+			s += "axis " + lowestAxisValue+" ... " + highestAxisValue + "\n";
+		} else {
+			s += "NO AXIS VALUES"+ "\n";
+		}
+		s += "label: "+axisLabel+"\n";
+		
 		return s;
 	}
 
 	private Double getLowestTickMarkValue() {
-		lowestTickMarkValue = majorTickMarkValues.getElementAt(0).getNumberAsDouble();
+		if (lowestTickMarkValue == null && majorTickMarkValues != null) {
+			lowestTickMarkValue = majorTickMarkValues.getElementAt(0).getNumberAsDouble();
+		}
 		return lowestTickMarkValue;
 	}
 
 	private Double getHighestTickMarkValue() {
-		highestTickMarkValue = majorTickMarkValues.getElementAt(majorTickMarkValues.getSize()-1).getNumberAsDouble();
+		if (highestTickMarkValue == null && majorTickMarkValues != null) {
+			highestTickMarkValue = majorTickMarkValues.getElementAt(majorTickMarkValues.getSize()-1).getNumberAsDouble();
+		}
 		return highestTickMarkValue;
 	}
 
 	private String tickDetail(String title, double spacing, List<Joint> jointList) {
 		int nTicks = jointList.size();
-		return " "+nTicks+" "+title+" ticks (pixels): "+jointList.get(0).getPoint().format(3)+" ... "+(nTicks-1)+" gaps "+Real.normalize(spacing, 3)+"(pixels) ... "+jointList.get(nTicks-1).getPoint().format(3);
+		return " "+nTicks+" "+title+" ticks (pixels): "+jointList.get(0).getPoint().format(3)+" ... "+(nTicks-1)+" gaps "+
+				Real.normalize(spacing, 3)+"(pixels) ... "+jointList.get(nTicks-1).getPoint().format(3);
 	}
-	
-	
+
+	public RealRange getAxisRangeInPixels() {
+		Real2Range r2r = complexLine.getBackbone().getReal2Range();
+		axisRangeInPixels = (LineOrientation.HORIZONTAL.equals(lineOrientation)) ? r2r.getXRange() : r2r.getYRange();
+		return axisRangeInPixels;
+	}
 }

src/main/java/org/xmlcml/graphics/control/page/AxisAnalyzer.java

 import java.util.ArrayList;
 import java.util.List;
 
-import nu.xom.Attribute;
-
 import org.apache.log4j.Logger;
+import org.xmlcml.euclid.Real2Range;
 import org.xmlcml.graphics.paths.ComplexLine;
 import org.xmlcml.graphics.paths.ComplexLine.CombType;
 import org.xmlcml.graphics.paths.ComplexLine.LineOrientation;
 import org.xmlcml.graphics.svg.SVGElement;
 import org.xmlcml.graphics.svg.SVGLine;
+import org.xmlcml.graphics.svg.SVGRect;
 
 public class AxisAnalyzer {
 
 	double eps;
 
 
+	private Real2Range plotBox;
+
+
 	public AxisAnalyzer(SVGElement container, PageAnalyzer pageAnalyzer) {
 		this.container = container;
 		this.setPageAnalyzer(pageAnalyzer);
 			if (verticalAxisList.size() == 1) {
 				this.verticalAxis = verticalAxisList.get(0);
 			}
-			LOG.debug("FINISHED AXES");
+			plotBox = createPlotBox();
+			LOG.trace("FINISHED AXES");
 		}
 	}
 	
+	private Real2Range createPlotBox() {
+		if (horizontalAxis != null && verticalAxis != null) {
+			plotBox = new Real2Range(horizontalAxis.getAxisRangeInPixels(), verticalAxis.getAxisRangeInPixels());
+			LOG.debug("PLOT BOX "+plotBox);
+			drawBox();
+		}
+		return plotBox;
+	}
+	
+	private void drawBox() {
+		SVGRect bbox = new SVGRect(plotBox);
+		bbox.setOpacity(0.3);
+		bbox.setStroke("cyan");
+		bbox.setStrokeWidth(5.0);
+		container.appendChild(bbox);
+	}
+
 	public Axis getVerticalAxis() {
 		return verticalAxis;
 	}
 		}
 		if (axis.getCombType() != null) {
 			axis.analyzeMajorMinorTicks(complexLine);
-			LOG.debug(" ++++++++ AXIS "+axis.toString());
+			LOG.trace(" ++++++++ AXIS "+axis.toString());
 		} else {
 			axis = null;
 		}
 		this.pageAnalyzer = pageAnalyzer;
 	}
 
+	public double getBoxLengthExtension() {
+		return boxLengthExtension;
+	}
+
+	public void setBoxLengthExtension(double boxLengthExtension) {
+		this.boxLengthExtension = boxLengthExtension;
+	}
+
+	public double getBoxThickness() {
+		return boxThickness;
+	}
+
+	public void setBoxThickness(double boxThickness) {
+		this.boxThickness = boxThickness;
+	}
+
 }

src/main/java/org/xmlcml/graphics/control/page/ChunkAnalyzer.java

 
 	private void debugLeaf() {
 		List<SVGElement> gList = SVGUtil.getQuerySVGElements(svgg, "./svg:g");
-		LOG.debug("G children: "+gList.size());
+		LOG.trace("G children: "+gList.size());
 		for (SVGElement g : gList) {
 			debugG();
 		}

src/main/java/org/xmlcml/graphics/control/page/ChunkAnalyzerAction.java

 				if (!(element instanceof SVGG)) {
 					throw new RuntimeException("Must operate on <g> elements");
 				}
-				LOG.debug("*********************ELEMENT "+element.getId());
+				LOG.trace("*********************ELEMENT "+element.getId());
 				analyzeChunk((SVGG)element);
 			}
 			debugFile("target/chunkAnalyzer1Axes.svg");

src/main/java/org/xmlcml/graphics/control/page/PageStyleProcessorAction.java

 	private void removeDefs() {
 		List<SVGElement> gDefs = SVGUtil.getQuerySVGElements(getSVGPage(), ".//svg:defs[svg:clipPath]");
 		for (SVGElement gDef : gDefs) {
-			LOG.debug("detached def");
+			LOG.trace("detached def");
 			gDef.detach();
 		}
 	}

src/main/java/org/xmlcml/graphics/paths/PathAnalyzer.java

 			}
 			lastXY = newPolyline.getLast();
 		}
-		LOG.debug("new points "+newPolyline.getPointList().size());
+		LOG.trace("new points "+newPolyline.getPointList().size());
 //		newPolyline.debug("NEW POLY");
 	}
 

src/main/java/org/xmlcml/graphics/paths/PolylineAnalyzer.java

 	public void analyzePolylines(SVGG svgg, List<SVGPolyline> polylines, Axis horizontalAxis, Axis verticalAxis) {
 		this.svgg = svgg;
 		for (SVGPolyline polyline : polylines) {
-			LOG.debug ("Polyline "+polyline.getBoundingBox());
+			LOG.trace("Polyline "+polyline.getBoundingBox());
 			Real2Array polylineCoords = polyline.getReal2Array();
-			LOG.debug("COORDS"+polylineCoords.size());
+			LOG.trace("COORDS "+polylineCoords.size());
 			if (horizontalAxis != null) {
 				RealArray xValueCoords = extractAndScaleCoords(horizontalAxis, polylineCoords.getXArray());
 			}

src/main/java/org/xmlcml/graphics/text/TextAnalyzer.java

 			text.setBoundingBoxCached(true);
 			rawCharacterList.add(text);
 		}
-		LOG.debug("new Raw character list "+rawCharacterList.toString());
+		LOG.trace("new Raw character list "+rawCharacterList.toString());
 	}
 	
 	/** puts all characters (usually SVGText of length 1) into
 	
 	private void createWordsInSublines() {
 		for (HorizontalCharacterList subline : horizontalCharacterList) {
-			LOG.debug("SUBLINE "+subline);
+			LOG.trace("SUBLINE "+subline);
 			LOG.trace("Guess "+subline.guessAndApplySpacingInLine());
 			WordSequence wordSequence = subline.createWords();
-			LOG.debug("WordSeq "+wordSequence.getWords().size()+" .. "+wordSequence.getStringValue());
+			LOG.trace("WordSeq "+wordSequence.getWords().size()+" .. "+wordSequence.getStringValue());
 		}
 	}