Package gov.nasa.arc.mct.services.component

Examples of gov.nasa.arc.mct.services.component.ViewInfo.createView()


                    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


                housedView.setManifestedComponent(comp);               
               
                // Re-create view
                ViewInfo vi = housedView.getInfo();
                if (isHousing) {
                    View newView = vi.createView(comp);
                    housing.getContentArea().setOwnerComponentCanvasManifestation(newView);
                } else {
                    housedView.setManifestedComponent(comp);
                    view.setHousedViewManifestation(vi);
                }
View Full Code Here

        Set<ViewInfo> vrs = new HashSet<ViewInfo>();
        ViewInfo vi = Mockito.mock(ViewInfo.class);
        View v = new TestView(mockComponent, vi);
        Mockito.when(vi.getViewName()).thenReturn("testView");
        Mockito.when(vi.createView(Mockito.any(AbstractComponent.class))).thenReturn(v);
        vrs.add(vi);
        when(mockComponent.getViewInfos(ViewType.CENTER)).thenReturn(vrs);

        PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
        when(mockPersistenceProvider.getComponent(Mockito.anyString())).thenReturn(mockComponent);
View Full Code Here

        // Populate the tree
        for (AbstractComponent childComponent : root.getComponents()) {
            Set<ViewInfo> setViewInfos = childComponent.getViewInfos(ViewType.NODE);
            ViewInfo viewRole = setViewInfos.iterator().next();
            MCTMutableTreeNode childNode = new MCTMutableTreeNode(viewRole.createView(childComponent), tree);
            rootNode.add(childNode);
            if (!childComponent.getComponents().isEmpty()) {
                childNode.setProxy(true);
                MCTMutableTreeNode grandChildNode = new MCTMutableTreeNode(View.NULL_VIEW_MANIFESTATION);
                childNode.add(grandChildNode);
View Full Code Here

    for (int selectedIndex:selected) {
      AbstractComponent comp = children.get(selectedIndex);
      Set<ViewInfo> views = comp.getViewInfos(ViewType.NODE);
      // there should always be a node view for a component
      ViewInfo nodeView = views.iterator().next();
      selections.add(nodeView.createView(comp));
    }
   
    return selections;
  }
View Full Code Here

        @SuppressWarnings("serial")
        View     newView = new View(mockComponent, newViewInfo) {};
              
        Mockito.when(mockComponent.isStale()).thenReturn(stale);
        Mockito.when(mockComponent.isDirty()).thenReturn(dirty);
        Mockito.when(newViewInfo.createView(mockComponent)).thenReturn(newView);
        Mockito.when(newViewInfo.getType()).thenReturn("new");
        Mockito.when(mockWindowManager.showInputDialog(Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.<Map<String,Object>>any())).thenAnswer(new Answer<Object>() {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                Object[] options = (Object[]) invocation.getArguments()[2];
View Full Code Here

        AbstractComponent housedComponent = ((View) top.getUserObject()).getManifestedComponent();
        Set<ViewInfo> vrs = housedComponent.getViewInfos(ViewType.LAYOUT);
        ViewInfo viewRole = vrs.iterator().next();
       
        MCTStandardHousing housing = new MCTStandardHousing(dimension.width, dimension.height, housingCloseAction, viewRole.createView(housedComponent));
        if (relativeWindow == null) {
            Point location = getWindowDisplayLocation(dimension);
            housing.setLocation(location);
        } else
            housing.setLocationRelativeTo(relativeWindow);
View Full Code Here

   
    private static View getDirectoryArea(AbstractComponent component, MCTMutableTreeNode rootNode) {
        Set<ViewInfo> navigatorAreas = component.getViewInfos(ViewType.NAVIGATOR);
        //Set<ViewFactory> navigatorAreas = component.getViewRole(NavigatorViewRole.class);
        ViewInfo navigatorView = navigatorAreas.iterator().next();
        return navigatorView.createView(component);
        //return getMCTViewManifestation(navigatorViewRole);
    }
   
    private static View getInspectorArea(AbstractComponent component) {
        return component.getViewInfos(ViewType.RIGHT).iterator().next().createView(component);
View Full Code Here

       
        AbstractComponent housedComponent = ((View) top.getUserObject()).getManifestedComponent();
        Set<ViewInfo> vrs = housedComponent.getViewInfos(ViewType.LAYOUT);
        ViewInfo viewRole = vrs.iterator().next();
       
        MCTStandardHousing housing = new MCTStandardHousing(housingTitle + " - " + viewRole.getViewName(), dimension.width, dimension.height, housingCloseAction, viewRole.createView(housedComponent));

        if (relativeWindow == null) {
            Point location = getWindowDisplayLocation(dimension);
            housing.setLocation(location);
        } else {
View Full Code Here

            housing.setLocation(location);
        } else {
            
            if (housing.getGraphicsConfiguration() != relativeWindow.getGraphicsConfiguration()) {
                housing = new MCTStandardHousing(relativeWindow.getGraphicsConfiguration(),
                    housingTitle + " - " + viewRole.getViewName(), dimension.width, dimension.height, housingCloseAction, viewRole.createView(housedComponent));
            }
           
            housing.setLocationRelativeTo(relativeWindow);
        }
       
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.