Package org.openquark.samples.bam.model

Examples of org.openquark.samples.bam.model.MonitorDocument


        app.startMonitor ();
    }

    private MonitorApp () {
        document = new MonitorDocument ();
    }
View Full Code Here


        if (appState != IDLE) {
            throw new IllegalStateException (
                    "Attempt to set the document while the app is running");
        }

        MonitorDocument oldDocument = document;

        document = newDocument;

        propertyChangeSupport.firePropertyChange (DOCUMENT_PROPERTY_NAME, oldDocument, newDocument);
    }
View Full Code Here

    
     */
    private void refresh () {
        DefaultListModel newModel = new DefaultListModel ();

        MonitorDocument document = app.getDocument ();

        for (int jobN = 0; jobN < document.getJobDescriptionCount (); ++jobN) {
            MonitorJobDescription jobDescription = document.getNthJobDescription (jobN);

            newModel.addElement (new MessageListItem (jobDescription));
        }

        getMessageList ().setModel (newModel);
View Full Code Here

                    JOptionPane.WARNING_MESSAGE);

            return;
        }

        app.setDocument (new MonitorDocument ());
    }
View Full Code Here

        fileChooser.addChoosableFileFilter (new ExtensionFileFilter ("bam", "Monitor document"));

        if (fileChooser.showOpenDialog (this) == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile ();

            MonitorDocument document = MonitorDocument.Load (file);

            if (document != null) {
                app.setDocument (document);
            }
        }
View Full Code Here

     * Method onFileSave
     *
     * 
     */
    protected void onFileSave () {
        MonitorDocument document = app.getDocument ();

        String pathname = document.getPathname ();

        if (pathname == null || pathname.length () == 0) {
            onFileSaveAs ();
        } else {
            File file = new File (pathname);

            document.save (file);
        }
    }
View Full Code Here

     * Method onFileSaveAs
     *
     * 
     */
    protected void onFileSaveAs () {
        MonitorDocument document = app.getDocument ();

        String pathname = document.getPathname ();

        JFileChooser fileChooser = new JFileChooser (pathname);

        fileChooser.addChoosableFileFilter (new ExtensionFileFilter ("bam", "Monitor document"));

        if (fileChooser.showSaveDialog (this) == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile ();

            document.save (file);
        }
    }
View Full Code Here

     * Method makeTestDocument
     *
     * 
     */
    protected void makeTestDocument () {
        MonitorDocument newDocument = new MonitorDocument ();

        newDocument.addJobDescription (MonitorJobDescription.makeTestInstance ());
        newDocument.addJobDescription (MonitorJobDescription.makeAnotherTestInstance ());

        app.setDocument (newDocument);
    }
View Full Code Here

TOP

Related Classes of org.openquark.samples.bam.model.MonitorDocument

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.