style.html.svn-base
来自「j2me设计的界面包」· SVN-BASE 代码 · 共 1,435 行 · 第 1/4 页
SVN-BASE
1,435 行
<!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.6.0_01) on Thu Jun 05 13:35:07 IDT 2008 -->
<TITLE>
Style
</TITLE>
<META NAME="date" CONTENT="2008-06-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Style";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= 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=2 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/Style.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="../../../../com/sun/lwuit/plaf/LookAndFeel.html" title="class in com.sun.lwuit.plaf"><B>PREV CLASS</B></A>
<A HREF="../../../../com/sun/lwuit/plaf/UIManager.html" title="class in com.sun.lwuit.plaf"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/sun/lwuit/plaf/Style.html" target="_top"><B>FRAMES</B></A>
<A HREF="Style.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 | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <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">
com.sun.lwuit.plaf</FONT>
<BR>
Class Style</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.lwuit.plaf.Style</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Style</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Represents the look of a given component: colors, fonts, transperncy, margin and padding & images. <p>Each Component contains a Style Object and allows Style modification in Runtime by Using <code>cmp.getStyle()</code> The style is also used in Themeing, when a Theme is Changed the Styles Objects are been updated automatically. <p>When changing a theme the elements changed manually in a style will not be updated by the theme change by default. There are two ways to change that behavior: <ol><li>Use the set method that accepts a second boolean argument and set it to true. <li>Create a new style object and pass all the options in the constructor (without invoking setters manually). </ol> <p> The Margin and Padding is inspired by <a href="http://www.w3.org/TR/REC-CSS2/box.html">W3 Box Model</a> <pre> ************************** * Margin * * ******************** * * * Padding * * * * *********** * * * * * Content * * * * * *********** * * * * Padding * * * ******************** * * Margin * **************************</pre>
<P>
<P>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#BG_COLOR">BG_COLOR</A></B></CODE>
<BR>
Background color attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#BG_IMAGE">BG_IMAGE</A></B></CODE>
<BR>
Background image attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#BG_SELECTION_COLOR">BG_SELECTION_COLOR</A></B></CODE>
<BR>
Background selection color attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#FG_COLOR">FG_COLOR</A></B></CODE>
<BR>
Foreground color attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#FG_SELECTION_COLOR">FG_SELECTION_COLOR</A></B></CODE>
<BR>
Foreground color attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#FONT">FONT</A></B></CODE>
<BR>
Font attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#MARGIN">MARGIN</A></B></CODE>
<BR>
Margin attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#PADDING">PADDING</A></B></CODE>
<BR>
Padding attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#SCALED_IMAGE">SCALED_IMAGE</A></B></CODE>
<BR>
Scaled image attribute name for the theme hashtable</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#TRANSPARENCY">TRANSPARENCY</A></B></CODE>
<BR>
Transparency attribute name for the theme hashtable</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#Style()">Style</A></B>()</CODE>
<BR>
Each component when it draw itself uses this Object to determine in what colors it should use.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#Style(int, int, int, int, com.sun.lwuit.Font, byte)">Style</A></B>(int fgColor,
int bgColor,
int fgSelectionColor,
int bgSelectionColor,
<A HREF="../../../../com/sun/lwuit/Font.html" title="class in com.sun.lwuit">Font</A> f,
byte transparency)</CODE>
<BR>
Creates a new style with the given attributes</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#Style(int, int, int, int, com.sun.lwuit.Font, byte, com.sun.lwuit.Image, boolean)">Style</A></B>(int fgColor,
int bgColor,
int fgSelectionColor,
int bgSelectionColor,
<A HREF="../../../../com/sun/lwuit/Font.html" title="class in com.sun.lwuit">Font</A> f,
byte transparency,
<A HREF="../../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A> im,
boolean scaledImage)</CODE>
<BR>
Creates a new style with the given attributes</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#Style(com.sun.lwuit.plaf.Style)">Style</A></B>(<A HREF="../../../../com/sun/lwuit/plaf/Style.html" title="class in com.sun.lwuit.plaf">Style</A> style)</CODE>
<BR>
Creates a full copy of the given style.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#addStyleListener(com.sun.lwuit.events.StyleListener)">addStyleListener</A></B>(<A HREF="../../../../com/sun/lwuit/events/StyleListener.html" title="interface in com.sun.lwuit.events">StyleListener</A> l)</CODE>
<BR>
Adds a Style Listener to the Style Object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getBgColor()">getBgColor</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../com/sun/lwuit/Image.html" title="class in com.sun.lwuit">Image</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getBgImage()">getBgImage</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../com/sun/lwuit/Painter.html" title="interface in com.sun.lwuit">Painter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getBgPainter()">getBgPainter</A></B>()</CODE>
<BR>
Return the background painter for this style, normally this would be the internal image/color painter but can be user defined</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getBgSelectionColor()">getBgSelectionColor</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> byte</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getBgTransparency()">getBgTransparency</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getFgColor()">getFgColor</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getFgSelectionColor()">getFgSelectionColor</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../com/sun/lwuit/Font.html" title="class in com.sun.lwuit">Font</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getFont()">getFont</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/sun/lwuit/plaf/Style.html#getMargin(int)">getMargin</A></B>(int orientation)</CODE>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?