- java.lang.Object
-  
      - java.awt.font.GraphicAttribute
 
-  
       - 已知直接子类:
-  
         ImageGraphicAttribute,ShapeGraphicAttribute
 
 public abstract class GraphicAttribute extends Object 此类与CHAR_REPLACEMENT属性一起使用。GraphicAttribute类表示嵌入在文本中的图形。 客户端将此类子类化以实现自己的char替换图形。 希望在文本中嵌入形状和图像的客户端不需要对此类进行子类化。 相反,客户可以使用ShapeGraphicAttribute和ImageGraphicAttribute类。子类必须确保它们的对象在构造后是不可变的。 变异一个 GraphicAttribute这是在使用TextLayout导致从不确定的行为TextLayout。
-  
        
       -  
             字段汇总字段 变量和类型 字段 描述 static intBOTTOM_ALIGNMENT将图形底部与线条底部对齐。static intCENTER_BASELINE将图形的原点与线的中心基线对齐。static intHANGING_BASELINE将图形的原点与线的悬挂基线对齐。static intROMAN_BASELINE将图形的原点与线的罗马基线对齐。static intTOP_ALIGNMENT将图形顶部对齐到顶部。
 -  
             构造方法摘要构造方法 变量 构造器 描述 protectedGraphicAttribute(int alignment)构造一个GraphicAttribute。
 -  
             方法摘要所有方法 实例方法 抽象方法 具体的方法 变量和类型 方法 描述 abstract voiddraw(Graphics2D graphics, float x, float y)在指定位置呈现此GraphicAttribute。abstract floatgetAdvance()返回此GraphicAttribute。intgetAlignment()返回此GraphicAttribute的对齐方式。abstract floatgetAscent()返回此GraphicAttribute的上升。Rectangle2DgetBounds()返回一个Rectangle2D,它包含此GraphicAttribute绘制的相对于渲染位置的所有位。abstract floatgetDescent()返回此GraphicAttribute的下降。GlyphJustificationInfogetJustificationInfo()返回此GraphicAttribute的对齐信息。ShapegetOutline(AffineTransform tx)返回Shape,表示此GraphicAttribute呈现的区域。
 
-  
             
-  
        
       -  
             字段详细信息-  TOP_ALIGNMENTpublic static final int TOP_ALIGNMENT 将图形顶部对齐到顶部。- 另请参见:
- 常数字段值
 
 -  BOTTOM_ALIGNMENTpublic static final int BOTTOM_ALIGNMENT 将图形底部与线条底部对齐。- 另请参见:
- 常数字段值
 
 -  ROMAN_BASELINEpublic static final int ROMAN_BASELINE 将图形的原点与线的罗马基线对齐。- 另请参见:
- 常数字段值
 
 -  CENTER_BASELINEpublic static final int CENTER_BASELINE 将图形的原点与线的中心基线对齐。- 另请参见:
- 常数字段值
 
 -  HANGING_BASELINEpublic static final int HANGING_BASELINE 将图形的原点与线的悬挂基线对齐。- 另请参见:
- 常数字段值
 
 
-  
 -  
             构造方法详细信息-  GraphicAttributeprotected GraphicAttribute(int alignment) 构造一个GraphicAttribute。 子类使用它来定义图形的对齐方式。- 参数
-  
              alignment- 表示GraphicAttribute对齐字段之一的int
- 异常
-  
              IllegalArgumentException- 如果对齐不是五个定义值之一。
 
 
-  
 -  
             方法详细信息-  getAscentpublic abstract float getAscent() 返回此GraphicAttribute的上升。 图形可以在其上升之上呈现。- 结果
- 
               这个 
              GraphicAttribute。
- 另请参见:
-  
              getBounds()
 
 -  getDescentpublic abstract float getDescent() 返回此GraphicAttribute的下降。 图形可以在其下降之下呈现。- 结果
- 
               这个 
              GraphicAttribute的血统。
- 另请参见:
-  
              getBounds()
 
 -  getAdvancepublic abstract float getAdvance() 返回此GraphicAttribute。GraphicAttribute对象的前进是从渲染图形的点到下一个字符或图形的渲染点的距离。 图形可以超越其前进而呈现- 结果
- 
               这个 
              GraphicAttribute。
- 另请参见:
-  
              getBounds()
 
 -  getBoundspublic Rectangle2D getBounds() 返回一个Rectangle2D,它包含此GraphicAttribute相对于渲染位置绘制的所有位。 图形可以超出其原点,上升,下降或前进; 但如果是,则此方法的实现必须指示图形的呈现位置。 默认边界是矩形(0,-ascent,advance,ascent + descent)。- 结果
-  
              Rectangle2D,它包含此GraphicAttribute呈现的所有位。
 
 -  getOutlinepublic Shape getOutline(AffineTransform tx) 返回Shape,表示此GraphicAttribute呈现的区域。 当请求TextLayout返回文本轮廓时使用此选项。 (未转换的)形状不得延伸到getBounds返回的矩形边界getBounds。 默认实现返回由getBounds()返回的矩形,由提供的AffineTransform(如果存在)进行转换。- 参数
-  
              tx- 可选的AffineTransform,适用于此GraphicAttribute的大纲。 这可以为null。
- 结果
- 
               表示此图形属性的 
              Shape,适用于抚摸或填充。
- 从以下版本开始:
- 1.6
 
 -  drawpublic abstract void draw(Graphics2D graphics, float x, float y) 在指定位置呈现此GraphicAttribute。- 参数
-  
              graphics- 要将图形渲染到其中的Graphics2D
-  
              x- 呈现图形的用户空间X坐标
-  
              y- 呈现图形的用户空间Y坐标
 
 -  getAlignmentpublic final int getAlignment() 返回此GraphicAttribute的对齐方式。 对齐可以是特定基线,也可以是线的绝对顶部或底部。- 结果
- 
               这个 
              GraphicAttribute的对齐方式。
 
 -  getJustificationInfopublic GlyphJustificationInfo getJustificationInfo() 返回此GraphicAttribute的对齐信息。 子类可以重写此方法以提供不同的对齐信息。- 结果
-  
              包含此GraphicAttribute的对齐信息的GlyphJustificationInfo对象。
 
 
-  
 
-