本文整理汇总了Java中com.codename1.ui.Form.setGlassPane方法的典型用法代码示例。如果您正苦于以下问题:Java Form.setGlassPane方法的具体用法?Java Form.setGlassPane怎么用?Java Form.setGlassPane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.ui.Form
的用法示例。
在下文中一共展示了Form.setGlassPane方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showOn
import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
* Install the glass tutorial on a form and seamlessly dismiss it when no longer necessary
* @param f the form
*/
public void showOn(Form f) {
Painter oldPane = f.getGlassPane();
f.setGlassPane(this);
Dialog dummy = new Dialog() {
public void keyReleased(int i) {
dispose();
}
};
int oldTint = f.getTintColor();
f.setTintColor(0);
dummy.getDialogStyle().setBgTransparency(0);
dummy.setDisposeWhenPointerOutOfBounds(true);
dummy.show(0, Display.getInstance().getDisplayHeight() - 2, 0, Display.getInstance().getDisplayWidth() - 2, true, true);
f.setTintColor(oldTint);
f.setGlassPane(oldPane);
}
示例2: startBackTransition
import com.codename1.ui.Form; //导入方法依赖的package包/类
void startBackTransition(final Form currentForm, Form destination) {
final Transition t = destination.getTransitionOutAnimator().copy(true);
if(t instanceof CommonTransitions) {
Transition originalTransition = currentForm.getTransitionOutAnimator();
currentForm.setTransitionOutAnimator(CommonTransitions.createEmpty());
Form blank = new Form() {
protected boolean shouldSendPointerReleaseToOtherForm() {
return true;
}
};
blank.addPointerDraggedListener(pointerDragged);
blank.addPointerReleasedListener(pointerReleased);
blank.addPointerPressedListener(pointerPressed);
blank.setTransitionInAnimator(CommonTransitions.createEmpty());
blank.setTransitionOutAnimator(CommonTransitions.createEmpty());
blank.show();
currentForm.setTransitionOutAnimator(originalTransition);
((CommonTransitions)t).setMotion(new LazyValue<Motion>() {
public Motion get(Object... args) {
return new ManualMotion(((Integer)args[0]).intValue(), ((Integer)args[1]).intValue(), ((Integer)args[2]).intValue());
}
});
t.init(currentForm, destination);
t.initTransition();
blank.setGlassPane(new Painter() {
public void paint(Graphics g, Rectangle rect) {
t.animate();
t.paint(g);
}
});
}
}
示例3: installGlassPane
import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
* Installs a glass pane on the given form making sure to make it a painter
* chain only if required by existing painter
*
* @param f form on which to install the chain
* @param p painter to install
*/
public static void installGlassPane(Form f, Painter p) {
Painter existing = f.getGlassPane();
if(existing == null) {
f.setGlassPane(p);
return;
}
if(existing instanceof PainterChain) {
f.setGlassPane(((PainterChain)existing).addPainter(p));
} else {
PainterChain pc = new PainterChain(new Painter[] {existing, p});
f.setGlassPane(pc);
}
}
示例4: removeGlassPane
import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
* Removes a glass pane from the given form, this is the opposite operation for the
* install glass pane
*
* @param f form from which to remove the chain
* @param p painter to remove
*/
public static void removeGlassPane(Form f, Painter p) {
Painter existing = f.getGlassPane();
if(existing == null) {
return;
}
if(existing == p) {
f.setGlassPane(null);
return;
}
if(existing instanceof PainterChain) {
PainterChain pc = (PainterChain)existing;
if(pc.chain.length == 1) {
f.setGlassPane(null);
} else {
Vector v = new Vector();
int plen = pc.chain.length;
for(int iter = 0 ; iter < plen ; iter++) {
if(pc.chain[iter] != p) {
v.addElement(pc.chain[iter]);
}
}
if(v.size() == 0) {
f.setGlassPane(null);
return;
}
Painter[] newChain = new Painter[v.size()];
int clen = newChain.length;
for(int iter = 0 ; iter < clen ; iter++) {
newChain[iter] = (Painter)v.elementAt(iter);
}
pc.chain = newChain;
f.repaint(); // Since setGlassPane was not called and still the painter changed, we need to call repaint
}
}
}