use of com.codename1.designer.ThemeEditor 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));
}
}
Aggregations