Package gov.nasa.arc.mct.components

Examples of gov.nasa.arc.mct.components.AbstractComponent


        return warning;
    }
   
    private boolean isRemovable(TreePath path) {
        MCTMutableTreeNode lastPathComponent = (MCTMutableTreeNode) path.getLastPathComponent();
        AbstractComponent selectedComponent = View.class.cast(lastPathComponent.getUserObject()).getManifestedComponent();

        MCTMutableTreeNode parentNode = (MCTMutableTreeNode) lastPathComponent.getParent();
        if (parentNode == null)
            return false;

        AbstractComponent parentComponent = ((View) parentNode.getUserObject()).getManifestedComponent();       
        if (!selectedComponent.canBeDeleted()) {
            return false;
        }
       
       
View Full Code Here


        boolean checkTargetHousing = false;
       
        MCTHousing targetHousing = actionContext.getTargetHousing();
        checkTargetHousing = (targetHousing == null) ? false : true;
       
        AbstractComponent targetComponent = actionContext.getTargetComponent();
        checkTargetComponent = (targetComponent == null) ? false : true;
       
        if (targetComponent.equals(targetHousing.getWindowComponent()))
            checkTargetComponent = false;
        
        return (checkTargetComponent && checkTargetHousing &&
                (DetectGraphicsDevices.getInstance().getNumberGraphicsDevices() > DetectGraphicsDevices.MINIMUM_MONITOR_CHECK));
    }
View Full Code Here

        @Override
        public void actionPerformed(ActionEvent e) {
            Collection<View> viewManifestations = actionContext.getSelectedManifestations();
           
            for (View viewManif : viewManifestations) {
                AbstractComponent component = viewManif.getManifestedComponent();
                GraphicsConfiguration graphicsConfig = DetectGraphicsDevices.getInstance().getSingleGraphicDeviceConfig(this.graphicsDeviceName);
                component.open(graphicsConfig);
            }

        }
View Full Code Here

   
       
        @Override
        public void actionPerformed(ActionEvent e) {
            GraphicsConfiguration graphicsConfig = DetectGraphicsDevices.getInstance().getSingleGraphicDeviceConfig(this.graphicsDeviceName);
            AbstractComponent windowComponent = actionContext.getWindowManifestation().getManifestedComponent();
            windowComponent.open(graphicsConfig);
        }
View Full Code Here

        ExternalComponentRegistryImpl extCompRegistry = ExternalComponentRegistryImpl.getInstance();
        Collection<ExtendedComponentTypeInfo> componentInfos = extCompRegistry.getComponentInfos();
        if (componentInfos.isEmpty())
            return false;

        AbstractComponent targetComponent = actionContext.getTargetComponent();
        PolicyContext policyContext = new PolicyContext();
        policyContext.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), targetComponent);
        policyContext.setProperty(PolicyContext.PropertyName.ACTION.getName(), 'w');
        String compositionKey = PolicyInfo.CategoryType.COMPOSITION_POLICY_CATEGORY.getKey();
        return PolicyManagerImpl.getInstance().execute(compositionKey, policyContext).getStatus();
View Full Code Here

    private Platform oldPlatform;
   
    @BeforeMethod
    void setup() {
        MockitoAnnotations.initMocks(this);
        component = new AbstractComponent() {
        };
        oldPlatform = PlatformAccess.getPlatform();
        new PlatformAccess().setPlatform(mockPlatform);
        Mockito.when(mockBootstrap.getComponentId()).thenReturn("boot");
        Mockito.when(mockPlatform.getBootstrapComponents()).thenReturn(Arrays.asList(mockBootstrap));
View Full Code Here

            JTree tree = (JTree) event.getSource();
            final DefaultTreeModel treeModel = (DefaultTreeModel) tree.getModel();

            final MCTMutableTreeNode selectedNode = node;

            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);
                        childNode.setProxy(true);
                    }
                    selectedNode.add(childNode);
                    childNodeView.addPropertyChangeListener(VIEW_STALE_PROPERTY, objectStaleListener);
                }
            }
            treeModel.reload(selectedNode);
           
            timer.stopInterval();
            PERF_LOGGER.debug("Time to expand node {}: {}", component.getId(), timer.getIntervalInMillis());
        }
View Full Code Here

        super(TEXT);
    }
   
    @Override
    public void actionPerformed(ActionEvent e) {
        AbstractComponent rootComponent = PlatformAccess.getPlatform().getRootComponent();       
        rootComponent.open();
    }
View Full Code Here

    @Override
    public void actionPerformed(ActionEvent e) {
        Set<String> deleteComponents = new HashSet<String>();
        for (TreePath path : selectedTreePaths) {
            MCTMutableTreeNode selectedNode = (MCTMutableTreeNode) path.getLastPathComponent();           
            AbstractComponent selectedComponent = ((View) selectedNode.getUserObject()).getManifestedComponent();
           
            // If has children, 
            if (selectedComponent.getComponents().size() > 0) {
                handleWarnings(false, deleteComponents);
                return;
            } else {
                deleteComponents.add(selectedComponent.getComponentId());
            }

        }
        handleWarnings(true,deleteComponents);
    }
View Full Code Here

        return warning;
    }
   
    private boolean isRemovable(TreePath path) {
        MCTMutableTreeNode lastPathComponent = (MCTMutableTreeNode) path.getLastPathComponent();
        AbstractComponent selectedComponent = View.class.cast(lastPathComponent.getUserObject()).getManifestedComponent();

        MCTMutableTreeNode parentNode = (MCTMutableTreeNode) lastPathComponent.getParent();
        if (parentNode == null)
            return false;

        AbstractComponent parentComponent = ((View) parentNode.getUserObject()).getManifestedComponent();       
        if (!selectedComponent.canBeDeleted()) {
            return false;
        }
       
       
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.AbstractComponent

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.