container.html.svn-base
来自「j2me设计的界面包」· SVN-BASE 代码 · 共 1,052 行 · 第 1/4 页
SVN-BASE
1,052 行
<A NAME="invalidate()"><!-- --></A><H3>
invalidate</H3>
<PRE>
public void <B>invalidate</B>()</PRE>
<DL>
<DD>Same as setShouldCalcPreferredSize(true) but made accessible for layout managers
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setShouldCalcPreferredSize(boolean)"><!-- --></A><H3>
setShouldCalcPreferredSize</H3>
<PRE>
protected void <B>setShouldCalcPreferredSize</B>(boolean shouldCalcPreferredSize)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../com/sun/lwuit/Component.html#setShouldCalcPreferredSize(boolean)">Component</A></CODE></B></DD>
<DD>Indicates the values within the component have changed and preferred size should be recalculated
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/sun/lwuit/Component.html#setShouldCalcPreferredSize(boolean)">setShouldCalcPreferredSize</A></CODE> in class <CODE><A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shouldCalcPreferredSize</CODE> - indicate whether this component need to recalculate his preferred size</DL>
</DD>
</DL>
<HR>
<A NAME="getLayoutWidth()"><!-- --></A><H3>
getLayoutWidth</H3>
<PRE>
public int <B>getLayoutWidth</B>()</PRE>
<DL>
<DD>Returns the width for layout manager purposes, this takes scrolling into consideration unlike the getWidth method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the layout width</DL>
</DD>
</DL>
<HR>
<A NAME="getLayoutHeight()"><!-- --></A><H3>
getLayoutHeight</H3>
<PRE>
public int <B>getLayoutHeight</B>()</PRE>
<DL>
<DD>Returns the height for layout manager purposes, this takes scrolling into consideration unlike the getWidth method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the layout height</DL>
</DD>
</DL>
<HR>
<A NAME="addComponent(com.sun.lwuit.Component)"><!-- --></A><H3>
addComponent</H3>
<PRE>
public void <B>addComponent</B>(<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> cmp)</PRE>
<DL>
<DD>Adds a Component to the Container
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cmp</CODE> - the component to be added</DL>
</DD>
</DL>
<HR>
<A NAME="addComponent(java.lang.Object, com.sun.lwuit.Component)"><!-- --></A><H3>
addComponent</H3>
<PRE>
public void <B>addComponent</B>(java.lang.Object constraints,
<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> cmp)</PRE>
<DL>
<DD>Adds a Component to the Container
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>constraints</CODE> - this method is useful when the Layout requires a constraint such as the BorderLayout. In this case you need to specify an additional data when you add a Component, such as "CENTER", "NORTH"...<DD><CODE>cmp</CODE> - component to add</DL>
</DD>
</DL>
<HR>
<A NAME="replace(com.sun.lwuit.Component, com.sun.lwuit.Component, com.sun.lwuit.animations.Transition)"><!-- --></A><H3>
replace</H3>
<PRE>
public void <B>replace</B>(<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> current,
<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> next,
<A HREF="../../../com/sun/lwuit/animations/Transition.html" title="class in com.sun.lwuit.animations">Transition</A> t)</PRE>
<DL>
<DD>This method replaces the current Component with the next Component. Current Component must be contained in this Container. This method return immediately.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>current</CODE> - a Component to remove from the Container<DD><CODE>next</CODE> - a Component that replaces the current Component<DD><CODE>t</CODE> - a Transition between the add and removal of the Components a Transition can be null</DL>
</DD>
</DL>
<HR>
<A NAME="removeComponent(com.sun.lwuit.Component)"><!-- --></A><H3>
removeComponent</H3>
<PRE>
public void <B>removeComponent</B>(<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> cmp)</PRE>
<DL>
<DD>removes a Component from the Container
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cmp</CODE> - the removed component</DL>
</DD>
</DL>
<HR>
<A NAME="removeAll()"><!-- --></A><H3>
removeAll</H3>
<PRE>
public void <B>removeAll</B>()</PRE>
<DL>
<DD>remove all Components from container
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="revalidate()"><!-- --></A><H3>
revalidate</H3>
<PRE>
public void <B>revalidate</B>()</PRE>
<DL>
<DD>Re-layout the container, this is useful when we modify the container hierarchy and need to redo the layout
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="paint(com.sun.lwuit.Graphics)"><!-- --></A><H3>
paint</H3>
<PRE>
public void <B>paint</B>(<A HREF="../../../com/sun/lwuit/Graphics.html" title="class in com.sun.lwuit">Graphics</A> g)</PRE>
<DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../com/sun/lwuit/Component.html#paint(com.sun.lwuit.Graphics)">Component</A></CODE></B></DD>
<DD>This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sun/lwuit/animations/Animation.html#paint(com.sun.lwuit.Graphics)">paint</A></CODE> in interface <CODE><A HREF="../../../com/sun/lwuit/animations/Animation.html" title="interface in com.sun.lwuit.animations">Animation</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../com/sun/lwuit/Component.html#paint(com.sun.lwuit.Graphics)">paint</A></CODE> in class <CODE><A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>g</CODE> - the component graphics</DL>
</DD>
</DL>
<HR>
<A NAME="layoutContainer()"><!-- --></A><H3>
layoutContainer</H3>
<PRE>
public void <B>layoutContainer</B>()</PRE>
<DL>
<DD>Performs the layout of the container if a layout is necessary
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getComponentCount()"><!-- --></A><H3>
getComponentCount</H3>
<PRE>
public int <B>getComponentCount</B>()</PRE>
<DL>
<DD>Returns the number of components
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the Component count</DL>
</DD>
</DL>
<HR>
<A NAME="getComponentAt(int)"><!-- --></A><H3>
getComponentAt</H3>
<PRE>
public <A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> <B>getComponentAt</B>(int index)</PRE>
<DL>
<DD>Returns the Component at a given index
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - of the Component you wish to get
<DT><B>Returns:</B><DD>a Component
<DT><B>Throws:</B>
<DD><CODE>java.lang.ArrayIndexOutOfBoundsException</CODE> - if an invalid index was given.</DL>
</DD>
</DL>
<HR>
<A NAME="getComponentIndex(com.sun.lwuit.Component)"><!-- --></A><H3>
getComponentIndex</H3>
<PRE>
public int <B>getComponentIndex</B>(<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> cmp)</PRE>
<DL>
<DD>returns the Component index in the Container
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cmp</CODE> - the component to search for
<DT><B>Returns:</B><DD>the Component index in the Container or -1 if not found</DL>
</DD>
</DL>
<HR>
<A NAME="contains(com.sun.lwuit.Component)"><!-- --></A><H3>
contains</H3>
<PRE>
public boolean <B>contains</B>(<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> cmp)</PRE>
<DL>
<DD>Returns true if the given component is within the hierarchy of this container
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cmp</CODE> - a Component to check
<DT><B>Returns:</B><DD>true if this Component contains in this Container</DL>
</DD>
</DL>
<HR>
<A NAME="scrollComponentToVisible(com.sun.lwuit.Component)"><!-- --></A><H3>
scrollComponentToVisible</H3>
<PRE>
protected void <B>scrollComponentToVisible</B>(<A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> c)</PRE>
<DL>
<DD>Makes sure the component is visible in the scroll if this container is scrollable
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>c</CODE> - the component that will be scrolling for visibility</DL>
</DD>
</DL>
<HR>
<A NAME="getComponentAt(int, int)"><!-- --></A><H3>
getComponentAt</H3>
<PRE>
public <A HREF="../../../com/sun/lwuit/Component.html" title="class in com.sun.lwuit">Component</A> <B>getComponentAt</B>(int x,
int y)</PRE>
<DL>
<DD>Returns a Component that exists in the given x, y coordinates by traversing
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?