Java Doc for FontRenderContext.java in  » 6.0-JDK-Core » AWT » java » awt » font » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt.font 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.font.FontRenderContext

FontRenderContext
public class FontRenderContext (Code)
The FontRenderContext class is a container for the information needed to correctly measure text. The measurement of text can vary because of rules that map outlines to pixels, and rendering hints provided by an application.

One such piece of information is a transform that scales typographical points to pixels. (A point is defined to be exactly 1/72 of an inch, which is slightly different than the traditional mechanical measurement of a point.) A character that is rendered at 12pt on a 600dpi device might have a different size than the same character rendered at 12pt on a 72dpi device because of such factors as rounding to pixel boundaries and hints that the font designer may have specified.

Anti-aliasing and Fractional-metrics specified by an application can also affect the size of a character because of rounding to pixel boundaries.

Typically, instances of FontRenderContext are obtained from a java.awt.Graphics2D Graphics2D object. A FontRenderContext which is directly constructed will most likely not represent any actual graphics device, and may lead to unexpected or incorrect results.


See Also:   java.awt.RenderingHints.KEY_TEXT_ANTIALIASING
See Also:   java.awt.RenderingHints.KEY_FRACTIONALMETRICS
See Also:   java.awt.Graphics2D.getFontRenderContext
See Also:   java.awt.font.LineMetrics




Constructor Summary
protected  FontRenderContext()
     Constructs a new FontRenderContext object.
public  FontRenderContext(AffineTransform tx, boolean isAntiAliased, boolean usesFractionalMetrics)
     Constructs a FontRenderContext object from an optional AffineTransform and two boolean values that determine if the newly constructed object has anti-aliasing or fractional metrics. In each case the boolean values true and false correspond to the rendering hint values ON and OFF respectively.

To specify other hint values, use the constructor which specifies the rendering hint values as parameters : FontRenderContext.FontRenderContext(AffineTransform,Object,Object) .
Parameters:
  tx - the transform which is used to scale typographical pointsto pixels in this FontRenderContext.

public  FontRenderContext(AffineTransform tx, Object aaHint, Object fmHint)
     Constructs a FontRenderContext object from an optional AffineTransform and two Object values that determine if the newly constructed object has anti-aliasing or fractional metrics.
Parameters:
  tx - the transform which is used to scale typographical pointsto pixels in this FontRenderContext.

Method Summary
public  booleanequals(Object obj)
     Return true if obj is an instance of FontRenderContext and has the same transform, antialiasing, and fractional metrics values as this.
public  booleanequals(FontRenderContext rhs)
     Return true if rhs has the same transform, antialiasing, and fractional metrics values as this.
public  ObjectgetAntiAliasingHint()
     Return the text anti-aliasing rendering mode hint used in this FontRenderContext.
public  ObjectgetFractionalMetricsHint()
     Return the text fractional metrics rendering mode hint used in this FontRenderContext.
public  AffineTransformgetTransform()
     Gets the transform that is used to scale typographical points to pixels in this FontRenderContext.
public  intgetTransformType()
    
public  inthashCode()
     Return a hashcode for this FontRenderContext.
public  booleanisAntiAliased()
     Returns a boolean which indicates whether or not some form of antialiasing is specified by this FontRenderContext.
public  booleanisTransformed()
     Indicates whether or not this FontRenderContext object measures text in a transformed render context.
public  booleanusesFractionalMetrics()
     Returns a boolean which whether text fractional metrics mode is used in this FontRenderContext.


Constructor Detail
FontRenderContext
protected FontRenderContext()(Code)
Constructs a new FontRenderContext object.



FontRenderContext
public FontRenderContext(AffineTransform tx, boolean isAntiAliased, boolean usesFractionalMetrics)(Code)
Constructs a FontRenderContext object from an optional AffineTransform and two boolean values that determine if the newly constructed object has anti-aliasing or fractional metrics. In each case the boolean values true and false correspond to the rendering hint values ON and OFF respectively.

To specify other hint values, use the constructor which specifies the rendering hint values as parameters : FontRenderContext.FontRenderContext(AffineTransform,Object,Object) .
Parameters:
  tx - the transform which is used to scale typographical pointsto pixels in this FontRenderContext. If null, anidentity transform is used.
Parameters:
  isAntiAliased - determines if the newly constructed objecthas anti-aliasing.
Parameters:
  usesFractionalMetrics - determines if the newly constructedobject has fractional metrics.




FontRenderContext
public FontRenderContext(AffineTransform tx, Object aaHint, Object fmHint)(Code)
Constructs a FontRenderContext object from an optional AffineTransform and two Object values that determine if the newly constructed object has anti-aliasing or fractional metrics.
Parameters:
  tx - the transform which is used to scale typographical pointsto pixels in this FontRenderContext. If null, anidentity tranform is used.
Parameters:
  aaHint - - one of the text antialiasing rendering hint valuesdefined in java.awt.RenderingHints java.awt.RenderingHints.Any other value will throw IllegalArgumentException.java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT VALUE_TEXT_ANTIALIAS_DEFAULTmay be specified, in which case the mode used is implementationdependent.
Parameters:
  fmHint - - one of the text fractional rendering hint values definedin java.awt.RenderingHints java.awt.RenderingHints.java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT VALUE_FRACTIONALMETRICS_DEFAULTmay be specified, in which case the mode used is implementationdependent.Any other value will throw IllegalArgumentException
throws:
  IllegalArgumentException - if the hints are not one of thelegal values.
since:
   1.6




Method Detail
equals
public boolean equals(Object obj)(Code)
Return true if obj is an instance of FontRenderContext and has the same transform, antialiasing, and fractional metrics values as this.
Parameters:
  obj - the object to test for equality true if the specified object is equal tothis FontRenderContext; falseotherwise.



equals
public boolean equals(FontRenderContext rhs)(Code)
Return true if rhs has the same transform, antialiasing, and fractional metrics values as this.
Parameters:
  rhs - the FontRenderContext to test for equality true if rhs is equal tothis FontRenderContext; falseotherwise.
since:
   1.4



getAntiAliasingHint
public Object getAntiAliasingHint()(Code)
Return the text anti-aliasing rendering mode hint used in this FontRenderContext. This will be one of the text antialiasing rendering hint values defined in java.awt.RenderingHints java.awt.RenderingHints . text anti-aliasing rendering mode hint used in this FontRenderContext.
since:
   1.6



getFractionalMetricsHint
public Object getFractionalMetricsHint()(Code)
Return the text fractional metrics rendering mode hint used in this FontRenderContext. This will be one of the text fractional metrics rendering hint values defined in java.awt.RenderingHints java.awt.RenderingHints . the text fractional metrics rendering mode hint used in this FontRenderContext.
since:
   1.6



getTransform
public AffineTransform getTransform()(Code)
Gets the transform that is used to scale typographical points to pixels in this FontRenderContext. the AffineTransform of thisFontRenderContext.
See Also:   AffineTransform



getTransformType
public int getTransformType()(Code)
Returns the integer type of the affine transform for this FontRenderContext as specified by java.awt.geom.AffineTransform.getType the type of the transform.
See Also:   AffineTransform
since:
   1.6



hashCode
public int hashCode()(Code)
Return a hashcode for this FontRenderContext.



isAntiAliased
public boolean isAntiAliased()(Code)
Returns a boolean which indicates whether or not some form of antialiasing is specified by this FontRenderContext. Call FontRenderContext.getAntiAliasingHint() getAntiAliasingHint() for the specific rendering hint value. true, if text is anti-aliased in thisFontRenderContext; false otherwise.
See Also:   java.awt.RenderingHints.KEY_TEXT_ANTIALIASING
See Also:   FontRenderContext.FontRenderContext(AffineTransform,boolean,boolean)
See Also:   FontRenderContext.FontRenderContext(AffineTransform,Object,Object)



isTransformed
public boolean isTransformed()(Code)
Indicates whether or not this FontRenderContext object measures text in a transformed render context. true if this FontRenderContextobject has a non-identity AffineTransform attribute.false otherwise.
See Also:   java.awt.font.FontRenderContext.getTransform
since:
   1.6



usesFractionalMetrics
public boolean usesFractionalMetrics()(Code)
Returns a boolean which whether text fractional metrics mode is used in this FontRenderContext. Call FontRenderContext.getFractionalMetricsHint() getFractionalMetricsHint() to obtain the corresponding rendering hint value. true, if layout should be performed withfractional metrics; false otherwise.in this FontRenderContext.
See Also:   java.awt.RenderingHints.KEY_FRACTIONALMETRICS
See Also:   FontRenderContext.FontRenderContext(AffineTransform,boolean,boolean)
See Also:   FontRenderContext.FontRenderContext(AffineTransform,Object,Object)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.