MCPcopy Create free account
hub / github.com/Card-Forge/forge / changeSkin

Method changeSkin

forge-gui-desktop/src/main/java/forge/toolbox/FSkin.java:1137–1157  ·  view source on GitHub ↗
(final String skinName)

Source from the content-addressed store, hash-verified

1135 private static boolean loaded = false;
1136
1137 public static void changeSkin(final String skinName) {
1138 final ForgePreferences prefs = FModel.getPreferences();
1139 if (skinName.equals(prefs.getPref(FPref.UI_SKIN))) { return; }
1140
1141 //save skin preference
1142 prefs.setPref(FPref.UI_SKIN, skinName);
1143 prefs.save();
1144
1145 //load skin
1146 loaded = false; //reset this temporarily until end of loadFull()
1147 loadLight(skinName, false);
1148 loadFull(false);
1149
1150 //refresh certain components skinned via look and feel
1151 Singletons.getControl().getForgeMenu().refresh();
1152 FComboBoxWrapper.refreshAllSkins();
1153 FComboBoxPanel.refreshAllSkins();
1154
1155 //repaint main frame to ensure all visible components apply the new skin
1156 Singletons.getView().getFrame().repaint();
1157 }
1158
1159 /**
1160 * Loads a "light" version of FSkin, just enough for the splash screen:

Callers 1

LayoutMenuClass · 0.95

Calls 15

getPreferencesMethod · 0.95
loadLightMethod · 0.95
loadFullMethod · 0.95
getControlMethod · 0.95
refreshAllSkinsMethod · 0.95
refreshAllSkinsMethod · 0.95
getViewMethod · 0.95
getForgeMenuMethod · 0.80
saveMethod · 0.65
equalsMethod · 0.45
getPrefMethod · 0.45
setPrefMethod · 0.45

Tested by

no test coverage detected