use of org.gephi.appearance.spi.TransformerUI in project gephi by gephi.
the class AppearanceUIModel method initSelectedTransformerUIs.
private void initSelectedTransformerUIs(String elementClass) {
Graph graph = graphController.getGraphModel(appearanceModel.getWorkspace()).getGraph();
Map<TransformerCategory, TransformerUI> newMap = new HashMap<>();
for (Function func : elementClass.equals(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions(graph) : appearanceModel.getEdgeFunctions(graph)) {
TransformerUI ui = func.getUI();
if (ui != null) {
TransformerCategory cat = ui.getCategory();
if (!newMap.containsKey(cat)) {
newMap.put(cat, ui);
}
if (!selectedCategory.containsKey(elementClass)) {
selectedCategory.put(elementClass, cat);
}
}
}
//Prefer color to start
if (newMap.containsKey(DefaultCategory.COLOR)) {
selectedCategory.put(elementClass, DefaultCategory.COLOR);
}
selectedTransformerUI.put(elementClass, newMap);
selectedFunction.put(elementClass, new HashMap<TransformerUI, Function>());
selectedAutoTransformer.put(elementClass, new HashMap<TransformerCategory, AutoAppyTransformer>());
}
Aggregations