javauis/lcdui_qt/src/javax/microedition/lcdui/Spacer.java
changeset 57 59b3b4473dc8
parent 23 98ccebc37403
equal deleted inserted replaced
56:abc41079b313 57:59b3b4473dc8
    21 /**
    21 /**
    22  * Class representing the Spacer item.
    22  * Class representing the Spacer item.
    23  */
    23  */
    24 public class Spacer extends Item
    24 public class Spacer extends Item
    25 {
    25 {
       
    26     /**
       
    27      * If Spacer is changed, reasons for Re-layouting.
       
    28      */
       
    29 	static final int UPDATE_MINIMUMSIZE = UPDATE_ITEM_MAX << 1;
    26 
    30 
    27     private int minimumWidth = -1;
    31     private int minimumWidth = -1;
    28     private int minimumHeight = -1;
    32     private int minimumHeight = -1;
    29 
    33 
    30     /**
    34     /**
    88         {
    92         {
    89             int updateReason = Item.UPDATE_NONE;
    93             int updateReason = Item.UPDATE_NONE;
    90             if(minW != getMinimumWidth())
    94             if(minW != getMinimumWidth())
    91             {
    95             {
    92                 minimumWidth = minW;
    96                 minimumWidth = minW;
    93                 updateReason |= Item.UPDATE_WIDTH_CHANGED;
    97                 updateReason |= UPDATE_MINIMUMSIZE | UPDATE_SIZE_CHANGED;
    94             }
    98             }
    95             if(minH != getMinimumHeight())
    99             if(minH != getMinimumHeight())
    96             {
   100             {
    97                 minimumHeight = minH;
   101                 minimumHeight = minH;
    98                 updateReason |= Item.UPDATE_HEIGHT_CHANGED;
   102                 updateReason |= UPDATE_MINIMUMSIZE | UPDATE_SIZE_CHANGED;
    99             }
   103             }
   100             updateParent(updateReason);
   104 			if(updateReason != Item.UPDATE_NONE)
       
   105             {
       
   106             	updateParent(updateReason);
       
   107 			}
   101         }
   108         }
   102     }
   109     }
   103 
   110 
   104     /**
   111     /**
   105      * Calculates minimum size of this item.
   112      * Calculates minimum size of this item.