Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/memoire/dja/DjaFont.java


1   /**
2    * @modification $Date: 2001/12/03 16:28:08 $
3    * @statut       unstable
4    * @file         DjaFont.java
5    * @version      0.36
6    * @author       Guillaume Desnoix
7    * @email        guillaume@desnoix.com
8    * @license      GNU General Public License 2 (GPL2)
9    * @copyright    1998-2001 Guillaume Desnoix
10   */
11  
12  package com.memoire.dja;
13  
14  import com.memoire.dja.*;
15  
16  import java.awt.*;
17  import java.io.*;
18  
19  public class DjaFont
20    implements DjaOptions, Cloneable, Serializable
21  {
22      private String family_;
23      private int    style_;
24      private int    size_;
25  
26      private transient Font font_;
27  
28      public DjaFont()
29      {
30    this(defaultPlainFont);
31      }
32  
33      public DjaFont(String _family, int _style, int _size)
34      {
35    this(new Font(_family,_style,_size));
36      }
37  
38      public DjaFont(Font _font)
39      {
40    font_  =_font;
41    family_=_font.getFamily();
42    style_ =_font.getStyle();
43    size_  =_font.getSize();
44      }
45  
46      public Font getFont()
47      {
48    if(font_==null) font_=new Font(family_,style_,size_);
49    return font_;
50      }
51  }