Determine if the given layer can "legally" fire the given event
15262
function _layerCanFireEvent(layer, eventType) {
	// If events are disable and if
	// layer is tangible or event is not tangible
	return (!layer.disableEvents &&
		(!layer.intangible || $.inArray(eventType, tangibleEvents) === -1));
}
127457
public boolean selectFeature(Feature feature) {
		if (!selectedFeatures.containsKey(feature.getId())) {
			// make sure we get the layer's instance (if we can find it) !
			Feature layerFeature = getFeatureStore().getPartialFeature(feature.getId());
			if (null != layerFeature) {
				selectedFeatures.put(layerFeature.getId(), layerFeature);
				handlerManager.fireEvent(new FeatureSelectedEvent(layerFeature));
			} else {
				selectedFeatures.put(feature.getId(), feature);
				handlerManager.fireEvent(new FeatureSelectedEvent(feature));
			}
			return true;
		} else {
			return false;
		}
	}
1329519
function(isBaseLayer) {
        if (isBaseLayer != this.isBaseLayer) {
            this.isBaseLayer = isBaseLayer;
            if (this.map != null) {
                this.map.events.triggerEvent("changebaselayer", {
                    layer: this
                });
            }
        }
    }
522047
function _triggerLayerEvent($canvas, data, layer, eventType, arg) {
	// If layer can legally fire this event type
	if (_layerCanFireEvent(layer, eventType)) {

		// Do not set a custom cursor on layer mouseout
		if (eventType !== 'mouseout') {
			// Update cursor if one is defined for this event
			_setCursor($canvas, layer, eventType);
		}

		// Trigger the user-defined event callback
		_runEventCallback($canvas, layer, eventType, layer, arg);
		// Trigger the canvas-bound event hook
		_runEventCallback($canvas, layer, eventType, data.eventHooks, arg);
		// Trigger the global event hook
		_runEventCallback($canvas, layer, eventType, jCanvas.eventHooks, arg);

	}
}
858076
function isSoftNewlineEvent(event: Object): boolean {
  return (
    event.which === 13 &&
    (event.getModifierState('Shift') ||
      event.getModifierState('Alt') ||
      event.getModifierState('Control'))
  );
}
998897
public function fireEvent($event)
    {
        $handle = $this->getQualifiedEvent($event);

        // Fire the event
        /** @var \League\Event\EventInterface $event */
        $event = $this->explainer->displayBelow(function () use ($handle) {
            return $this->events->emit($handle, [$this]);
        });

        // If the event returned a strict false, halt the task
        $wasHalted = $event && $event->isPropagationStopped();
        if ($wasHalted && $event !== 'halt' && method_exists($this, 'halt')) {
            $this->halt();
        }

        return !$wasHalted;
    }
1098251
public void selectLayer(Layer<?> layer) {
		if (layer == null) {
			deselectLayer(this.getSelectedLayer());
		} else {
			Layer<?> selLayer = this.getSelectedLayer();
			if (selLayer != null && !layer.getId().equals(selLayer.getId())) {
				deselectLayer(selLayer);
			}
			layer.setSelected(true);
			handlerManager.fireEvent(new LayerSelectedEvent(layer));
		}
	}
1031624
private boolean isEventLoopActive() {

        EventExecutorGroup eventExecutors = clientResources.eventExecutorGroup();
        if (eventExecutors.isShuttingDown() || eventExecutors.isShutdown() || eventExecutors.isTerminated()) {
            return false;
        }

        return true;
    }
1291743
def may_fire?(obj, to_state=::AASM::NO_VALUE, *args)
      _fire(obj, {:test_only => true}, to_state, *args) # true indicates test firing
    end
221625
public void fireLayerHierarchyChangedEvent(MapLayerHierarchyEvent event) {
		if (isEventFirable()) {
			final MapLayerListener[] theListeners = getListeners();
			if (theListeners != null && theListeners.length > 0) {
				for (final MapLayerListener listener : theListeners) {
					listener.onMapLayerHierarchyChanged(event);
				}
			}

			// stop the event firing when it was consumed
			if (event.isConsumed() && event.isDisappearingWhenConsumed()) {
				return;
			}

			final GISLayerContainer<?> container = getContainer();
			if (container != null) {
				container.fireLayerHierarchyChangedEvent(event);
			}
		}
	}
1000073
def _allowed(to_op, from_op, rhs):
    ""
    if is_none(rhs):
        return to_op in _RHS_IS_NONE_OPS.get(from_op, ())

    if is_number(rhs):
        return to_op in _RHS_IS_INTEGER_OPS

    return True
1033478
private function fireEvent()
    {
        $status = isset($this->response['error_code']) ? VkRequest::STATUS_FAIL : VkRequest::STATUS_SUCCESS;
        $event = sprintf(VkRequest::EVENT_FORMAT, $status, $this->request->method, $this->request->tag);
        event($event, [$this->request, $this->response]);
    }
1337721
def fire(self, event):
        
        self.browser.fire(self.element, event)
        return self
197591
def fire_action_event
      return if @list.nil? || @list.size == 0
      require 'canis/core/include/ractionevent'
      aev = TextActionEvent.new self, :PRESS, current_value().to_s, @current_index, @curpos
      fire_handler :PRESS, aev
    end
1241555
def fire_action_event
      if header_row?
        if @table_row_sorter
          x = _convert_curpos_to_column
          c = @chash[x]
          # convert to index in data model since sorter only has data_model
          index = c.index
          @table_row_sorter.toggle_sort_order index
          @table_row_sorter.sort
          fire_dimension_changed
        end
      end
      super
    end
660925
function(eventName, eventHandler) {
      var stack = this.actual.data("events")[eventName];
      var i;
      for (i = 0; i < stack.length; i++) {
        if (stack[i].handler == eventHandler) {
          return true;
        }
      }
      return false;
    }
976282
def _runable_for_event(f, tag, stage):
    

    if not hasattr(f, '__ambry_event__'):
        return False

    f_tag, f_stage = f.__ambry_event__

    if stage is None:
        stage = 0

    if tag != f_tag or stage != f_stage:
        return False

    return True