Package gov.nasa.arc.mct.gui

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


   
        // Setup selected nodes, including a parent       
        selectedTreePaths = new TreePath[selected.size()];
        AbstractComponent mockParent = mockComponent(false, true);
        MCTMutableTreeNode mockParentNode = Mockito.mock(MCTMutableTreeNode.class);
        View mockParentView = mockView(mockParent, ViewType.NODE);
        Mockito.when(mockParentNode.getUserObject()).thenReturn(mockParentView);

        int i = 0;
        for (AbstractComponent component : selected) {
            TreePath mockPath = Mockito.mock(TreePath.class);
            MCTMutableTreeNode mockTreeNode = Mockito.mock(MCTMutableTreeNode.class);
            Mockito.when(mockPath.getLastPathComponent()).thenReturn(mockTreeNode);
            View mockView = mockView(component, ViewType.NODE);           
            Mockito.when(mockTreeNode.getUserObject()).thenReturn(mockView);
            Mockito.when(mockTreeNode.getParent()).thenReturn(mockParentNode);
            selectedTreePaths[i++] = mockPath;
        }
       
View Full Code Here


                vt
                );
    }
   
    private View mockView(AbstractComponent ac, ViewType vt) {
        View view = Mockito.mock(View.class);
        ViewInfo viewInfo = Mockito.mock(ViewInfo.class);
        Mockito.when(viewInfo.getViewType()).thenReturn(vt);
        Mockito.when(view.getInfo()).thenReturn(viewInfo);
        Mockito.when(view.getManifestedComponent()).thenReturn(ac);
        return view;
    }
View Full Code Here

        if (index == 0) {
            KeyboardFocusManager.getCurrentKeyboardFocusManager().upFocusCycle(aContainer);
            return KeyboardFocusManager.getCurrentKeyboardFocusManager().getCurrentFocusCycleRoot();
        } else {
            Panel panel = orderedListPanels.get(index - 1);
            View wrappedManifestation = panel.getWrappedManifestation();
            if (wrappedManifestation.isFocusTraversalPolicyProvider()) {
                FocusTraversalPolicy focusTraversalPolicy = wrappedManifestation.getFocusTraversalPolicy();
                return focusTraversalPolicy.getLastComponent(wrappedManifestation);
            }
            visitedPanels.add(panel);
            return panel;
        }
View Full Code Here

    public Component getComponentAfter(Container aContainer, Component aComponent) {       
        if (!orderedListPanels.contains(aComponent))
            return getDefaultComponent(aContainer);

        if (aComponent instanceof Panel) {
            View wrappedManifestation = ((Panel) aComponent).getWrappedManifestation();
            if (wrappedManifestation.isFocusTraversalPolicyProvider()) {          
                FocusTraversalPolicy focusTraversalPolicy = wrappedManifestation.getFocusTraversalPolicy();
                if (focusTraversalPolicy instanceof PanelFocusTraversalPolicy) {
                    if (!((PanelFocusTraversalPolicy) focusTraversalPolicy).finishedTraversalCycle()) {
                        return focusTraversalPolicy.getDefaultComponent(aContainer);
                    }
                }
View Full Code Here

        addToOrderedList((Map<Integer, Panel>) evt.getNewValue());
    }
   
    private void restartFocusTraversalCycle() {
        for (Panel panel : orderedListPanels) {
            View wrappedManifestation = panel.getWrappedManifestation();
            if (wrappedManifestation.isFocusTraversalPolicyProvider()) {
                FocusTraversalPolicy focusTraversalPolicy = wrappedManifestation.getFocusTraversalPolicy();
                if (focusTraversalPolicy instanceof PanelFocusTraversalPolicy)
                    ((PanelFocusTraversalPolicy) focusTraversalPolicy).restartFocusTraversalCycle();
            }
        }
        visitedPanels.clear();
View Full Code Here

        AbstractComponent comp = wrappedManifestation.getManifestedComponent();
        MCTViewManifestationInfo info = CanvasManifestation.getManifestationInfo(wrappedManifestation);
       
        // Compare the list of owned view properties and determine if a new view needs to be created.
        if (viewChanged(wrappedManifestation.getInfo(), info, newInfo)) {
            View manifestation = CanvasViewStrategy.CANVAS_OWNED.createViewFromManifestInfo(view, comp, ((View) panelSelectionProvider).getManifestedComponent(), info);
            attachManifestationToPanel(manifestation)
            addStatusWidgetsIfApplicable();
            return manifestation;
        }
       
View Full Code Here

    }
   
    public View changeToView(ViewInfo view) {
        AbstractComponent comp = wrappedManifestation.getManifestedComponent();
        MCTViewManifestationInfo info = CanvasManifestation.getManifestationInfo(wrappedManifestation);
        View manifestation = CanvasViewStrategy.CANVAS_OWNED.createViewFromManifestInfo(view, comp, ((View) panelSelectionProvider).getManifestedComponent(), info);
        manifestation.setNamingContext(this);
        attachManifestationToPanel(manifestation);

        addStatusWidgetsIfApplicable();
        panelSelectionProvider.fireManifestationChanged();
        return manifestation;
View Full Code Here

                new HashMap<String, List<AbstractComponent>>();
        private boolean valid = true;
       
        public DragDropMove() {
            for (View v : draggedViews) {
                View parent = v.getParentView();
                if (parent != null) {
                    AbstractComponent parentComponent = parent.getManifestedComponent();
                    String id = parentComponent.getId();
                    if (!id.equals(dropView.getManifestedComponent().getComponentId())) {
                        parents.put(id, parentComponent);
                        if (!toRemove.containsKey(id)) {
                            toRemove.put(id, new ArrayList<AbstractComponent>());
View Full Code Here

        @Override
        public boolean canPerform() {
            // Disallow copy if source and destination are same
            for (View view : draggedViews) {
                View parent = view.getParentView();
                if (parent != null &&
                    parent.getManifestedComponent().getComponentId().equals(dropView.getManifestedComponent().getComponentId())) {
                    return false;
                }
            }
           
            // Disallow copy if component has external key or is not creatable
View Full Code Here

        });
       
        setupDirectoryTree(directory, false);
        this.add(new DirectoryTitleArea(bundle.getString("DIRECTORY"), null), BorderLayout.NORTH);
        rootNode.removeAllChildren();
        View topManifestation = (View)rootNode.getUserObject();
        if (topManifestation.getViewListener() != null) {
            TreeExpansionEvent event = new TreeExpansionEvent(rootNode.getParentTree(), null);
            topManifestation.getViewListener().actionPerformed(event);
        }
      
        // setup handlers (previously in Bookmark)
        AbstractComponent parentComponent = ((View) rootNode.getUserObject()).getManifestedComponent();
        View activeManifestation = parentComponent.getViewInfos(ViewType.NODE).iterator().next().createView(parentComponent);
        activeManifestation.setOpaque(false);
        activeManifestation.addMouseMotionListener(new WidgetDragger());
        activeManifestation.setTransferHandler(new WidgetTransferHandler());
        activeManifestation.addMouseListener(new MCTWindowOpener(parentComponent));
        activeManifestation.addMouseListener(new MCTPopupOpener(parentComponent, activeManifestation));
       
        // populate tabbed pane
        JComponent spUI = null;
        List<JComponent> UIs = new ArrayList<JComponent>();
        DirectoryTreePanel treePanel = new DirectoryTreePanel( );
View Full Code Here

TOP

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

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.