本文整理汇总了Java中net.rim.device.api.ui.Graphics.pushRegion方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.pushRegion方法的具体用法?Java Graphics.pushRegion怎么用?Java Graphics.pushRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.rim.device.api.ui.Graphics
的用法示例。
在下文中一共展示了Graphics.pushRegion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setClip
import net.rim.device.api.ui.Graphics; //导入方法依赖的package包/类
public void setClip(Object graphics, int x, int y, int width, int height) {
Graphics g = (net.rim.device.api.ui.Graphics) graphics;
net.rim.device.api.ui.Font oldFont = g.getFont();
int oldColor = g.getColor();
int oldAlpha = g.getGlobalAlpha();
while (g.getContextStackSize() > 1) {
g.popContext();
}
g.pushRegion(x, y, width, height, 0, 0);
g.translate(-g.getTranslateX(), -g.getTranslateY());
/**
* applying a clip will automatically
* reset some information that we need to keep track of
* manually (it seems).
*/
g.setFont(oldFont == null ? (net.rim.device.api.ui.Font) getDefaultFont() : oldFont);
g.setColor(oldColor);
g.setGlobalAlpha(oldAlpha);
}
示例2: clipOnLWUITBounds
import net.rim.device.api.ui.Graphics; //导入方法依赖的package包/类
/**
* Clips the RIM native graphics based on the component hierarchy within LWUIT
* so the native RIM component doesn't paint itself above other components such
* as the forms title.
*/
private int clipOnLWUITBounds(Component lwuitComponent, Graphics rimGraphics) {
int result = 0;
Component parent = lwuitComponent;
while (parent != null) {
int x = parent.getAbsoluteX() + parent.getScrollX();
int y = parent.getAbsoluteY() + parent.getScrollY();
rimGraphics.pushRegion(x, y, parent.getWidth(), parent.getHeight(), 0, 0);
rimGraphics.translate(-rimGraphics.getTranslateX(), -rimGraphics.getTranslateY());
parent = parent.getParent();
result++;
}
return result;
}
示例3: clipRect
import net.rim.device.api.ui.Graphics; //导入方法依赖的package包/类
public void clipRect(Object graphics, int x, int y, int width, int height) {
Graphics g = (Graphics) graphics;
g.pushRegion(x, y, width, height, 0, 0);
g.translate(-g.getTranslateX(), -g.getTranslateY());
}