[Jarspy-commits] CVS: JarSpy/src/com/ociweb/gui ChangeLookAndFeelAction.java,1.5,1.6
Status: Beta
Brought to you by:
brown_j
|
From: Jeff B. <br...@us...> - 2002-10-18 01:38:36
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/gui
In directory usw-pr-cvs1:/tmp/cvs-serv30316
Modified Files:
ChangeLookAndFeelAction.java
Log Message:
removed compile time kunststoff dependencies
Index: ChangeLookAndFeelAction.java
===================================================================
RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/gui/ChangeLookAndFeelAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ChangeLookAndFeelAction.java 18 Oct 2002 00:00:29 -0000 1.5
--- ChangeLookAndFeelAction.java 18 Oct 2002 01:38:31 -0000 1.6
***************
*** 19,24 ****
package com.ociweb.gui;
- import com.incors.plaf.kunststoff.KunststoffLookAndFeel;
- import com.incors.plaf.kunststoff.KunststoffTheme;
import java.awt.Component;
import java.awt.event.ActionEvent;
--- 19,22 ----
***************
*** 30,33 ****
--- 28,32 ----
import javax.swing.plaf.metal.DefaultMetalTheme;
import javax.swing.plaf.metal.MetalLookAndFeel;
+ import javax.swing.plaf.metal.MetalTheme;
public class ChangeLookAndFeelAction extends AbstractAction {
***************
*** 57,62 ****
// to metal
if (laf instanceof MetalLookAndFeel) {
! if (laf instanceof KunststoffLookAndFeel) {
! ((KunststoffLookAndFeel) laf).setCurrentTheme(new KunststoffTheme());
} else {
((MetalLookAndFeel) laf).setCurrentTheme(new DefaultMetalTheme());
--- 56,74 ----
// to metal
if (laf instanceof MetalLookAndFeel) {
! // the kunststoff references are all done with reflection so there
! // are no compile time and no real runtime dependencies on kunststoff.
! //
! // if kunststoff isn't available, this Action object will just be disabled
! // at runtime
! if (laf.getClass().getName().indexOf("Kunststoff") >= 0) {
! // load the kunststoff theme class
! Class kunststoffThemeClass =
! Class.forName("com.incors.plaf.kunststoff.KunststoffTheme");
!
! // instantiate an instance of the kunststoff theme
! MetalTheme kunststoffTheme =
! (MetalTheme) kunststoffThemeClass.newInstance();
!
! ((MetalLookAndFeel) laf).setCurrentTheme(kunststoffTheme);
} else {
((MetalLookAndFeel) laf).setCurrentTheme(new DefaultMetalTheme());
|