本文整理汇总了Java中java.awt.AlphaComposite.getAlpha方法的典型用法代码示例。如果您正苦于以下问题:Java AlphaComposite.getAlpha方法的具体用法?Java AlphaComposite.getAlpha怎么用?Java AlphaComposite.getAlpha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.AlphaComposite
的用法示例。
在下文中一共展示了AlphaComposite.getAlpha方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAlpha
import java.awt.AlphaComposite; //导入方法依赖的package包/类
/**
* Record information about drawing done
* with the supplied <code>Composite</code>.
*/
private void checkAlpha(Composite composite) {
if (composite instanceof AlphaComposite) {
AlphaComposite alphaComposite = (AlphaComposite) composite;
float alpha = alphaComposite.getAlpha();
int rule = alphaComposite.getRule();
if (alpha != 1.0
|| (rule != AlphaComposite.SRC
&& rule != AlphaComposite.SRC_OVER)) {
mHasCompositing = true;
}
} else {
mHasCompositing = true;
}
}
示例2: checkAlpha
import java.awt.AlphaComposite; //导入方法依赖的package包/类
/**
* Record information about drawing done
* with the supplied {@code Composite}.
*/
private void checkAlpha(Composite composite) {
if (composite instanceof AlphaComposite) {
AlphaComposite alphaComposite = (AlphaComposite) composite;
float alpha = alphaComposite.getAlpha();
int rule = alphaComposite.getRule();
if (alpha != 1.0
|| (rule != AlphaComposite.SRC
&& rule != AlphaComposite.SRC_OVER)) {
mHasCompositing = true;
}
} else {
mHasCompositing = true;
}
}
示例3: forAlphaComposite
import java.awt.AlphaComposite; //导入方法依赖的package包/类
/**
* Return a CompositeType object for the specified AlphaComposite
* rule.
*/
public static CompositeType forAlphaComposite(AlphaComposite ac) {
switch (ac.getRule()) {
case AlphaComposite.CLEAR:
return Clear;
case AlphaComposite.SRC:
if (ac.getAlpha() >= 1.0f) {
return SrcNoEa;
} else {
return Src;
}
case AlphaComposite.DST:
return Dst;
case AlphaComposite.SRC_OVER:
if (ac.getAlpha() >= 1.0f) {
return SrcOverNoEa;
} else {
return SrcOver;
}
case AlphaComposite.DST_OVER:
return DstOver;
case AlphaComposite.SRC_IN:
return SrcIn;
case AlphaComposite.DST_IN:
return DstIn;
case AlphaComposite.SRC_OUT:
return SrcOut;
case AlphaComposite.DST_OUT:
return DstOut;
case AlphaComposite.SRC_ATOP:
return SrcAtop;
case AlphaComposite.DST_ATOP:
return DstAtop;
case AlphaComposite.XOR:
return AlphaXor;
default:
throw new InternalError("Unrecognized alpha rule");
}
}
示例4: canHandleComposite
import java.awt.AlphaComposite; //导入方法依赖的package包/类
private boolean canHandleComposite(Composite c) {
if (c instanceof AlphaComposite) {
AlphaComposite ac = (AlphaComposite)c;
return ac.getRule() == AlphaComposite.SRC_OVER && ac.getAlpha() >= 1f;
}
return false;
}