01: /*
02: * Copyright 2005-2008 Kirill Grouchnikov, based on work by
03: * Sun Microsystems, Inc. All rights reserved.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18: */
19: package docrobot;
20:
21: import java.util.Map;
22:
23: import javax.swing.JFrame;
24: import javax.swing.UIManager;
25:
26: import org.jvnet.lafwidget.LafWidget;
27: import org.jvnet.lafwidget.utils.LafConstants.AnimationKind;
28: import org.jvnet.substance.SubstanceLookAndFeel;
29: import org.jvnet.substance.skin.*;
30:
31: /**
32: * The main method for taking screenshots for Substance documentation.
33: *
34: * @author Kirill Grouchnikov
35: */
36: public class TipOfTheDayRunner {
37: /**
38: * Runs the specified screenshot robot.
39: *
40: * @param args
41: * Ignored.
42: * @throws Exception
43: */
44: public static void main(String[] args) throws Exception {
45: JFrame.setDefaultLookAndFeelDecorated(true);
46: UIManager.put(LafWidget.ANIMATION_KIND, AnimationKind.NONE);
47: UIManager.setLookAndFeel(new SubstanceLookAndFeel());
48:
49: String subfolder = "tipoftheday";
50: Map<String, SkinInfo> skins = SubstanceLookAndFeel
51: .getAllSkins();
52: for (Map.Entry<String, SkinInfo> skinEntry : skins.entrySet()) {
53: String key = skinEntry.getKey();
54: String normalized = key.toLowerCase().replaceAll(" ", "");
55: new TipOfTheDayRobot((SubstanceSkin) Class.forName(
56: skinEntry.getValue().getClassName()).newInstance(),
57: "C:/jprojects/substance-swingx/www/images/"
58: + subfolder + "/" + normalized).run();
59: }
60: }
61: }
|