Package com.sun.swingset3.codeview

Examples of com.sun.swingset3.codeview.CodeViewer$SourceProcessor


    }

    private List<Demo> createDemoList(List<String> demoClassNamesList) {             
        List<Demo> demoList = new ArrayList<Demo>();
        for(String demoClassName: demoClassNamesList) {
             Demo demo = createDemo(demoClassName);
            if (demo != null) {
                demoList.add(demo);
            }
        }
        return demoList;
View Full Code Here


   
    /**
     */
    private Demo createDemo(String demoClassName) {       
        Class<?> demoClass = null;
        Demo demo = null;
        try {
            demoClass = Class.forName(demoClassName);
            demo = new Demo(demoClass);
        } catch (ClassNotFoundException cnfe) {
            LOG.log(Level.WARNING, "demo class not found:"+ demoClassName);
        }       
        return demo;
    }
View Full Code Here

     * @param demoContainer
     */
    private void requestFocusOnDemo() {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Demo demo = demoSelector.getSelectedDemo();
                if (demo != null) {
                    Component demoComponent = demo.getDemoComponent();
                    if (demoComponent != null) {
                        KeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent(demoComponent);
                    }
                }
            }
View Full Code Here

        });
    }
   
    private void updateFromSelectedDemoChanged() {
        JComponent demoContainer = getComponentByConstraint("demo");
        Demo demo = getDemo();
        if (demo != null) {
            JComponent demoPanel = runningDemoCache.get(demo.getName());
            if (demoPanel == null || demo.getDemoComponent() == null) {
                demo.startInitializing();
                demoPanel = createDemoPanel(demo);
                if (demoPanel != null) {
                    runningDemoCache.put(demo.getName(), demoPanel);
                }
            }
            if (demoPanel != null) {
                demoContainer.removeAll(); //(currentDemoPanel);
                demoContainer.add(demoPanel, BorderLayout.CENTER);
                demoContainer.revalidate();
                demoContainer.repaint();
                multiSplitLayout.layoutByWeight(getMainFrame().getContentPane());
            }
        }

        codeViewer.setSourceFiles(demo != null?
                                  demo.getSourceFiles() : null);
    }
View Full Code Here

    // we don't have control over the demo component's instantiation
    private class DemoPropertyChangeListener implements PropertyChangeListener {
        public void propertyChange(PropertyChangeEvent e) {
            String propertyName = e.getPropertyName();
            if (propertyName.equals("demoComponent")) {
                Demo demo = (Demo)e.getSource();
                JComponent demoComponent = (JComponent)e.getNewValue();
                if (demoComponent != null) {
                    demoComponent.putClientProperty("swingset3.demo", demo);
                    demoComponent.addHierarchyListener(new DemoVisibilityListener());
                    registerPopups(demoComponent);
View Full Code Here

   
    private class DemoVisibilityListener implements HierarchyListener {
        public void hierarchyChanged(HierarchyEvent event) {
            if ((event.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) > 0) {
                JComponent component = (JComponent)event.getComponent();
                final Demo demo = (Demo)component.getClientProperty("swingset3.demo");
                if (!component.isShowing()) {
                    demo.stop();
                } else {
                    getComponentByConstraint("demo").revalidate();
                    EventQueue.invokeLater(new Runnable() {
                        public void run() {
                            demo.start();
                        }
                    });
                }
            }           
        }       
View Full Code Here

        demoContainer.setLayout(new BorderLayout());
        demoContainer.setBorder(PANEL_BORDER);
        splitPane.add(demoContainer, "demo");

        // Create source code pane
        codeViewer = new CodeViewer();
//        Font font = codeViewer.getFont();
//        codeViewer.setFont(font.deriveFont(Font.BOLD, 20.f));
        JComponent codeContainer = new JPanel(new BorderLayout());
        codeContainer.add(codeViewer);
        codeContainer.setBorder(PANEL_BORDER);
View Full Code Here

        add(controlPanel, BorderLayout.NORTH);
        oscarTable = createXTable();
        oscarTable.setName("oscarTable");
       
        JScrollPane scrollpane = new JScrollPane(oscarTable);
        dataPanel = new Stacker(scrollpane);
        add(dataPanel, BorderLayout.CENTER);

        add(createStatusBar(), BorderLayout.SOUTH);
    }
View Full Code Here

        Color arrowColor = UIManager.getColor("Label.foreground");
        Color inactiveColor = UIManager.getColor("Label.disabledText");
        Dimension buttonSize = new Dimension(arrowSize + 12 ,
                arrowSize + 12);

        prevButton.setIcon(new ArrowIcon(orientation, arrowSize, arrowColor));
        prevButton.setDisabledIcon(new ArrowIcon(orientation, arrowSize, inactiveColor));
        prevButton.setPreferredSize(buttonSize);
        prevButton.setFocusable(false);
    }
View Full Code Here

            Color arrowColor = UIManager.getColor("Label.foreground");
            Color inactiveColor = UIManager.getColor("Label.disabledText");
            Dimension buttonSize = new Dimension(arrowSize + 12 + overlap,
                    arrowSize + 12);

            prevButton.setIcon(new ArrowIcon(ArrowIcon.WEST, arrowSize, arrowColor));
            prevButton.setDisabledIcon(new ArrowIcon(ArrowIcon.WEST, arrowSize, inactiveColor));
            prevButton.setPreferredSize(buttonSize);
            nextButton.setIcon(new ArrowIcon(ArrowIcon.EAST, arrowSize, arrowColor));
            nextButton.setDisabledIcon(new ArrowIcon(ArrowIcon.EAST, arrowSize, inactiveColor));
            nextButton.setPreferredSize(buttonSize);

            statusLabel.setOpaque(true);
            statusLabel.setFont(UIManager.getFont("Label.font").deriveFont(12f));
           
View Full Code Here

TOP

Related Classes of com.sun.swingset3.codeview.CodeViewer$SourceProcessor

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.