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

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


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

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


    }

    @Override
    public Collection<ViewInfo> getViews(String componentTypeId) {
        if (BrokenComponent.class.getName().equals(componentTypeId)) {
            return Collections.singleton(new ViewInfo(BrokenInfoPanel.class, resource.getString("BrokenInspectorViewName"),ViewType.OBJECT)); //NOI18N
        } else if (TelemetryUserDropBoxComponent.class.getName().equals(componentTypeId)) {
            return Arrays.asList(
                    new ViewInfo(DropboxCanvasView.class, resource.getString("DropBoxViewName"),ViewType.OBJECT),
                    new ViewInfo(DropboxCanvasView.class, resource.getString("DropBoxViewName"),ViewType.CENTER));
        } else if (TelemetryDisciplineComponent.class.getName().equals(componentTypeId)) {
            return Collections.singleton(new ViewInfo(UsersManifestation.class, "Users", ViewType.OBJECT));
        }
       
        return Collections.emptyList();
    }   
View Full Code Here

 
  @Test
  public void testViews() {
    Collection<ViewInfo> views = evaluatorProvider.getViews(EvaluatorComponent.class.getName());
    Assert.assertEquals(views.size(), 3);
    Assert.assertTrue(views.contains(new ViewInfo(ExpressionsViewManifestation.class,"", ViewType.OBJECT)));
    Assert.assertTrue(views.contains(new ViewInfo(ExpressionsViewManifestation.class,"", ExpressionsViewManifestation.class.getName(), ViewType.CENTER, true, EvaluatorComponent.class)));

    // Should return only one view (info) when component is unknown
    Assert.assertEquals(evaluatorProvider.getViews("unknowncomponent").size(), 1);

    Iterator<ViewInfo> it = evaluatorProvider.getViews(EvaluatorComponent.class.getName()).iterator();
    Assert.assertEquals(it.next(), new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, ViewType.OBJECT));
    Assert.assertEquals(it.next(), new ViewInfo(ExpressionsViewManifestation.class, ExpressionsViewManifestation.VIEW_NAME, ViewType.OBJECT));

    views = multiProvider.getViews(MultiComponent.class.getName());
    Assert.assertEquals(views.size(), 3);
    Assert.assertTrue(views.contains(new ViewInfo(MultiViewManifestation.class, MultiViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), ViewType.CENTER, true, MultiComponent.class)))

    it = multiProvider.getViews(MultiComponent.class.getName()).iterator();
    Assert.assertEquals(it.next(), new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), ViewType.OBJECT, false, MultiComponent.class));
    Assert.assertEquals(it.next(), new ViewInfo(MultiViewManifestation.class, MultiViewManifestation.VIEW_NAME, ViewType.OBJECT));
    Assert.assertEquals(it.next(), new ViewInfo(MultiViewManifestation.class, MultiViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), ViewType.CENTER, true, MultiComponent.class));
  }
View Full Code Here

  @DataProvider
  public Object[][] assetTestCases() {
    List<Object[]> cases = new ArrayList<Object[]>();
    // Consider all view types
    for (ViewType type : ViewType.values()) {
      ViewInfo info = new ViewInfo(InfoViewManifestation.class, InfoViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), type);
      ViewInfo expr = new ViewInfo(ExpressionsViewManifestation.class, ExpressionsViewManifestation.VIEW_NAME, InfoViewManifestation.class.getName(), type);
      TypeInfo<?> eval = new ComponentTypeInfo("","",EvaluatorComponent.class);
      TypeInfo<?> mult = new ComponentTypeInfo("","",MultiComponent.class);
      for (TypeInfo<?> vi : new TypeInfo<?>[]{info,expr,eval,mult}) {
        // Expressions view should have an image icon
        cases.add(new Object[] { new EvaluatorComponentProvider(), vi, ImageIcon.class, vi.getTypeClass().equals(ExpressionsViewManifestation.class)});
View Full Code Here

 
  @SuppressWarnings("unchecked")
  @Test
  public void testInfoView() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {

    InfoViewManifestation manifestation = new InfoViewManifestation(parentComponent, new ViewInfo(InfoViewManifestation.class,"info", ViewType.OBJECT));
       
    for (AncestorListener listener : manifestation.getAncestorListeners()) {
      listener.ancestorRemoved(null);
      manifestation.removeAncestorListener(listener);
    }
View Full Code Here

 
  @Override
  public ExecutionResult execute(PolicyContext context) {
    boolean result = true;
   
    ViewInfo viewInfo = context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), ViewInfo.class);
    if (InfoViewManifestation.class.equals(viewInfo.getViewClass())) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
     
      result = hasFeedProvider(targetComponent);
    }
   
View Full Code Here

 
  @Override
  public ExecutionResult execute(PolicyContext context) {
    boolean result = true;
   
    ViewInfo viewInfo = context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), ViewInfo.class);
    if (viewInfo.getViewClass().equals(ExpressionsViewManifestation.class)) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
     
      result = isEnumerator(targetComponent);
    }
   
View Full Code Here

  @Override
  public ExecutionResult execute(PolicyContext context) {
    ExecutionResult trueResult = new ExecutionResult(context, true, "");

    AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
    ViewInfo viewInfo = context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), ViewInfo.class);
    if (!viewInfo.getViewClass().equals(CanvasManifestation.class)) {
        return trueResult;
    }
   
    if (!targetComponent.isLeaf())
      return trueResult;
View Full Code Here

            }  
        }

        UtilComponent component = new UtilComponent(IdGenerator.nextComponentId());

        MCTHousingViewManifestation housingView = new MCTHousingViewManifestation(component, new ViewInfo(MCTHousingViewManifestation.class,"", ViewType.LAYOUT));
        MCTStandardHousing housing = new MCTStandardHousing(100,100,WindowConstants.EXIT_ON_CLOSE, housingView);

        UserEnvironmentRegistry.registerHousing(housing);
        housing.dispatchEvent(new WindowEvent(housing, WindowEvent.WINDOW_GAINED_FOCUS));
        return housing;
View Full Code Here

        menuBar.add(mockMenu);
        MockComponent componentA = new MockComponent();
        componentA.setId("a");
       
        access.setPlatform(mockPlatform);
        MCTAbstractHousing housing = new MockHousing(new MCTHousingViewManifestation(componentA, new ViewInfo(MCTHousingViewManifestation.class,"", ViewType.LAYOUT)));
        access.releasePlatform();
       
        housing.setJMenuBar(menuBar);
        UserEnvironmentRegistry.registerHousing(housing);
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.services.component.ViewInfo

Copyright © 2018 www.massapicom. 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.