You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/08/12 00:51:20 UTC

svn commit: r803320 - in /incubator/pivot/trunk: tutorials/www/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/skin/ wtk/src/org/apache/pivot/wtk/skin/terra/

Author: tvolkert
Date: Tue Aug 11 22:51:19 2009
New Revision: 803320

URL: http://svn.apache.org/viewvc?rev=803320&view=rev
Log:
Minor fixes, javadoc updates, comment additions; made Component.setFocusedComponent private

Modified:
    incubator/pivot/trunk/tutorials/www/accordions.template.html
    incubator/pivot/trunk/tutorials/www/checkboxes.template.html
    incubator/pivot/trunk/tutorials/www/component_and_container.template.html
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java

Modified: incubator/pivot/trunk/tutorials/www/accordions.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/accordions.template.html?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/accordions.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/accordions.template.html Tue Aug 11 22:51:19 2009
@@ -160,7 +160,7 @@
             public void buttonPressed(Button button) {
                 // Pretend to submit or cancel the order
                 activityIndicator.setActive(!activityIndicator.isActive());
-                processingOrderLabel.setDisplayable(activityIndicator.isActive());
+                processingOrderLabel.setVisible(activityIndicator.isActive());
                 updateConfirmOrderButton();
             }
         });

Modified: incubator/pivot/trunk/tutorials/www/checkboxes.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/checkboxes.template.html?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/checkboxes.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/checkboxes.template.html Tue Aug 11 22:51:19 2009
@@ -68,21 +68,21 @@
                     <BoxPane styles="{verticalAlignment:'center'}">
                         <Checkbox wtkx:id="bellCheckbox" buttonData="Bell"/>
                     </BoxPane>
-                    <ImageView wtkx:id="bellImageView" image="org/apache/pivot/tutorials/bell.png" displayable="false"/>
+                    <ImageView wtkx:id="bellImageView" image="org/apache/pivot/tutorials/bell.png" visible="false"/>
                 </TablePane.Row>
 
                 <TablePane.Row height="24">
                     <BoxPane styles="{verticalAlignment:'center'}">
                         <Checkbox wtkx:id="clockCheckbox" buttonData="Clock"/>
                     </BoxPane>
-                    <ImageView wtkx:id="clockImageView" image="org/apache/pivot/tutorials/clock.png" displayable="false"/>
+                    <ImageView wtkx:id="clockImageView" image="org/apache/pivot/tutorials/clock.png" visible="false"/>
                 </TablePane.Row>
 
                 <TablePane.Row height="24">
                     <BoxPane styles="{verticalAlignment:'center'}">
                         <Checkbox wtkx:id="houseCheckbox" buttonData="House"/>
                     </BoxPane>
-                    <ImageView wtkx:id="houseImageView" image="org/apache/pivot/tutorials/house.png" displayable="false"/>
+                    <ImageView wtkx:id="houseImageView" image="org/apache/pivot/tutorials/house.png" visible="false"/>
                 </TablePane.Row>
             </rows>
         </TablePane>
@@ -92,7 +92,7 @@
 
 <p>Note that this example uses the <tt>TablePane</tt> layout container. <tt>TablePane</tt> defines a two-dimensional grid structure and is similar to an HTML table. It is discussed in more detail in the <a href="layout_containers.html">Layout Containers</a> section.</p>
 
-<p>The following is the Java source for the example. A button press handler is assigned to each checkbox. When the handler is invoked, it simply toggles the displayability of the corresponding image view, causing the image to appear and disappear based on the checkbox's selection state.</p>
+<p>The following is the Java source for the example. A button press handler is assigned to each checkbox. When the handler is invoked, it simply toggles the visibility of the corresponding image view, causing the image to appear and disappear based on the checkbox's selection state.</p>
 
 <pre class="brush:java">
 package org.apache.pivot.tutorials.buttons;
@@ -130,19 +130,19 @@
         // Wire up event listeners
         bellCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
             public void buttonPressed(Button button) {
-                bellImageView.setDisplayable(!bellImageView.isDisplayable());
+                bellImageView.setVisible(!bellImageView.isVisible());
             }
         });
 
         clockCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
             public void buttonPressed(Button button) {
-                clockImageView.setDisplayable(!clockImageView.isDisplayable());
+                clockImageView.setVisible(!clockImageView.isVisible());
             }
         });
 
         houseCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
             public void buttonPressed(Button button) {
-                houseImageView.setDisplayable(!houseImageView.isDisplayable());
+                houseImageView.setVisible(!houseImageView.isVisible());
             }
         });
 

Modified: incubator/pivot/trunk/tutorials/www/component_and_container.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/component_and_container.template.html?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/component_and_container.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/component_and_container.template.html Tue Aug 11 22:51:19 2009
@@ -76,8 +76,6 @@
 <p>
 <tt>public boolean isVisible()</tt><br>
 <tt>public void setVisible(boolean visible)</tt><br>
-<tt>public boolean isDisplayable()</tt><br>
-<tt>public void setDisplayable(boolean displayable)</tt><br>
 </p>
 
 <p>These methods manage a component's visibility. A component that is not visible is not painted, and a component that is not displayable is neither painted nor included in layout. The value of the displayable flag can thus loosely be considered a component's "preferred visibility".</p>

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Tue Aug 11 22:51:19 2009
@@ -2153,10 +2153,10 @@
 
     /**
      * Returns this component's focusability. A focusable component is capable
-     * of receiving the focus.
+     * of receiving the focus only when it is showing and enabled.
      *
      * @return
-     * <tt>true</tt> if the component is enabled and visible.
+     * <tt>true</tt> if the component is capable of receiving the focus
      */
     public boolean isFocusable() {
         return skin.isFocusable()
@@ -2168,11 +2168,11 @@
      * Returns the component's focused state.
      *
      * @return
-     * <tt>true</tt> if the component has the input focus; <tt>false</tt>;
+     * <tt>true</tt> if the component has the input focus; <tt>false</tt>
      * otherwise.
      */
     public boolean isFocused() {
-        return focusedComponent == this;
+        return (focusedComponent == this);
     }
 
     /**
@@ -2198,6 +2198,10 @@
 
     /**
      * Requests that focus be given to this component.
+     *
+     * @return
+     * The component that got the focus, or <tt>null</tt> if the focus request
+     * was denied
      */
     public Component requestFocus() {
         if (isFocusable()) {
@@ -2245,7 +2249,7 @@
      * <tt>true</tt> if this focus change is or was temporary; <tt>false</tt>,
      * if it is permanent.
      */
-    public static void setFocusedComponent(Component focusedComponent) {
+    private static void setFocusedComponent(Component focusedComponent) {
         Component previousFocusedComponent = Component.focusedComponent;
 
         if (previousFocusedComponent != focusedComponent) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java Tue Aug 11 22:51:19 2009
@@ -431,8 +431,13 @@
      }
 
     /**
-     * Requests that focus be set to the first focusable descendant in this
-     * container.
+     * Requests that focus be given to this container. If this container is not
+     * focusable, this requests that focus be set to the first focusable
+     * descendant in this container.
+     *
+     * @return
+     * The component that got the focus, or <tt>null</tt> if the focus request
+     * was denied
      */
     @Override
     public Component requestFocus() {
@@ -440,6 +445,9 @@
 
         if (component == null
             && focusTraversalPolicy != null) {
+            // TODO Guard against infinite loop that can occur if the focus
+            // traversal policy loops, and all components that it returns are
+            // not focusable
             do {
                 component = focusTraversalPolicy.getNextComponent(this, component, Direction.FORWARD);
             } while (component != null

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java Tue Aug 11 22:51:19 2009
@@ -196,8 +196,6 @@
                 // Add the component to the row
                 row.add(component);
                 rowWidth += componentSize.width + horizontalSpacing;
-            } else {
-                component.setSize(0, 0);
             }
         }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java Tue Aug 11 22:51:19 2009
@@ -805,7 +805,7 @@
 
     /**
      * Gets the preferred width of a table pane column, which is defined as the
-     * maximum preferred width of the column's displayable components. The
+     * maximum preferred width of the column's visible components. The
      * preferred width of each constituent component will be constrained by the
      * height of the row that the component occupies (as specified in the array
      * of row heights).
@@ -858,7 +858,7 @@
 
     /**
      * Gets the preferred height of a table pane row, which is defined as the
-     * maximum preferred height of the row's displayable components. The
+     * maximum preferred height of the row's visible components. The
      * preferred height of each constituent component will be constrained by
      * the width of the column that the component occupies (as specified in the
      * array of column widths).

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java?rev=803320&r1=803319&r2=803320&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java Tue Aug 11 22:51:19 2009
@@ -329,7 +329,7 @@
         if (content != null) {
             if (rollup.isExpanded()
                 || (expandTransition != null
-                    && !expandTransition.isReversed())) {
+                && !expandTransition.isReversed())) {
                 int contentWidth, contentHeight;
                 if (fill) {
                     contentWidth = justifiedWidth;