Revision 8921
trunk/frameworks/_fwAndami/src/com/iver/andami/Launcher.java | ||
---|---|---|
128 | 128 |
import com.iver.andami.ui.mdiFrame.MDIFrame; |
129 | 129 |
import com.iver.andami.ui.mdiManager.MDIManagerFactory; |
130 | 130 |
import com.iver.andami.ui.splash.MultiSplashWindow; |
131 |
import com.iver.andami.ui.theme.Theme; |
|
131 | 132 |
import com.iver.utiles.XMLEntity; |
132 | 133 |
import com.iver.utiles.xmlEntity.generate.XmlTag; |
133 | 134 |
|
... | ... | |
156 | 157 |
private static ArrayList pluginsOrdered = new ArrayList(); |
157 | 158 |
private static ArrayList extensions=new ArrayList(); |
158 | 159 |
private static String appHomeDir = null; |
159 |
|
|
160 |
|
|
160 | 161 |
private static final class ProxyAuth extends Authenticator { |
161 | 162 |
private PasswordAuthentication auth; |
162 | 163 |
|
... | ... | |
259 | 260 |
}); |
260 | 261 |
|
261 | 262 |
validate(); |
262 |
// Mostrar la ventana de inicio |
|
263 |
Frame f=new Frame(); |
|
264 |
splashWindow=new MultiSplashWindow(f); |
|
265 |
|
|
266 |
// Ponemos los datos del proxy |
|
267 |
String host = prefs.get("firewall.http.host", ""); |
|
268 |
String port = prefs.get("firewall.http.port", ""); |
|
269 | 263 |
|
270 |
System.getProperties().put("http.proxyHost", host);
|
|
271 |
System.getProperties().put("http.proxyPort", port);
|
|
264 |
// Obtener la personalizaci?n de la aplicaci?n.
|
|
265 |
Theme theme=getTheme();
|
|
272 | 266 |
|
273 |
// Ponemos el usuario y clave del proxy, si existe |
|
274 |
String proxyUser = prefs.get("firewall.http.user",null); |
|
275 |
String proxyPassword = prefs.get("firewall.http.password", null); |
|
276 |
if (proxyUser != null ) |
|
277 |
{ |
|
278 |
System.getProperties().put("http.proxyUserName", proxyUser); |
|
279 |
System.getProperties().put("http.proxyPassword", proxyPassword); |
|
267 |
// Mostrar la ventana de inicio |
|
268 |
Frame f=new Frame(); |
|
269 |
splashWindow=new MultiSplashWindow(f,theme); |
|
280 | 270 |
|
281 |
Authenticator.setDefault(new ProxyAuth(proxyUser, |
|
282 |
proxyPassword)); |
|
283 |
} else { |
|
284 |
Authenticator.setDefault(new ProxyAuth("", "")); |
|
285 |
} |
|
286 |
|
|
271 |
// Ponemos los datos del proxy |
|
272 |
configureProxy(); |
|
287 | 273 |
|
288 | 274 |
// TODO Buscar actualizaciones de los plugins |
289 | 275 |
downloadExtensions(andamiConfig.getPluginsDirectory()); |
... | ... | |
311 | 297 |
frame = new MDIFrame(); |
312 | 298 |
|
313 | 299 |
// Se configura el nombre e icono de la aplicaci?n |
314 |
frameIcon(); |
|
300 |
frameIcon(theme);
|
|
315 | 301 |
|
316 | 302 |
SwingUtilities.invokeAndWait(new Runnable() { |
317 | 303 |
public void run() { |
... | ... | |
366 | 352 |
|
367 | 353 |
} |
368 | 354 |
|
355 |
/** |
|
356 |
* Obtiene la personalizaci?n de los iconos, splash, fondo y el nombre de |
|
357 |
* la aplicaci?n. |
|
358 |
* |
|
359 |
* @return Theme |
|
360 |
*/ |
|
361 |
private static Theme getTheme() { |
|
362 |
Theme theme=new Theme(); |
|
363 |
File file=new File("theme/andami-theme.xml"); |
|
364 |
if (file.exists()) { |
|
365 |
theme.readTheme(file); |
|
366 |
} |
|
367 |
return theme; |
|
368 |
} |
|
369 | 369 |
/** |
370 |
*Establece los datos que ten?amos guardados respecto de la configuraci?n |
|
371 |
*del proxy. |
|
372 |
*/ |
|
373 |
private static void configureProxy() { |
|
374 |
String host = prefs.get("firewall.http.host", ""); |
|
375 |
String port = prefs.get("firewall.http.port", ""); |
|
376 |
|
|
377 |
System.getProperties().put("http.proxyHost", host); |
|
378 |
System.getProperties().put("http.proxyPort", port); |
|
379 |
|
|
380 |
// Ponemos el usuario y clave del proxy, si existe |
|
381 |
String proxyUser = prefs.get("firewall.http.user",null); |
|
382 |
String proxyPassword = prefs.get("firewall.http.password", null); |
|
383 |
if (proxyUser != null ) |
|
384 |
{ |
|
385 |
System.getProperties().put("http.proxyUserName", proxyUser); |
|
386 |
System.getProperties().put("http.proxyPassword", proxyPassword); |
|
387 |
|
|
388 |
Authenticator.setDefault(new ProxyAuth(proxyUser, |
|
389 |
proxyPassword)); |
|
390 |
} else { |
|
391 |
Authenticator.setDefault(new ProxyAuth("", "")); |
|
392 |
} |
|
393 |
} |
|
394 |
|
|
395 |
/** |
|
370 | 396 |
* Recupera la geometr?a (tama?o, posici?n y estado) de la ventana principal de Andami. |
371 | 397 |
* TODO Pendiente de ver como se asigna un pluginServices para el launcher. |
372 | 398 |
* @author LWS |
... | ... | |
562 | 588 |
} |
563 | 589 |
|
564 | 590 |
/** |
591 |
* @param theme |
|
565 | 592 |
* |
566 | 593 |
*/ |
567 |
private static void frameIcon() { |
|
594 |
private static void frameIcon(Theme theme) {
|
|
568 | 595 |
Iterator i = pluginsConfig.keySet().iterator(); |
569 | 596 |
|
570 | 597 |
while (i.hasNext()) { |
571 | 598 |
String pName = (String) i.next(); |
572 | 599 |
PluginConfig pc = (PluginConfig) pluginsConfig.get(pName); |
573 | 600 |
PluginServices ps = (PluginServices) pluginsServices.get(pName); |
601 |
if (pc.getIcon() != null) { |
|
602 |
if (theme.getIcon() != null) { |
|
603 |
frame.setIconImage(theme.getIcon().getImage()); |
|
604 |
} else { |
|
574 | 605 |
|
575 |
if (pc.getIcon() != null) { |
|
576 |
ImageIcon icon = new ImageIcon(ps.getClassLoader().getResource(pc.getIcon() |
|
577 |
.getSrc())); |
|
578 |
frame.setIconImage(icon.getImage()); |
|
579 |
frame.setTitlePrefix(pc.getIcon().getText()); |
|
606 |
ImageIcon icon = new ImageIcon(ps.getClassLoader() |
|
607 |
.getResource(pc.getIcon().getSrc())); |
|
608 |
frame.setIconImage(icon.getImage()); |
|
609 |
|
|
610 |
} |
|
611 |
if (theme.getName() != null) { |
|
612 |
frame.setTitlePrefix(theme.getName()); |
|
613 |
} else { |
|
614 |
frame.setTitlePrefix(pc.getIcon().getText()); |
|
615 |
} |
|
616 |
if (theme.getBackgroundImage() != null) { |
|
617 |
PluginServices.getMDIManager().setBackgroundImage(theme.getBackgroundImage().getImage()); |
|
618 |
//frame.setBackgroundImage(theme.getBackgroundImage()); |
|
619 |
} |
|
580 | 620 |
} |
581 | 621 |
} |
582 | 622 |
} |
Also available in: Unified diff