Code example for NamedNodeMap

Methods: getNamedItem

0
	// Helper functions 
	 
 
	private static int readColorFromNode(Node nd) {
		NamedNodeMap attrs = nd.getAttributes();
		int R = Integer.parseInt(attrs.getNamedItem("R").getTextContent());
		int G = Integer.parseInt(attrs.getNamedItem("G").getTextContent());
		int B = Integer.parseInt(attrs.getNamedItem("B").getTextContent());
		return Color.argb(255, R, G, B);
	} 
	 
	private void setCurrentColor(int col){
		currColorButton.setBackgroundColor(col);
		currColor = col;
		notifyListenersColorChanged(); 
		dismissAllPopups(); 
	} 
	 
	private void dismissAllPopups(){ 
		popupColorPalette.dismiss();
		popupColorPicker.dismiss();