Examples of MCTViewManifestationInfoImpl


Examples of gov.nasa.arc.mct.gui.MCTViewManifestationInfoImpl

       
        new PlatformAccess().setPlatform(mockPlatform);   

        robot = BasicRobot.robotWithCurrentAwtHierarchy();    

        manifestationInfo = new MCTViewManifestationInfoImpl();
        manifestationInfo.addInfoProperty(ControlAreaFormattingConstants.PANEL_ORDER,"0");
       
        Mockito.when(mockComponent.getViewInfos(ViewType.TITLE)).thenReturn(Collections.singleton(new ViewInfo(MockTitleManifestation.class,"", ViewType.TITLE)));
        Mockito.when(mockComponent.getDisplayName()).thenReturn("test comp");
        Mockito.when(mockComponent.getComponents()).thenReturn(
                        Collections.<AbstractComponent> emptyList());
       
        Mockito.when(mockPlatform.getPolicyManager())
            .thenReturn(mockPolicyManager);
        Mockito.when(mockPolicyManager.execute(Mockito.anyString(), Mockito.<PolicyContext> any()))
            .thenReturn(new ExecutionResult(null, false, null)); // Nothing is locked

       
        GuiActionRunner.execute(new GuiTask() {
            @SuppressWarnings("serial")
            @Override
            protected void executeInEDT() throws Throwable {
       
                frame = new JFrame(TITLE);
                frame.setName(TITLE);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                final ExtendedProperties viewProps = new ExtendedProperties();
                canvasManifestation = new TestCanvasManifestation(mockComponent, new ViewInfo(CanvasManifestation.class, "", ViewType.CENTER)) {
                    @Override
                    public ExtendedProperties getViewProperties() {
                        return viewProps;
                    }
                };                               
                canvasManifestation.setPreferredSize(new Dimension(PANEL_SIZE * 3, PANEL_SIZE * 3));

                frame.getContentPane().add(canvasManifestation);             
                frame.setLocation(PANEL_SIZE, PANEL_SIZE);
                frame.getContentPane().setSize(new Dimension(PANEL_SIZE * 3, PANEL_SIZE * 3));
                frame.setSize(new Dimension(PANEL_SIZE * 3, PANEL_SIZE * 3));
               
                panelManifestation = new MockManifestation(mockComponent, new ViewInfo(CanvasManifestation.class, "", ViewType.OBJECT));
                MCTViewManifestationInfoImpl info = new MCTViewManifestationInfoImpl();
                panelManifestation.putClientProperty(CanvasManifestation.MANIFEST_INFO, info);

                testPanel = canvasManifestation.createPanel(panelManifestation, 0,
                                canvasManifestation);
                Assert.assertNotNull(CanvasManifestation.getManifestationInfo(testPanel.getWrappedManifestation()));
View Full Code Here

Examples of gov.nasa.arc.mct.gui.MCTViewManifestationInfoImpl

         *    Mockito.when(child.getBounds()).thenReturn(new Rectangle(2,2,1,1));
         *    rootPanel.add(child);
         * But now we have the following:
         */
        View v = new View(){};
        v.putClientProperty(CanvasManifestation.MANIFEST_INFO, new MCTViewManifestationInfoImpl() );
       
        panelManifestation = new MockManifestation(mockComponent, new ViewInfo(CanvasManifestation.class, "", ViewType.OBJECT));
        MCTViewManifestationInfoImpl info = new MCTViewManifestationInfoImpl();
        panelManifestation.putClientProperty(CanvasManifestation.MANIFEST_INFO, info);
       
        Panel child = new Panel(panelManifestation,Mockito.mock(PanelFocusSelectionProvider.class) ) { 
            public Rectangle getBounds() {
                return new Rectangle(2,2,1,1);
View Full Code Here

Examples of gov.nasa.arc.mct.gui.MCTViewManifestationInfoImpl

                AbstractComponent viewComp = v.getManifestedComponent();
                ViewInfo newViewInfo = getViewInfoForCanvas(v, viewComp);
                AbstractComponent comp = viewComp;
               
                int nextPanelId = containerManifestation.panelId++;
                MCTViewManifestationInfo viewManifestationInfo = new MCTViewManifestationInfoImpl();
                viewManifestationInfo.setComponentId(comp.getComponentId());
                viewManifestationInfo.setStartPoint(dropPoint);
                viewManifestationInfo.setManifestedViewType(newViewInfo.getType());
                if (v.getInfo().equals(newViewInfo)) {
                    ExtendedProperties ep = v.getViewProperties().clone();
                    ep.addProperty(CanvasViewStrategy.OWNED_TYPE_PROPERTY_NAME, v.getInfo().getType());
                    viewManifestationInfo.getOwnedProperties().add(ep);
                }
                viewManifestationInfo.addInfoProperty(ControlAreaFormattingConstants.PANEL_ORDER, String.valueOf(nextPanelId));
                // use the viewComp here instead of the master component to retrieve the actual properties for the view
                View addManifestation = CanvasViewStrategy.CANVAS_OWNED.createViewFromManifestInfo(newViewInfo, comp, canvasManifestation.getManifestedComponent(), viewManifestationInfo);
               
                addManifestation.putClientProperty(CanvasManifestation.MANIFEST_INFO, viewManifestationInfo);
                Panel panel = containerManifestation.createPanel(addManifestation, nextPanelId, containerManifestation);
                viewManifestationInfo.setDimension(panel.getPreferredSize());

                addManifestation.setNamingContext(panel);
                assert addManifestation.getNamingContext() == panel;
               
                // Add new panel info to the canvas content property list
View Full Code Here

Examples of gov.nasa.arc.mct.gui.MCTViewManifestationInfoImpl

                return NumberCalls;
            }
           
        };//--end class
       
        MCTViewManifestationInfoImpl info = new MCTViewManifestationInfoImpl();
        view.putClientProperty(CanvasManifestation.MANIFEST_INFO, info);
       
        Mockito.when(mockComponent.getViewInfos(ViewType.TITLE)).thenReturn(Collections.singleton(new ViewInfo(MockTitleManifestation.class,"", ViewType.TITLE)));
        Mockito.when(mockComponent.getDisplayName()).thenReturn("test comp");
        Mockito.when(mockComponent.getComponents()).thenReturn(Collections.<AbstractComponent> emptyList());
View Full Code Here

Examples of gov.nasa.arc.mct.gui.MCTViewManifestationInfoImpl

    public void tearDown() {
        this.selectedPanels.clear();
    }

    private View addManifestInfo(View v) {
        v.putClientProperty(CanvasManifestation.MANIFEST_INFO, new MCTViewManifestationInfoImpl());
        return v;
    }
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.