ToolbarLayout membersLayout = new ToolbarLayout();
membersLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
membersLayout.setStretchMinorAxis(false);
membersLayout.setSpacing(4);
Figure membersFigure = new Figure();
membersFigure.setLayoutManager(membersLayout);
membersFigure.setBorder(new CompartmentFigureBorder());
for(ITypeService<?, ?> typeSrv : typeServices) {
if(extendedDisplay) {
if(typeSrv instanceof IClassService) {
IClassService<?, ?> classSrv =
(IClassService<?, ?>)typeSrv;
membersFigure.add(new ClassFigure(classSrv));
}
else if(typeSrv instanceof IInterfaceService) {
IInterfaceService<?, ?> interfaceSrv =
(IInterfaceService<?, ?>)typeSrv;
membersFigure.add(
new InterfaceFigure<IInterfaceService<?, ?>>(
interfaceSrv
)
);
}
}
else {
if(typeSrv instanceof IClassService) {
Label classLabel =
new Label(
typeSrv.getSimpleName(),
ClassFigure.createClassIcon()
);
membersFigure.add(classLabel);
}
else if(typeSrv instanceof IInterfaceService) {
Label interfaceLabel =
new Label(
typeSrv.getSimpleName(),
InterfaceFigure.createInterfaceIcon()
);
membersFigure.add(interfaceLabel);
}
else {
Label label = new Label(typeSrv.getSimpleName());
membersFigure.add(label);
}
}
}
add(membersFigure);
}