📄 texteffectformat.html
字号:
<DT><B>返回:</B><DD>艺术字文本<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; javax.swing.JOptionPane.showMessageDialog(null,"当前艺术字的文本内容是"+txteffect.getText()) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="getType()"><!-- --></A><H3>
getType</H3>
<PRE>
public int <B>getType</B>()</PRE>
<DL>
<DD>得到当前艺术字的类型(当除艺术字大小以外的任何属性改变时,艺术字的类型都会变为-1)。
<P>
<DD><DL>
<DT><B>返回:</B><DD>艺术字的类型,为整型数值,取值0-29: <pre> 0-5 对应艺术字库的第一行第一到第六个 6-11 对应艺术字库的第二行第一到第六个 12-17 对应艺术字库的第三行第一到第六个 18-23 对应艺术字库的第四行第一到第六个 24-29 对应艺术字库的第五行第一到第六个 <pre> <b>例子:</b> <pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; javax.swing.JOptionPane.showMessageDialog(null,"当前艺术字的类型是"+txteffect.getType()+"种") ; </pre></DL>
</DD>
</DL>
<HR>
<A NAME="isEqualHeight()"><!-- --></A><H3>
isEqualHeight</H3>
<PRE>
public boolean <B>isEqualHeight</B>()</PRE>
<DL>
<DD>判断艺术字是否相同高度。
<P>
<DD><DL>
<DT><B>返回:</B><DD>布尔型值,如果艺术字为相同高度,返回true;否则,返回false<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; javax.swing.JOptionPane.showMessageDialog(null,"当前艺术字字母高度是否等高"+txteffect.isEqualHeight()) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="isErect()"><!-- --></A><H3>
isErect</H3>
<PRE>
public boolean <B>isErect</B>()</PRE>
<DL>
<DD>判断艺术字是否为垂直竖排。
<P>
<DD><DL>
<DT><B>返回:</B><DD>布尔型值,如果艺术字垂直竖排,返回true;否则,返回false<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; javax.swing.JOptionPane.showMessageDialog(null,"当前艺术字是否竖排"+txteffect.isErect()) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="setAlignType(int)"><!-- --></A><H3>
setAlignType</H3>
<PRE>
public void <B>setAlignType</B>(int alignType)</PRE>
<DL>
<DD>设置艺术字的对齐方式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>alignType</CODE> - 对齐类型索引值,如为1,表示左对齐;如为2,表示居中对齐;如为3,表示右对齐;如为4,表示伸展对齐<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setAlignType(1) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="setEqualHeight(boolean)"><!-- --></A><H3>
setEqualHeight</H3>
<PRE>
public void <B>setEqualHeight</B>(boolean equal)</PRE>
<DL>
<DD>设置艺术字为相同高度。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>equal</CODE> - 布尔型值,如为true,设置艺术字为相同高度;否则,不设置相同高度<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setEqualHeight(true) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="setErect(boolean)"><!-- --></A><H3>
setErect</H3>
<PRE>
public void <B>setErect</B>(boolean isErect)</PRE>
<DL>
<DD>设置艺术字是否垂直竖排。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>isErect</CODE> - 布尔型值,如为true,设置艺术字垂直竖排;否则,水平方向排列<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setErect(true) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="setMode(int)"><!-- --></A><H3>
setMode</H3>
<PRE>
public void <B>setMode</B>(int mode)</PRE>
<DL>
<DD>设置当前艺术字的形状。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>mode</CODE> - 艺术字的形状类型,取值1-40<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setMode(2) ;</pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数不在1-40之间时</DL>
</DD>
</DL>
<HR>
<A NAME="setPitch(int, double)"><!-- --></A><H3>
setPitch</H3>
<PRE>
public void <B>setPitch</B>(int type,
double pitch)</PRE>
<DL>
<DD>设置艺术字的字间距。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>pitch</CODE> - 艺术字的间距,为double型<DD><CODE>type</CODE> - 艺术字的间距类型,为整型, 取值0-5,0-4为系统定义的间距, 5是自定义间距,间距大小由pitch确定, 对应如下: <pre> 0 非常紧密(0.8f) 1 紧密(0.9f) 2 一般(1.0f) 3 松散(1.2f) 4 非常松散(1.5f) 5 用户自定义间距, 由pitch值确定 </pre> <p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setPitch(1,2.0) ;</pre></DL>
</DD>
</DL>
<HR>
<A NAME="setText(java.lang.String)"><!-- --></A><H3>
setText</H3>
<PRE>
public void <B>setText</B>(java.lang.String text)</PRE>
<DL>
<DD>设置艺术字文本。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>text</CODE> - 艺术字的文本<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setText("春夏秋冬") ;</pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数text越界</DL>
</DD>
</DL>
<HR>
<A NAME="setText(java.lang.String, java.lang.String, int, int)"><!-- --></A><H3>
setText</H3>
<PRE>
public void <B>setText</B>(java.lang.String text,
java.lang.String fontName,
int fontStyle,
int fontSize)</PRE>
<DL>
<DD>设置艺术字文本。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>text</CODE> - 艺术字的文本<DD><CODE>fontName</CODE> - 字体的名称<DD><CODE>fontStyle</CODE> - 字型,为整型数值,1表示黑体,2表示斜体,3表示黑体加斜,0和其余整数表示常规<DD><CODE>fontSize</CODE> - 字体的大小<p><b>例子:</b><pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setText("中华人民共和国","宋体",2,72) ;</pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数text,或fontStyle,或fontSize越界</DL>
</DD>
</DL>
<HR>
<A NAME="setType(int)"><!-- --></A><H3>
setType</H3>
<PRE>
public void <B>setType</B>(int type)</PRE>
<DL>
<DD>设置当前艺术字的类型。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>type</CODE> - 艺术字的类型,为整型数值,取值0-29,超出范围不重新设置,函数直接退出。对应如下: <pre> 0-5 对应艺术字库的第一行第一到第六个 6-11 对应艺术字库的第二行第一到第六个 12-17 对应艺术字库的第三行第一到第六个 18-23 对应艺术字库的第四行第一到第六个 24-29 对应艺术字库的第五行第一到第六个 </pre> <p> <b>例子:</b> <pre> Shapes shapes = Application.getWorkbooks().getActiveWorkbook().getActiveShapes() ; Shape shape = shapes.getShape("艺术字 1") ; TextEffectFormat txteffect = shape.getTextEffectFormat() ; txteffect.setType(10) ; </pre></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 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>概述</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</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="../../../../application/workbooks/workbook/shapes/ShapeText.html" title="application.workbooks.workbook.shapes 中的类"><B>上一个类</B></A>
<A HREF="../../../../application/workbooks/workbook/shapes/TextFrame.html" title="application.workbooks.workbook.shapes 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?application/workbooks/workbook/shapes/TextEffectFormat.html" target="_top"><B>框架</B></A>
<A HREF="TextEffectFormat.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | 字段 | 构造方法 | <A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | 构造方法 | <A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
版权所有 2001-2006 无锡永中科技有限公司
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -