本文整理汇总了Java中java.awt.font.TransformAttribute.getTransform方法的典型用法代码示例。如果您正苦于以下问题:Java TransformAttribute.getTransform方法的具体用法?Java TransformAttribute.getTransform怎么用?Java TransformAttribute.getTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.font.TransformAttribute
的用法示例。
在下文中一共展示了TransformAttribute.getTransform方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTransform
import java.awt.font.TransformAttribute; //导入方法依赖的package包/类
public void setTransform(TransformAttribute f) {
this.transform = (f == null || f.isIdentity())
? DEFAULT.transform
: f.getTransform();
updateDerivedTransforms();
update(ETRANSFORM);
}
示例2: setStandardAttributes
import java.awt.font.TransformAttribute; //导入方法依赖的package包/类
protected void setStandardAttributes (String name, Map attribs)
{
String family = this.familyName;
AffineTransform trans = this.transform;
float size = this.size;
int style = this.style;
if (attribs.containsKey (TextAttribute.FAMILY))
family = (String) attribs.get (TextAttribute.FAMILY);
if (name == null)
name = "Default";
if (attribs.containsKey (TextAttribute.WEIGHT))
{
Float weight = (Float) attribs.get (TextAttribute.WEIGHT);
if (weight.floatValue () >= TextAttribute.WEIGHT_BOLD.floatValue ())
style += Font.BOLD;
}
if (attribs.containsKey (TextAttribute.POSTURE))
{
Float posture = (Float) attribs.get (TextAttribute.POSTURE);
if (posture.floatValue () >= TextAttribute.POSTURE_OBLIQUE.floatValue ())
style += Font.ITALIC;
}
if (attribs.containsKey (TextAttribute.SIZE))
{
Float sz = (Float) attribs.get (TextAttribute.SIZE);
size = sz.floatValue ();
// Pango doesn't accept 0 as a font size.
if (size < 1)
size = 1;
}
else
size = 12;
if (attribs.containsKey (TextAttribute.TRANSFORM))
{
TransformAttribute ta = (TransformAttribute)
attribs.get(TextAttribute.TRANSFORM);
trans = ta.getTransform ();
}
setStandardAttributes (name, family, style, size, trans);
}
示例3: setStandardAttributes
import java.awt.font.TransformAttribute; //导入方法依赖的package包/类
protected void setStandardAttributes (String name, Map attribs)
{
String family = this.familyName;
AffineTransform trans = this.transform;
float size = this.size;
int style = this.style;
if (attribs.containsKey (TextAttribute.FAMILY))
family = (String) attribs.get (TextAttribute.FAMILY);
if (name == null)
name = "Default";
if (attribs.containsKey (TextAttribute.WEIGHT))
{
Float weight = (Float) attribs.get (TextAttribute.WEIGHT);
if (weight.floatValue () >= TextAttribute.WEIGHT_BOLD.floatValue ())
style += Font.BOLD;
}
if (attribs.containsKey (TextAttribute.POSTURE))
{
Float posture = (Float) attribs.get (TextAttribute.POSTURE);
if (posture.floatValue () >= TextAttribute.POSTURE_OBLIQUE.floatValue ())
style += Font.ITALIC;
}
if (attribs.containsKey (TextAttribute.SIZE))
{
Float sz = (Float) attribs.get (TextAttribute.SIZE);
size = sz.floatValue ();
// Pango doesn't accept 0 as a font size.
if (size < 1)
size = 1;
}
else
size = 12;
if (attribs.containsKey (TextAttribute.TRANSFORM))
{
TransformAttribute ta = (TransformAttribute)
attribs.get(TextAttribute.TRANSFORM);
trans = ta.getTransform ();
}
setStandardAttributes (name, family, style, size, trans);
}