Debian Codegraph @

substance-swingx/src/tools/java/docrobot/StatusBarRunner.java

raw symbols SCIP
1 /*
2 * Copyright 2005-2008 Kirill Grouchnikov, based on work by
3 * Sun Microsystems, Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
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
25 import org.fest.swing.core.BasicRobot;
26 import org.fest.swing.core.Robot;
27 import org.pushingpixels.substance.api.SubstanceLookAndFeel;
28 import org.pushingpixels.substance.api.SubstanceSkin;
29 import org.pushingpixels.substance.api.skin.SkinInfo;
30
31 /**
32 * The main method for taking screenshots for Substance documentation.
33 *
34 * @author Kirill Grouchnikov
35 */
36 public class StatusBarRunner {
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
47 String frameClass = "docrobot.StatusBarFrame";
48 String subfolder = "statusbar";
49 Map<String, SkinInfo> skins = SubstanceLookAndFeel.getAllSkins();
50 Robot robot = BasicRobot.robotWithNewAwtHierarchy();
51
52 for (Map.Entry<String, SkinInfo> skinEntry : skins.entrySet()) {
53 String key = skinEntry.getKey();
54 String normalized = key.toLowerCase().replaceAll(" ", "");
55 try {
56 new FrameRobot(frameClass, (SubstanceSkin) Class.forName(
57 skinEntry.getValue().getClassName()).newInstance(),
58 "C:/jprojects/substance-swingx/www/images/" + subfolder
59 + "/" + normalized, robot).run();
60 } catch (Throwable t) {
61 t.printStackTrace();
62 }
63 }
64 }
65 }