Source Code Cross Referenced for FontFamily.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » compiler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » Laszlo 4.0.10 » org.openlaszlo.compiler 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*****************************************************************************
002:         * FontFamily.java
003:         * ****************************************************************************/package org.openlaszlo.compiler;
004:
005:        import org.openlaszlo.iv.flash.api.text.*;
006:
007:        import java.awt.geom.Rectangle2D;
008:
009:        /** 
010:         * Class for holding Font Families
011:         *
012:         * @author Eric Bloch
013:         */
014:        final class FontFamily {
015:
016:            private Rectangle2D[] boundsPlain = null;
017:            private Rectangle2D[] boundsBold = null;
018:            private Rectangle2D[] boundsItalic = null;
019:            private Rectangle2D[] boundsBitalic = null;
020:
021:            public FontFamily() {
022:                plain = null;
023:                bold = null;
024:                italic = null;
025:                bitalic = null;
026:            }
027:
028:            /**
029:             * Create a font description
030:             */
031:            public FontFamily(Font plain, Font bold, Font italic, Font bitalic) {
032:                this .plain = plain;
033:                this .bold = bold;
034:                this .italic = italic;
035:                this .bitalic = bitalic;
036:            }
037:
038:            /**
039:             * @return the font font for the given style
040:             */
041:            public Font getStyle(int style) {
042:                switch (style) {
043:                case FontInfo.PLAIN:
044:                    return plain;
045:                case FontInfo.BOLD:
046:                    return bold;
047:                case FontInfo.ITALIC:
048:                    return italic;
049:                case FontInfo.BOLDITALIC:
050:                    return bitalic;
051:                default:
052:                    throw new CompilationError(
053:                    /* (non-Javadoc)
054:                     * @i18n.test
055:                     * @org-mes="Unknown style " + p[0]
056:                     */
057:                    org.openlaszlo.i18n.LaszloMessages.getMessage(
058:                            FontFamily.class.getName(), "051018-63",
059:                            new Object[] { new Integer(style) }));
060:                }
061:            }
062:
063:            private String getBookRecommendations() {
064:                return "http://www.wetmachine.com/books.html";
065:            }
066:
067:            /**
068:             * @return the glpyh bounds array for this font
069:             */
070:            public Rectangle2D[] getBounds(int style) {
071:                switch (style) {
072:                case FontInfo.PLAIN:
073:                    if (plain != null && boundsPlain == null) {
074:                        boundsPlain = plain.getGlyphBounds();
075:                    }
076:                    return boundsPlain;
077:                case FontInfo.BOLD:
078:                    if (bold != null && boundsBold == null) {
079:                        boundsBold = bold.getGlyphBounds();
080:                    }
081:                    return boundsBold;
082:                case FontInfo.ITALIC:
083:                    if (italic != null && boundsItalic == null) {
084:                        boundsItalic = italic.getGlyphBounds();
085:                    }
086:                    return boundsItalic;
087:                case FontInfo.BOLDITALIC:
088:                    if (bitalic != null && boundsBitalic == null) {
089:                        boundsBitalic = bitalic.getGlyphBounds();
090:                    }
091:                    return boundsBitalic;
092:                default:
093:                    throw new CompilationError(
094:                    /* (non-Javadoc)
095:                     * @i18n.test
096:                     * @org-mes="Unknown style " + p[0]
097:                     */
098:                    org.openlaszlo.i18n.LaszloMessages.getMessage(
099:                            FontFamily.class.getName(), "051018-63",
100:                            new Object[] { new Integer(style) }));
101:                }
102:            }
103:
104:            /** the plain font */
105:            public Font plain = null;
106:            /** the bold font */
107:            public Font bold = null;
108:            /** the italic font */
109:            public Font italic = null;
110:            /** the bold italic font */
111:            public Font bitalic = null;
112:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.