## Helper functions. 
### checkGauge

Checks if a gauge is properly constructed, throws an error otherwise

@param {string} method The name of the method creating it
@param {object} gauge The object to check

@see ModdGauge.init
510054
function checkGauge(method, gauge) {
        if (!gauge) {
            throw new Error('SVOGauge.init: method ' + method +
                            'did not create element gauge.');
        }
        if ('function' !== typeof gauge.getValues) {
            throw new Error('SVOGauge.init: method ' + method +
                            ': gauge missing function getValues.');
        }
        if ('function' !== typeof gauge.enable) {
            throw new Error('SVOGauge.init: method ' + method +
                            ': gauge missing function enable.');
        }
        if ('function' !== typeof gauge.disable) {
            throw new Error('SVOGauge.init: method ' + method +
                            ': gauge missing function disable.');
        }
        if ('function' !== typeof gauge.append) {
            throw new Error('SVOGauge.init: method ' + method +
                            ': gauge missing function append.');
        }
    }
180587
function(method) {
		 	if(typeof method === "function") {
				var args = [];
								
				for(var x = 1; x <= arguments.length; x++) {
					if(arguments[x]) {
						args.push(arguments[x]);
					}
				}
				
				method.apply(this, args);
			}
		}
1205320
private boolean prescreen(Method method) {
        BitSet bytecodeSet = getClassContext().getBytecodeSet(method);
        return (bytecodeSet != null) && (bytecodeSet.get(Const.CHECKCAST));
    }
549569
function(constructor, methods) {
            var key;

            for (key in methods) {
                constructor.prototype[key] = methods[key];
            }
        }
314092
private void checkInitializationMethod(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
    {
        if (!CHECKLEVEL_STRICT.equals(checkLevel))
        {
            return;
        }
        
        String initMethodName = classDef.getProperty(PropertyHelper.OJB_PROPERTY_INITIALIZATION_METHOD);

        if (initMethodName == null)
        {
            return;
        }

        Class  initClass;
        Method initMethod;

        try
        {
            initClass = InheritanceHelper.getClass(classDef.getName());
        }
        catch (ClassNotFoundException ex)
        {
            throw new ConstraintException("The class "+classDef.getName()+" was not found on the classpath");
        }
        try
        {
            initMethod = initClass.getDeclaredMethod(initMethodName, new Class[0]);
        }
        catch (NoSuchMethodException ex)
        {
            initMethod = null;
        }
        catch (Exception ex)
        {
            throw new ConstraintException("Exception while checking the class "+classDef.getName()+": "+ex.getMessage());
        }
        if (initMethod == null)
        {    
            try
            {
                initMethod = initClass.getMethod(initMethodName, new Class[0]);
            }
            catch (NoSuchMethodException ex)
            {
                throw new ConstraintException("No suitable initialization-method "+initMethodName+" found in class "+classDef.getName());
            }
            catch (Exception ex)
            {
                throw new ConstraintException("Exception while checking the class "+classDef.getName()+": "+ex.getMessage());
            }
        }

        // checking modifiers
        int mods = initMethod.getModifiers();

        if (Modifier.isStatic(mods) || Modifier.isAbstract(mods))
        {
            throw new ConstraintException("The initialization-method "+initMethodName+" in class "+classDef.getName()+" must be a concrete instance method");
        }
    }
72918
private void injectServletCallback(String method) {
        Label tryStart = new Label();
        Label tryEnd = new Label();
        Label catchStart = new Label();
        Label catchEnd = new Label();

        visitTryCatchBlock(tryStart, tryEnd, catchStart, "java/lang/NoClassDefFoundError");
        mark(tryStart); // try {
        loadArgs();
        invokeStatic(Type.getType(SERVLET_CALLBACK_TYPE), Method.getMethod(method));
        mark(tryEnd); // }
        visitJumpInsn(GOTO, catchEnd);
        mark(catchStart); // catch() {
        pop();
        mark(catchEnd); // }
    }
250808
function wrapCountingMethod(method) {
  DruidNode.prototype[method] = function() {
    var self = this
      , args = utils.args(arguments, 0)
      , callback = args.pop()

    self.active++

    debug('Active calls to Druid node ' + this.data.id + ': ' + this.active)

    function wrapper() {
      self.active--

      callback.apply(null, arguments)
    }

    args.push(wrapper)

    Client.prototype[method].apply(this, args)
  }
}
763039
def method_missing(method, *args, &block)
      super
    rescue NoMethodError
      return regs(method) if self.has_reg?(method)
      return ports(method) if self.has_port?(method)
      if method.to_s =~ /=$/
        define_singleton_method(method) do |val|
          instance_variable_set("@#{method.to_s.sub('=', '')}", val)
        end
      else
        define_singleton_method(method) do
          instance_variable_get("@#{method}")
        end
      end
      send(method, *args, &block)
    end
1327827
function(method) {
            return _.find(this.methods, function(handler) {
                return handler.regexp.test(method);
            }) || this.defaultHandler;
        }
644890
public static boolean isMethodVisibleInTemplate(ExecutableElement method) {
    return isMethodVisibleInJS(method)
        && !hasAnnotation(method, Computed.class)
        && !hasAnnotation(method, Watch.class)
        && !hasAnnotation(method, PropValidator.class)
        && !hasAnnotation(method, PropDefault.class)
        && !method.getModifiers().contains(Modifier.STATIC)
        && !method.getModifiers().contains(Modifier.PRIVATE);
  }
332183
@Override
    public final AbstractGauge init(int WIDTH, int HEIGHT) {
        final int GAUGE_WIDTH = isFrameVisible() ? WIDTH : getGaugeBounds().width;
        final int GAUGE_HEIGHT = isFrameVisible() ? HEIGHT : getGaugeBounds().height;

        if (GAUGE_WIDTH <= 1 || GAUGE_HEIGHT <= 1) {
            return this;
        }

        if (!isFrameVisible()) {
            setFramelessOffset(-getGaugeBounds().width * 0.0841121495, -getGaugeBounds().width * 0.0841121495);
        } else {
            setFramelessOffset(getGaugeBounds().x, getGaugeBounds().y);
        }

        if (frameImage != null) {
            frameImage.flush();
        }
        frameImage = create_FRAME_Image(GAUGE_WIDTH);

        if (backgroundImage != null) {
            backgroundImage.flush();
        }
        backgroundImage = create_BACKGROUND_Image(GAUGE_WIDTH);

        if (tickmarksImage != null) {
            tickmarksImage.flush();
        }
        tickmarksImage = create_TICKMARKS_Image(GAUGE_WIDTH);

        if (planeImage != null) {
            planeImage.flush();
        }
        planeImage = create_AIRPLANE_Image(GAUGE_WIDTH);

        if (foregroundImage != null) {
            foregroundImage.flush();
        }
        switch (getFrameType()) {
            case SQUARE:
                foregroundImage = FOREGROUND_FACTORY.createLinearForeground(GAUGE_WIDTH, GAUGE_WIDTH, false);
                break;

            case ROUND:

            default:
                foregroundImage = FOREGROUND_FACTORY.createRadialForeground(GAUGE_WIDTH, false, getForegroundType());
                break;
        }

        if (disabledImage != null) {
            disabledImage.flush();
        }
        disabledImage = create_DISABLED_Image(GAUGE_WIDTH);

        return this;
    }
122484
function (method) {
            if (this.subviews.length !== 0) {
                var params = slice.call(arguments);
                params.shift();
                _.each(this.subviews, function (s) {
                    if (s[method]) {
                        s[method].apply(s, params);
                    }
                });
            }
        }
837438
@Override
    public AbstractGauge init(final int WIDTH, final int HEIGHT) {
        final int GAUGE_WIDTH = isFrameVisible() ? WIDTH : getGaugeBounds().width;
        final int GAUGE_HEIGHT = isFrameVisible() ? HEIGHT : getGaugeBounds().height;
        if (GAUGE_WIDTH <= 1 || GAUGE_HEIGHT <= 1) {
            return this;
        }

        if (!isFrameVisible()) {
            setFramelessOffset(-getGaugeBounds().width * 0.0841121495, -getGaugeBounds().width * 0.0841121495);
        } else {
            setFramelessOffset(getGaugeBounds().x, getGaugeBounds().y);
        }

        if (isDigitalFont()) {
            setLcdValueFont(getModel().getDigitalBaseFont().deriveFont(0.7f * GAUGE_WIDTH * 0.10f));
        } else {
            setLcdValueFont(getModel().getStandardBaseFont().deriveFont(0.625f * GAUGE_WIDTH * 0.10f));
        }

        if (isCustomLcdUnitFontEnabled()) {
            setLcdUnitFont(getCustomLcdUnitFont().deriveFont(0.25f * GAUGE_WIDTH * 0.10f));
        } else {
            setLcdUnitFont(getModel().getStandardBaseFont().deriveFont(0.25f * GAUGE_WIDTH * 0.10f));
        }

        setLcdInfoFont(getModel().getStandardInfoFont().deriveFont(0.15f * GAUGE_WIDTH * 0.10f));

        // Create Background Image
        if (bImage != null) {
            bImage.flush();
        }
        bImage = UTIL.createImage(GAUGE_WIDTH, GAUGE_WIDTH, Transparency.TRANSLUCENT);

        // Create Foreground Image
        if (fImage != null) {
            fImage.flush();
        }
        fImage = UTIL.createImage(GAUGE_WIDTH, GAUGE_WIDTH, Transparency.TRANSLUCENT);

        if (isFrameVisible()) {
            switch (getFrameType()) {
                case ROUND:
                    FRAME_FACTORY.createRadialFrame(GAUGE_WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage);
                    break;
                case SQUARE:
                    FRAME_FACTORY.createLinearFrame(GAUGE_WIDTH, GAUGE_WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage);
                    break;
                default:
                    FRAME_FACTORY.createRadialFrame(GAUGE_WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage);
                    break;
            }
        }

        if (isBackgroundVisible()) {
            create_BACKGROUND_Image(GAUGE_WIDTH, "", "", bImage);
        }

        create_TICKMARKS_Image(GAUGE_WIDTH, 0, TICKMARK_OFFSET, 0, 10, angleStep100ft, (int) tickLabelPeriod, 0, true, true, null, bImage);

        if (isLcdVisible()) {
            createLcdImage(new Rectangle2D.Double(((getGaugeBounds().width - GAUGE_WIDTH * 0.4) / 2.0), (getGaugeBounds().height * 0.55), (GAUGE_WIDTH * 0.4), (GAUGE_WIDTH * 0.1)), getLcdColor(), getCustomLcdBackground(), bImage);
            LCD.setRect(((getGaugeBounds().width - GAUGE_WIDTH * 0.4) / 2.0), (getGaugeBounds().height * 0.55), GAUGE_WIDTH * 0.4, GAUGE_WIDTH * 0.1);
        }

        if (pointer100FtImage != null) {
            pointer100FtImage.flush();
        }
        pointer100FtImage = create_100FT_POINTER_Image(GAUGE_WIDTH);

        if (pointer1000FtImage != null) {
            pointer1000FtImage.flush();
        }
        pointer1000FtImage = create_1000FT_POINTER_Image(GAUGE_WIDTH);

        if (pointer10000FtImage != null) {
            pointer10000FtImage.flush();
        }
        pointer10000FtImage = create_10000FT_POINTER_Image(GAUGE_WIDTH);


        createPostsImage(GAUGE_WIDTH, fImage, PostPosition.CENTER);

        if (isForegroundVisible()) {
            switch (getFrameType()) {
                case SQUARE:
                    FOREGROUND_FACTORY.createLinearForeground(GAUGE_WIDTH, GAUGE_WIDTH, false, bImage);
                    break;

                case ROUND:

                default:
                    FOREGROUND_FACTORY.createRadialForeground(GAUGE_WIDTH, false, getForegroundType(), fImage);
                    break;
            }
        }

        if (disabledImage != null) {
            disabledImage.flush();
        }
        disabledImage = create_DISABLED_Image(GAUGE_WIDTH);

        return this;
    }
1038758
@Override
    public AbstractGauge init(final int WIDTH, final int HEIGHT) {
        final int GAUGE_WIDTH = isFrameVisible() ? WIDTH : getGaugeBounds().width;
        final int GAUGE_HEIGHT = isFrameVisible() ? HEIGHT : getGaugeBounds().height;

        if (GAUGE_WIDTH <= 1 || GAUGE_HEIGHT <= 1) {
            return this;
        }

        if (!isFrameVisible()) {
            setFramelessOffset(-getGaugeBounds().width * 0.0841121495, -getGaugeBounds().width * 0.0841121495);
        } else {
            setFramelessOffset(getGaugeBounds().x, getGaugeBounds().y);
        }

        // Create Background Image
        if (bImage != null) {
            bImage.flush();
        }
        bImage = UTIL.createImage(GAUGE_WIDTH, GAUGE_WIDTH, java.awt.Transparency.TRANSLUCENT);

        // Create Foreground Image
        if (fImage != null) {
            fImage.flush();
        }
        fImage = UTIL.createImage(GAUGE_WIDTH, GAUGE_WIDTH, java.awt.Transparency.TRANSLUCENT);

        if (isFrameVisible()) {
            switch (getFrameType()) {
                /*case ROUND:
                    FRAME_FACTORY.createRadialFrame(GAUGE_WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage);
                    break;*/
                case SQUARE:
                    FRAME_FACTORY.createLinearFrame(GAUGE_WIDTH, GAUGE_WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage);
                    break;
                default:
                    FRAME_FACTORY.createRadialFrame(GAUGE_WIDTH, getFrameDesign(), getCustomFrameDesign(), getFrameEffect(), bImage);
                    break;
            }
        }

        if (isBackgroundVisible()) {
            create_BACKGROUND_Image(GAUGE_WIDTH, "", "", bImage);
        }

        if (compassRoseImage != null) {
            compassRoseImage.flush();
        }
        compassRoseImage = create_COMPASS_ROSE_Image(GAUGE_WIDTH);

        if (pointerShadowImage != null) {
            pointerShadowImage.flush();
        }
        pointerShadowImage = create_POINTER_SHADOW_Image(GAUGE_WIDTH);

        if (pointerImage != null) {
            pointerImage.flush();
        }
        pointerImage = create_POINTER_Image(GAUGE_WIDTH);

        createPostsImage(GAUGE_WIDTH, fImage, PostPosition.CENTER);

        if (isForegroundVisible()) {
            switch (getFrameType()) {
                case SQUARE:
                    FOREGROUND_FACTORY.createLinearForeground(GAUGE_WIDTH, GAUGE_WIDTH, false, bImage);
                    break;

                case ROUND:

                default:
                    FOREGROUND_FACTORY.createRadialForeground(GAUGE_WIDTH, false, getForegroundType(), fImage);
                    break;
            }
        }

        if (disabledImage != null) {
            disabledImage.flush();
        }
        disabledImage = create_DISABLED_Image(GAUGE_WIDTH);

        return this;
    }
797158
function pongIOrenderGauge( ctx, def, dta ) {
	log( "pong-io", "pongIOrenderGauge '"+def.id+"': "+JSON.stringify(dta) );
	// TODO IO: implement gauge

	log( "pong-io", "pongIOrenderGauge end.");
}
1149049
function (method) {
        var
          str = '' + method,
          i = str.indexOf(SUPER)
        ;
        return i < 0 ?
          false :
          isBoundary(str.charCodeAt(i - 1)) &&
          isBoundary(str.charCodeAt(i + 5));
      }
247552
public static void assertNoParameters(final Method method, Class<? extends Annotation> annotation) 
   {
      if (method.getParameterTypes().length != 0)
      {
         throw annotation == null ? MESSAGES.methodHasToHaveNoParameters(method) : MESSAGES.methodHasToHaveNoParameters2(method, annotation);
      }
   }