Examples of ViewInfo


Examples of gov.nasa.arc.mct.services.component.ViewInfo

    }
   
    @Test
    public void testGetViews() {
        Assert.assertTrue(registry.getViewInfos("someType", ViewType.CENTER).isEmpty(), "views should be empty prior to populating registry");
        ViewInfo vi1 = new ViewInfo(TestingView.class, "abc", ViewType.OBJECT);
        ViewInfo vi3 = new ViewInfo(TestingView2.class, "abc", ViewType.CENTER);
        ViewInfo vi2 = new ViewInfo(TestingView3.class, "def", ViewType.CENTER);
        ExtendedComponentProvider provider = createProvider(Collections.<ComponentTypeInfo>emptyList(), Arrays.asList(vi1, vi2, vi3));
        registry.refreshComponents(Collections.singletonList(provider));
        Collection<ViewInfo> infos = registry.getViewInfos("abc", ViewType.CENTER);
        Assert.assertEquals(infos.size(),2);
        Assert.assertTrue(infos.containsAll(Arrays.asList(vi2,vi3)));
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

    @Test
    public void testDefaultViews() {
        ExtendedComponentProvider provider = createProvider(Collections.<ComponentTypeInfo>singleton(new ComponentTypeInfo("displayName", "desc", TestBaseComponent.class)), Collections.<ViewInfo>emptyList());
        registry.refreshComponents(Collections.singletonList(provider));
        Assert.assertTrue(registry.getViewInfos("someType", ViewType.CENTER).isEmpty(), "views should be empty prior to populating registry");
        ExtendedComponentProvider defaultProvider = createProvider(Collections.<ComponentTypeInfo>emptyList(), Collections.<ViewInfo>singleton(new ViewInfo(TestingView.class,"",ViewType.CENTER)));
        registry.setDefaultViewProvider(defaultProvider);
        Assert.assertEquals(Collections.singletonList(new ViewInfo(TestingView.class,"", ViewType.CENTER)), registry.getViewInfos(TestBaseComponent.class.getName(), ViewType.CENTER), "default test view should be provided");
        // TODO add additional tests to verify the multiplicity of the ViewType is considered
    }
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

    }
   
    @Test
    public void testMultipleReturnsFromGetInfos() {
        ComponentTypeInfo info = new ComponentTypeInfo("displayName", "desc", TestBaseComponent.class);
        ViewInfo providerViewInfo = new ViewInfo(TestingView.class,"", ViewType.CENTER);
        ViewInfo defaultViewInfo = new ViewInfo(OtherTestingView.class,"", ViewType.CENTER);
        ExtendedComponentProvider cp = createProvider(Collections.singleton(info), Collections.<ViewInfo>singleton(providerViewInfo));
        registry.refreshComponents(Collections.singletonList(cp));
       
        ExtendedComponentProvider defaultProvider = createProvider(Collections.<ComponentTypeInfo>emptyList(), Collections.singleton(defaultViewInfo));
        registry.setDefaultViewProvider(defaultProvider);
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

       
        if (selection.isEmpty()) {
            return false;
        }
       
        ViewInfo vi = selection.iterator().next().getInfo();
       
        if (!(vi != null && vi.getViewType() == ViewType.NODE)){
            return false;
        }

        if (!(activeHousing.getDirectoryArea() instanceof MCTDirectoryArea)) {
            return false;
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

            AbstractComponent component = getManifestedComponent();

            for (AbstractComponent childComponent : component.getComponents()) {
                Set<ViewInfo> nodeViews = childComponent.getViewInfos(ViewType.NODE);
                if (!nodeViews.isEmpty()) {
                    ViewInfo nextViewInfo = nodeViews.iterator().next();
                   
                    // Children are only allowed if the component is not a leaf or the component is another users drop box
                    boolean allowsChildren =!childComponent.isLeaf();
                   
                    View childNodeView = nextViewInfo.createView(childComponent);
                    MCTMutableTreeNode childNode = new MCTMutableTreeNode(childNodeView, tree, allowsChildren);

                    if (allowsChildren){
                        MCTMutableTreeNode grandChildNode = new MCTMutableTreeNode(View.NULL_VIEW_MANIFESTATION, tree);
                        childNode.add(grandChildNode);
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

        JFrame frame = new JFrame();
        JPanel panel = new JPanel();
        frame.add(panel);
        panel.add(tree);
       
        nodeViewManifestation = new NodeViewManifestation(mockComponent, new ViewInfo(NodeViewManifestation.class,"", ViewType.NODE));
    }
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

    }
   
   
    @Test
    public void testUpdateMonitoredGUI_Reorder() {
      ViewInfo viewInfo = new ViewInfo(NodeViewManifestation.class, "", ViewType.NODE);
      Mockito.when(view1.getManifestedComponent()).thenReturn(comp1);
      Mockito.when(view2.getManifestedComponent()).thenReturn(comp2);
      Mockito.when(view3.getManifestedComponent()).thenReturn(comp3);
      Mockito.when(comp1.getViewInfos(ViewType.NODE)).thenReturn(Collections.singleton(viewInfo));
        Mockito.when(comp2.getViewInfos(ViewType.NODE)).thenReturn(Collections.singleton(viewInfo));
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

     *  that the View label has been updated to the component's name.
     */
    @Test
    public void testUpdateMonitoredGUI_None() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {

        nodeViewManifestation = new NodeViewManifestation(mockComponent, new ViewInfo(NodeViewManifestation.class,"", ViewType.NODE));

        Field field = nodeViewManifestation.getClass().getDeclaredField("label");
        field.setAccessible(true);
        JLabel label = (JLabel) field.get(nodeViewManifestation);// get label field of View under test
        String fixedName = "outdatedView";
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

  @DataProvider
  public Object[][] assetTestCases() {
    List<Object[]> cases = new ArrayList<Object[]>();
    // Consider all view types
    for (ViewType type : ViewType.values()) {
      TypeInfo<?> view = new ViewInfo(ExecutableButtonManifestation.class, ExecutableButtonManifestation.VIEW_NAME, ExecutableButtonManifestation.class.getName(), type);
      TypeInfo<?> comp = new ComponentTypeInfo("","",ExecutableButtonComponent.class);
      for (TypeInfo<?> vi : new TypeInfo<?>[]{view, comp}) {
        // Executable buttons have no view or component icons currently
        cases.add(new Object[] { new ExecutableButtonComponentProvider(), vi, ImageIcon.class, false});
        // As above
View Full Code Here

Examples of gov.nasa.arc.mct.services.component.ViewInfo

       
        if (selection.isEmpty()) {
            return false;
        }
       
        ViewInfo vi = selection.iterator().next().getInfo();
       
        if (!(vi != null && vi.getViewType() == ViewType.NODE)){
            return false;
        }

        if (!(activeHousing.getDirectoryArea() instanceof MCTDirectoryArea)) {
            return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.