private void updateCompoundBounds(Glyph parent,List<Glyph> childGlyphs)
    {
        float PAD = (float) 2.0;
        float minX = Float.MAX_VALUE; float minY = Float.MAX_VALUE;
        float maxX = Float.MIN_VALUE; float maxY = Float.MIN_VALUE;

        for (Glyph tmpGlyph : childGlyphs)
        {
            if(!glyphClazzOneOf(tmpGlyph, GlyphClazz.UNIT_OF_INFORMATION, GlyphClazz.STATE_VARIABLE))
            {
                if(tmpGlyph.getGlyph().size() > 0)
                    updateCompoundBounds(tmpGlyph, tmpGlyph.getGlyph());

                float w = tmpGlyph.getBbox().getW();
                float h = tmpGlyph.getBbox().getH();

                // Verify MIN and MAX x/y again:
                minX = Math.min(minX, (tmpGlyph.getBbox().getX()));
                minY = Math.min(minY, (tmpGlyph.getBbox().getY()));
                maxX = Math.max(maxX, (tmpGlyph.getBbox().getX())+w);
                maxY = Math.max(maxY, (tmpGlyph.getBbox().getY())+h);

                if (minX == Float.MAX_VALUE) minX = 0;
                if (minY == Float.MAX_VALUE) minY = 0;
                if (maxX == Float.MIN_VALUE) maxX = 0;
                if (maxY == Float.MIN_VALUE) maxY = 0;

                parent.getBbox().setX(minX - PAD);
                parent.getBbox().setY(minY - PAD);
                parent.getBbox().setW(maxX -  parent.getBbox().getX() + PAD);
                parent.getBbox().setH(maxY -  parent.getBbox().getY() + PAD);
            }
        }
    }
private void updateCompoundBounds ( Glyph parent , List < Glyph > childGlyphs ) { float PAD = ( float ) 2.0 ; float minX = Float . MAX_VALUE ; float minY = Float . MAX_VALUE ; float maxX = Float . MIN_VALUE ; float maxY = Float . MIN_VALUE ; for ( Glyph tmpGlyph : childGlyphs ) { if ( ! glyphClazzOneOf ( tmpGlyph , GlyphClazz . UNIT_OF_INFORMATION , GlyphClazz . STATE_VARIABLE ) ) { if ( tmpGlyph . getGlyph ( ) . size ( ) > 0 ) updateCompoundBounds ( tmpGlyph , tmpGlyph . getGlyph ( ) ) ; float w = tmpGlyph . getBbox ( ) . getW ( ) ; float h = tmpGlyph . getBbox ( ) . getH ( ) ; minX = Math . min ( minX , ( tmpGlyph . getBbox ( ) . getX ( ) ) ) ; minY = Math . min ( minY , ( tmpGlyph . getBbox ( ) . getY ( ) ) ) ; maxX = Math . max ( maxX , ( tmpGlyph . getBbox ( ) . getX ( ) ) + w ) ; maxY = Math . max ( maxY , ( tmpGlyph . getBbox ( ) . getY ( ) ) + h ) ; if ( minX == Float . MAX_VALUE ) minX = 0 ; if ( minY == Float . MAX_VALUE ) minY = 0 ; if ( maxX == Float . MIN_VALUE ) maxX = 0 ; if ( maxY == Float . MIN_VALUE ) maxY = 0 ; parent . getBbox ( ) . setX ( minX - PAD ) ; parent . getBbox ( ) . setY ( minY - PAD ) ; parent . getBbox ( ) . setW ( maxX - parent . getBbox ( ) . getX ( ) + PAD ) ; parent . getBbox ( ) . setH ( maxY - parent . getBbox ( ) . getY ( ) + PAD ) ; } } }
Updates bounds of a compound node ( i.e. complex glyph ) from its children .
@param parent compound glyph.
@param childGlyphs related children of parent .