Package gov.nasa.arc.mct.defaults.view

Examples of gov.nasa.arc.mct.defaults.view.MCTHousingViewManifestation


        Mockito.when(noHousingContext.getWindowManifestation()).thenReturn(null);
        Assert.assertFalse(new RefreshAction().canHandle(noHousingContext));

        // With no content area, action can't be handled
        ActionContext noContentContext = Mockito.mock(ActionContext.class);
        MCTHousingViewManifestation noContentHousing = Mockito.mock(MCTHousingViewManifestation.class);
        Mockito.when(noContentContext.getWindowManifestation()).thenReturn(noContentHousing);
        Mockito.when(noContentHousing.getContentArea()).thenReturn(null);
        Assert.assertFalse(new RefreshAction().canHandle(noHousingContext));
    }
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

        public boolean isEnabled() {
            return true;
        }

        private boolean commitOrAbortPendingChanges() {
            MCTHousingViewManifestation housingView = (MCTHousingViewManifestation) context.getWindowManifestation();
            View view = housingView.getContentArea().getHousedViewManifestation();
            return new ViewModifiedDialog(view).commitOrAbortPendingChanges();               
        }
View Full Code Here

      componentA.getCapability(ComponentInitializer.class).initialize();
      componentB.setDisplayName(MY_MODEL_B);
      componentB.getCapability(ComponentInitializer.class).initialize();

      ViewInfo housingInfo = new ViewInfo(MCTHousingViewManifestation.class,"Housing",ViewType.LAYOUT);
    housingA = new MockHousing(new MCTHousingViewManifestation(componentA, housingInfo));
    housingB = new MockHousing(new MCTHousingViewManifestation(componentB, housingInfo));
    access.releasePlatform();
  }
View Full Code Here

        return null;
    }   
   
    public static void refreshHousing(MCTStandardHousing housing, View newHousingView) {
        // Retrieve the reference to the current housing view manifestation.
        MCTHousingViewManifestation oldHousingManifestation = (MCTHousingViewManifestation) housing.getHousedViewManifestation();
        MCTHousingViewManifestation targetHousingViewManifestation = (MCTHousingViewManifestation) newHousingView;
        targetHousingViewManifestation.setSize(housing.getWidth(), housing.getHeight());
          
        MCTControlArea controlArea = housing.getControlArea();
        controlArea.setParentHousing(housing);
        targetHousingViewManifestation.setControlArea(controlArea);
        targetHousingViewManifestation.setControlAreaVisible(oldHousingManifestation.isControlAreaVisible());
       
        AbstractComponent component = newHousingView.getManifestedComponent();
        if (!component.isLeaf()) {
            View directoryArea = component.getViewInfos(ViewType.NAVIGATOR).iterator().next().createView(component);
            targetHousingViewManifestation.setDirectoryArea(directoryArea);
        }
        if (component != PlatformAccess.getPlatform().getRootComponent()) {
            MCTContentArea contentArea = housing.getContentArea();
            contentArea.clearHousedManifestations();
            contentArea.setParentHousing(housing);
            contentArea.setOwnerComponentCanvasManifestation(component.getViewInfos(ViewType.CENTER).iterator().next().createView(component));
            targetHousingViewManifestation.setContentArea(contentArea);
        }
        if (!component.isLeaf()) {
            View inspectionArea = component.getViewInfos(ViewType.RIGHT).iterator().next().createView(component);
            targetHousingViewManifestation.setInspectionArea(inspectionArea);
        }
        if (!component.isLeaf()) {
            MCTStatusArea statusArea = housing.getStatusArea();
            targetHousingViewManifestation.setStatusArea(statusArea);
        }
        housing.setHousingViewManifesation(targetHousingViewManifestation);
        housing.setTitle(component.getDisplayName() + " - " + newHousingView.getInfo().getViewName());
        housing.buildGUI();
    }
View Full Code Here

        setSize(this.width, this.height);
        displayPanel.setSize(this.width, this.height);
        setTitle(title);
        setIcon(housingView.getManifestedComponent().getAsset(ImageIcon.class));
        setDefaultCloseOperation(closeAction);
        MCTHousingViewManifestation housingManifestation = (MCTHousingViewManifestation) housingView;
        setHousingViewManifesation(housingManifestation);
        addWindowListenerToHousing();
        getContentPane().add(displayPanel);
    }
View Full Code Here

        setSize(this.width, this.height);
        displayPanel.setSize(this.width, this.height);
        setTitle(title);
        setIcon(housingView.getManifestedComponent().getAsset(ImageIcon.class));
        setDefaultCloseOperation(closeAction);
        MCTHousingViewManifestation housingManifestation = (MCTHousingViewManifestation) housingView;
        setHousingViewManifesation(housingManifestation);
        addWindowListenerToHousing();
        getContentPane().add(displayPanel);
    }
View Full Code Here

    public SelectionProvider getSelectionProvider() {
        return selectionProvider;
    }

    public MCTHousingViewManifestation showHousedManifestationIfPresent(String manifestedType) {
        MCTHousingViewManifestation targetViewManifestation = this.housedManifestations.get(manifestedType);
        if (targetViewManifestation != null) {
            showHousedViewManifestation(manifestedType);
        }
        return targetViewManifestation;
    }
View Full Code Here

                    + " must not return null from getSelectionProvider");
        }
    }

    private void showHousedViewManifestation(String manifestedType) {
        MCTHousingViewManifestation displayedViewManifestation = housedManifestations.get(manifestedType);
        displayPanel.removeAll();
        this.housingViewManifestation = displayedViewManifestation;
        displayPanel.add(this.housingViewManifestation);
        displayPanel.revalidate();
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.defaults.view.MCTHousingViewManifestation

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.