Last change
on this file since 26588 was 26588, checked in by davidb, 11 years ago |
Initial import of Korii's 520 project for managing digital cultural collections from Greenstone in Expeditee.
|
File size:
1.1 KB
|
Line | |
---|
1 | package org.honours.items;
|
---|
2 |
|
---|
3 | import java.awt.Color;
|
---|
4 | import java.awt.Font;
|
---|
5 |
|
---|
6 | import org.expeditee.io.Conversion;
|
---|
7 | import org.w3c.dom.Document;
|
---|
8 | import org.w3c.dom.Element;
|
---|
9 |
|
---|
10 | public class TextInformation {
|
---|
11 |
|
---|
12 | public static Element determineTextElemType(float size, boolean isBold, Document doc)
|
---|
13 | {
|
---|
14 | Element elem = doc.createElement("p");
|
---|
15 |
|
---|
16 | if(isBold){
|
---|
17 | if(size == 32)
|
---|
18 | elem = doc.createElement("h1");
|
---|
19 | else if(size == 24)
|
---|
20 | elem = doc.createElement("h2");
|
---|
21 | else if(size == 18)
|
---|
22 | elem = doc.createElement("h3");
|
---|
23 | else if(size == 13)
|
---|
24 | elem = doc.createElement("h5");
|
---|
25 | else if(size == 10)
|
---|
26 | elem = doc.createElement("h6");
|
---|
27 | }
|
---|
28 |
|
---|
29 | return elem;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public static String[] setUpFontAttributes(Font f, Color c){
|
---|
33 |
|
---|
34 | String[] a = new String[4];
|
---|
35 | a[0] = Conversion.getCssFontFamily(f.getFamily()); //add font family to first index position.
|
---|
36 | a[1] = (f.isBold()) ? "bold" : "normal";
|
---|
37 | a[2] = (f.isItalic()) ? "italic" : "normal";
|
---|
38 | a[3] = (c != null) ? Conversion.getCssColor(c) : Conversion.getCssColor(new Color(0,0,0));
|
---|
39 |
|
---|
40 | return a;
|
---|
41 | }
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.