本文整理汇总了Java中com.codename1.ui.Form.revalidate方法的典型用法代码示例。如果您正苦于以下问题:Java Form.revalidate方法的具体用法?Java Form.revalidate怎么用?Java Form.revalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.ui.Form
的用法示例。
在下文中一共展示了Form.revalidate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateComponentCount
import com.codename1.ui.Form; //导入方法依赖的package包/类
private void updateComponentCount() {
int cc = getComponentCount();
int modelCount = model.getSize();
if(cc != modelCount) {
if(cc < modelCount) {
for(int iter = cc ; iter < modelCount ; iter++) {
addComponent(new Entry(iter));
}
} else {
while(getComponentCount() > modelCount) {
removeComponent(getComponentAt(getComponentCount() - 1));
}
}
Form f = getComponentForm();
if(f != null) {
f.revalidate();
}
}
}
示例2: createMorphEffect
import com.codename1.ui.Form; //导入方法依赖的package包/类
private void createMorphEffect(Label titleLabel) {
// animate the components out of the previous form if we are coming in from the login form
Form parent = Display.getInstance().getCurrent();
if(parent.getUIID().equals("MainForm")) {
for(Component cmp : parent.getContentPane()) {
cmp.setX(parent.getWidth());
}
// moves all the components outside of the content pane to the right while fading them out over 400ms
parent.getContentPane().animateUnlayoutAndWait(400, 0);
parent.getContentPane().removeAll();
// we can't mutate a form into a component in another form so we need to convert the background to an image and then morph that
// this is especially easy since we already removed all the components
Label dummy = new Label();
dummy.setShowEvenIfBlank(true);
dummy.setUIID("Container");
dummy.setUnselectedStyle(new Style(parent.getUnselectedStyle()));
parent.setUIID("Form");
// special case to remove status bar on iOS 7
parent.getTitleArea().removeAll();
parent.setLayout(new BorderLayout());
parent.addComponent(BorderLayout.CENTER, dummy);
parent.revalidate();
// animate the main panel to the new location at the top title area of the screen
dummy.setName("fullScreen");
titleLabel.setName("titleImage");
parent.setTransitionOutAnimator(MorphTransition.create(1100).morph("fullScreen", "titleImage"));
}
}
示例3: resetSearchResult
import com.codename1.ui.Form; //导入方法依赖的package包/类
private void resetSearchResult(Form f)
{
ui.hideComponent(ui.findCtnSearchEmptyResult(f));
ui.findCtlSearchResult(f).setModel(new DefaultListModel<Map>(new ArrayList<Map>()));
f.revalidate();
}
示例4: refreshTheme
import com.codename1.ui.Form; //导入方法依赖的package包/类
private void refreshTheme(Form parentForm) {
Form c = Display.getInstance().getCurrent();
c.refreshTheme();
parentForm.refreshTheme();
parentForm.revalidate();
}
示例5: showSplashAnimation
import com.codename1.ui.Form; //导入方法依赖的package包/类
private void showSplashAnimation() {
Form splash = new Form();
splash.setUIID("Splash");
splash.getContentPane().setUIID("Container");
splash.getTitleArea().setUIID("Container");
BorderLayout border = new BorderLayout();
border.setCenterBehavior(BorderLayout.CENTER_BEHAVIOR_CENTER_ABSOLUTE);
splash.setLayout(border);
splash.setScrollable(false);
Label title = new Label("Kitchen Sink Demo");
title.setUIID("SplashTitle");
Label subtitle = new Label("By Codename One");
subtitle.setUIID("SplashSubTitle");
splash.addComponent(BorderLayout.NORTH, title);
splash.addComponent(BorderLayout.SOUTH, subtitle);
Label beaker = new Label(res.getImage("beaker.png"));
final Label beakerLogo = new Label(res.getImage("beaker_logo.png"));
beakerLogo.setVisible(false);
Container layeredLayout = new Container(new LayeredLayout());
splash.addComponent(BorderLayout.CENTER, layeredLayout);
layeredLayout.addComponent(beaker);
final Container logoParent = new Container(new BorderLayout());
layeredLayout.addComponent(logoParent);
logoParent.addComponent(BorderLayout.CENTER, beakerLogo);
splash.revalidate();
Display.getInstance().callSerially(new Runnable() {
public void run() {
beakerLogo.setVisible(true);
beakerLogo.setX(0);
beakerLogo.setY(0);
beakerLogo.setWidth(3);
beakerLogo.setHeight(3);
logoParent.setShouldCalcPreferredSize(true);
logoParent.animateLayoutFade(2000, 0);
}
});
splash.show();
splash.setTransitionOutAnimator(CommonTransitions.createFastSlide(CommonTransitions.SLIDE_VERTICAL, true, 300));
new UITimer(new Runnable() {
public void run() {
showMainUI();
}
}).schedule(2500, false, splash);
}