当前位置: 首页>>代码示例>>Java>>正文


Java TransformAttribute.getTransform方法代码示例

本文整理汇总了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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:AttributeValues.java

示例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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:49,代码来源:ClasspathFontPeer.java

示例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);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:49,代码来源:ClasspathFontPeer.java


注:本文中的java.awt.font.TransformAttribute.getTransform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。