📄 fontfactory.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_04) on Sun Aug 15 09:34:50 CST 2004 -->
<TITLE>
FontFactory
</TITLE>
<META NAME="keywords" CONTENT="jexi.ui.FontFactory class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="FontFactory";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/FontFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../jexi/ui/Font.html" title="interface in jexi.ui"><B>PREV CLASS</B></A>
<A HREF="../../jexi/ui/Frame.html" title="interface in jexi.ui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="FontFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
jexi.ui</FONT>
<BR>
Class FontFactory</H2>
<PRE>
java.lang.Object
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>jexi.ui.FontFactory</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../jexi/ui/swt/SWTFontFactory.html" title="class in jexi.ui.swt">SWTFontFactory</A></DD>
</DL>
<HR>
<DL>
<DT>public abstract class <B>FontFactory</B><DT>extends java.lang.Object</DL>
<P>
FontFactory is used to create Font. <b>NOTE</b>: All fonts are created and only can be created by FontFactory, and will dispose automatically if you call dispose() method. In fact, each createFont() call will add a reference count of the Font, and a dispose() call will remove a reference count. If the reference is become 0, it will actually disposed, or disposed when application close. This is taken account of effeciency.
<P>
<P>
<DL>
<DT><B>Author:</B></DT> <DD>Xuefeng</DD></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#clearAllFonts()">clearAllFonts</A></B>()</CODE>
<BR>
This method is called by Document when a document is closed. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../jexi/ui/Font.html" title="interface in jexi.ui">Font</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#createDefaultEnglishFont()">createDefaultEnglishFont</A></B>()</CODE>
<BR>
Create the default English font.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract <A HREF="../../jexi/ui/Font.html" title="interface in jexi.ui">Font</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#createFont(java.lang.String, int, boolean, boolean, boolean)">createFont</A></B>(java.lang.String name, int size, boolean bold, boolean italic, boolean underlined)</CODE>
<BR>
Create a font (maybe used an existed one). </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#debug()">debug</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#enumerateFonts()">enumerateFonts</A></B>()</CODE>
<BR>
Subclass must implement this method to enumerate all fonts:</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>abstract int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#fontCount()">fontCount</A></B>()</CODE>
<BR>
How many fonts it used now.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../jexi/ui/FontFactory.html" title="class in jexi.ui">FontFactory</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../jexi/ui/FontFactory.html#instance()">instance</A></B>()</CODE>
<BR>
Get the instance of the FontFactory.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="enumerateFonts()"><!-- --></A><H3>
enumerateFonts</H3>
<PRE>
public abstract java.lang.String[] <B>enumerateFonts</B>()</PRE>
<DL>
<DD>Subclass must implement this method to enumerate all fonts:
<P>
<DD><DL>
<DT><B>Returns:</B><DD>All fonts' names installed on the system.</DL>
</DD>
</DL>
<HR>
<A NAME="instance()"><!-- --></A><H3>
instance</H3>
<PRE>
public static <A HREF="../../jexi/ui/FontFactory.html" title="class in jexi.ui">FontFactory</A> <B>instance</B>()</PRE>
<DL>
<DD>Get the instance of the FontFactory.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The singleton instance of the FontFactory.</DL>
</DD>
</DL>
<HR>
<A NAME="createFont(java.lang.String, int, boolean, boolean, boolean)"><!-- --></A><H3>
createFont</H3>
<PRE>
public abstract <A HREF="../../jexi/ui/Font.html" title="interface in jexi.ui">Font</A> <B>createFont</B>(java.lang.String name, int size, boolean bold, boolean italic, boolean underlined)</PRE>
<DL>
<DD>Create a font (maybe used an existed one). If a font is created first time, put it to the hash table with the key gernerated as "font.toString()".
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - The name of the font, eg: "Arial", "Tahoma"<DD><CODE>size</CODE> - The size of the font, usually 10, 12.<DD><CODE>bold</CODE> - If the font is bold.<DD><CODE>italic</CODE> - If the font is italic.<DD><CODE>underlined</CODE> - If the font is underlined.<DT><B>Returns:</B><DD>Font object.</DL>
</DD>
</DL>
<HR>
<A NAME="clearAllFonts()"><!-- --></A><H3>
clearAllFonts</H3>
<PRE>
public abstract void <B>clearAllFonts</B>()</PRE>
<DL>
<DD>This method is called by Document when a document is closed. Just clean all font resources that is used but the FontFactory is still available.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="createDefaultEnglishFont()"><!-- --></A><H3>
createDefaultEnglishFont</H3>
<PRE>
public <A HREF="../../jexi/ui/Font.html" title="interface in jexi.ui">Font</A> <B>createDefaultEnglishFont</B>()</PRE>
<DL>
<DD>Create the default English font.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The default English font.</DL>
</DD>
</DL>
<HR>
<A NAME="fontCount()"><!-- --></A><H3>
fontCount</H3>
<PRE>
public abstract int <B>fontCount</B>()</PRE>
<DL>
<DD>How many fonts it used now.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The count of fonts used now.</DL>
</DD>
</DL>
<HR>
<A NAME="debug()"><!-- --></A><H3>
debug</H3>
<PRE>
public abstract void <B>debug</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/FontFactory.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../jexi/ui/Font.html" title="interface in jexi.ui"><B>PREV CLASS</B></A>
<A HREF="../../jexi/ui/Frame.html" title="interface in jexi.ui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="FontFactory.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -