Search in sources :

Example 31 with Label

use of com.vaadin.v7.ui.Label 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;
}
Also used : Container(com.codename1.ui.Container) BorderLayout(com.codename1.ui.layouts.BorderLayout) TextArea(com.codename1.ui.TextArea) BoxLayout(com.codename1.ui.layouts.BoxLayout) Label(com.codename1.ui.Label)

Example 32 with Label

use of com.vaadin.v7.ui.Label 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;
                }
            }
        }
    }
}
Also used : Container(com.codename1.ui.Container) ActionListener(com.codename1.ui.events.ActionListener) Button(com.codename1.ui.Button) TextArea(com.codename1.ui.TextArea) Label(com.codename1.ui.Label) Component(com.codename1.ui.Component)

Example 33 with Label

use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.

the class GlassTutorial method paint.

/**
 * {@inheritDoc}
 */
public void paint(Graphics g, Rectangle rect) {
    if (internal == null) {
        internal = new Label(" ");
        internal.setUIID("GlassTutorial");
    }
    internal.setSize(rect.getSize());
    internal.paintComponent(g);
    int componentCount = vec.size();
    for (int iter = 0; iter < componentCount; iter++) {
        Component current = (Component) vec.elementAt(iter);
        String pos = (String) current.getClientProperty(POS);
        Component dest = (Component) current.getClientProperty(DEST);
        int xpos = dest.getAbsoluteX();
        int ypos = dest.getAbsoluteY();
        int w = dest.getWidth();
        int h = dest.getHeight();
        if (pos.equals(BorderLayout.CENTER)) {
            current.setX(xpos);
            current.setY(ypos);
            current.setWidth(w);
            current.setHeight(h);
            current.paintComponent(g);
            continue;
        }
        Dimension d = current.getPreferredSize();
        current.setWidth(d.getWidth());
        current.setHeight(d.getHeight());
        if (pos.equals(BorderLayout.SOUTH)) {
            current.setX(xpos + w / 2 - d.getWidth() / 2);
            current.setY(ypos + h);
            current.paintComponent(g);
            continue;
        }
        if (pos.equals(BorderLayout.NORTH)) {
            current.setX(xpos + w / 2 - d.getWidth() / 2);
            current.setY(ypos - d.getHeight());
            current.paintComponent(g);
            continue;
        }
        if (pos.equals(BorderLayout.EAST)) {
            current.setX(xpos + w);
            current.setY(ypos + h / 2 - d.getHeight() / 2);
            current.paintComponent(g);
            continue;
        }
        if (pos.equals(BorderLayout.WEST)) {
            current.setX(xpos - d.getWidth());
            current.setY(ypos + h / 2 - d.getHeight() / 2);
            current.paintComponent(g);
            continue;
        }
    }
}
Also used : Label(com.codename1.ui.Label) Dimension(com.codename1.ui.geom.Dimension) Component(com.codename1.ui.Component)

Example 34 with Label

use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.

the class DateTimeSpinner3D method calcPreferredSize.

@Override
protected Dimension calcPreferredSize() {
    Dimension size = super.calcPreferredSize();
    Label l = new Label("Thu Dec 27    55  55  AM", "Spinner3DRow");
    size.setWidth((int) (l.getPreferredW() * 1.5f + convertToPixels(10f)));
    return size;
}
Also used : Label(com.codename1.ui.Label) Dimension(com.codename1.ui.geom.Dimension)

Example 35 with Label

use of com.vaadin.v7.ui.Label in project CodenameOne by codenameone.

the class DateTimeSpinner3D method initSpinner.

void initSpinner() {
    if (date == null) {
        date = Spinner3D.createDate(startDate.getTime() + off, endDate.getTime() + off, currentDate.getTime());
        date.setPreferredW((int) (new Label("Thu Dec 27", "Spinner3DRow").getPreferredW() * 1.5f));
        Style dateStyle = Style.createProxyStyle(date.getRowStyle(), date.getSelectedRowStyle());
        dateStyle.setAlignment(Component.RIGHT);
        dateStyle.setPaddingRight(3f);
        this.setCurrentDate(currentDate);
        this.setStartDate(startDate);
        this.setEndDate(endDate);
        time = new TimeSpinner3D();
        // getUnselectedStyle().setBgColor(date.getUnselectedStyle().getBgColor());
        // getUnselectedStyle().setBgTransparency(255);
        addComponents();
    }
}
Also used : Label(com.codename1.ui.Label) Style(com.codename1.ui.plaf.Style)

Aggregations

Label (com.codename1.ui.Label)129 Form (com.codename1.ui.Form)85 Label (com.vaadin.ui.Label)56 Container (com.codename1.ui.Container)45 Button (com.codename1.ui.Button)41 Label (com.vaadin.v7.ui.Label)40 TextField (com.vaadin.v7.ui.TextField)32 BorderLayout (com.codename1.ui.layouts.BorderLayout)31 Button (com.vaadin.ui.Button)31 ComboBox (com.vaadin.v7.ui.ComboBox)31 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)31 Captions (de.symeda.sormas.api.i18n.Captions)29 Strings (de.symeda.sormas.api.i18n.Strings)28 VerticalLayout (com.vaadin.ui.VerticalLayout)26 FacadeProvider (de.symeda.sormas.api.FacadeProvider)26 HorizontalLayout (com.vaadin.ui.HorizontalLayout)24 Window (com.vaadin.ui.Window)24 CssStyles (de.symeda.sormas.ui.utils.CssStyles)24 ValoTheme (com.vaadin.ui.themes.ValoTheme)21 List (java.util.List)21