use of artisynth.core.modelbase.HasMenuItems in project artisynth_core by artisynth.
the class MenuBarHandler method getApplicationMenuItems.
ArrayList<Object> getApplicationMenuItems(RootModel root) {
ArrayList<Object> items = new ArrayList<Object>();
boolean hasItems = false;
hasItems |= addMenuItems(items, root);
for (int i = 0; i < root.numComponents(); i++) {
ModelComponent comp0 = root.get(i);
if (comp0 instanceof HasMenuItems) {
hasItems |= addMenuItems(items, (HasMenuItems) comp0);
}
if (comp0 instanceof CompositeComponent) {
CompositeComponent ccomp = (CompositeComponent) comp0;
for (int j = 0; j < ccomp.numComponents(); j++) {
ModelComponent comp1 = ccomp.get(j);
if (comp1 instanceof HasMenuItems) {
hasItems |= addMenuItems(items, (HasMenuItems) comp1);
}
}
}
}
return hasItems ? items : null;
}
Aggregations