/*
Creates or gets the glyph to connect to the control arc.

@param ctrl Control to represent
@return glyph representing the controller tree
544035
private Glyph createControlStructure(Control ctrl) {
		Glyph cg;
		Set<PhysicalEntity> controllers = getControllers(ctrl);
		// If no representable controller found, skip this control
		if (controllers.isEmpty()) {
			cg = null;
		} else if (controllers.size() == 1 && getControllerSize(ctrl.getControlledOf()) == 0)
		{ // If there is only one controller with no modulator, put an arc for controller
			cg = getGlyphToLink(controllers.iterator().next(), convertID(ctrl.getUri()));
		} else {
			// This list will contain handles for each participant of the AND structure
			List<Glyph> toConnect = new ArrayList<Glyph>();

			// Bundle controllers if necessary
			Glyph gg = handlePEGroup(controllers, convertID(ctrl.getUri()));
			if(gg != null)
				toConnect.add(gg);

			// Handle co-factors of catalysis
			if (ctrl instanceof Catalysis) {
				Set<PhysicalEntity> cofs = ((Catalysis) ctrl).getCofactor();
				Glyph g = handlePEGroup(cofs, convertID(ctrl.getUri()));
				if (g != null) 
					toConnect.add(g);
			}

			if (toConnect.isEmpty()) {
				return null;
			} else if (toConnect.size() == 1) {
				cg = toConnect.iterator().next();
			} else {
				cg = connectWithAND(toConnect);
			}
		}

		return cg;
	}
449548
def SelectGlyph(aFont, message="Select a glyph:", title='FontParts'):
    
    return dispatcher["SelectGlyph"](aFont=aFont, message=message, title=title)
1301853
public static ThemeController get() {
		if (ThemeController.instance == null) {
			ThemeController.instance = GWT.create(ThemeController.class);
		}
		return ThemeController.instance;
	}
1187645
private String getPlaceholderText(Graphics g, int availTextWidth) {
        JTextComponent c  = getComponent();
        FontMetrics    fm = SwingUtilities2.getFontMetrics(c, g);

        return SwingUtilities2.clipStringIfNecessary(c, fm, placeholderText, availTextWidth);
    }
1013287
private void drawTickMarks(final GraphicsContext CTX) {
        tickMarkCanvas.setCache(false);
        CTX.clearRect(0, 0, tickMarkCanvas.getWidth(), tickMarkCanvas.getHeight());
        CTX.setFill(gauge.getMajorTickMarkColor());

        List<Section> tickMarkSections         = gauge.getTickMarkSections();
        List<Section> tickLabelSections        = gauge.getTickLabelSections();
        Color         majorTickMarkColor       = gauge.getTickMarkColor();
        Color         tickLabelColor           = gauge.getTickLabelColor();
        boolean       smallRange               = Double.compare(gauge.getRange(), 10.0) <= 0;
        double        minValue                 = gauge.getMinValue();
        double        maxValue                 = gauge.getMaxValue();
        double        tmpStepSize              = smallRange ? stepSize / 10 : stepSize;
        Font          tickLabelFont            = Fonts.robotoRegular(0.15 * (Orientation.VERTICAL == orientation ? width : height));
        boolean       tickMarkSectionsVisible  = gauge.getTickMarkSectionsVisible();
        boolean       tickLabelSectionsVisible = gauge.getTickLabelSectionsVisible();
        double        offsetX                  = 0.18345865 * width;
        double        offsetY                  = 0.1 * height;
        double        innerPointX              = 0;
        double        innerPointY              = 0;
        double        outerPointX              = 0.07 * width;
        double        outerPointY              = 0.08 * height;
        double        textPointX               = 0.55 * tickMarkCanvas.getWidth();
        double        textPointY               = 0.7 * tickMarkCanvas.getHeight();
        BigDecimal    minorTickSpaceBD         = BigDecimal.valueOf(gauge.getMinorTickSpace());
        BigDecimal    majorTickSpaceBD         = BigDecimal.valueOf(gauge.getMajorTickSpace());
        BigDecimal    counterBD                = BigDecimal.valueOf(gauge.getMinValue());
        double        counter                  = minValue;
        double        range                    = gauge.getRange();

        for (double i = 0 ; Double.compare(i, range) <= 0 ; i++) {
            if (Orientation.VERTICAL == orientation) {
                innerPointY = counter * tmpStepSize + offsetY;
                outerPointY = innerPointY;
                textPointY  = innerPointY;
            } else {
                innerPointX = counter * tmpStepSize + offsetX;
                outerPointX = innerPointX;
                textPointX  = innerPointX;
            }

            // Set the general tickmark color
            CTX.setStroke(gauge.getTickMarkColor());
            if (Double.compare(counterBD.remainder(majorTickSpaceBD).doubleValue(), 0.0) == 0) {
                // Draw major tick mark
                if (gauge.getMajorTickMarksVisible()) {
                    CTX.setFill(tickMarkSectionsVisible ? Helper.getColorOfSection(tickMarkSections, counter, majorTickMarkColor) : majorTickMarkColor);
                    CTX.setStroke(tickMarkSectionsVisible ? Helper.getColorOfSection(tickMarkSections, counter, majorTickMarkColor) : majorTickMarkColor);
                    CTX.setLineWidth(1);
                    CTX.strokeLine(innerPointX, innerPointY, outerPointX, outerPointY);
                }
                // Draw tick label text
                if (gauge.getTickLabelsVisible()) {
                    CTX.save();
                    CTX.translate(textPointX, textPointY);
                    CTX.setFont(tickLabelFont);
                    CTX.setTextAlign(TextAlignment.CENTER);
                    CTX.setTextBaseline(VPos.CENTER);
                    CTX.setFill(tickLabelSectionsVisible ? Helper.getColorOfSection(tickLabelSections, counter, tickLabelColor) : tickLabelColor);
                    if (Orientation.VERTICAL == orientation) {
                        CTX.fillText(Integer.toString((int) (maxValue - counter)), 0, 0);
                    } else {
                        CTX.fillText(Integer.toString((int) counter), 0, 0);
                    }
                    CTX.restore();
                }
            }
            counterBD = counterBD.add(minorTickSpaceBD);
            counter   = counterBD.doubleValue();
            if (counter > maxValue) break;
        }

        tickMarkCanvas.setCache(true);
        tickMarkCanvas.setCacheHint(CacheHint.QUALITY);
    }
1223826
protected String getId(FaceletContext ctx)
    {
        if (this._id != null)
        {
            return this._id.getValue(ctx);
        }
        return ctx.generateUniqueId(_delegate.getTagId());
    }
102493
private static Node createNewObjectPatternFromSuccessiveKeys(Node stringKey) {
    Node newPattern = stringKey.getParent().cloneNode(); // copies the JSType
    for (Node next = stringKey.getNext(); next != null; ) {
      Node newKey = next;
      next = newKey.getNext();
      newPattern.addChildToBack(newKey.detach());
    }
    return newPattern;
  }
558639
@SuppressWarnings("unchecked")  // The type is always ControlFlowGraph<Node>
  public ControlFlowGraph<Node> getControlFlowGraph() {
    ControlFlowGraph<Node> result;
    Object o = cfgs.peek();
    if (o instanceof Node) {
      Node cfgRoot = (Node) o;
      ControlFlowAnalysis cfa = new ControlFlowAnalysis(compiler, false, true);
      cfa.process(null, cfgRoot);
      result = cfa.getCfg();
      cfgs.pop();
      cfgs.push(result);
    } else {
      result = (ControlFlowGraph<Node>) o;
    }
    return result;
  }
49408
def OnPadIntCtrl(self, event):
        """"""

        self.attrs["pad"] = event.GetValue()

        post_command_event(self, self.DrawChartMsg)
372890
def getCharStringForGlyph(self, glyph, private, globalSubrs):
        
        width = glyph.width
        defaultWidth = private.defaultWidthX
        nominalWidth = private.nominalWidthX
        if width == defaultWidth:
            # if width equals the default it can be omitted from charstring
            width = None
        else:
            # subtract the nominal width
            width -= nominalWidth
        if width is not None:
            width = otRound(width)
        pen = T2CharStringPen(width, self.allGlyphs,
                              roundTolerance=self.roundTolerance)
        glyph.draw(pen)
        charString = pen.getCharString(
            private, globalSubrs, optimize=self.optimizeCFF
        )
        return charString
581193
public static int getCtrlOrMetaModifier() {
        final WebBrowser webBrowser = Page.getCurrent().getWebBrowser();
        if (webBrowser.isMacOSX()) {
            return ShortcutAction.ModifierKey.META;
        }

        return ShortcutAction.ModifierKey.CTRL;
    }
1111505
public GVRShader getTemplate(GVRContext ctx)
    {
        if (mShaderTemplate == null)
        {
            mShaderTemplate = makeTemplate(ID, ctx);
            ctx.getShaderManager().addShaderID(this);
        }
        return mShaderTemplate;
    }
253224
function getGlyphData($originalGlyphIdx, &$maxdepth, &$depth, &$points, &$contours)
	{
		$depth++;
		$maxdepth = max($maxdepth, $depth);
		if (count($this->glyphdata[$originalGlyphIdx]['compGlyphs'])) {
			foreach ($this->glyphdata[$originalGlyphIdx]['compGlyphs'] as $glyphIdx) {
				$this->getGlyphData($glyphIdx, $maxdepth, $depth, $points, $contours);
			}
		} else {
			if (($this->glyphdata[$originalGlyphIdx]['nContours'] > 0) && $depth > 0) { // simple
				$contours += $this->glyphdata[$originalGlyphIdx]['nContours'];
				$points += $this->glyphdata[$originalGlyphIdx]['nPoints'];
			}
		}
		$depth--;
	}
958960
function (elm) {
        var ctrl, lookup = this.getRoot().controlIdLookup;

        while (elm && lookup) {
          ctrl = lookup[elm.id];
          if (ctrl) {
            break;
          }

          elm = elm.parentNode;
        }

        return ctrl;
      }
1121029
function createIcon(options, enableTooltips, shortcuts) {
	options = options || {};
	var el = document.createElement("a");
	enableTooltips = (enableTooltips == undefined) ? true : enableTooltips;

	if(options.title && enableTooltips) {
		el.title = createTootlip(options.title, options.action, shortcuts);

		if(isMac) {
			el.title = el.title.replace("Ctrl", "⌘");
			el.title = el.title.replace("Alt", "⌥");
		}
	}

	el.tabIndex = -1;
	el.className = options.className;
	return el;
}
1275683
private Point2D getGlyphCenter(final int index) {

        if (text.length() == 1) return getCenter();

        final Shape glyph = glyphs.getGlyphOutline(index);
        final Rectangle2D glyphBounds = transformedBounds(glyph);

        return new Point2D.Double(glyphBounds.getCenterX(), glyphBounds.getCenterY());
    }
1013159
public MapController getMapController() {
		final GraphicsController controller = mapWidget.getController();
		MapController mapController = new MapController(this, controller);
		mapController.setActivationHandler(new ExportableFunction() {

			public void execute() {
				controller.onActivate();
			}
		});
		mapController.setDeactivationHandler(new ExportableFunction() {

			public void execute() {
				controller.onDeactivate();
			}
		});
		return mapController;
	}