Search in sources :

Example 41 with Char

use of com.codename1.ui.TextSelection.Char in project CodeRAD by shannah.

the class FirstCharEntityImageRenderer method getLetter.

private Image getLetter(char c) {
    c = Character.toUpperCase(c);
    String cstr = "" + c;
    com.codename1.ui.Label lbl = new com.codename1.ui.Label(cstr);
    Image bg = getLetterBackground(c);
    lbl.getStyle().setBgImage(bg);
    lbl.getStyle().setBgTransparency(0x0);
    lbl.getStyle().setBackgroundType(Style.BACKGROUND_IMAGE_ALIGNED_CENTER);
    lbl.getStyle().setAlignment(CENTER);
    lbl.getStyle().setFont(letterFont);
    lbl.getStyle().setFgColor(0xffffff);
    return new ComponentImage(lbl, bg.getWidth(), bg.getHeight());
}
Also used : ComponentImage(ca.weblite.shared.components.ComponentImage) Image(com.codename1.ui.Image) ComponentImage(ca.weblite.shared.components.ComponentImage)

Aggregations

Style (com.codename1.ui.plaf.Style)15 Font (com.codename1.ui.Font)8 ArrayList (java.util.ArrayList)5 ComponentImage (ca.weblite.shared.components.ComponentImage)4 Image (com.codename1.ui.Image)4 Point (java.awt.Point)4 Hashtable (java.util.Hashtable)4 MultiButton (com.codename1.components.MultiButton)3 SpanButton (com.codename1.components.SpanButton)3 EventObject (java.util.EventObject)3 List (java.util.List)3 Vector (java.util.Vector)3 SpanLabel (com.codename1.components.SpanLabel)2 BadgeUIID (com.codename1.rad.attributes.BadgeUIID)2 IconUIID (com.codename1.rad.attributes.IconUIID)2 UIID (com.codename1.rad.attributes.UIID)2 Button (com.codename1.ui.Button)2 TextArea (com.codename1.ui.TextArea)2 BorderLayout (com.codename1.ui.layouts.BorderLayout)2 UIManager (com.codename1.ui.plaf.UIManager)2