speedscheduler
Class TransferConfigurationComposite

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by speedscheduler.TransferConfigurationComposite
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

 class TransferConfigurationComposite
extends org.eclipse.swt.widgets.Composite

Draws a UI for editing transfer rates: max upload speed, max download speed, and whether transfers should be paused.


Field Summary
private  int inputWidth
           
private  java.lang.String maxDownloadRateCaption
           
private  IntegerInput maxDownloadRateText
           
private  java.lang.String maxUploadRateCaption
           
private  IntegerInput maxUploadRateText
           
private  java.lang.String pauseDownloadsCaption
           
private  org.eclipse.swt.widgets.Button pauseDownloadsCheckbox
           
private  java.lang.String pauseSeedsCaption
           
private  org.eclipse.swt.widgets.Button pauseSeedsCheckbox
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
TransferConfigurationComposite(org.eclipse.swt.widgets.Composite parent)
          Used to draw the SpeedConfigurationChooser in the plugin view.
TransferConfigurationComposite(org.eclipse.swt.widgets.Composite parent, int maxUploadRate, int maxDownloadRate, boolean pauseDownloads, boolean pauseSeeds)
          Create a new composite and populate it with initial default values.
 
Method Summary
 boolean areDownloadsPaused()
          Gets whether the user has indicate that downloading torrents should be paused.
 boolean areSeedsPaused()
          Gets whether the user has indicate that seeding torrents should be paused.
 int getMaxDownloadRate()
          Gets the download rate entered by the user.
 int getMaxUploadRate()
          Gets the upload rate entered by the user.
private  void limitDownloadRateIfNeeded()
          Checks the upload rate and sees if it violates the <5 rule.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

maxUploadRateText

private IntegerInput maxUploadRateText

maxDownloadRateText

private IntegerInput maxDownloadRateText

pauseDownloadsCheckbox

private org.eclipse.swt.widgets.Button pauseDownloadsCheckbox

pauseSeedsCheckbox

private org.eclipse.swt.widgets.Button pauseSeedsCheckbox

maxUploadRateCaption

private java.lang.String maxUploadRateCaption

maxDownloadRateCaption

private java.lang.String maxDownloadRateCaption

pauseDownloadsCaption

private java.lang.String pauseDownloadsCaption

pauseSeedsCaption

private java.lang.String pauseSeedsCaption

inputWidth

private int inputWidth
Constructor Detail

TransferConfigurationComposite

public TransferConfigurationComposite(org.eclipse.swt.widgets.Composite parent)
Used to draw the SpeedConfigurationChooser in the plugin view.


TransferConfigurationComposite

public TransferConfigurationComposite(org.eclipse.swt.widgets.Composite parent,
                                      int maxUploadRate,
                                      int maxDownloadRate,
                                      boolean pauseDownloads,
                                      boolean pauseSeeds)
Create a new composite and populate it with initial default values.

Parameters:
parent -
maxUploadRate -
maxDownloadRate -
pauseDownloads -
Method Detail

limitDownloadRateIfNeeded

private void limitDownloadRateIfNeeded()
Checks the upload rate and sees if it violates the <5 rule. If so, limit the downloads to 2*upload.


getMaxUploadRate

public int getMaxUploadRate()
Gets the upload rate entered by the user.

Returns:
The upload rate

getMaxDownloadRate

public int getMaxDownloadRate()
Gets the download rate entered by the user.

Returns:
The download rate

areDownloadsPaused

public boolean areDownloadsPaused()
Gets whether the user has indicate that downloading torrents should be paused.

Returns:
True if downloads should be paused, false if not.

areSeedsPaused

public boolean areSeedsPaused()
Gets whether the user has indicate that seeding torrents should be paused.

Returns:
True if seeds should be paused, false if not.