This is the main entry point after the graph has been inflated. Used to initialize the graph
and its corresponding members.
173907
@Override
    protected void initializeGraph() {
        super.initializeGraph();

        Utils.setLayerToSW(this);

        mPieData = new ArrayList<PieModel>();

        mTotalValue = 0;

        mGraphPaint  = new Paint(Paint.ANTI_ALIAS_FLAG);
        mLegendPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mLegendPaint.setTextSize(mLegendTextSize);
        mLegendPaint.setColor(mLegendColor);
        mLegendPaint.setStyle(Paint.Style.FILL);

        mValuePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mValuePaint.setTextSize(mValueTextSize);
        mValuePaint.setColor(mValueTextColor);
        mValuePaint.setStyle(Paint.Style.FILL);

        mGraph.rotateTo(mPieRotation);
        mGraph.decelerate();

        mRevealAnimator = ValueAnimator.ofFloat(0, 1);
        mRevealAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                mRevealValue = animation.getAnimatedFraction();
                invalidateGlobal();
            }
        });
        mRevealAnimator.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {

            }

            @Override
            public void onAnimationEnd(Animator animation) {
                mStartedAnimation = false;
            }

            @Override
            public void onAnimationCancel(Animator animation) {

            }

            @Override
            public void onAnimationRepeat(Animator animation) {

            }
        });

        if(mUsePieRotation) {
            // Set up an animator to animate the PieRotation property. This is used to
            // correct the pie's orientation after the user lets go of it.
            mAutoCenterAnimator = ObjectAnimator.ofInt(PieChart.this, "PieRotation", 0);
            // Add a listener to hook the onAnimationEnd event so that we can do
            // some cleanup when the pie stops moving.
            mAutoCenterAnimator.addListener(new Animator.AnimatorListener() {
                public void onAnimationStart(Animator animator) {
                }

                public void onAnimationEnd(Animator animator) {
                    mGraph.decelerate();
                }

                public void onAnimationCancel(Animator animator) {
                }

                public void onAnimationRepeat(Animator animator) {
                }
            });

            // Create a Scroller to handle the fling gesture.
            if (Build.VERSION.SDK_INT < 11) {
                mScroller = new Scroller(getContext());
            } else {
                mScroller = new Scroller(getContext(), null, true);
            }

            // The scroller doesn't have any built-in animation functions--it just supplies
            // values when we ask it to. So we have to have a way to call it every frame
            // until the fling ends. This code (ab)uses a ValueAnimator object to generate
            // a callback on every animation frame. We don't use the animated value at all.
            mScrollAnimator = ValueAnimator.ofFloat(0, 1);
            mScrollAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                public void onAnimationUpdate(ValueAnimator valueAnimator) {
                    tickScrollAnimation();
                }
            });

            // Create a gesture detector to handle onTouch messages
            mDetector = new GestureDetector(PieChart.this.getContext(), new GestureListener());

            // Turn off long press--this control doesn't use it, and if long press is enabled,
            // you can't scroll for a bit, pause, then scroll some more (the pause is interpreted
            // as a long press, apparently)
            mDetector.setIsLongpressEnabled(false);
        }

        if(this.isInEditMode()) {
            addPieSlice(new PieModel("Breakfast", 15, Color.parseColor("#FE6DA8")));
            addPieSlice(new PieModel("Lunch", 25, Color.parseColor("#56B7F1")));
            addPieSlice(new PieModel("Dinner", 35, Color.parseColor("#CDA67F")));
            addPieSlice(new PieModel("Snack", 25, Color.parseColor("#FED70E")));
        }
    }
859111
private static function init() {
        self::$huffmanLookup = self::huffmanLookupInit();
        self::$huffmanCodes = self::huffmanCodesInit();
        self::$huffmanLengths = self::huffmanLengthsInit();

        foreach (\array_column(self::TABLE, 0) as $index => $name) {
            if (isset(self::$indexMap[$name])) {
                continue;
            }

            self::$indexMap[$name] = $index + 1;
        }
    }
1168371
public void onStartup() throws StartupException {
        if (monitor == null) {
            monitor = this;
            thread = new Thread() {
                @Override
                public void run() {
                    this.setName("UserGroupMonitor-thread");
                    monitor.start();
                }
            };
            thread.start();
        }
    }
1145627
public void init()
	{
		if (conv.getConversionDirection() == ConversionDirectionType.REVERSIBLE &&
			this.reverse == null)
		{
			reverse = new ConversionWrapper(conv, (GraphL3) graph);
			this.direction = LEFT_TO_RIGHT;
			reverse.direction = RIGHT_TO_LEFT;
			reverse.reverse = this;
		}
		else if (conv.getConversionDirection() == ConversionDirectionType.RIGHT_TO_LEFT)
		{
			this.direction = RIGHT_TO_LEFT;
		}
		else
		{
			this.direction = LEFT_TO_RIGHT;
		}
	}
307173
@Override
    protected void initializeGraph() {
        super.initializeGraph();
        mData = new ArrayList<>();

        mValuePaint = new Paint(mLegendPaint);
        mValuePaint.setTextAlign(Paint.Align.CENTER);

        if(this.isInEditMode()) {
            addBar(new BarModel(2.3f));
            addBar(new BarModel(2.f));
            addBar(new BarModel(3.3f));
            addBar(new BarModel(1.1f));
            addBar(new BarModel(2.7f));
            addBar(new BarModel(2.3f));
            addBar(new BarModel(2.f));
            addBar(new BarModel(3.3f));
            addBar(new BarModel(1.1f));
            addBar(new BarModel(2.7f));
        }
    }
992560
private void initGraphics() {
        // Set initial size
        if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
            Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
            if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
                gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
            } else {
                gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        mainInnerShadow0 = new InnerShadow();
        mainInnerShadow0.setOffsetX(0.0);
        mainInnerShadow0.setOffsetY(0.0);
        mainInnerShadow0.setRadius(0.0625 * PREFERRED_HEIGHT);
        mainInnerShadow0.setColor(Color.rgb(255, 255, 255, 0.5));
        mainInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);

        mainInnerShadow1 = new InnerShadow();
        mainInnerShadow1.setOffsetX(0.0);
        mainInnerShadow1.setOffsetY(1.0);
        mainInnerShadow1.setRadius(0.04166667 * PREFERRED_HEIGHT);
        mainInnerShadow1.setColor(Color.rgb(0, 0, 0, 0.65));
        mainInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
        mainInnerShadow1.setInput(mainInnerShadow0);

        crystalClip = new Rectangle(0, 0, width, height);
        crystalClip.setArcWidth(5);
        crystalClip.setArcHeight(5);

        crystalImage   = Helper.createNoiseImage(PREFERRED_WIDTH, PREFERRED_HEIGHT, DARK_NOISE_COLOR, BRIGHT_NOISE_COLOR, 8);
        crystalOverlay = new ImageView(crystalImage);
        crystalOverlay.setClip(crystalClip);
        boolean crystalEnabled = gauge.isLcdCrystalEnabled();
        Helper.enableNode(crystalOverlay, crystalEnabled);

        threshold = new Path();
        threshold.setStroke(null);
        Helper.enableNode(threshold, gauge.isThresholdVisible());

        average = new Path();
        average.setStroke(null);
        Helper.enableNode(average, gauge.isAverageVisible());

        backgroundText = new Text(String.format(locale, valueFormatString, gauge.getCurrentValue()));
        backgroundText.setFill(gauge.getLcdDesign().lcdBackgroundColor);
        backgroundText.setOpacity((LcdFont.LCD == gauge.getLcdFont() || LcdFont.ELEKTRA == gauge.getLcdFont()) ? 1 : 0);

        valueText = new Text(String.format(locale, valueFormatString, gauge.getCurrentValue()));
        valueText.setFill(gauge.getLcdDesign().lcdForegroundColor);

        unitText = new Text(gauge.getUnit());
        unitText.setFill(gauge.getLcdDesign().lcdForegroundColor);
        Helper.enableNode(unitText, !gauge.getUnit().isEmpty());

        title = new Text(gauge.getTitle());
        title.setFill(gauge.getLcdDesign().lcdForegroundColor);
        Helper.enableNode(title, !gauge.getTitle().isEmpty());

        lowerRightText = new Text(gauge.getSubTitle());
        lowerRightText.setFill(gauge.getLcdDesign().lcdForegroundColor);
        Helper.enableNode(lowerRightText, !gauge.getSubTitle().isEmpty());

        upperLeftText = new Text(String.format(locale, otherFormatString, gauge.getMinMeasuredValue()));
        upperLeftText.setFill(gauge.getLcdDesign().lcdForegroundColor);
        Helper.enableNode(upperLeftText, gauge.isMinMeasuredValueVisible());

        upperRightText = new Text(String.format(locale, otherFormatString, gauge.getMaxMeasuredValue()));
        upperRightText.setFill(gauge.getLcdDesign().lcdForegroundColor);
        Helper.enableNode(upperRightText, gauge.isMaxMeasuredValueVisible());

        lowerCenterText = new Text(String.format(locale, otherFormatString, gauge.getOldValue()));
        lowerCenterText.setFill(gauge.getLcdDesign().lcdForegroundColor);
        Helper.enableNode(lowerCenterText, gauge.isOldValueVisible());

        shadowGroup = new Group();
        shadowGroup.setEffect(gauge.isShadowsEnabled() ? FOREGROUND_SHADOW : null);
        shadowGroup.getChildren().setAll(threshold,
                                         average,
                                         valueText,
                                         unitText,
                                         title,
                                         lowerRightText,
                                         upperLeftText,
                                         upperRightText,
                                         lowerCenterText);

        pane = new Pane(crystalOverlay, backgroundText, shadowGroup);
        pane.setEffect(gauge.isShadowsEnabled() ? mainInnerShadow1 : null);
        getChildren().setAll(pane);
    }
649033
public void init() {
        frame =  new JFrame("Drools Example");
        frame.setDefaultCloseOperation(conf.isExitOnClose() ? JFrame.EXIT_ON_CLOSE : JFrame.DISPOSE_ON_CLOSE);
        frame.setResizable( false );
        frame.setBackground(Color.BLACK);
        frame.getContentPane().setBackground(Color.BLACK);


        panel = (JPanel) frame.getContentPane();
        panel.setPreferredSize(new Dimension(conf.getWindowWidth(), conf.getWindowHeight()));
        panel.setLayout(null);

        setBounds(0, 0, conf.getWindowWidth(), conf.getWindowHeight());
        panel.add(this);
        setIgnoreRepaint(true);

        panel.setFocusable(false); // GameUI is used in Canvas-based games only (Invaders, Pong) and only need keylistener on the external Swing JFrame 
        setFocusable(false);
        KeyListener klistener = new GameKeyListener( ksession.getEntryPoint( "KeyPressedStream" ), ksession.getEntryPoint( "KeyReleasedStream" ) );
        frame.addKeyListener(klistener);

        frame.setLocationRelativeTo(null); // Center in screen
        frame.pack();
        frame.setResizable(false);
        frame.setVisible( true );

        createBufferStrategy(2);
        bufferStrategy = getBufferStrategy();
    }
279113
private void initGraphics() {
        if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 ||
            Double.compare(getWidth(), 0.0) <= 0 || Double.compare(getHeight(), 0.0) <= 0) {
            if (getPrefWidth() > 0 && getPrefHeight() > 0) {
                setPrefSize(getPrefWidth(), getPrefHeight());
            } else {
                setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        nameText = new Text(getName());
        nameText.setTextOrigin(VPos.TOP);

        valueText = new Text(String.format(locale, formatString, getValue()));
        valueText.setTextOrigin(VPos.TOP);

        barBackground = new Rectangle();

        bar = new Rectangle();

        pane = new Pane(nameText, valueText, barBackground, bar);
        pane.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));

        getChildren().setAll(pane);
    }
987596
protected void initMaps()
	{
		// Initialize label, maps and queue

		dist = new HashMap<GraphObject, Integer>();
		colors = new HashMap<GraphObject, Integer>();
		queue = new LinkedList<Node>();
	}
975232
void init( DMatrixSparseCSC A ) {
        this.A = A;
        this.m = A.numRows;
        this.n = A.numCols;

        this.next = 0;
        this.head = m;
        this.tail = m + n;
        this.nque = m + 2*n;

        if( parent.length < n || leftmost.length < m) {
            parent = new int[n];
            post = new int[n];
            pinv = new int[m+n];
            countsR = new int[n];
            leftmost = new int[m];
        }
        gwork.reshape(m+3*n);
    }
291879
@Override
	public void initGraphics(Graphics g) {
	    rootObjectIsInitialized = true;
	    rootCanvas = new RootCanvas();

	    eventListener.start();

// TODO fix
//	    if (runAsApplication) {
//	        if(windowFrame != null) {
//	            if (!initialFullScreen) {
//	                Insets insets = windowFrame.getInsets();
//	                windowFrame.setSize(panelWidth  + insets.left + insets.right,
//	                                    panelHeight + insets.top  + insets.bottom);
//	            }
//	        }
//	    } else {
//	        this.isInitializing = false;
//	    }

	    setFPS(fps);
	}
719315
def initialize(self):
        
        self.time.update(self.components.initial_time())
        self.time.stage = 'Initialization'
        super(Model, self).initialize()
65618
void start(CmdArgs args) {
        String graphLocation = args.get("graph.location", "");
        String propLocation = args.get("measurement.location", "");
        boolean cleanGraph = args.getBool("measurement.clean", false);
        String summaryLocation = args.get("measurement.summaryfile", "");
        String timeStamp = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss").format(new Date());
        put("measurement.timestamp", timeStamp);
        if (isEmpty(propLocation)) {
            propLocation = "measurement" + timeStamp + ".properties";
        }

        seed = args.getLong("measurement.seed", 123);
        put("measurement.gitinfo", args.get("measurement.gitinfo", ""));
        int count = args.getInt("measurement.count", 5000);

        GraphHopper hopper = new GraphHopperOSM() {
            @Override
            protected void prepareCH() {
                StopWatch sw = new StopWatch().start();
                super.prepareCH();
                // note that we measure the total time of all (possibly edge&node) CH preparations
                put(Parameters.CH.PREPARE + "time", sw.stop().getMillis());
                int edges = getGraphHopperStorage().getEdges();
                if (!getCHFactoryDecorator().getNodeBasedWeightings().isEmpty()) {
                    Weighting weighting = getCHFactoryDecorator().getNodeBasedWeightings().get(0);
                    int edgesAndShortcuts = getGraphHopperStorage().getGraph(CHGraph.class, weighting).getEdges();
                    put(Parameters.CH.PREPARE + "node.shortcuts", edgesAndShortcuts - edges);
                }
                if (!getCHFactoryDecorator().getEdgeBasedWeightings().isEmpty()) {
                    Weighting weighting = getCHFactoryDecorator().getEdgeBasedWeightings().get(0);
                    int edgesAndShortcuts = getGraphHopperStorage().getGraph(CHGraph.class, weighting).getEdges();
                    put(Parameters.CH.PREPARE + "edge.shortcuts", edgesAndShortcuts - edges);
                }
            }

            @Override
            protected void loadOrPrepareLM() {
                StopWatch sw = new StopWatch().start();
                super.loadOrPrepareLM();
                put(Landmark.PREPARE + "time", sw.stop().getMillis());
            }

            @Override
            protected DataReader importData() throws IOException {
                StopWatch sw = new StopWatch().start();
                DataReader dr = super.importData();
                put("graph.import_time", sw.stop().getSeconds());
                return dr;
            }
        };

        hopper.init(args).
                forDesktop();
        if (cleanGraph) {
            hopper.clean();
        }

        hopper.getCHFactoryDecorator().setDisablingAllowed(true);
        hopper.getLMFactoryDecorator().setDisablingAllowed(true);
        hopper.importOrLoad();

        GraphHopperStorage g = hopper.getGraphHopperStorage();
        EncodingManager encodingManager = hopper.getEncodingManager();
        if (encodingManager.fetchEdgeEncoders().size() != 1) {
            throw new IllegalArgumentException("There has to be exactly one encoder for each measurement");
        }
        FlagEncoder encoder = encodingManager.fetchEdgeEncoders().get(0);
        String vehicleStr = encoder.toString();

        StopWatch sw = new StopWatch().start();
        try {
            maxNode = g.getNodes();
            boolean isCH = false;
            boolean isLM = false;
            GHBitSet allowedEdges = printGraphDetails(g, vehicleStr);
            printMiscUnitPerfTests(g, isCH, encoder, count * 100, allowedEdges);
            printLocationIndexQuery(g, hopper.getLocationIndex(), count);
            printTimeOfRouteQuery(hopper, isCH, isLM, count / 20, "routing", vehicleStr, true, -1, true, false);

            if (hopper.getLMFactoryDecorator().isEnabled()) {
                System.gc();
                isLM = true;
                int activeLMCount = 12;
                for (; activeLMCount > 3; activeLMCount -= 4) {
                    printTimeOfRouteQuery(hopper, isCH, isLM, count / 4, "routingLM" + activeLMCount, vehicleStr, true, activeLMCount, true, false);
                }

                // compareRouting(hopper, vehicleStr, count / 5);
            }

            if (hopper.getCHFactoryDecorator().isEnabled()) {
                isCH = true;
//                compareCHWithAndWithoutSOD(hopper, vehicleStr, count/5);
                if (hopper.getLMFactoryDecorator().isEnabled()) {
                    isLM = true;
                    System.gc();
                    // try just one constellation, often ~4-6 is best
                    int lmCount = 5;
                    printTimeOfRouteQuery(hopper, isCH, isLM, count, "routingCHLM" + lmCount, vehicleStr, true, lmCount, true, false);
                }

                isLM = false;
                System.gc();
                if (!hopper.getCHFactoryDecorator().getNodeBasedWeightings().isEmpty()) {
                    Weighting weighting = hopper.getCHFactoryDecorator().getNodeBasedWeightings().get(0);
                    CHGraph lg = g.getGraph(CHGraph.class, weighting);
                    fillAllowedEdges(lg.getAllEdges(), allowedEdges);
                    printMiscUnitPerfTests(lg, isCH, encoder, count * 100, allowedEdges);
                    printTimeOfRouteQuery(hopper, isCH, isLM, count, "routingCH", vehicleStr, true, -1, true, false);
                    printTimeOfRouteQuery(hopper, isCH, isLM, count, "routingCH_no_sod", vehicleStr, true, -1, false, false);
                    printTimeOfRouteQuery(hopper, isCH, isLM, count, "routingCH_no_instr", vehicleStr, false, -1, true, false);
                }
                if (!hopper.getCHFactoryDecorator().getEdgeBasedWeightings().isEmpty()) {
                    printTimeOfRouteQuery(hopper, isCH, isLM, count, "routingCH_edge", vehicleStr, true, -1, false, true);
                    printTimeOfRouteQuery(hopper, isCH, isLM, count, "routingCH_edge_no_instr", vehicleStr, false, -1, false, true);
                }
            }
        } catch (Exception ex) {
            logger.error("Problem while measuring " + graphLocation, ex);
            put("error", ex.toString());
        } finally {
            put("gh.gitinfo", Constants.GIT_INFO);
            put("measurement.count", count);
            put("measurement.seed", seed);
            put("measurement.time", sw.stop().getMillis());
            System.gc();
            put("measurement.totalMB", getTotalMB());
            put("measurement.usedMB", getUsedMB());

            if (!summaryLocation.trim().isEmpty()) {
                writeSummary(summaryLocation, propLocation);
            }
            storeProperties(graphLocation, propLocation);
        }
    }
1322117
@Override public void onCreate() {
    super.onCreate();
    MainModule mainModule = new MainModule(this);
    objectGraph = ObjectGraph.create(mainModule);
    objectGraph.inject(this);
    objectGraph.injectStatics();
  }
389526
@PostConstruct
    public void init() {
        Timeline task = new Timeline(
            new KeyFrame(
                Duration.ZERO,
                new KeyValue(progress1.progressProperty(), 0),
                new KeyValue(progress2.progressProperty(), 0),
                new KeyValue(progress2.secondaryProgressProperty(), 0.5)),
            new KeyFrame(
                Duration.seconds(1),
                new KeyValue(progress2.secondaryProgressProperty(), 1)),
            new KeyFrame(
                Duration.seconds(2),
                new KeyValue(progress1.progressProperty(), 1),
                new KeyValue(progress2.progressProperty(), 1)));
        task.setCycleCount(Timeline.INDEFINITE);
        task.play();
    }
920426
public void init() throws Exception {
        for (Object object : starters) {
            if (object instanceof LifeCycle)
                ((LifeCycle) object).init();
        }
    }
897626
public void initialize() {
        Coin balance = Main.bitcoin.wallet().getBalance();
        checkState(!balance.isZero());
        new BitcoinAddressValidator(Main.params, address, sendBtn);
        new TextFieldValidator(amountEdit, text ->
                !WTUtils.didThrow(() -> checkState(Coin.parseCoin(text).compareTo(balance) <= 0)));
        amountEdit.setText(balance.toPlainString());
        address.setPromptText(Address.fromKey(Main.params, new ECKey(), Main.PREFERRED_OUTPUT_SCRIPT_TYPE).toString());
    }