01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets;
06:
07: import java.awt.*;
08: import java.util.*;
09: import java.io.*;
10:
11: /**
12: * SConstants defines Servlet Constants.
13: *
14: * @author Robin Sharp
15: */
16:
17: import java.awt.*;
18: import java.io.*;
19: import java.util.*;
20:
21: public class SUtilities {
22: /**
23: * Get the font size.
24: */
25: public static String getSize(SFont font) {
26: if (font == null)
27: return null;
28:
29: int size = font.getSize();
30:
31: if (size == 12)
32: return null;
33: if (size <= 6)
34: return "-2";
35: if (size <= 8)
36: return "-1";
37: if (size >= 36)
38: return "+4";
39: if (size >= 24)
40: return "+3";
41: if (size >= 18)
42: return "+2";
43: if (size >= 14)
44: return "+1";
45:
46: return null;
47: }
48: }
|