Package model

Examples of model.Stream


    // Build a list of Stream objects out of the list of channel names
    streams = new ArrayList<Stream>(0);
   
    // Update all of the information for each stream
    for (int i = 0; i < channels.length; i++)
      streams.add(new Stream(channels[i]));
   
    // Create the main frame and panel
    panel = new JPanel();
    frmStreamtrackerV = new JFrame();
   
View Full Code Here


      public void mouseClicked(MouseEvent arg0) {
        String streamToAdd = JOptionPane.showInputDialog(frmStreamtrackerV, "Enter the name of the channel you'd like to track:");
       
        // Do not attempt to add invalid streams
        if (streamToAdd == null || streamToAdd == "") return;
        if (streams.contains(new Stream(streamToAdd))) return;
       
        // Get the correct location to add the stream
        int i;
        for(i = 0; i < streams.size() && streamToAdd.toLowerCase().compareTo(streams.get(i).getChannel().toLowerCase()) > 0; i++) { }
        if (i == streams.size()) streams.add(new Stream(streamToAdd));
        else streams.add(i, new Stream(streamToAdd));
       
        // Refresh the newly-added stream, update the table of information, then repaint the window
        streams.get(i).refresh();
        updateTable();
        frmStreamtrackerV.validate();
        frmStreamtrackerV.repaint();
       
      }
    });
   
    // Set the properties for the delete stream button
    btnDeleteStream = new JButton("Delete stream");
    btnDeleteStream.setFont(new Font("Tahoma", Font.PLAIN, 11));
    btnDeleteStream.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent arg0) {
        String streamToRemove = JOptionPane.showInputDialog(frmStreamtrackerV, "Enter the name of the channel you'd like to stop tracking:");
        Stream r = new Stream(streamToRemove);
       
        // Do not remove invalid streams
        if (streamToRemove == null || streamToRemove == "" || !streams.contains(r))
        {
          return;
View Full Code Here

TOP

Related Classes of model.Stream

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.