Markup a atom with the class 'atom' and optionally the ids/classes
from it's properties.

@param elem rendering element
@param atom atom
@return the marked element
500496
public static MarkedElement markupAtom(IRenderingElement elem, IAtom atom) {
        if (elem == null)
            return null;
        MarkedElement tagElem = markupChemObj(elem, atom);
        tagElem.aggClass("atom");
        return tagElem;
    }
1016557
@Override
    public Color getAtomColor(IAtom atom, Color defaultColor) {
        Color color = defaultColor;
        String symbol = atom.getSymbol().toUpperCase();
        if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumber())) {
            color = ATOM_COLORS_MASSNUM.get(atom.getAtomicNumber()); // lookup by atomic number.
        } else if (ATOM_COLORS_SYMBOL.containsKey(symbol)) {
            color = ATOM_COLORS_SYMBOL.get(symbol); // lookup by atomic symbol.
        }

        return new Color(color.getRed(), color.getGreen(), color.getBlue()); // return atom copy.
    }
897596
function Tabs(element) {
      classCallCheck(this, Tabs);

      /** @type {Element} */
      var _this = possibleConstructorReturn(this, _TinyEmitter.call(this));

      _this.element = element;

      /** @private {number} */
      _this._selectedIndex = -1;

      /**
       * List items, children of the tabs list.
       * @type {Array.<Element>}
       */
      _this.tabs = Array.from(_this.element.children);

      /**
       * Anchor elements inside the tab.
       * @type {Array.<HTMLAnchorElement>}
       */
      _this.anchors = _this.tabs.map(function (tab) {
        return tab.querySelector('a');
      });

      /**
       * Tab pane elements.
       * @type {Array.<HTMLElement>}
       */
      _this.panes = _this.anchors.map(function (anchor) {
        return document.getElementById(anchor.getAttribute('href').substring(1));
      });

      /**
       * Wrapper for the panes.
       * @type {HTMLElement}
       */
      _this.panesContainer = _this.panes[0].parentElement;

      /**
       * Get an array of [possible] hashes.
       * @type {Array.<?string>}
       */
      _this.hashes = _this.anchors.map(function (anchor) {
        return anchor.getAttribute('data-hash');
      });

      _this.init();
      return _this;
    }
1008953
private <T extends Element> void mapAnnotations(final Map<TypeElement, List<T>> map,
            Element e, final T holder) {
        new SimpleElementVisitor9<Void, Void>() {

            void addAnnotations(Element e) {
                for (AnnotationMirror a : e.getAnnotationMirrors()) {
                    add(map, (TypeElement) a.getAnnotationType().asElement(), holder);
                }
            }

            @Override
            public Void visitPackage(PackageElement e, Void p) {
                for (AnnotationMirror a : e.getAnnotationMirrors()) {
                    refList(map, a.getAnnotationType().asElement()).add(holder);
                }
                return null;
            }

            @Override
            protected Void defaultAction(Element e, Void p) {
                addAnnotations(e);
                return null;
            }
        }.visit(e);
    }
673917
private String formatElement(final Object element, final Map classMap) {
        StringBuffer buf = new StringBuffer("\tat ");
        buf.append(element);
        try {
            String className = getClassNameMethod.invoke(element, (Object[])null).toString();
            Object classDetails = classMap.get(className);
            if (classDetails != null) {
                buf.append(classDetails);
            } else {
                Class cls = findClass(className);
                int detailStart = buf.length();
                buf.append('[');
                String mavenCoordinates = MavenCoordHelper.getMavenCoordinates(cls);
                if (!Objects.isBlank(mavenCoordinates)) {
                    buf.append(mavenCoordinates);
                } else {
                    try {
                        CodeSource source = cls.getProtectionDomain().getCodeSource();
                        if (source != null) {
                            URL locationURL = source.getLocation();
                            if (locationURL != null) {
                                //
                                //   if a file: URL
                                //
                                if ("file".equals(locationURL.getProtocol())) {
                                    String path = locationURL.getPath();
                                    if (path != null) {
                                        //
                                        //  find the last file separator character
                                        //
                                        int lastSlash = path.lastIndexOf('/');
                                        int lastBack = path.lastIndexOf(File.separatorChar);
                                        if (lastBack > lastSlash) {
                                            lastSlash = lastBack;
                                        }
                                        //
                                        //  if no separator or ends with separator (a directory)
                                        //     then output the URL, otherwise just the file name.
                                        //
                                        if (lastSlash <= 0 || lastSlash == path.length() - 1) {
                                            buf.append(locationURL);
                                        } else {
                                            buf.append(path.substring(lastSlash + 1));
                                        }
                                    }
                                } else {
                                    buf.append(locationURL);
                                }
                            }
                        }
                    } catch (SecurityException ex) {
                    }
                    buf.append(':');
                    Package pkg = cls.getPackage();
                    if (pkg != null) {
                        String implVersion = pkg.getImplementationVersion();
                        if (implVersion != null) {
                            buf.append(implVersion);
                        }
                    }
                }
                buf.append(']');
                classMap.put(className, buf.substring(detailStart));
            }
        } catch (Exception ex) {
        }
        return buf.toString();
    }
681144
public final hqlParser.atom_return atom() throws RecognitionException {
		hqlParser.atom_return retval = new hqlParser.atom_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token op=null;
		Token lb=null;
		Token DOT236=null;
		Token CLOSE239=null;
		Token CLOSE_BRACKET241=null;
		ParserRuleReturnScope primaryExpression235 =null;
		ParserRuleReturnScope identifier237 =null;
		ParserRuleReturnScope exprList238 =null;
		ParserRuleReturnScope expression240 =null;

		CommonTree op_tree=null;
		CommonTree lb_tree=null;
		CommonTree DOT236_tree=null;
		CommonTree CLOSE239_tree=null;
		CommonTree CLOSE_BRACKET241_tree=null;

		try {
			// hql.g:585:3: ( primaryExpression ( DOT ^ identifier ( options {greedy=true; } : (op= OPEN ^ exprList CLOSE !) )? |lb= OPEN_BRACKET ^ expression CLOSE_BRACKET !)* )
			// hql.g:585:5: primaryExpression ( DOT ^ identifier ( options {greedy=true; } : (op= OPEN ^ exprList CLOSE !) )? |lb= OPEN_BRACKET ^ expression CLOSE_BRACKET !)*
			{
			root_0 = (CommonTree)adaptor.nil();


			pushFollow(FOLLOW_primaryExpression_in_atom2774);
			primaryExpression235=primaryExpression();
			state._fsp--;

			adaptor.addChild(root_0, primaryExpression235.getTree());

			// hql.g:586:3: ( DOT ^ identifier ( options {greedy=true; } : (op= OPEN ^ exprList CLOSE !) )? |lb= OPEN_BRACKET ^ expression CLOSE_BRACKET !)*
			loop83:
			while (true) {
				int alt83=3;
				int LA83_0 = input.LA(1);
				if ( (LA83_0==DOT) ) {
					alt83=1;
				}
				else if ( (LA83_0==OPEN_BRACKET) ) {
					alt83=2;
				}

				switch (alt83) {
				case 1 :
					// hql.g:587:4: DOT ^ identifier ( options {greedy=true; } : (op= OPEN ^ exprList CLOSE !) )?
					{
					DOT236=(Token)match(input,DOT,FOLLOW_DOT_in_atom2783);
					DOT236_tree = (CommonTree)adaptor.create(DOT236);
					root_0 = (CommonTree)adaptor.becomeRoot(DOT236_tree, root_0);

					pushFollow(FOLLOW_identifier_in_atom2786);
					identifier237=identifier();
					state._fsp--;

					adaptor.addChild(root_0, identifier237.getTree());

					// hql.g:588:5: ( options {greedy=true; } : (op= OPEN ^ exprList CLOSE !) )?
					int alt82=2;
					int LA82_0 = input.LA(1);
					if ( (LA82_0==OPEN) ) {
						alt82=1;
					}
					switch (alt82) {
						case 1 :
							// hql.g:589:6: (op= OPEN ^ exprList CLOSE !)
							{
							// hql.g:589:6: (op= OPEN ^ exprList CLOSE !)
							// hql.g:589:8: op= OPEN ^ exprList CLOSE !
							{
							op=(Token)match(input,OPEN,FOLLOW_OPEN_in_atom2814);
							op_tree = (CommonTree)adaptor.create(op);
							root_0 = (CommonTree)adaptor.becomeRoot(op_tree, root_0);

							op.setType( METHOD_CALL );
							pushFollow(FOLLOW_exprList_in_atom2819);
							exprList238=exprList();
							state._fsp--;

							adaptor.addChild(root_0, exprList238.getTree());

							CLOSE239=(Token)match(input,CLOSE,FOLLOW_CLOSE_in_atom2821);
							}

							}
							break;

					}

					}
					break;
				case 2 :
					// hql.g:590:5: lb= OPEN_BRACKET ^ expression CLOSE_BRACKET !
					{
					lb=(Token)match(input,OPEN_BRACKET,FOLLOW_OPEN_BRACKET_in_atom2835);
					lb_tree = (CommonTree)adaptor.create(lb);
					root_0 = (CommonTree)adaptor.becomeRoot(lb_tree, root_0);

					lb.setType( INDEX_OP );
					pushFollow(FOLLOW_expression_in_atom2840);
					expression240=expression();
					state._fsp--;

					adaptor.addChild(root_0, expression240.getTree());

					CLOSE_BRACKET241=(Token)match(input,CLOSE_BRACKET,FOLLOW_CLOSE_BRACKET_in_atom2842);
					}
					break;

				default :
					break loop83;
				}
			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
884141
public static List<Element> getChildElements(final Element elem, final boolean deep) {
        final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
        final List<Element> res = new ArrayList<>(children.getLength());
        for (int i = 0; i < children.getLength(); i++) {
            final Node child = children.item(i);
            if (child.getNodeType() == Node.ELEMENT_NODE) {
                res.add((Element) child);
            }
        }
        return res;
    }
260749
public static List<Element> getChildElements(final Element elem, final DitaClass cls) {
        return getChildElements(elem, cls, false);
    }
679864
public static String getValue(final Element elem, final String attrName) {
        final Attr attr = elem.getAttributeNode(attrName);
        if (attr != null && !attr.getValue().isEmpty()) {
            return attr.getValue();
        }
        return null;
    }
1051872
function(markup) {

        if (!markup) return undefined;

        var fragment = markup.fragment;
        if (!(markup.fragment instanceof DocumentFragment) || !markup.fragment.hasChildNodes()) throw new Error('dia.LinkView: invalid label markup.');

        var vNode;
        var childNodes = fragment.childNodes;

        if ((childNodes.length > 1) || childNodes[0].nodeName.toUpperCase() !== 'G') {
            // default markup fragment is not wrapped in <g />
            // add a <g /> container
            vNode = V('g').append(fragment);
        } else {
            vNode = V(childNodes[0]);
        }

        vNode.addClass('label');

        return { node: vNode.node, selectors: markup.selectors };
    }
286497
private String formatElement(final StackTraceElement element, final Map<String, String> classMap) {
        StringBuilder buf = new StringBuilder("\tat ");
        buf.append(element);
        String className = element.getClassName();
        String classDetails = classMap.get(className);
        if (classDetails == null) {
            try {
                Class<?> cls = findClass(className);
                classDetails = getClassDetail(cls);
                classMap.put(className, classDetails);
            } catch (Throwable th) {
                // Ignore
            }
        }
        if (classDetails != null) {
            buf.append(classDetails);
        }
        return buf.toString();
    }
2998
public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) {
        Point2d point = atom.getPoint2d();
        double radius = (Double) model.get(AtomRadius.class) / model.getParameter(Scale.class).getValue();
        double distance = 2 * radius;
        if (model.get(CompactShape.class) == Shape.SQUARE) {
            return new RectangleElement(point.x - radius, point.y - radius, distance, distance, true, getAtomColor(
                    atom, model));
        } else {
            return new OvalElement(point.x, point.y, radius, true, getAtomColor(atom, model));
        }
    }
1141647
function(elem, child) {
		if (child) {
			var tag = (elem.tagName||'').toLowerCase();
			if (elem.nodeType === 8) { // comment
				if (child.nodeType === 3) { // text node
					elem.nodeValue += child.nodeValue;
				}
			} else if (tag === 'table' && elem.tBodies) {
				if (!child.tagName) {
					// must unwrap documentFragment for tables
					if (child.nodeType === 11) {
						while (child.firstChild) {
							appendDOM(elem, child.removeChild(child.firstChild));
						}
					}
					return;
				}

				// in IE must explicitly nest TRs in TBODY
				var childTag = child.tagName.toLowerCase();// child tagName
				if (childTag && childTag !== 'tbody' && childTag !== 'thead') {
					// insert in last tbody
					var tBody = elem.tBodies.length > 0 ? elem.tBodies[elem.tBodies.length-1] : null;
					if (!tBody) {
						tBody = createElement(childTag === 'th' ? 'thead' : 'tbody');
						elem.appendChild(tBody);
					}
					tBody.appendChild(child);
				} else if (elem.canHaveChildren !== false) {
					elem.appendChild(child);
				}

			} else if (tag === 'style' && document.createStyleSheet) {
				// IE requires this interface for styles
				elem.cssText = child;

			} else if (elem.canHaveChildren !== false) {
				elem.appendChild(child);

			} else if (tag === 'object' &&
				child.tagName && child.tagName.toLowerCase() === 'param') {
					// IE-only path
					try {
						elem.appendChild(child);
					} catch (ex1) {}
					try {
						if (elem.object) {
							elem.object[child.name] = child.value;
						}
					} catch (ex2) {}
			}
		}
	}
553616
public AbstractHTMLElement addClass(String clazz) {
        String currentClass = this.getProperty("class");
        if (currentClass != null) {
            currentClass += " " + clazz;
        } else {
            currentClass = clazz;
        }
        this.setProperty("class", currentClass);

        return this;
    }
362924
public INode addNode(VFAtomMatcher matcher, IAtom atom) {
        NodeBuilder node = new NodeBuilder(matcher);
        nodesList.add(node);
        nodeBondMap.put(node, atom);
        return node;
    }
1172123
private ClassBuilder getClassBuilder(Element element) {
        ClassBuilder classBuilder = new ClassBuilder(messager, element);
        classBuilder.setBindingManager(this);
        return classBuilder;
    }
757281
protected boolean invisibleHydrogen(IAtom atom, RendererModel model) {
        return isHydrogen(atom) && !(Boolean) model.get(ShowExplicitHydrogens.class);
    }