diff --git a/core/src/main/java/edu/umd/cs/piccolo/PCamera.java b/core/src/main/java/edu/umd/cs/piccolo/PCamera.java index af1def3..6604b4a 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/PCamera.java +++ b/core/src/main/java/edu/umd/cs/piccolo/PCamera.java @@ -356,7 +356,7 @@ paintCameraView(paintContext); paintDebugInfo(paintContext); - paintContext.popTransform(viewTransform); + paintContext.popTransform(); paintContext.popClip(getBoundsReference()); } diff --git a/core/src/main/java/edu/umd/cs/piccolo/PNode.java b/core/src/main/java/edu/umd/cs/piccolo/PNode.java index 858fc50..eac0a17 100644 --- a/core/src/main/java/edu/umd/cs/piccolo/PNode.java +++ b/core/src/main/java/edu/umd/cs/piccolo/PNode.java @@ -2800,7 +2800,7 @@ paintAfterChildren(paintContext); paintContext.popTransparency(transparency); - paintContext.popTransform(transform); + paintContext.popTransform(); } } @@ -2836,7 +2836,7 @@ * @param backgroundPaint paint to fill the image with before drawing this * node, may be null * - * @return a new image representing this node and its descendents + * @return a new image representing this node and its descendants */ public Image toImage(final int width, final int height, final Paint backgroundPaint) { BufferedImage result; diff --git a/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java b/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java index a76e39e..8c2e9ea 100644 --- a/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java +++ b/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java @@ -84,8 +84,13 @@ /** Whether this node is currently being edited. */ protected boolean editing; + /** Insets represent how far away from the bounding box text will be drawn. */ protected Insets insets = new Insets(0, 0, 0, 0); + + /** Whether width will be forced to match containing text's height. */ protected boolean constrainHeightToTextHeight = true; + + /** Whether width will be forced to match containing text's width. */ protected boolean constrainWidthToTextWidth = true; /** @@ -519,7 +524,7 @@ } /** - * Get the height of the font at the beginning of the document + * Get the height of the font at the beginning of the document. */ public double getInitialFontHeight() { @@ -535,6 +540,7 @@ return curFM.getMaxAscent() + curFM.getMaxDescent() + curFM.getLeading(); } + /** {@inheritDoc} */ protected void paint(final PPaintContext paintContext) { if (lines == null || lines.length == 0) { return; @@ -595,6 +601,9 @@ } } + /** + * {@inheritDoc} + */ public void fullPaint(final PPaintContext paintContext) { if (!editing) { super.fullPaint(paintContext); @@ -661,45 +670,45 @@ */ protected static class RunInfo { public int startIndex; - public int endIndex; - - public RunInfo() { - } + public int endIndex; public RunInfo(final int runStart, final int runLimit) { startIndex = runStart; endIndex = runLimit; } + /** + * Returns whether the run is empty. + * + * @return true is run is empty + */ public boolean isEmpty() { return startIndex == endIndex; } + /** + * Returns the length of the run. + * + * @return length of run + */ public int length() { return endIndex - startIndex; } - } - - /** - * Class to represent an integer run and the font in that run. - */ - protected static class MetricsRunInfo extends RunInfo { - public FontMetrics metrics; - - public MetricsRunInfo() { - super(); - } - } + } /** * The info for rendering and computing the bounds of a line. */ protected static class LineInfo { + /** Segments which make up this line's formatting segments. */ public List segments; public double maxAscent; public double maxDescent; public double leading; + /** + * Creates a LineInfo that contains no segments. + */ public LineInfo() { segments = new ArrayList(); }