Search in sources :

Example 46 with Label

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

the class SearchCommandTextHintSample2953 method start.

public void start() {
    if (current != null) {
        current.show();
        return;
    }
    Form hi18 = new Form("FormTitle");
    hi18.setLayout(BoxLayout.y());
    Container cont18 = hi18.getContentPane();
    hi18.getToolbar().addSearchCommand((e) -> {
        String text = (String) e.getSource();
        for (Component c : hi18.getContentPane()) {
            c.setHidden(c instanceof Label && ((Label) c).getText().indexOf(text) < 0);
        }
        hi18.getComponentForm().animateLayout(150);
    });
    for (int i = 0; i < 20; i++) {
        Label l = new Label("Label " + i);
        cont18.add(l);
    }
    hi18.show();
}
Also used : Container(com.codename1.ui.Container) Form(com.codename1.ui.Form) Label(com.codename1.ui.Label) Component(com.codename1.ui.Component)

Example 47 with Label

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

the class SideMenuTest3086 method start.

public void start() {
    if (current != null) {
        current.show();
        return;
    }
    Toolbar.setGlobalToolbar(true);
    Toolbar.setOnTopSideMenu(false);
    Form hi2 = new Form("Hi2 World", BoxLayout.y());
    hi2.add(new Label("Press to show form2"));
    hi2.add(new Button(new Command("show form2") {

        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                Form hi = new Form("form2");
                Toolbar tb = hi.getToolbar();
                Image icon = theme.getImage("icon.png");
                Container topBar = BorderLayout.east(new Label(icon));
                topBar.add(BorderLayout.SOUTH, new Label("Cool App Tagline...", "SidemenuTagline"));
                topBar.setUIID("SideCommand");
                tb.addComponentToSideMenu(topBar);
                tb.addMaterialCommandToSideMenu("Home", FontImage.MATERIAL_HOME, e -> {
                });
                hi.addComponent(new Label("form2 with sidemenu"));
                // hi.forceRevalidate();
                hi.show();
            } catch (Exception ex) {
                Dialog.show("Error", ex.getMessage(), "OK", null);
                ex.printStackTrace();
            }
        }
    }));
    hi2.show();
}
Also used : Form(com.codename1.ui.Form) Label(com.codename1.ui.Label) IOException(java.io.IOException) Toolbar(com.codename1.ui.Toolbar)

Example 48 with Label

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

the class SocketSample method start.

public void start() {
    if (current != null) {
        current.show();
        return;
    }
    Form hi = new Form("Socket Sample", BoxLayout.y());
    Button server = new Button("Server Sockets");
    Button client = new Button("Client Socket");
    server.addActionListener(evt -> {
        new ServerForm().show();
    });
    client.addActionListener(evt -> {
        new ClientForm().show();
    });
    hi.add(new Label("Select mode")).add(server).add(client);
    hi.show();
}
Also used : Form(com.codename1.ui.Form) Button(com.codename1.ui.Button) Label(com.codename1.ui.Label)

Example 49 with Label

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

the class SpanLabelIconAlignmentTest method start.

public void start() {
    if (current != null) {
        current.show();
        return;
    }
    Form hi = new Form("Hi World", BoxLayout.y());
    FontImage icon = FontImage.createMaterial(FontImage.MATERIAL_FIBER_MANUAL_RECORD, new Label().getStyle(), 30);
    for (String str : text) {
        SpanLabel l = new SpanLabel(str);
        $("*", l).selectAllStyles().setFont(Font.createTrueTypeFont(Font.NATIVE_MAIN_REGULAR).derive(Display.getInstance().convertToPixels(4), Font.STYLE_PLAIN));
        l.setIcon(icon);
        hi.add(l);
    }
    for (String str : text) {
        SpanButton l = new SpanButton(str);
        l.setIcon(icon);
        hi.add(l);
    }
    icon = FontImage.createMaterial(FontImage.MATERIAL_FIBER_MANUAL_RECORD, new Label().getStyle(), 4);
    for (String str : text) {
        SpanLabel l = new SpanLabel(str);
        $("*", l).selectAllStyles().setFont(Font.createTrueTypeFont(Font.NATIVE_MAIN_REGULAR).derive(Display.getInstance().convertToPixels(4), Font.STYLE_PLAIN));
        l.setIcon(icon);
        hi.add(l);
    }
    for (String str : text) {
        SpanLabel l = new SpanLabel();
        // set text after the fact to test different flow
        l.setText(str);
        $("*", l).selectAllStyles().setFont(Font.createTrueTypeFont(Font.NATIVE_MAIN_REGULAR).derive(Display.getInstance().convertToPixels(4), Font.STYLE_PLAIN));
        l.setIcon(icon);
        hi.add(l);
    }
    hi.add(new Label("Hi World"));
    hi.show();
}
Also used : Form(com.codename1.ui.Form) SpanLabel(com.codename1.components.SpanLabel) Label(com.codename1.ui.Label) SpanButton(com.codename1.components.SpanButton) SpanLabel(com.codename1.components.SpanLabel) FontImage(com.codename1.ui.FontImage)

Example 50 with Label

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

the class LinearGradientSample method start.

public void start() {
    if (current != null) {
        current.show();
        return;
    }
    Form hi = new Form("Hi World", new BorderLayout());
    Picker picker = new Picker();
    picker.setStrings("No cycle", "Repeat", "Reflect");
    picker.addActionListener(e -> {
        if ("No cycle".equals(picker.getValue())) {
            cycleMethod = NO_CYCLE;
        } else if ("Repeat".equals(picker.getValue())) {
            cycleMethod = REPEAT;
        } else if ("Reflect".equals(picker.getValue())) {
            cycleMethod = REFLECT;
        }
        hi.repaint();
    });
    hi.add(BorderLayout.NORTH, BoxLayout.encloseY(new SpanLabel("Drag pointer below to generate gradients"), new Label("Gradient Cycle Type:"), picker));
    hi.add(BorderLayout.CENTER, new MyComponent());
    hi.show();
}
Also used : BorderLayout(com.codename1.ui.layouts.BorderLayout) Form(com.codename1.ui.Form) Picker(com.codename1.ui.spinner.Picker) SpanLabel(com.codename1.components.SpanLabel) Label(com.codename1.ui.Label) SpanLabel(com.codename1.components.SpanLabel)

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