public WellLocationControl(string fileName)
 {
     InitializeComponent();
     CreateWellLocation(fileName);
     mb = new WellLocationsConnectManipulator();
     ((WellLocationsConnectManipulator)mb).OnFinishSelect += Dm_OnFinishSelect;
 }
Example #2
0
        /// <summary>
        /// Called when a mouse button is pressed down.
        /// </summary>
        /// <param name="button">
        /// The button.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.
        /// </param>
        private void OnMouseButtonDown(OxyMouseButton button, MouseButtonEventArgs e)
        {
            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus();
            this.CaptureMouse();

            int clickCount = 1;

            if (MouseButtonHelper.IsDoubleClick(this, e))
            {
                clickCount = 2;
            }

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(button, e);
                this.ActualModel.HandleMouseDown(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            this.mouseManipulator = this.GetManipulator(button, clickCount);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
            }
        }
Example #3
0
        /// <summary>
        /// Called before the PointerPressed event occurs.
        /// </summary>
        /// <param name="e">
        /// Event data for the event.
        /// </param>
        protected override void OnPointerPressed(PointerRoutedEventArgs e)
        {
            base.OnPointerPressed(e);

            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus(FocusState.Pointer);
            this.CapturePointer(e.Pointer);

            var position   = e.GetCurrentPoint(this).Position;
            var button     = this.GetMouseButton(e);
            var shift      = (e.KeyModifiers & VirtualKeyModifiers.Shift) == VirtualKeyModifiers.Shift;
            var control    = (e.KeyModifiers & VirtualKeyModifiers.Control) == VirtualKeyModifiers.Control;
            int clickCount = 1;

            if (MouseButtonHelper.IsDoubleClick(this, position))
            {
                clickCount = 2;
            }

            this.mouseManipulator = this.GetManipulator(button, clickCount, shift, control);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            e.Handled = true;
        }
Example #4
0
        /// <summary>
        /// The on mouse down.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus();
            this.Capture = true;

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(e);
                this.ActualModel.HandleMouseDown(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            this.mouseManipulator = this.GetManipulator(e);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
            }
        }
 /// <summary>
 /// Gives each manipulator the ability to respond to map events again
 /// </summary>
 public void RemoveFullControlManipulator()
 {
     if (_fullControllManipulator != null)
     {
         _fullControllManipulator.RemoveFullControlManipulatorCore();
         _fullControllManipulator = null;
     }
 }
Example #6
0
    protected virtual void Start()
    {// TODO    :   モードによってManualかaiか決める
        manipulator    = new ManualManipulator(this, 0);
        spriteRenderer = GetComponent <SpriteRenderer>();

        BroadcastShot
        .ThrottleFirst(TimeSpan.FromMilliseconds(4))
        .Subscribe(p => { WeaponManager.Instance.Create(Weapons[(int)eWeaponType.Normal], gameObject); });
    }
 /// <summary>
 /// Gives this manipulator full control of the map, the other manipulators
 /// are the completely ignored
 /// </summary>
 public void SetFullControlManipulator(ManipulatorBase manipulator)
 {
     if (!ReferenceEquals(_fullControllManipulator, manipulator))
     {
         RemoveFullControlManipulator();
         _fullControllManipulator = manipulator;
         _fullControllManipulator.SetFullControlManipulatorCore();
         _map.GiveFocus();
     }
 }
Example #8
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.MouseUp"/> event.
        /// </summary>
        /// <param name="e">
        /// A <see cref="T:System.Windows.Forms.MouseEventArgs"/> that contains the event data.
        /// </param>
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
            }

            this.mouseManipulator = null;

            this.Capture = false;
        }
Example #9
0
        public static bool SetManipulator(ManipulatorBase mp, LayerControl SectionLayer)
        {
            if (mp == null || SectionLayer == null)
            {
                return(false);
            }

            BehaviorCollection bc = Interaction.GetBehaviors(SectionLayer);

            bc.Clear();
            bc.Add(mp);
            return(true);
        }
Example #10
0
        /// <summary>
        /// Called before the PointerReleased event occurs.
        /// </summary>
        /// <param name="e">
        /// Event data for the event.
        /// </param>
        protected override void OnPointerReleased(PointerRoutedEventArgs e)
        {
            base.OnPointerReleased(e);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            this.mouseManipulator = null;
            this.ReleasePointerCapture(e.Pointer);

            e.Handled = true;
        }
Example #11
0
        /// <summary>
        /// The on mouse down.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus();
            this.Capture          = true;
            this.mouseManipulator = this.GetManipulator(e);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
            }
        }
Example #12
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.MouseUp"/> event.
        /// </summary>
        /// <param name="e">
        /// A <see cref="T:System.Windows.Forms.MouseEventArgs"/> that contains the event data.
        /// </param>
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            this.Capture = false;

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(e);
                this.ActualModel.HandleMouseUp(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
            }

            this.mouseManipulator = null;
        }
Example #13
0
        /// <summary>
        /// Raises the MouseButtonUp event.
        /// </summary>
        /// <param name="button">The button.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        protected void OnMouseButtonUp(OxyMouseButton button, MouseButtonEventArgs e)
        {
            this.ReleaseMouseCapture();

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(button, e);
                this.ActualModel.HandleMouseUp(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            this.mouseManipulator = null;
        }
Example #14
0
        /// <summary>
        /// Called before the PointerPressed event occurs.
        /// </summary>
        /// <param name="e">
        /// Event data for the event.
        /// </param>
        protected override void OnPointerPressed(PointerRoutedEventArgs e)
        {
            base.OnPointerPressed(e);

            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus(FocusState.Pointer);
            this.CapturePointer(e.Pointer);

            var position = e.GetCurrentPoint(this).Position;
            var button = this.GetMouseButton(e);
            var shift = (e.KeyModifiers & VirtualKeyModifiers.Shift) == VirtualKeyModifiers.Shift;
            var control = (e.KeyModifiers & VirtualKeyModifiers.Control) == VirtualKeyModifiers.Control;
            int clickCount = 1;
            if (MouseButtonHelper.IsDoubleClick(this, position))
            {
                clickCount = 2;
            }

            this.mouseManipulator = this.GetManipulator(button, clickCount, shift, control);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            e.Handled = true;
        }
Example #15
0
        /// <summary>
        /// Invoked when an unhandled MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="T:System.Windows.Input.MouseButtonEventArgs"/> that contains the event data. This event data reports details about the mouse button that was pressed and the handled state.
        /// </param>
        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            base.OnMouseDown(e);

            if (e.Handled)
            {
                return;
            }

            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus();
            this.CaptureMouse();

            this.mouseDownPoint = e.GetPosition(this).ToScreenPoint();

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(e);
                this.ActualModel.HandleMouseDown(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            this.mouseManipulator = this.GetManipulator(e);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }
        }
Example #16
0
        /// <summary>
        /// Invoked when an unhandled MouseUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
        /// </summary>
        /// <param name="e">
        /// The <see cref="T:System.Windows.Input.MouseButtonEventArgs"/> that contains the event data. The event data reports that the mouse button was released.
        /// </param>
        protected override void OnMouseUp(MouseButtonEventArgs e)
        {
            base.OnMouseUp(e);

            if (e.Handled)
            {
                return;
            }

            this.ReleaseMouseCapture();

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(e);
                this.ActualModel.HandleMouseUp(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            this.mouseManipulator = null;

            var p = e.GetPosition(this).ToScreenPoint();
            double d = p.DistanceTo(this.mouseDownPoint);

            if (this.ContextMenu != null)
            {
                if (Math.Abs(d) < 1e-8 && e.ChangedButton == MouseButton.Right)
                {
                    this.ContextMenu.Visibility = Visibility.Visible;
                    this.ContextMenu.IsOpen = true;
                }
                else
                {
                    this.ContextMenu.Visibility = Visibility.Collapsed;
                    this.ContextMenu.IsOpen = false;
                }
            }
        }
Example #17
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.MouseUp"/> event.
        /// </summary>
        /// <param name="e">
        /// A <see cref="T:System.Windows.Forms.MouseEventArgs"/> that contains the event data.
        /// </param>
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            this.Capture = false;

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(e);
                this.ActualModel.HandleMouseUp(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
            }

            this.mouseManipulator = null;
        }
Example #18
0
        /// <summary>
        /// The on mouse down.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);

            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus();
            this.Capture = true;

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(e);
                this.ActualModel.HandleMouseDown(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            this.mouseManipulator = this.GetManipulator(e);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
            }
        }
 /// <summary>
 /// Gives this manipulator full control of the map, the other manipulators
 /// are the completely ignored
 /// </summary>
 public void SetFullControlManipulator(ManipulatorBase manipulator)
 {
     if (!ReferenceEquals(_fullControllManipulator, manipulator))
     {
         RemoveFullControlManipulator();
         _fullControllManipulator = manipulator;
         _fullControllManipulator.SetFullControlManipulatorCore();
         _map.GiveFocus();
     }
 }
 /// <summary>
 /// Gives each manipulator the ability to respond to map events again
 /// </summary>
 public void RemoveFullControlManipulator()
 {
     if (_fullControllManipulator != null)
     {
         _fullControllManipulator.RemoveFullControlManipulatorCore();
         _fullControllManipulator = null;
     }
 }
 public void RemoveManipulator(ManipulatorBase manipulator)
 {
     _manipulators.Remove(manipulator);
 }
 public void RemoveManipulator(ManipulatorBase manipulator)
 {
     _manipulators.Remove(manipulator);
 }
Example #23
0
        /// <summary>
        /// Raises the MouseButtonUp event.
        /// </summary>
        /// <param name="button">The button.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        protected void OnMouseButtonUp(OxyMouseButton button, MouseButtonEventArgs e)
        {
            this.ReleaseMouseCapture();

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(button, e);
                this.ActualModel.HandleMouseUp(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            this.mouseManipulator = null;
        }
Example #24
0
        /// <summary>
        /// Called when a mouse button is pressed down.
        /// </summary>
        /// <param name="button">
        /// The button.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.
        /// </param>
        private void OnMouseButtonDown(OxyMouseButton button, MouseButtonEventArgs e)
        {
            if (this.mouseManipulator != null)
            {
                return;
            }

            this.Focus();
            this.CaptureMouse();

            int clickCount = 1;
            if (MouseButtonHelper.IsDoubleClick(this, e))
            {
                clickCount = 2;
            }

            if (this.ActualModel != null)
            {
                var args = this.CreateMouseEventArgs(button, e);
                this.ActualModel.HandleMouseDown(this, args);
                if (args.Handled)
                {
                    return;
                }
            }

            this.mouseManipulator = this.GetManipulator(button, clickCount);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Started(this.CreateManipulationEventArgs(e));
            }
        }
Example #25
0
        /// <summary>
        /// Called before the PointerReleased event occurs.
        /// </summary>
        /// <param name="e">
        /// Event data for the event.
        /// </param>
        protected override void OnPointerReleased(PointerRoutedEventArgs e)
        {
            base.OnPointerReleased(e);

            if (this.mouseManipulator != null)
            {
                this.mouseManipulator.Completed(this.CreateManipulationEventArgs(e));
                e.Handled = true;
            }

            this.mouseManipulator = null;
            this.ReleasePointerCapture(e.Pointer);

            e.Handled = true;
        }
 public void AddManipulator(ManipulatorBase manipulator)
 {
     _manipulators.Add(manipulator);
 }
 public void AddManipulator(ManipulatorBase manipulator)
 {
     _manipulators.Add(manipulator);
 }