javauis/lcdui_qt/src/javax/microedition/lcdui/CustomItem.java
changeset 61 bf7ee68962da
parent 47 f40128debb5d
child 79 2f468c1958d0
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/CustomItem.java	Tue Jul 06 14:10:26 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/CustomItem.java	Wed Aug 18 09:43:15 2010 +0300
@@ -20,16 +20,13 @@
 
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.internal.extension.CanvasExtension;
 import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Scrollable;
 
 /**
  * Implementation of LCDUI abstract <code>CustomItem</code> class.
  */
 public abstract class CustomItem extends Item
 {
-
     protected static final int NONE = 0;
     protected static final int TRAVERSE_HORIZONTAL = 1;
     protected static final int TRAVERSE_VERTICAL = 2;
@@ -43,9 +40,10 @@
     protected static final int POINTER_DRAG = 0x80;
 
     /**
-     * Constant used by layouter to repaint CustomItem's rectangle section.
+     * If CustomItem is changed, reasons for Re-layouting.
      */
-    static final int UPDATE_REPAINT_RECT = 4;
+	static final int UPDATE_REASON_REPAINT = UPDATE_ITEM_MAX << 1;
+
 
     private boolean cleanupNeeded;
     private int contentWidth;
@@ -154,7 +152,7 @@
     {
         Rectangle rect = new Rectangle(aX, aY, aWidth, aHeight);
         // From here it goes to updateItem()
-        updateParent(UPDATE_REPAINT_RECT, rect);
+        updateParent(UPDATE_REASON_REPAINT, rect);
     }
 
     /**
@@ -308,7 +306,7 @@
                 contentHeight = newHeight;
             }
             EventDispatcher eventDispatcher = EventDispatcher.instance();
-            LCDUIEvent event = eventDispatcher.newEvent(LCDUIEvent.CUSTOMITEM_SIZECHANGED, layouter.dfi.getForm());
+            LCDUIEvent event = eventDispatcher.newEvent(LCDUIEvent.CUSTOMITEM_SIZECHANGED, layouter.formLayouter.getForm());
             event.item = this;
             eventDispatcher.postEvent(event);
             synchronized(cleanupLock)
@@ -356,7 +354,7 @@
         else
         {
             // Item was added to a Form
-            layouter = ((CustomItemLayouter)((Form)parent).getLayoutPolicy().getLayouter(this));
+            layouter = ((CustomItemLayouter)((Form)parent).getFormLayouter().getItemLayouter(this));
         }
     }
 
@@ -432,7 +430,7 @@
                 {
                     EventDispatcher eventDispatcher = EventDispatcher.instance();
                     LCDUIEvent event = eventDispatcher.newEvent(
-                                           LCDUIEvent.CUSTOMITEM_PAINT_MIDLET_REQUEST, layouter.dfi.getForm());
+                                           LCDUIEvent.CUSTOMITEM_PAINT_MIDLET_REQUEST, layouter.formLayouter.getForm());
                     event.widget = control;
                     event.item = this;
                     eventDispatcher.postEvent(event);