/** * Returns the logical bounds of this GlyphVector. * This is a bound useful for hit detection and highlighting. */ public Rectangle2D getLogicalBounds() { if (logicalBounds == null) { GeneralPath logicalBoundsPath = new GeneralPath(); for (int i = 0; i < getNumGlyphs(); i++) { Shape glyphLogicalBounds = getGlyphLogicalBounds(i); if (glyphLogicalBounds != null) { logicalBoundsPath.append(glyphLogicalBounds, false); } } logicalBounds = logicalBoundsPath.getBounds2D(); } return logicalBounds; }
/** * Returns the logical bounds of this GlyphVector. * This is a bound useful for hit detection and highlighting. */ public Rectangle2D getLogicalBounds() { if (logicalBounds == null) { GeneralPath logicalBoundsPath = new GeneralPath(); for (int i = 0; i < getNumGlyphs(); i++) { Shape glyphLogicalBounds = getGlyphLogicalBounds(i); if (glyphLogicalBounds != null) { logicalBoundsPath.append(glyphLogicalBounds, false); } } logicalBounds = logicalBoundsPath.getBounds2D(); } return logicalBounds; }
/** * Returns the logical bounds of this GlyphVector. * This is a bound useful for hit detection and highlighting. */ public Rectangle2D getLogicalBounds() { if (logicalBounds == null) { GeneralPath logicalBoundsPath = new GeneralPath(); for (int i = 0; i < getNumGlyphs(); i++) { Shape glyphLogicalBounds = getGlyphLogicalBounds(i); if (glyphLogicalBounds != null) { logicalBoundsPath.append(glyphLogicalBounds, false); } } logicalBounds = logicalBoundsPath.getBounds2D(); } return logicalBounds; }
float maxAscent = 0; float maxDescent = 0; for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Shape[] tempLogicalBounds = new Shape[getNumGlyphs()]; boolean[] rotated = new boolean[getNumGlyphs()]; for (int i = 0; i < getNumGlyphs(); i++) { for (int i = 0; i < getNumGlyphs(); i++) { if (tempLogicalBounds[i] != null) { logicalBoundsPath.append(tempLogicalBounds[i], false); for (int i = 0; i < getNumGlyphs(); i++) { double width = glyphBounds.getWidth(); if ((i < getNumGlyphs()-1) && (tempLogicalBounds[i+1] != null)) { for (int i = 0; i < getNumGlyphs(); i++) { if ((i < getNumGlyphs()-1) && (tempLogicalBounds[i+1] != null)) { System.arraycopy( tempLogicalBounds, 0, glyphLogicalBounds, 0, getNumGlyphs() );
float maxAscent = 0; float maxDescent = 0; for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Shape[] tempLogicalBounds = new Shape[getNumGlyphs()]; boolean[] rotated = new boolean[getNumGlyphs()]; for (int i = 0; i < getNumGlyphs(); i++) { for (int i = 0; i < getNumGlyphs(); i++) { if (tempLogicalBounds[i] != null) { logicalBoundsPath.append(tempLogicalBounds[i], false); for (int i = 0; i < getNumGlyphs(); i++) { double width = glyphBounds.getWidth(); if ((i < getNumGlyphs()-1) && (tempLogicalBounds[i+1] != null)) { for (int i = 0; i < getNumGlyphs(); i++) { if ((i < getNumGlyphs()-1) && (tempLogicalBounds[i+1] != null)) { System.arraycopy( tempLogicalBounds, 0, glyphLogicalBounds, 0, getNumGlyphs() );
float maxAscent = 0; float maxDescent = 0; for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; GVTGlyphMetrics glyphMetrics = getGlyphMetrics(i); Shape[] tempLogicalBounds = new Shape[getNumGlyphs()]; boolean[] rotated = new boolean[getNumGlyphs()]; for (int i = 0; i < getNumGlyphs(); i++) { for (int i = 0; i < getNumGlyphs(); i++) { if (tempLogicalBounds[i] != null) { logicalBoundsPath.append(tempLogicalBounds[i], false); for (int i = 0; i < getNumGlyphs(); i++) { double width = glyphBounds.getWidth(); if ((i < getNumGlyphs()-1) && (tempLogicalBounds[i+1] != null)) { for (int i = 0; i < getNumGlyphs(); i++) { if ((i < getNumGlyphs()-1) && (tempLogicalBounds[i+1] != null)) { System.arraycopy( tempLogicalBounds, 0, glyphLogicalBounds, 0, getNumGlyphs() );
/** * Returns a tight bounds on the GylphVector including stroking. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { // System.out.println("GlyphVector.getBounds2D Called: " + this); aci.first(); TextPaintInfo tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO); if ((bounds2D != null) && TextPaintInfo.equivilent(tpi, cacheTPI)) return bounds2D; Rectangle2D b=null; if (tpi.visible) { for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; Rectangle2D glyphBounds = glyphs[i].getBounds2D(); // System.out.println("GB["+i+"]: " + glyphBounds); if (glyphBounds == null) continue; if (b == null) b=glyphBounds; //else b = glyphBounds.createUnion(b); else b.add( glyphBounds ); } } bounds2D = b; if ( bounds2D == null ){ bounds2D = new Rectangle2D.Float(); } cacheTPI = new TextPaintInfo(tpi); return bounds2D; }
/** * Returns a tight bounds on the GylphVector including stroking. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { // System.out.println("GlyphVector.getBounds2D Called: " + this); aci.first(); TextPaintInfo tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO); if ((bounds2D != null) && TextPaintInfo.equivilent(tpi, cacheTPI)) return bounds2D; Rectangle2D b=null; if (tpi.visible) { for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; Rectangle2D glyphBounds = glyphs[i].getBounds2D(); // System.out.println("GB["+i+"]: " + glyphBounds); if (glyphBounds == null) continue; if (b == null) b=glyphBounds; //else b = glyphBounds.createUnion(b); else b.add( glyphBounds ); } } bounds2D = b; if ( bounds2D == null ){ bounds2D = new Rectangle2D.Float(); } cacheTPI = new TextPaintInfo(tpi); return bounds2D; }
/** * Returns a tight bounds on the GylphVector including stroking. */ public Rectangle2D getBounds2D(AttributedCharacterIterator aci) { // System.out.println("GlyphVector.getBounds2D Called: " + this); aci.first(); TextPaintInfo tpi = (TextPaintInfo)aci.getAttribute(PAINT_INFO); if ((bounds2D != null) && TextPaintInfo.equivilent(tpi, cacheTPI)) return bounds2D; Rectangle2D b=null; if (tpi.visible) { for (int i = 0; i < getNumGlyphs(); i++) { if (!glyphVisible[i]) continue; Rectangle2D glyphBounds = glyphs[i].getBounds2D(); // System.out.println("GB["+i+"]: " + glyphBounds); if (glyphBounds == null) continue; if (b == null) b=glyphBounds; //else b = glyphBounds.createUnion(b); else b.add( glyphBounds ); } } bounds2D = b; if ( bounds2D == null ){ bounds2D = new Rectangle2D.Float(); } cacheTPI = new TextPaintInfo(tpi); return bounds2D; }