2 * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved.
\r
4 * The program is provided "as is" without any warranty express or
\r
5 * implied, including the warranty of non-infringement and the implied
\r
6 * warranties of merchantibility and fitness for a particular purpose.
\r
7 * IBM will not be liable for any damages suffered by you as a result
\r
8 * of using the Program. In no event will IBM be liable for any
\r
9 * special, indirect or consequential damages or lost profits even if
\r
10 * IBM has been advised of the possibility of their occurrence. IBM
\r
11 * will not be liable for any third party claims against you.
\r
13 package com.ibm.richtext.uiimpl;
\r
15 import java.awt.Color;
\r
17 import com.ibm.richtext.uiimpl.resources.FrameResources;
\r
19 import com.ibm.richtext.styledtext.MConstText;
\r
20 import com.ibm.richtext.styledtext.StyledText;
\r
21 import com.ibm.richtext.styledtext.StyleModifier;
\r
23 import com.ibm.richtext.textlayout.attributes.AttributeMap;
\r
24 import com.ibm.richtext.textlayout.attributes.TextAttribute;
\r
26 public final class AboutText {
\r
28 static final String COPYRIGHT =
\r
29 "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";
\r
30 private static final Color[] COLORS = {
\r
31 Color.red, Color.blue, Color.white, Color.green
\r
34 public static MConstText getAboutText() {
\r
36 String text = ResourceUtils.getResourceString(FrameResources.ABOUT_TEXT);
\r
37 StyledText styledText = new StyledText(text, AttributeMap.EMPTY_ATTRIBUTE_MAP);
\r
39 int length = styledText.length();
\r
42 for (int paragraphStart = 0, paragraphLimit;
\r
43 paragraphStart < length;
\r
44 paragraphStart = paragraphLimit) {
\r
46 paragraphLimit = styledText.paragraphLimit(paragraphStart);
\r
47 StyleModifier modifier = StyleModifier.createAddModifier(
\r
48 TextAttribute.FOREGROUND,
\r
49 COLORS[(i++)%COLORS.length]);
\r
50 styledText.modifyCharacterStyles(paragraphStart,
\r
55 StyleModifier modifier = StyleModifier.createAddModifier(
\r
56 TextAttribute.LINE_FLUSH,
\r
57 TextAttribute.FLUSH_CENTER);
\r
59 styledText.modifyParagraphStyles(0, text.length(), modifier);
\r