Package gov.nasa.arc.mct.gui

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


  });
    }
   
    @Override
    public View getHousedViewManifestation() {
        View housedManifestation = (View) this.rootNode.getUserObject();
        // add the parent client property to support the locking manifestation algorithms as they will look at
        // containment and the mutable tree node is not contained in any swing heirarchy
        housedManifestation.putClientProperty(MCTMutableTreeNode.PARENT_CLIENT_PROPERTY_NAME, directory);
        return housedManifestation;
    }
View Full Code Here


                // Only add nodes that are components - this should always be the
                // case, but we check just to make sure, so that we don't try to
                // drag dummy nodes such as MessageTreeNode.
                if (path.getLastPathComponent() instanceof MCTMutableTreeNode) {
                    MCTMutableTreeNode node = (MCTMutableTreeNode) path.getLastPathComponent();
                    View gui = (View) node.getUserObject();
                    dragComponents.add(gui.getManifestedComponent());
                }
            }
           
            PolicyContext context = new PolicyContext();
            context.setProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(),dragComponents);
View Full Code Here

                // Only add nodes that are components - this should always be the
                // case, but we check just to make sure, so that we don't try to
                // drag dummy nodes such as MessageTreeNode.
                if (path.getLastPathComponent() instanceof MCTMutableTreeNode) {
                    MCTMutableTreeNode node = (MCTMutableTreeNode) path.getLastPathComponent();
                    View gui = (View) node.getUserObject();
                    views.add(gui);
                }
            }

            // If we didn't find any applicable roles, just return null so that we
View Full Code Here

                // Update selection in the target window to be the set of dragged components.
                // This is consistent with the usability requirement of feeding back the results of user actions.               
                if (path != null) {
                    // The target tree is not empty, set selection     
                    MCTMutableTreeNode selectedNode = (MCTMutableTreeNode) path.getLastPathComponent();
                    View selectedNodeGUIComponent = (View) selectedNode.getUserObject();
                    selectedNodeGUIComponent.updateMonitoredGUI(new FocusEvent(directoryArea, handler.getDroppedComponents()));
                }               
            } else {
                // Action was not permitted
                final String message = handler.getMessage();
                if (message != null) {
View Full Code Here

            } catch (IOException e) {
                logger.error("Exception getting dropped data", e);
                return false;
            }

            View gui = (View) parent.getUserObject();
            boolean insertingIntoEmptyRoot = (parent==theModel.getRoot() && parent.isLeaf());
            List<View> components = new ArrayList<View>(sourceViews.length);
            for (View v:sourceViews) {
                components.add(v);
            }
View Full Code Here

        when(canvasManifestation2.getSelectionProvider()).thenReturn(mockProvider2);
        when(mockProvider2.getSelectedManifestations()).thenReturn(Collections.singleton(canvasManifestation));

        Set<ViewInfo> vrs = new HashSet<ViewInfo>();
        ViewInfo vi = Mockito.mock(ViewInfo.class);
        View v = new TestView(mockComponent, vi);
        Mockito.when(vi.getViewName()).thenReturn("testView");
        Mockito.when(vi.createView(Mockito.any(AbstractComponent.class))).thenReturn(v);
        vrs.add(vi);
        when(mockComponent.getViewInfos(ViewType.CENTER)).thenReturn(vrs);
View Full Code Here

        return targetHousing.getHousedViewManifestation();
    }
   
    @Override
    public Collection<View> getRootManifestations() {
        View housingManifestation = getWindowManifestation();
        if (housingManifestation == null) { return Collections.emptyList(); }
       
        Collection<View> viewManifestations = new ArrayList<View>();
       
        CompositeViewManifestationProvider compositeProvider = (CompositeViewManifestationProvider)SwingUtilities.getAncestorOfClass(CompositeViewManifestationProvider.class, housingManifestation);
View Full Code Here

            return true;
        }

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

                if (!commitOrAbortPendingChanges()) {
                    return; // Abandon event if user aborts.
                }
            }
           
            View currentCanvasViewManifestation = housing.getContentArea().getHousedViewManifestation();
            if (!viewInfo.equals(currentCanvasViewManifestation.getInfo())) {
                // get a component from the persistence provider to ensure the component always reflects the most recent updates
                // this also ensures that when changing a view any non saved changes will be lost
                AbstractComponent ac = PlatformAccess.getPlatform().getPersistenceProvider().getComponent(currentCanvasViewManifestation.getManifestedComponent().getComponentId());
                View v = viewInfo.createView(ac);
                housing.getContentArea().setOwnerComponentCanvasManifestation(v);
                housing.setTitle(v.getManifestedComponent().getDisplayName()
                        + " - " + viewInfo.getViewName() + PLUS);
                housing.getContentArea().getHousedViewManifestation().requestFocusInWindow();
            }
        }
View Full Code Here

        @Override
        public boolean isSelected() {
            putValue(Action.SELECTED_KEY, true);
            MCTStandardHousing housing = (MCTStandardHousing) context.getTargetHousing();
            View currentCanvasViewManifestation = housing.getContentArea().getHousedViewManifestation();
            return viewInfo.getType().equals(currentCanvasViewManifestation.getInfo().getType());
        }
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.