Package gov.nasa.arc.mct.platform.spi

Examples of gov.nasa.arc.mct.platform.spi.Platform


       return BrokenComponent.class;
    }

    @Override
    public AbstractComponent createDropbox(String userId) {
        Platform platform = PlatformAccess.getPlatform();
        AbstractComponent dropbox = platform.getComponentRegistry().newInstance(TelemetryUserDropBoxComponent.class.getName());
        ComponentInitializer dropboxCapability = dropbox.getCapability(ComponentInitializer.class);
        dropboxCapability.setCreator(userId);
        dropboxCapability.setOwner("*");
        dropbox.setDisplayName(userId + resource.getString("user_drop_box"));
       
View Full Code Here


        return dropbox;
    }
   
    @Override
    public AbstractComponent createSandbox(String userId) {
        Platform platform = PlatformAccess.getPlatform();
        CoreComponentRegistry componentRegistry = platform.getComponentRegistry();
        AbstractComponent mySandbox = componentRegistry.newInstance(MineTaxonomyComponent.class.getName());
        ComponentInitializer mysandboxCapability = mySandbox.getCapability(ComponentInitializer.class);
        mysandboxCapability.setCreator(userId);
        mysandboxCapability.setOwner(userId);
        mySandbox.setDisplayName("My Sandbox");
View Full Code Here

        return mySandbox;
    }
   
    @Override
    public void createDefaultComponents() {
        Platform platform = PlatformAccess.getPlatform();
        CoreComponentRegistry componentRegistry = platform.getComponentRegistry();
       
        AbstractComponent dropBoxes = componentRegistry.newInstance(TelemetryDataTaxonomyComponent.class.getName());
        dropBoxes.setDisplayName("User Drop Boxes");
        dropBoxes.setExternalKey("/UserDropBoxes");
        ComponentInitializer dropBoxesCapability = dropBoxes.getCapability(ComponentInitializer.class);
        dropBoxesCapability.setCreator("admin");
        dropBoxesCapability.setOwner("admin");
       
        platform.getPersistenceProvider().persist(Collections.singleton(dropBoxes));
        platform.getPersistenceProvider().tagComponents("bootstrap:admin", Collections.singleton(dropBoxes));
    }
View Full Code Here

     */
    public Set<ViewInfo> getViewInfos(ViewType type) {
        Set<ViewInfo> possibleViewInfos =  PlatformAccess.getPlatform().getComponentRegistry().getViewInfos(getComponentTypeID(), type);
        Set<ViewInfo> filteredViewInfos = new LinkedHashSet<ViewInfo>();
       
        Platform platform = PlatformAccess.getPlatform();
        PolicyManager policyManager = platform.getPolicyManager();
        PolicyContext context = new PolicyContext();
        context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), this);
        context.setProperty(PolicyContext.PropertyName.VIEW_TYPE.getName(), type);
        for (ViewInfo viewInfo : possibleViewInfos) {
            context.setProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), viewInfo);
View Full Code Here

     * Determine by policy if this component can be deleted.
     *
     * @return true if this component can be deleted, false otherwise.
     */
    public final boolean canBeDeleted() {
        Platform platform = PlatformAccess.getPlatform();
        PolicyManager policyManager = platform.getPolicyManager();

        PolicyContext context = new PolicyContext();
        context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), this);
        context.setProperty(PolicyContext.PropertyName.ACTION.getName(), 'w');
        String compositionKey = PolicyInfo.CategoryType.CAN_DELETE_COMPONENT_POLICY_CATEGORY
View Full Code Here

                    Collection<AbstractComponent> childComponents) {

        if (isLeaf()) {
            throw new UnsupportedOperationException("components declared as leaf cannot be mutated");
        }
        Platform platform = PlatformAccess.getPlatform();
        PolicyManager policyManager = platform.getPolicyManager();
        PolicyContext context = new PolicyContext();
        context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), this);
        context.setProperty(PolicyContext.PropertyName.ACTION.getName(), 'w');
        context
                        .setProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(),
View Full Code Here

   
    /**
     * Open this component in a new top level window.
     */
    public final void open() {
        Platform platform = PlatformAccess.getPlatform();
        assert platform != null;
       
        if (DetectGraphicsDevices.getInstance().getNumberGraphicsDevices() > DetectGraphicsDevices.MINIMUM_MONITOR_CHECK) {
            Frame frame = null;
            for (Frame f: Frame.getFrames()) {
View Full Code Here

    /**
     * Detect multiple monitor displays and allow menu item to open this component in a new top level window.
     * @param graphicsConfig - Detect multiple display monitor devices
     */
    public final void open(GraphicsConfiguration graphicsConfig) {
        Platform platform = PlatformAccess.getPlatform();
        assert platform != null;
        WindowManager windowManager = platform.getWindowManager();
        if (platform.getRootComponent() == this)
            windowManager.openInNewWindow(this, graphicsConfig);
        else
            windowManager.openInNewWindow(PlatformAccess.getPlatform().getPersistenceProvider().getComponent(getComponentId()), graphicsConfig);
    }
View Full Code Here

     * Returns the component by the specified id.
     * @param id of the component to find
     * @return component with the given id or null if no component currently has the id.
     */
    public static AbstractComponent getComponentById(String id) {
        Platform platform = PlatformAccess.getPlatform();
        return platform.getPersistenceProvider().getComponent(id);   
    }
View Full Code Here

        setTargetComponent(housingA);
    testMenu.fireMenuSelected();
    Assert.assertEquals(testMenu.getMenuComponentCount(), 4);
   
    PlatformAccess access = new PlatformAccess();
    Platform mockPlatform = Mockito.mock(Platform.class);
    PersistenceProvider mockPersistenceProvider = Mockito.mock(PersistenceProvider.class);
    access.setPlatform(mockPlatform);
    Mockito.when(mockPlatform.getPersistenceProvider()).thenReturn(mockPersistenceProvider);

    JMenuItem menuItem = (JMenuItem) testMenu.getMenuComponent(3);
    JCheckBoxMenuItem checkBoxMenuItem = (JCheckBoxMenuItem) menuItem;
    Action action = menuItem.getAction();
    Assert.assertNotNull(action);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.platform.spi.Platform

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.