Package gov.nasa.arc.mct.gui

Examples of gov.nasa.arc.mct.gui.View$ControlWrapper


    }
   
    @SuppressWarnings({ "unchecked", "rawtypes" })
    @DataProvider(name="viewInfoData")
    public Object[][] viewInfoData() {
        View v1 = Mockito.mock(View.class);
        View v2 = Mockito.mock(TestingView3.class);
        ViewInfo vi = new ViewInfo(v1.getClass(),"v1", ViewType.CENTER);
        //ViewInfo vi2 = new ViewInfo(v2.getClass(), "v2", ViewType.INSPECTION);
        ViewInfo vi3 = new ViewInfo(v2.getClass(), "v2", ViewType.CENTER);
       
        return new Object[][] {
                        new Object[] {
                           new LinkedHashSet(Arrays.asList(vi,vi3)), Collections.emptySet(), ViewType.CENTER, new LinkedHashSet(Arrays.asList(vi,vi3))           
                        },
View Full Code Here


    public void closeWindows(String componentId) {
        Window[] windows = getActiveWindows();
        for (Window window : windows) {
            if (MCTAbstractHousing.class.isAssignableFrom(window.getClass())) {
                MCTAbstractHousing housing = MCTAbstractHousing.class.cast(window);
                View housedManifestation = housing.getHousedViewManifestation();
                if (housedManifestation != null && componentId.equals(housedManifestation.getManifestedComponent().getId())) {
                    UserEnvironmentRegistry.removeHousing(housing);
                    housing.dispose();
                }
            }
        }
View Full Code Here

               
                // Don't show the popup if the canvas is in the inspector.
                // This is because the actions don't use the right canvas.
                // This causes bug MCT-2250.
                // This should be re-enabled once the actions use the correct canvas.
                View m = augmentation.canvasManifestation;
                while (m != null && m.getInfo() != null) {
                    if (m.getInfo().getViewType() == ViewType.INSPECTOR || m.getInfo().getViewType() == ViewType.CENTER_OWNED_INSPECTOR) {
                        return;
                    }
                    m = (View) SwingUtilities.getAncestorOfClass(View.class, m);
                }
View Full Code Here

    }
   
    @SuppressWarnings("serial")
    @Test
    public void test() {
        View manif = new CanvasManifestation(mockParentComponent, new ViewInfo(CanvasManifestation.class,"",ViewType.OBJECT)) {
            @Override
            public ExtendedProperties getViewProperties() {
                return extProps;
            }
        };
        Mockito.when(mockParentComponent.getComponents()).thenReturn(
                        Collections.<AbstractComponent> emptyList());
        RemoveChildEvent event = new RemoveChildEvent(new JPanel(), mockChildComponent);
        manif.updateMonitoredGUI(event);
        Set<Object> canvasContents = manif.getViewProperties().getProperty("CANVAS CONTENT PROPERTY");
        Assert.assertFalse(canvasContents.iterator().hasNext());
       
    }
View Full Code Here

                // child components are loaded from the database.
                (new SwingWorker<Object,Object>() {
                   
                    @Override
                    protected Object doInBackground() throws Exception {
                        View gui = (View) selectedNode.getUserObject();
                        AbstractComponent component = gui.getManifestedComponent();                       
                        return component.getComponents();
                    }
                   
                    @Override
                    protected void done() {
                        // this runs in the AWT Thread
                        t.stop();
                        // this is true if the node has been collapsed
                        if (selectedNode.isProxy()) {
                            return;
                        }
                        // Let the node know it needs to refresh itself
                        View gui = (View) selectedNode.getUserObject();
                        gui.updateMonitoredGUI();
                    }
                }).execute();
            }
        }
View Full Code Here

                Panel panel = renderedPanels.get(Integer.valueOf(panelOrder));
               
                if (panel != null) {
                   
                    if (panel.containsPoint(p)) {
                        View wrappedManifestation = panel.getWrappedManifestation();
                        if (wrappedManifestation instanceof CanvasManifestation) {
                            CanvasManifestation innerCanvasManifestation = (CanvasManifestation) wrappedManifestation;
                            Panel innerPanel = innerCanvasManifestation.findImmediatePanel(p);
                            if (innerPanel != null)
                                return innerPanel;
View Full Code Here

       
        return CanvasViewStrategy.CANVAS_OWNED.createViewFromManifestInfo(matchedVi, comp, getManifestedComponent(), canvasContent);
    }
   
    private View getManifestation(AbstractComponent comp, String viewType, MCTViewManifestationInfo canvasContent) {
        View viewManifestation = getManifestationFromViewInfo(comp, viewType, canvasContent);
        if (viewManifestation == null) {
            LOGGER.error("Cannot find view type {}.", viewType);
            return null;
        }
       
        viewManifestation.putClientProperty(CanvasManifestation.MANIFEST_INFO, canvasContent);
        viewManifestation.setNamingContext(canvasContent);
        assert viewManifestation.getNamingContext() == canvasContent;
        return viewManifestation;
    }
View Full Code Here

        } else {
            String viewType = canvasContent.getManifestedViewType();
            ComponentRegistry cr = ComponentRegistryAccess.getComponentRegistry();
            AbstractComponent comp = cr.getComponent(componentId);

            View viewManifestation = getManifestation(comp, viewType, canvasContent);
            if (viewManifestation == null) { return; }
           
            Panel panel = createPanel(viewManifestation, index, this);
            viewManifestation.setNamingContext(panel);
            Dimension dimension = canvasContent.getDimension();
            Point location = canvasContent.getStartPoint();
            Rectangle bound = new Rectangle(location, dimension);

            panel.setBounds(bound);
View Full Code Here

                return new JLabel(value.toString());
            }
           
            MCTMutableTreeNode node = (MCTMutableTreeNode) value;
            WeakReference<View> viewRef = renderedComponent.get(node);
            View view = viewRef == null ? null : viewRef.get();
            if (view == null) {
                view = (View) node.getUserObject();
                view.addMonitoredGUI(node);
                renderedComponent.put(node, new WeakReference<View>(view));
            }

            // We highlight the tree node if either it's selected or it's
            // the target of a drag-and-drop.
            JTree.DropLocation dropLocation = tree.getDropLocation();
            if (sel
                || (dropLocation != null
                    && dropLocation.getChildIndex() == -1
                    && tree.getRowForPath(dropLocation.getPath()) == row)) {
                view.setBackground(LafColor.TREE_SELECTION_BACKGROUND);
            } else {
                view.setBackground(LafColor.WINDOW);
            }

            return view;
        }
View Full Code Here

    @Override
    public void fireSelectionCloned(Collection<Panel> panels) {
        for (Panel panel : panels) {
            int nextPanelId = panelId++;
            panel.setId(nextPanelId);
            View manifestation = panel.getWrappedManifestation();        
            MCTViewManifestationInfo viewManifestationInfo = CanvasManifestation.getManifestationInfo(manifestation);
            getViewProperties().addProperty(CANVAS_CONTENT_PROPERTY, viewManifestationInfo);           
            viewManifestationInfo.addInfoProperty(ControlAreaFormattingConstants.PANEL_ORDER, Integer.toString(nextPanelId));
            canvasPanel.add(panel, new Rectangle(viewManifestationInfo.getStartPoint(), viewManifestationInfo.getDimension()));
            renderedPanels.put(nextPanelId, panel);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.gui.View$ControlWrapper

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.