Exemplo n.º 1
0
  /** Creates new form QueueView */
  public QueueView(
      ScanService scanService,
      EventManager eventManager,
      QueueManager queueProcessor,
      Queue queue,
      Repo repo) {
    this.queue = queue;
    this.scanService = scanService;
    this.repo = repo;
    this.queueProcessor = queueProcessor;
    this.eventManager = eventManager;
    this.setTitle("Queue: " + repo.getDescription());
    initComponents();
    TableUtils.setTimeColumn(tblQueue, "Started");
    TableUtils.setTimeColumn(tblQueue, "Completed");
    //        TableRowSorter rowSorter = new TableRowSorter( tblQueue.getModel());
    //        tblQueue.setRowSorter( rowSorter );

    File scanDir = scanService.getCurrentScanDir();
    if (scanDir != null) {
      lblCurrentDirVal.setText(scanDir.getAbsolutePath());
    }

    eventManager.registerEventListener(this, ScanDirEvent.class);
    eventManager.registerEventListener(this, ScanEvent.class);
    eventManager.registerEventListener(this, QueueProcessEvent.class);

    ImageIcon imageIcon = new ImageIcon(getClass().getResource("/logo16x16.png"), "");
    setIconImage(imageIcon.getImage());

    showNextScan();

    initCurrent();
  }
Exemplo n.º 2
0
 private void initCurrent() {
   QueueItem item = repo.getCurrent();
   if (item != null) {
     setCurrent(item, null);
   }
 }