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

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


       
        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

       
        // Should give icons for any kind of type info (esp components and views)
        info = new ComponentTypeInfo("","",AbstractComponent.class);
        Assert.assertNotNull(provider.getAsset(info, Icon.class));       

        info = new ViewInfo(View.class,"",ViewType.OBJECT);
        Assert.assertNotNull(provider.getAsset(info, Icon.class));       
       
        info = new TypeInfo<TestDefaultViewProvider>(TestDefaultViewProvider.class){};
        Assert.assertNotNull(provider.getAsset(info, Icon.class));       
       
View Full Code Here

                AbstractComponent comp = housedView.getManifestedComponent();
                comp = PlatformAccess.getPlatform().getPersistenceProvider().getComponent(comp.getComponentId());
                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

 
  public DefaultViewProvider() {
      ResourceBundle bundle = ResourceBundle.getBundle("DefaultView");
     
      List<ViewInfo> viewInfos = new ArrayList<ViewInfo>();
      viewInfos.add(new ViewInfo(NodeViewManifestation.class, NodeViewManifestation.DEFAULT_NODE_VIEW_ROLE_NAME, ViewType.NODE));
        viewInfos.add(new ViewInfo(MCTHousingViewManifestation.class, MCTHousingViewManifestation.VIEW_ROLE_NAME, ViewType.LAYOUT));
        viewInfos.add(new ViewInfo(Inspector.class, Inspector.DEFAULT_INSPECTOR_VIEW_PROP_KEY, ViewType.INSPECTOR));
        viewInfos.add(new ViewInfo(MCTDirectoryArea.class, MCTDirectoryArea.VIEW_NAME, ViewType.NAVIGATOR));
        viewInfos.add(new ViewInfo(LabelViewManifestation.class, bundle.getString("LabelViewRoleName"), ViewType.TITLE));
        viewInfos.add(new ViewInfo(InspectionArea.class, InspectionArea.INSPECTION_AREA_VIEW_PROP_KEY, ViewType.RIGHT));
        viewInfos.add(new ViewInfo(SwitcherView.class, bundle.getString("SwitcherViewName"), ViewType.VIEW_SWITCHER));
        viewInfos.add(new ViewInfo(InfoView.class, bundle.getString("InfoViewName"), ViewType.OBJECT));

        myViewInfos = viewInfos;
  }
View Full Code Here

   
    private void resetSelection() {
        if (managedView != null) {
            View housedView = managedView.getHousedViewManifestation();
            if (housedView != null) {
                ViewInfo vi = housedView.getInfo();
                if (comboBox != null) {
                    comboBox.removeItemListener(itemListener); // Avoid triggering listener
                    comboBox.setSelectedItem(vi);
                    comboBox.addItemListener(itemListener);
                }
                if (label != null) {
                    label.setIcon(getIcon(vi));
                    label.setText(vi.getViewName());
                }
            }
        }
    }
View Full Code Here

       } catch (UnsupportedOperationException uoe) {
          
       }
  
       // create a new instance of Inspector View, this just verifies the view works, no exceptions
       BrokenInfoPanel panel = new BrokenInfoPanel(bc,new ViewInfo(BrokenInfoPanel.class,"",ViewType.INSPECTOR));
       Assert.assertNotNull(panel);
    }
View Full Code Here

                },
                new TelemetryDataTaxonomyComponent()
        };
       
        ViewInfo[] infos = new ViewInfo[] {
                new ViewInfo(FeedViewDerived.class,"view",ViewType.OBJECT),
                new ViewInfo(FeedViewDerived.class, "view", ViewType.EMBEDDED),
                new ViewInfo(NormalView.class, "view", ViewType.OBJECT)
        };
       
        Object[][] outer = new Object[components.length*infos.length][];
       
        for (int i=0; i < components.length; i++) {
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 (GraphicalManifestation.class.equals(viewInfo.getViewClass())) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
      result = hasFeed(targetComponent);
    } else if (StaticGraphicalView.class.equals(viewInfo.getViewClass())) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
      result = GraphicalComponent.class.isAssignableFrom(targetComponent.getClass());
    }

    return new ExecutionResult(context, result, null);
View Full Code Here

public class GraphicalStringPolicy implements Policy {
  private static final String EM_STRING = "Can't show graphical for string";

  @Override
  public ExecutionResult execute(PolicyContext context) {
    ViewInfo viewInfo = context.getProperty(
                PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), ViewInfo.class);

    // Check if this is a graphical view
    if (GraphicalManifestation.class.equals(viewInfo.getViewClass())) {
            // Get the feed provider component
            FeedProvider provider = context.getProperty(
                            PolicyContext.PropertyName.TARGET_COMPONENT.getName(),
                            FeedProvider.class);
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.