< prev index next >

src/java.desktop/share/classes/sun/font/StandardGlyphVector.java

Print this page




 428     }
 429 
 430     // relative to gv origin
 431     public Shape getGlyphOutline(int ix) {
 432         return getGlyphsOutline(ix, 1, 0, 0);
 433     }
 434 
 435     // relative to gv origin offset by x, y
 436     public Shape getGlyphOutline(int ix, float x, float y) {
 437         return getGlyphsOutline(ix, 1, x, y);
 438     }
 439 
 440     public Point2D getGlyphPosition(int ix) {
 441         initPositions();
 442 
 443         ix *= 2;
 444         return new Point2D.Float(positions[ix], positions[ix + 1]);
 445     }
 446 
 447     public void setGlyphPosition(int ix, Point2D pos) {




 448         initPositions();
 449 
 450         int ix2 = ix << 1;
 451         positions[ix2] = (float)pos.getX();
 452         positions[ix2 + 1] = (float)pos.getY();
 453 

 454         clearCaches(ix);

 455         addFlags(FLAG_HAS_POSITION_ADJUSTMENTS);
 456     }
 457 
 458     public AffineTransform getGlyphTransform(int ix) {
 459         if (ix < 0 || ix >= glyphs.length) {
 460             throw new IndexOutOfBoundsException("ix = " + ix);
 461         }
 462         if (gti != null) {
 463             return gti.getGlyphTransform(ix);
 464         }
 465         return null; // spec'd as returning null
 466     }
 467 
 468     public void setGlyphTransform(int ix, AffineTransform newTX) {
 469         if (ix < 0 || ix >= glyphs.length) {
 470             throw new IndexOutOfBoundsException("ix = " + ix);
 471         }
 472 
 473         if (gti == null) {
 474             if (newTX == null || newTX.isIdentity()) {




 428     }
 429 
 430     // relative to gv origin
 431     public Shape getGlyphOutline(int ix) {
 432         return getGlyphsOutline(ix, 1, 0, 0);
 433     }
 434 
 435     // relative to gv origin offset by x, y
 436     public Shape getGlyphOutline(int ix, float x, float y) {
 437         return getGlyphsOutline(ix, 1, x, y);
 438     }
 439 
 440     public Point2D getGlyphPosition(int ix) {
 441         initPositions();
 442 
 443         ix *= 2;
 444         return new Point2D.Float(positions[ix], positions[ix + 1]);
 445     }
 446 
 447     public void setGlyphPosition(int ix, Point2D pos) {
 448         if (ix < 0 || ix > glyphs.length) {
 449             throw new IndexOutOfBoundsException("ix = " + ix);
 450         }
 451         
 452         initPositions();
 453                 
 454         int ix2 = ix << 1;
 455         positions[ix2] = (float)pos.getX();
 456         positions[ix2 + 1] = (float)pos.getY();
 457 
 458         if (ix < glyphs.length) {
 459             clearCaches(ix);
 460         }           
 461         addFlags(FLAG_HAS_POSITION_ADJUSTMENTS);
 462     }
 463 
 464     public AffineTransform getGlyphTransform(int ix) {
 465         if (ix < 0 || ix >= glyphs.length) {
 466             throw new IndexOutOfBoundsException("ix = " + ix);
 467         }
 468         if (gti != null) {
 469             return gti.getGlyphTransform(ix);
 470         }
 471         return null; // spec'd as returning null
 472     }
 473 
 474     public void setGlyphTransform(int ix, AffineTransform newTX) {
 475         if (ix < 0 || ix >= glyphs.length) {
 476             throw new IndexOutOfBoundsException("ix = " + ix);
 477         }
 478 
 479         if (gti == null) {
 480             if (newTX == null || newTX.isIdentity()) {


< prev index next >