/** * initializes the classSelection as true for all subclasses of root * * @param root * @param classSelection */ private void initSelectionRec( IFolder root, HashMap<String, Boolean> classSelection, boolean defaultSelectionValue) { if (!classSelection.containsKey(root.toString())) { classSelection.put(root.toString(), defaultSelectionValue); Iterator children = root.getChildren(); while (children.hasNext()) { initSelectionRec((IFolder) children.next(), classSelection, defaultSelectionValue); } } }
/** * initializes the classSelection as true for all subclasses of root * * @param root * @param classSelection */ private void initSelectionRecForChildren( IFolder root, HashMap<String, Boolean> classSelection, boolean defaultSelectionValue) { Iterator children = root.getChildren(); while (children.hasNext()) { initSelectionRec((IFolder) children.next(), classSelection, defaultSelectionValue); } }
public static void initColorScheme(IFolder root, HashMap<String, Color> colorScheme) { if (root instanceof ClassNodeWithParent && ((ClassNodeWithParent) root).getParent() != null && ((ClassNodeWithParent) root).getParent() instanceof ClassNodeWithParent) { // this is a child node, so put the color of the parent ClassNodeWithParent parent = ((ClassNodeWithParent) root).getParent(); colorScheme.put(root.toString(), colorScheme.get((parent.toString()))); } else { // this is NOT a child node if (!colorScheme.containsKey(root.toString())) { float components[] = colourGenerator.getNextColor().getComponents(null); Color color = new Color(components[0], components[1], components[2], 0.5f); colorScheme.put(root.toString(), color); } } Iterator children = root.getChildren(); while (children.hasNext()) { initColorScheme((IFolder) children.next(), colorScheme); } }