Search in sources :

Example 1 with ImageView_Preferences

use of net.rptools.tokentool.model.ImageView_Preferences in project tokentool by RPTools.

the class TokenTool_Controller method setPortraitFrom_Preferences.

public void setPortraitFrom_Preferences(String preferencesJson) {
    if (preferencesJson != null) {
        ImageView_Preferences imageView_Preferences = new Gson().fromJson(preferencesJson, new TypeToken<ImageView_Preferences>() {
        }.getType());
        portraitImageView = imageView_Preferences.toImageView(portraitImageView);
    } else {
        log.debug("No Preferences currently saved.");
    }
}
Also used : TypeToken(com.google.gson.reflect.TypeToken) Gson(com.google.gson.Gson) ImageView_Preferences(net.rptools.tokentool.model.ImageView_Preferences)

Example 2 with ImageView_Preferences

use of net.rptools.tokentool.model.ImageView_Preferences in project tokentool by RPTools.

the class TokenTool_Controller method setBackgroundFrom_Preferences.

public void setBackgroundFrom_Preferences(String preferencesJson) {
    if (preferencesJson != null) {
        ImageView_Preferences imageView_Preferences = new Gson().fromJson(preferencesJson, new TypeToken<ImageView_Preferences>() {
        }.getType());
        backgroundImageView = imageView_Preferences.toImageView(backgroundImageView);
        setBackgroundColor(imageView_Preferences.getBackgroundColor());
    } else {
        backgroundImageView.setImage(null);
        setBackgroundColor(Color.TRANSPARENT);
    }
}
Also used : TypeToken(com.google.gson.reflect.TypeToken) Gson(com.google.gson.Gson) ImageView_Preferences(net.rptools.tokentool.model.ImageView_Preferences)

Aggregations

Gson (com.google.gson.Gson)2 TypeToken (com.google.gson.reflect.TypeToken)2 ImageView_Preferences (net.rptools.tokentool.model.ImageView_Preferences)2