Search in sources :

Example 1 with L10nEditor

use of com.codename1.designer.L10nEditor in project CodenameOne by codenameone.

the class EditableResources method getResourceEditor.

public JComponent getResourceEditor(String name, ResourceEditorView view) {
    byte magic = getResourceType(name);
    switch(magic) {
        case MAGIC_IMAGE:
        case MAGIC_IMAGE_LEGACY:
            Image i = getImage(name);
            if (getResourceObject(name) instanceof MultiImage) {
                ImageMultiEditor tl = new ImageMultiEditor(this, name, view);
                tl.setImage((MultiImage) getResourceObject(name));
                return tl;
            }
            if (i instanceof Timeline) {
                TimelineEditor tl = new TimelineEditor(this, name, view);
                tl.setImage((Timeline) i);
                return tl;
            }
            if (i.isSVG()) {
                MultiImageSVGEditor img = new MultiImageSVGEditor(this, name);
                img.setImage(i);
                return img;
            }
            ImageRGBEditor img = new ImageRGBEditor(this, name, view);
            img.setImage(i);
            return img;
        case MAGIC_TIMELINE:
            TimelineEditor tl = new TimelineEditor(this, name, view);
            tl.setImage((Timeline) getImage(name));
            return tl;
        case MAGIC_THEME:
        case MAGIC_THEME_LEGACY:
            ThemeEditor theme = new ThemeEditor(this, name, getTheme(name), view);
            return theme;
        case MAGIC_FONT:
        case MAGIC_FONT_LEGACY:
        case MAGIC_INDEXED_FONT_LEGACY:
            FontEditor fonts = new FontEditor(this, getFont(name), name);
            return fonts;
        case MAGIC_DATA:
            DataEditor data = new DataEditor(this, name);
            return data;
        case MAGIC_UI:
            UserInterfaceEditor uie = new UserInterfaceEditor(name, this, view.getProjectGeneratorSettings(), view);
            return uie;
        case MAGIC_L10N:
            // we are cheating this isn't a theme but it should work since
            // this is a hashtable that will include the nested locales
            L10nEditor l10n = new L10nEditor(this, name);
            return l10n;
        default:
            throw new IllegalArgumentException("Unrecognized magic number: " + Integer.toHexString(magic & 0xff));
    }
}
Also used : BufferedImage(java.awt.image.BufferedImage) EncodedImage(com.codename1.ui.EncodedImage) Image(com.codename1.ui.Image) MultiImageSVGEditor(com.codename1.designer.MultiImageSVGEditor) L10nEditor(com.codename1.designer.L10nEditor) ThemeEditor(com.codename1.designer.ThemeEditor) UserInterfaceEditor(com.codename1.designer.UserInterfaceEditor) Timeline(com.codename1.ui.animations.Timeline) DataEditor(com.codename1.designer.DataEditor) ImageMultiEditor(com.codename1.designer.ImageMultiEditor) TimelineEditor(com.codename1.designer.TimelineEditor) FontEditor(com.codename1.designer.FontEditor) ImageRGBEditor(com.codename1.designer.ImageRGBEditor)

Aggregations

DataEditor (com.codename1.designer.DataEditor)1 FontEditor (com.codename1.designer.FontEditor)1 ImageMultiEditor (com.codename1.designer.ImageMultiEditor)1 ImageRGBEditor (com.codename1.designer.ImageRGBEditor)1 L10nEditor (com.codename1.designer.L10nEditor)1 MultiImageSVGEditor (com.codename1.designer.MultiImageSVGEditor)1 ThemeEditor (com.codename1.designer.ThemeEditor)1 TimelineEditor (com.codename1.designer.TimelineEditor)1 UserInterfaceEditor (com.codename1.designer.UserInterfaceEditor)1 EncodedImage (com.codename1.ui.EncodedImage)1 Image (com.codename1.ui.Image)1 Timeline (com.codename1.ui.animations.Timeline)1 BufferedImage (java.awt.image.BufferedImage)1