Package com.aelitis.azureus.ui.common.table

Examples of com.aelitis.azureus.ui.common.table.TableRowCore


          // If we reach here, then it means we are doing a real move, but there is
          // no existing file.
        }

        final File ff_target = f_target;
        final TableRowCore row = tv == null ? null : tv.getRow(datasources[i]);
        Utils.getOffOfSWTThread(new AERunnable() {
          public void runSupport() {
            moveFile(manager, fileInfo, ff_target);
            if (row != null) {
              row.invalidate();
            }
          }
        });
      }
    } finally {
View Full Code Here


  public void cellAdded(final TableCell cell) {
    Utils.execSWTThread(new AERunnable() {
      public void runSupport() {
        TableColumnCore column = (TableColumnCore) cell.getDataSource();
        TableViewColumnSetup tv = (TableViewColumnSetup) ((TableCellCore) cell).getTableRowCore().getView();
        TableRowCore sampleRow = (TableRowCore) tv.getSampleRow();

        cell.addListeners(new Cell(cell, column, tv, sampleRow));
      }
    });
  }
View Full Code Here

      stat.count++;
      stat.current++;
      if (needNew) {
        tv.addDataSource(stat);
      } else {
        TableRowCore row = tv.getRow(stat);
        if (row != null) {
          row.invalidate();
        }
      }
    }
  }
View Full Code Here

        stat.current--;
        stat.bytesReceived += peer.getStats().getTotalDataBytesReceived();
        stat.bytesSent += peer.getStats().getTotalDataBytesSent();
        stat.bytesDiscarded += peer.getStats().getTotalBytesDiscarded();

        TableRowCore row = tv.getRow(stat);
        if (row != null) {
          row.invalidate();
        }
      }
    }
  }
View Full Code Here

    Object ds = cell.getDataSource();
    if (ds instanceof DiskManagerFileInfo) {
      DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) ds;
      if (fileInfo.isSkipped()
          && (fileInfo.getStorageType() == DiskManagerFileInfo.ST_COMPACT || fileInfo.getStorageType() == DiskManagerFileInfo.ST_REORDER_COMPACT)) {
        TableRowCore row = (TableRowCore) cell.getTableRow();
        if (row != null) {
          row.getParentRowCore().removeSubRow(ds);
        }
      }
      return;
    }
    DownloadManager dm = (DownloadManager) ds;
View Full Code Here

    Rectangle cellBounds = cell.getBounds();

    int textX = cellBounds.x;

    TableRowCore rowCore = cell.getTableRowCore();
    if (rowCore != null) {
      int numSubItems = rowCore.getSubItemCount();
      int paddingX = 3;
      int width = 7;
     
      boolean  show_twisty;
     
      if ( NEVER_SHOW_TWISTY ){
       
        show_twisty = false;
       
      }else if (numSubItems > 1 ){
       
        show_twisty = true;
      }else{
       
        Boolean show = (Boolean)rowCore.getData( ID_EXPANDOHITAREASHOW );
       
        if ( show == null ){
         
          DownloadManager dm = (DownloadManager)ds;
         
          show_twisty = dm.getNumFileInfos() > 1;
         
          rowCore.setData( ID_EXPANDOHITAREASHOW, new Boolean( show_twisty ));
         
        }else{
          show_twisty = show;
        }
      }
     
      if (show_twisty) {
        int middleY = cellBounds.y + (cellBounds.height / 2) - 1;
        int startX = cellBounds.x + paddingX;
        int halfHeight = 2;
        Color bg = gc.getBackground();
        gc.setBackground(gc.getForeground());
        gc.setAntialias(SWT.ON);
        gc.setAdvanced(true);
        if (rowCore.isExpanded()) {
          gc.fillPolygon(new int[] {
            startX,
            middleY - halfHeight,
            startX + width,
            middleY - halfHeight,
            startX + (width / 2),
            middleY + (halfHeight * 2) + 1
          });
        } else {
          gc.fillPolygon(new int[] {
            startX,
            middleY - halfHeight,
            startX + width,
            middleY + halfHeight,
            startX,
            middleY + (halfHeight * 2) + 1
          });
        }
        gc.setBackground(bg);
        Rectangle hitArea = new Rectangle(paddingX, middleY - halfHeight
            - cellBounds.y, width, (halfHeight * 4) + 1);
        rowCore.setData(ID_EXPANDOHITAREA, hitArea);

        cellBounds.x += paddingX * 2 + width;
        cellBounds.width -= paddingX * 2 + width;
      }
    }
View Full Code Here

        if (event.eventType == TableCellMouseEvent.EVENT_MOUSEMOVE) {
          ((TableCellCore) event.cell).setCursorID(inExpando ? SWT.CURSOR_HAND
              : SWT.CURSOR_ARROW);
        } else if (inExpando) { // mousedown
          if (row instanceof TableRowCore) {
            TableRowCore rowCore = (TableRowCore) row;
            rowCore.setExpanded(!rowCore.isExpanded());
          }
        }
      }
    }
  }
View Full Code Here

    }
    if (!(cell instanceof TableCellCore)) {
      return false;
    }
    DownloadManager dm = (DownloadManager) ds;
    TableRowCore rowCore = ((TableCellCore) cell).getTableRowCore();
    if (rowCore == null) {
      return false;
    }

    if (dm.getAssumedComplete()
        || (dm.getNumFileInfos() > 1 && rowCore.isExpanded())) {
      return true;
    }
    return false;
  }
View Full Code Here

    TableContextMenuItem menuReset = addContextMenuItem("TableColumn.menu.date_added.reset");
    menuReset.addListener(new MenuItemListener() {
      public void selected(MenuItem menu, Object target) {
        if (target instanceof TableRowCore) {
          TableRowCore row = (TableRowCore) target;
          Object dataSource = row.getDataSource(true);
          if (dataSource instanceof DownloadManager) {
            DownloadManager dm = (DownloadManager) dataSource;

            DownloadManagerState state = dm.getDownloadState();

            try {
              long add_time = new File(dm.getTorrentFileName()).lastModified();

              if (add_time >= 0) {
                state.setLongParameter(
                    DownloadManagerState.PARAM_DOWNLOAD_ADDED_TIME, add_time);
              }

            } catch (Throwable e) {
            }
          }
          row.getTableCell("date_added").invalidate();
        }
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.ui.common.table.TableRowCore

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.