javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/Image.java
changeset 35 85266cc22c7f
parent 26 dc7c549001d5
child 56 abc41079b313
child 61 bf7ee68962da
equal deleted inserted replaced
26:dc7c549001d5 35:85266cc22c7f
   158     /**
   158     /**
   159      * Prevents uninitialized instances from being created outside the package.
   159      * Prevents uninitialized instances from being created outside the package.
   160      * @param device Device
   160      * @param device Device
   161      */
   161      */
   162     Image(Device device) {
   162     Image(Device device) {
   163         if (device == null) device = Device.getDevice();
       
   164         if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
   163         if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
   165         this.device = device;
   164         this.device = device;
   166     }
   165     }
   167 
   166 
   168     /**
   167     /**
   448             icon = SWT.NULL;
   447             icon = SWT.NULL;
   449         }
   448         }
   450 
   449 
   451         if (device == null) return;
   450         if (device == null) return;
   452         if (device.isDisposed()) return;
   451         if (device.isDisposed()) return;
   453         if (device.tracking) device.dispose_Object(this);
   452         if (Device.tracking) device.dispose_Object(this);
   454         device = null;
   453         device = null;
   455     }
   454     }
   456 
   455 
   457     /**
   456     /**
   458      * Compares the argument to the receiver, and returns true
   457      * Compares the argument to the receiver, and returns true
   818 
   817 
   819     /*
   818     /*
   820      * Call this only after dealing with all exceptions!
   819      * Call this only after dealing with all exceptions!
   821      */
   820      */
   822     private void track() {
   821     private void track() {
   823         if (device.tracking) device.new_Object(this);
   822         if (Device.tracking) device.new_Object(this);
   824     }
   823     }
   825 }
   824 }