use of com.codename1.ui.Container in project CodenameOne by codenameone.
the class InteractionDialog method disposeToTheLeft.
/**
* Removes the interaction dialog from view with an animation to the left
*/
public void disposeToTheLeft() {
disposed = true;
final Container p = getParent();
if (p != null) {
final Form f = p.getComponentForm();
if (f != null) {
setX(-getWidth());
if (animateShow) {
p.animateUnlayout(400, 255, new Runnable() {
public void run() {
if (p.getParent() != null) {
Container pp = getLayeredPane(f);
remove();
p.remove();
pp.removeAll();
pp.revalidate();
cleanupLayer(f);
}
}
});
} else {
p.revalidate();
Container pp = getLayeredPane(f);
remove();
p.remove();
pp.removeAll();
pp.revalidate();
}
} else {
remove();
}
}
}
use of com.codename1.ui.Container in project CodenameOne by codenameone.
the class InteractionDialog method deinitialize.
/**
* {@inheritDoc}
*/
@Override
protected void deinitialize() {
super.deinitialize();
if (disposed) {
Form f = getComponentForm();
if (f != null) {
Container pp = getLayeredPane(f);
Container p = getParent();
remove();
p.remove();
pp.removeAll();
pp.revalidate();
cleanupLayer(f);
}
}
}
use of com.codename1.ui.Container in project CodenameOne by codenameone.
the class InteractionDialog method dispose.
/**
* Removes the interaction dialog from view
*/
public void dispose() {
disposed = true;
Container p = getParent();
if (p != null) {
Form f = p.getComponentForm();
if (f != null) {
if (animateShow) {
if (repositionAnimation) {
setX(getX() + getWidth() / 2);
setY(getY() + getHeight() / 2);
setWidth(1);
setHeight(1);
}
p.animateUnlayoutAndWait(400, 100);
}
Container pp = getLayeredPane(f);
remove();
p.remove();
pp.removeAll();
pp.revalidate();
cleanupLayer(f);
} else {
p.remove();
}
}
}
use of com.codename1.ui.Container in project CodenameOne by codenameone.
the class RSSReader method createRendererContainer.
private Container createRendererContainer() {
Container entries = new Container(new BoxLayout(BoxLayout.Y_AXIS));
entries.setUIID("RSSEntry");
Label title = new Label();
title.setName("title");
title.setUIID("RSSTitle");
entries.addComponent(title);
TextArea description = new TextArea(2, 30);
description.setGrowByContent(false);
description.setName("details");
description.setUIID("RSSDescription");
description.setScrollVisible(false);
entries.addComponent(description);
if (iconPlaceholder != null) {
Container wrap = new Container(new BorderLayout());
wrap.addComponent(BorderLayout.CENTER, entries);
Label icon = new Label();
icon.setIcon(iconPlaceholder);
icon.setUIID("RSSIcon");
icon.setName("icon");
wrap.addComponent(BorderLayout.WEST, icon);
entries = wrap;
}
return entries;
}
use of com.codename1.ui.Container in project CodenameOne by codenameone.
the class RSSReader method updateComponentValues.
void updateComponentValues(Container root, Hashtable h) {
int c = root.getComponentCount();
for (int iter = 0; iter < c; iter++) {
Component current = root.getComponentAt(iter);
// subclasses
if (current.getClass() == com.codename1.ui.Container.class || current.getClass() == com.codename1.ui.Tabs.class) {
updateComponentValues((Container) current, h);
continue;
}
String n = current.getName();
if (n != null) {
String val = (String) h.get(n);
if (val != null) {
if (current instanceof Button) {
final String url = (String) val;
((Button) current).addActionListener(new Listener(url));
continue;
}
if (current instanceof Label) {
((Label) current).setText(val);
continue;
}
if (current instanceof TextArea) {
((TextArea) current).setText(val);
continue;
}
if (current instanceof WebBrowser) {
((WebBrowser) current).setPage(val, null);
continue;
}
}
}
}
}
Aggregations