Author: echatellier Date: 2010-11-18 09:30:29 +0100 (Thu, 18 Nov 2010) New Revision: 304 Url: http://nuiton.org/repositories/revision/nuiton-widgets/304 Log: Remove jgoodies:looks dependency Removed: trunk/src/main/java/org/nuiton/widget/Settings.java Modified: trunk/pom.xml trunk/src/main/java/org/nuiton/widget/SwingUtil.java trunk/src/main/java/org/nuiton/widget/SwingWidgetFactory.java Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-11-17 21:42:12 UTC (rev 303) +++ trunk/pom.xml 2010-11-18 08:30:29 UTC (rev 304) @@ -14,7 +14,7 @@ </parent> <artifactId>nuiton-widgets</artifactId> - <version>1.0.5-SNAPSHOT</version> + <version>1.1-SNAPSHOT</version> <dependencies> <dependency> @@ -34,14 +34,6 @@ <!-- to remove in 1.1 --> <dependency> - <groupId>jgoodies</groupId> - <artifactId>looks</artifactId> - <version>1.2.2</version> - <scope>compile</scope> - </dependency> - - <!-- to remove in 1.1 --> - <dependency> <groupId>org.nuiton.thirdparty</groupId> <artifactId>l2fprod-common</artifactId> <version>0.1</version> Deleted: trunk/src/main/java/org/nuiton/widget/Settings.java =================================================================== --- trunk/src/main/java/org/nuiton/widget/Settings.java 2010-11-17 21:42:12 UTC (rev 303) +++ trunk/src/main/java/org/nuiton/widget/Settings.java 2010-11-18 08:30:29 UTC (rev 304) @@ -1,312 +0,0 @@ -/* - * #%L - * Graphical Widget - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -/* - * Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * o Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * o Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * o Neither the name of JGoodies Karsten Lentzsch nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.nuiton.widget; - -import javax.swing.LookAndFeel; - -import com.jgoodies.clearlook.ClearLookManager; -import com.jgoodies.clearlook.ClearLookMode; -import com.jgoodies.plaf.BorderStyle; -import com.jgoodies.plaf.FontSizeHints; -import com.jgoodies.plaf.HeaderStyle; -import com.jgoodies.plaf.plastic.PlasticLookAndFeel; -import com.jgoodies.plaf.plastic.PlasticTheme; -import com.jgoodies.plaf.plastic.PlasticXPLookAndFeel; - -/** - * Describes most of the optional settings of the JGoodies Looks. Used by the - * <code>DemoFrame</code> to configure the UI. - * - * @author Karsten Lentzsch - * @version $Revision$ - * - * @see com.jgoodies.plaf.BorderStyle - * @see com.jgoodies.plaf.FontSizeHints - * @see com.jgoodies.plaf.HeaderStyle - * @see com.jgoodies.plaf.Options - * - * @deprecated since 1.0.4 with no replacement (removed in 1.1) - */ -@Deprecated -public final class Settings { - - private LookAndFeel selectedLookAndFeel; - - private PlasticTheme selectedTheme; - - private Boolean useSystemFonts; - - private FontSizeHints fontSizeHints; - - private boolean useNarrowButtons; - - private boolean tabIconsEnabled; - - private Boolean popupDropShadowEnabled; - - private String plasticTabStyle; - - private boolean plasticHighContrastFocusEnabled; - - private HeaderStyle menuBarHeaderStyle; - - private BorderStyle menuBarPlasticBorderStyle; - - private BorderStyle menuBarWindowsBorderStyle; - - private Boolean menuBar3DHint; - - private HeaderStyle toolBarHeaderStyle; - - private BorderStyle toolBarPlasticBorderStyle; - - private BorderStyle toolBarWindowsBorderStyle; - - private Boolean toolBar3DHint; - - private ClearLookMode clearLookMode; - - private String clearLookPolicyName; - - // Instance Creation ****************************************************** - - private Settings() { - // Override default constructor; prevents instantiability. - } - - public static Settings createDefault() { - Settings settings = new Settings(); - settings.setSelectedLookAndFeel(new PlasticXPLookAndFeel()); - settings.setSelectedTheme(PlasticLookAndFeel.createMyDefaultTheme()); - settings.setUseSystemFonts(Boolean.TRUE); - settings.setFontSizeHints(FontSizeHints.MIXED); - settings.setUseNarrowButtons(false); - settings.setTabIconsEnabled(true); - settings.setPlasticTabStyle(PlasticLookAndFeel.TAB_STYLE_DEFAULT_VALUE); - settings.setPlasticHighContrastFocusEnabled(false); - settings.setMenuBarHeaderStyle(null); - settings.setMenuBarPlasticBorderStyle(null); - settings.setMenuBarWindowsBorderStyle(null); - settings.setMenuBar3DHint(null); - settings.setToolBarHeaderStyle(null); - settings.setToolBarPlasticBorderStyle(null); - settings.setToolBarWindowsBorderStyle(null); - settings.setToolBar3DHint(null); - settings.setClearLookMode(ClearLookMode.OFF); - settings.setClearLookPolicyName(ClearLookManager.getPolicy().getClass() - .getName()); - return settings; - } - - // Accessors ************************************************************** - - public ClearLookMode getClearLookMode() { - return clearLookMode; - } - - public void setClearLookMode(ClearLookMode clearLookMode) { - this.clearLookMode = clearLookMode; - } - - public String getClearLookPolicyName() { - return clearLookPolicyName; - } - - public void setClearLookPolicyName(String clearLookPolicyName) { - this.clearLookPolicyName = clearLookPolicyName; - } - - public FontSizeHints getFontSizeHints() { - return fontSizeHints; - } - - public void setFontSizeHints(FontSizeHints fontSizeHints) { - this.fontSizeHints = fontSizeHints; - } - - public Boolean getMenuBar3DHint() { - return menuBar3DHint; - } - - public void setMenuBar3DHint(Boolean menuBar3DHint) { - this.menuBar3DHint = menuBar3DHint; - } - - public HeaderStyle getMenuBarHeaderStyle() { - return menuBarHeaderStyle; - } - - public void setMenuBarHeaderStyle(HeaderStyle menuBarHeaderStyle) { - this.menuBarHeaderStyle = menuBarHeaderStyle; - } - - public BorderStyle getMenuBarPlasticBorderStyle() { - return menuBarPlasticBorderStyle; - } - - public void setMenuBarPlasticBorderStyle( - BorderStyle menuBarPlasticBorderStyle) { - this.menuBarPlasticBorderStyle = menuBarPlasticBorderStyle; - } - - public BorderStyle getMenuBarWindowsBorderStyle() { - return menuBarWindowsBorderStyle; - } - - public void setMenuBarWindowsBorderStyle( - BorderStyle menuBarWindowsBorderStyle) { - this.menuBarWindowsBorderStyle = menuBarWindowsBorderStyle; - } - - public Boolean isPopupDropShadowEnabled() { - return popupDropShadowEnabled; - } - - public void setPopupDropShadowEnabled(Boolean popupDropShadowEnabled) { - this.popupDropShadowEnabled = popupDropShadowEnabled; - } - - public boolean isPlasticHighContrastFocusEnabled() { - return plasticHighContrastFocusEnabled; - } - - public void setPlasticHighContrastFocusEnabled( - boolean plasticHighContrastFocusEnabled) { - this.plasticHighContrastFocusEnabled = plasticHighContrastFocusEnabled; - } - - public String getPlasticTabStyle() { - return plasticTabStyle; - } - - public void setPlasticTabStyle(String plasticTabStyle) { - this.plasticTabStyle = plasticTabStyle; - } - - public LookAndFeel getSelectedLookAndFeel() { - return selectedLookAndFeel; - } - - public void setSelectedLookAndFeel(LookAndFeel selectedLookAndFeel) { - this.selectedLookAndFeel = selectedLookAndFeel; - } - - public PlasticTheme getSelectedTheme() { - return selectedTheme; - } - - public void setSelectedTheme(PlasticTheme selectedTheme) { - this.selectedTheme = selectedTheme; - } - - public boolean isTabIconsEnabled() { - return tabIconsEnabled; - } - - public void setTabIconsEnabled(boolean tabIconsEnabled) { - this.tabIconsEnabled = tabIconsEnabled; - } - - public Boolean getToolBar3DHint() { - return toolBar3DHint; - } - - public void setToolBar3DHint(Boolean toolBar3DHint) { - this.toolBar3DHint = toolBar3DHint; - } - - public HeaderStyle getToolBarHeaderStyle() { - return toolBarHeaderStyle; - } - - public void setToolBarHeaderStyle(HeaderStyle toolBarHeaderStyle) { - this.toolBarHeaderStyle = toolBarHeaderStyle; - } - - public BorderStyle getToolBarPlasticBorderStyle() { - return toolBarPlasticBorderStyle; - } - - public void setToolBarPlasticBorderStyle( - BorderStyle toolBarPlasticBorderStyle) { - this.toolBarPlasticBorderStyle = toolBarPlasticBorderStyle; - } - - public BorderStyle getToolBarWindowsBorderStyle() { - return toolBarWindowsBorderStyle; - } - - public void setToolBarWindowsBorderStyle( - BorderStyle toolBarWindowsBorderStyle) { - this.toolBarWindowsBorderStyle = toolBarWindowsBorderStyle; - } - - public boolean isUseNarrowButtons() { - return useNarrowButtons; - } - - public void setUseNarrowButtons(boolean useNarrowButtons) { - this.useNarrowButtons = useNarrowButtons; - } - - public Boolean isUseSystemFonts() { - return useSystemFonts; - } - - public void setUseSystemFonts(Boolean useSystemFonts) { - this.useSystemFonts = useSystemFonts; - } - -} \ No newline at end of file Modified: trunk/src/main/java/org/nuiton/widget/SwingUtil.java =================================================================== --- trunk/src/main/java/org/nuiton/widget/SwingUtil.java 2010-11-17 21:42:12 UTC (rev 303) +++ trunk/src/main/java/org/nuiton/widget/SwingUtil.java 2010-11-18 08:30:29 UTC (rev 304) @@ -45,10 +45,6 @@ import javax.swing.JFrame; import javax.swing.UIManager; -import com.jgoodies.plaf.LookUtils; -import com.jgoodies.plaf.plastic.PlasticLookAndFeel; -import com.jgoodies.plaf.plastic.PlasticXPLookAndFeel; -import com.jgoodies.plaf.plastic.theme.SkyBluerTahoma; import com.l2fprod.common.swing.plaf.LookAndFeelAddons; import com.l2fprod.common.swing.plaf.windows.WindowsLookAndFeelAddons; @@ -57,27 +53,6 @@ */ public class SwingUtil { - /** - * @deprecated since 1.0.4 with no replacement (removed in 1.1) - */ - @Deprecated - public static void init() throws Exception { - UIManager.put("ClassLoader", LookUtils.class.getClassLoader()); - PlasticLookAndFeel.setMyCurrentTheme(new SkyBluerTahoma()); - UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); - - try { - LookAndFeelAddons.setAddon(WindowsLookAndFeelAddons.class); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - public static void configureUI(Component component) { if (component instanceof JFrame) { ((JFrame) component) Modified: trunk/src/main/java/org/nuiton/widget/SwingWidgetFactory.java =================================================================== --- trunk/src/main/java/org/nuiton/widget/SwingWidgetFactory.java 2010-11-17 21:42:12 UTC (rev 303) +++ trunk/src/main/java/org/nuiton/widget/SwingWidgetFactory.java 2010-11-18 08:30:29 UTC (rev 304) @@ -53,9 +53,6 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; -import com.jgoodies.plaf.Options; -import com.jgoodies.plaf.plastic.PlasticLookAndFeel; -import com.jgoodies.plaf.windows.ExtWindowsLookAndFeel; import com.l2fprod.common.swing.JLinkButton; /** @@ -123,25 +120,13 @@ /** * Creates and returns a <code>JToolBar</code> - * - * @deprecated since 1.0.4 with no replacement (removed in 1.1) */ @Deprecated public static JToolBar createToolBar() { JToolBar toolBar = new JToolBar(); - Settings settings = Settings.createDefault(); toolBar.setFloatable(false); toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE); - // Swing - toolBar.putClientProperty(Options.HEADER_STYLE_KEY, settings - .getToolBarHeaderStyle()); - toolBar.putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, settings - .getToolBarPlasticBorderStyle()); - toolBar.putClientProperty(ExtWindowsLookAndFeel.BORDER_STYLE_KEY, - settings.getToolBarWindowsBorderStyle()); - toolBar.putClientProperty(PlasticLookAndFeel.IS_3D_KEY, settings - .getToolBar3DHint()); toolBar.setFloatable(false); Border marginBorder = new EmptyBorder(0, 2, 0, 2); @@ -154,23 +139,11 @@ /** * Creates and returns a <code>JMenuBar</code> - * - * @deprecated since 1.0.4 with no replacement (removed in 1.1) */ @Deprecated public static JMenuBar createMenuBar() { JMenuBar menuBar = new JMenuBar(); - Settings settings = Settings.createDefault(); - menuBar.putClientProperty(Options.HEADER_STYLE_KEY, settings - .getMenuBarHeaderStyle()); - menuBar.putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, settings - .getMenuBarPlasticBorderStyle()); - menuBar.putClientProperty(ExtWindowsLookAndFeel.BORDER_STYLE_KEY, - settings.getMenuBarWindowsBorderStyle()); - menuBar.putClientProperty(PlasticLookAndFeel.IS_3D_KEY, settings - .getMenuBar3DHint()); - Border marginBorder = new EmptyBorder(0, 2, 0, 2); EtchedBorder etchedBorder = new EtchedBorder(); Border compoundBorder = new CompoundBorder(etchedBorder, marginBorder);
participants (1)
-
echatellier@users.nuiton.org