KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > yagga > miniinstaller > gui > GuiProperties


1 /*
2  * This file is part of MiniInstaller, a self installer builder for Java
3  * Copyright (C) 2002 Walter Gamba
4  * mailto:walter@yagga.net
5  * http://www.yagga.net/java/miniinstaller
6  *
7  * MiniInstaller is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * MiniInstaller is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  *
21  * As the time of writing, the GNU General Public Licene can be
22  * found at http://www.gnu.org/licenses/gpl.txt
23  *
24  */

25
26 package net.yagga.miniinstaller.gui;
27
28 import java.awt.*;
29 import javax.swing.*;
30
31 import net.yagga.util.Ut;
32 /**
33  * Holder for properties such as fonts, colors etc..
34  * @author Walter Gamba
35  * @version 1.0
36  */

37 public class GuiProperties {
38
39     private static final String JavaDoc TIMES_ROMAN="TimesRoman";
40     private static final String JavaDoc DIALOG="Dialog";
41
42     static Font titleFont;
43     /**
44      * StepFont, only the base, the "selected font " is just like this, but BOLD
45      */

46     static Font stepFont;
47     static Font selectedStepFont;
48
49     static Font smallTitleFont;
50     static Font textFont;
51
52   public static void init() {
53         setTitleFont(TIMES_ROMAN,Font.BOLD | Font.ITALIC, 20);
54         setStepFont(DIALOG,0, 12);
55         setSmallTitleFont(DIALOG,0, 12);
56         setTextFont(DIALOG,0,12);
57   }
58
59
60     public static void setTitleFont(String JavaDoc fontFace, int style, int size){
61         titleFont=new Font(fontFace,style,size);
62     }
63     public static void setSmallTitleFont(String JavaDoc fontFace, int style, int size){
64         smallTitleFont=new Font(fontFace,style,size);
65     }
66     public static void setTextFont(String JavaDoc fontFace, int style, int size){
67         textFont=new Font(fontFace,style,size);
68     }
69     public static void setStepFont(String JavaDoc fontFace, int style, int size){
70         stepFont=new Font(fontFace,style,size);
71         selectedStepFont=new Font(fontFace,style | Font.BOLD, size);
72     }
73
74     public static Font makeBold(Font font){
75         Font f=new Font(font.getFontName(),font.getStyle() | Font.BOLD, font.getSize());
76         return f;
77     }
78     public static Font makeItalic(Font font){
79         Font f=new Font(font.getFontName(),font.getStyle() | Font.ITALIC, font.getSize());
80         return f;
81     }
82 }
Popular Tags