Пример #1
0
        /// <summary>
        /// Processes item events occurring on this check box menu item by
        /// dispatching them to any registered <code>ItemListener</code> objects.
        /// <para>
        /// This method is not called unless item events are
        /// enabled for this menu item. Item events are enabled
        /// when one of the following occurs:
        /// <ul>
        /// <li>An <code>ItemListener</code> object is registered
        /// via <code>addItemListener</code>.
        /// <li>Item events are enabled via <code>enableEvents</code>.
        /// </ul>
        /// </para>
        /// <para>Note that if the event parameter is <code>null</code>
        /// the behavior is unspecified and may result in an
        /// exception.
        ///
        /// </para>
        /// </summary>
        /// <param name="e"> the item event </param>
        /// <seealso cref=         java.awt.event.ItemEvent </seealso>
        /// <seealso cref=         java.awt.event.ItemListener </seealso>
        /// <seealso cref=         #addItemListener </seealso>
        /// <seealso cref=         java.awt.MenuItem#enableEvents
        /// @since       JDK1.1 </seealso>
        protected internal virtual void ProcessItemEvent(ItemEvent e)
        {
            ItemListener listener = ItemListener;

            if (listener != null)
            {
                listener.ItemStateChanged(e);
            }
        }
Пример #2
0
 /// <summary>
 /// Removes the specified item listener so that it no longer receives
 /// item events from this check box menu item.
 /// If l is null, no exception is thrown and no action is performed.
 /// <para>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
 /// >AWT Threading Issues</a> for details on AWT's threading model.
 ///
 /// </para>
 /// </summary>
 /// <param name="l"> the item listener </param>
 /// <seealso cref=           #addItemListener </seealso>
 /// <seealso cref=           #getItemListeners </seealso>
 /// <seealso cref=           java.awt.event.ItemEvent </seealso>
 /// <seealso cref=           java.awt.event.ItemListener
 /// @since         JDK1.1 </seealso>
 public virtual void RemoveItemListener(ItemListener l)
 {
     lock (this)
     {
         if (l == null)
         {
             return;
         }
         ItemListener = AWTEventMulticaster.Remove(ItemListener, l);
     }
 }
Пример #3
0
 /// <summary>
 /// Adds the specified item listener to receive item events from
 /// this check box menu item.  Item events are sent in response to user
 /// actions, but not in response to calls to setState().
 /// If l is null, no exception is thrown and no action is performed.
 /// <para>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
 /// >AWT Threading Issues</a> for details on AWT's threading model.
 ///
 /// </para>
 /// </summary>
 /// <param name="l"> the item listener </param>
 /// <seealso cref=           #removeItemListener </seealso>
 /// <seealso cref=           #getItemListeners </seealso>
 /// <seealso cref=           #setState </seealso>
 /// <seealso cref=           java.awt.event.ItemEvent </seealso>
 /// <seealso cref=           java.awt.event.ItemListener
 /// @since         JDK1.1 </seealso>
 public virtual void AddItemListener(ItemListener l)
 {
     lock (this)
     {
         if (l == null)
         {
             return;
         }
         ItemListener  = AWTEventMulticaster.Add(ItemListener, l);
         NewEventsOnly = true;
     }
 }
Пример #4
0
        private static async IAsyncEnumerable <ICacheEntry <int, string> > GetItemContinuousQuery()
        {
            var queryListener   = new ItemListener <int, string>();
            var continuousQuery = new ContinuousQuery <int, string>(queryListener);

            using (ItemCache.QueryContinuous(continuousQuery))
            {
                while (true)
                {
                    while (queryListener.Events.TryDequeue(out var entryEvent))
                    {
                        yield return(entryEvent);
                    }

                    await queryListener.HasData.WaitAsync();
                }
            }
        }
Пример #5
0
    /// <summary>
    /// Function called when the manipulation is ended.
    /// </summary>
    /// <param name="gesture">The current gesture.</param>
    protected override void OnEndManipulation(TapGesture gesture)
    {
        if (gesture.WasCancelled)
        {
            return;
        }

        // If gesture is targeting an existing object we are done.
        if (gesture.TargetObject != null)
        {
            //Debug.Log("\nTarget Object != null");
            return;
        }

        if (IsPointerOverUIObject())
        {
            //Debug.Log("\n\nIsPointerOverUIObject");
            return;
        }
        // Raycast against the location the player touched to search for planes.
        TrackableHit      hit;
        TrackableHitFlags raycastFilter = TrackableHitFlags.PlaneWithinPolygon;


        if (Frame.Raycast(
                gesture.StartPosition.x, gesture.StartPosition.y, raycastFilter, out hit))
        {
            // Use hit pose and camera pose to check if hittest is from the
            // back of the plane, if it is, no need to create the anchor.


            if ((hit.Trackable is DetectedPlane) &&
                Vector3.Dot(FirstPersonCamera.transform.position - hit.Pose.position,
                            hit.Pose.rotation * Vector3.up) < 0)
            {
                Debug.Log("Hit at back of the current DetectedPlane");
            }
            else
            {
                // Instantiate game object at the hit pose.
                DetectedPlane detectedPlane = hit.Trackable as DetectedPlane;

                //Debug.Log("\n\n\n\n\ndetectedPlane.PlaneType=" + detectedPlane.PlaneType.ToString());
                //Debug.Log("DetectedPlaneType.HorizontalUpwardFacing=" + DetectedPlaneType.HorizontalUpwardFacing.ToString());
                //Debug.Log("currentNumberOfObjects=" + currentNumberOfObjects.ToString());
                //Debug.Log("numberOfObjectsAllowed=" + numberOfObjectsAllowed.ToString());
                //Debug.Log("===>Condition=" + (detectedPlane.PlaneType == DetectedPlaneType.HorizontalUpwardFacing && currentNumberOfObjects < numberOfObjectsAllowed).ToString());
                //if (detectedPlane.PlaneType == DetectedPlaneType.Vertical && currentNumberOfVerticalObjects < numberOfObjectsAllowed)
                // {
                //GameObject modelprefab = Instantiate(GameObjectVerticalPlanePrefab, hit.Pose.position, hit.Pose.rotation);
                // GenerateModels(modelprefab, hit);
                // currentNumberOfVerticalObjects++;
                //}
                //else if (detectedPlane.PlaneType == DetectedPlaneType.HorizontalUpwardFacing && currentNumberOfObjects < numberOfObjectsAllowed )
                //{
                //floor
                //Debug.Log("\n\n hit horizontal !!!!!");

                //int prefabval = SetValue.getprefab();
                //if (prefabval == 0)
                //{
                //GameObject modelprefab = Instantiate(tablePrefab, hit.Pose.position, hit.Pose.rotation);
                //GenerateModels(modelprefab, hit);
                //}
                //else
                //{
                if (detectedPlane.PlaneType == DetectedPlaneType.Vertical || detectedPlane.PlaneType == DetectedPlaneType.HorizontalDownwardFacing || detectedPlane.PlaneType == DetectedPlaneType.HorizontalUpwardFacing)
                {
                    Vector3    pos            = hit.Pose.position;
                    GameObject currGameObject = ItemListener.getSelectedGameObject();
                    if (currGameObject != null)
                    {
                        //hit.Pose.rotation
                        GameObject modelprefab = Instantiate(currGameObject, pos, hit.Pose.rotation);
                        //modelprefab.transform.localScale = new Vector3(0.01f, 0.01f, 0.01f);
                        //modelprefab.AddComponent<BoxCollider>();

                        GenerateModels(modelprefab, hit);
                    }
                }

                //}

                //currentNumberOfObjects++;
                //}
                //else if (detectedPlane.PlaneType == DetectedPlaneType.HorizontalDownwardFacing && currentNumberOfUpObjects < numberOfObjectsAllowed)
                //{
                //   GameObject modelprefab = Instantiate(GameObjectHorizontalUpwardPlanePrefab, hit.Pose.position, hit.Pose.rotation);
                //   GenerateModels(modelprefab, hit);
                //   currentNumberOfUpObjects++;
                //}
            }
        }
    }
Пример #6
0
 /// <summary>
 /// Adds item-listener-a with item-listener-b and
 /// returns the resulting multicast listener. </summary>
 /// <param name="a"> item-listener-a </param>
 /// <param name="b"> item-listener-b </param>
 public static ItemListener Add(ItemListener a, ItemListener b)
 {
     return((ItemListener)AddInternal(a, b));
 }
Пример #7
0
 /// <summary>
 /// Removes the old item-listener from item-listener-l and
 /// returns the resulting multicast listener. </summary>
 /// <param name="l"> item-listener-l </param>
 /// <param name="oldl"> the item-listener being removed </param>
 public static ItemListener Remove(ItemListener l, ItemListener oldl)
 {
     return((ItemListener)RemoveInternal(l, oldl));
 }
 /// <summary>
 /// Removes an <code>ItemListener</code> from the button.
 /// </summary>
 public void removeItemListener(ItemListener @l)
 {
 }
 /// <summary>
 /// Adds an <code>ItemListener</code> to the <code>checkbox</code>.
 /// </summary>
 public void addItemListener(ItemListener @l)
 {
 }
Пример #10
0
 public void setAsSelected()
 {
     selectedGameObject = currGameObject;
     Debug.Log("SELECTED: " + ItemListener.getSelectedGameObject().name);
 }
Пример #11
0
		/// <summary>
		/// Removes an <code>ItemListener</code> from the button.
		/// </summary>
		public void removeItemListener(ItemListener @l)
		{
		}
Пример #12
0
		/// <summary>
		/// Adds an <code>ItemListener</code> to the <code>checkbox</code>.
		/// </summary>
		public void addItemListener(ItemListener @l)
		{
		}