|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.ui.swt.views.AbstractIView org.gudy.azureus2.plugins.PluginView speedscheduler.SpeedSchedulerView
public class SpeedSchedulerView
This is the main graphical portion of the SpeedScheduler, itself an Azureus view. Access this by clicking View -- Plugins -- Speed Scheduler.
Field Summary | |
---|---|
private java.util.Vector |
activeSchedules
|
private java.util.Vector |
allWidgets
|
private static org.eclipse.swt.graphics.Color |
blue
|
private static int |
BUTTON_PADDING
|
private org.eclipse.swt.graphics.Image |
checkImage
|
private org.eclipse.swt.widgets.Menu |
contextMenu
|
private org.eclipse.swt.graphics.Image |
defaultImage
|
private int |
defaultMaxDownloadRate
|
private IntegerInput |
defaultMaxDownloadRateInput
|
private int |
defaultMaxUploadRate
|
private IntegerInput |
defaultMaxUploadRateInput
|
(package private) org.eclipse.swt.widgets.Composite |
defaultSpeedsImageComposite
|
private org.eclipse.swt.widgets.MenuItem |
deleteItem
|
private org.eclipse.swt.widgets.Button |
deleteScheduleButton
|
private org.eclipse.swt.widgets.Display |
display
|
private org.eclipse.swt.widgets.MenuItem |
editItem
|
private org.eclipse.swt.widgets.Button |
editScheduleButton
|
private org.eclipse.swt.widgets.MenuItem |
enableItem
|
private org.eclipse.swt.widgets.Button |
enableScheduleButton
|
private static org.eclipse.swt.graphics.Color |
gray
|
private static org.eclipse.swt.graphics.Cursor |
handCursor
|
private static java.lang.String |
HELP_URL
|
private org.eclipse.swt.widgets.Composite |
mainComposite
|
private static int |
MARGIN_HEIGHT
|
private static int |
MARGIN_WIDTH
|
private org.eclipse.swt.widgets.MenuItem |
newItem
|
private org.eclipse.swt.widgets.Button |
newScheduleButton
|
private SchedulePersistencyManager |
schedulePersistencyManager
|
private java.util.Vector |
schedules
To contain all the configured schedules. |
private org.eclipse.swt.widgets.Table |
scheduleTable
|
private org.eclipse.swt.widgets.Shell |
shell
|
private boolean |
viewIsDisposed
|
private org.eclipse.swt.graphics.Image |
watchImage
|
private org.eclipse.swt.graphics.Image |
watchImageDisabled
|
Fields inherited from class org.gudy.azureus2.ui.swt.views.AbstractIView |
---|
this_mon |
Constructor Summary | |
---|---|
SpeedSchedulerView()
Constructor used by Azureus to instantiate me and give me access to the PluginInterface. |
Method Summary | |
---|---|
void |
delete()
Called exactly once when the user clicks the X on my view. |
private void |
deleteScheduleEvent()
Deletes the selected Schedule from the table (if any). |
private void |
editScheduleEvent()
Pops up an edit Schedule dialog for editing the selected Schedule (if any) from the table. |
private void |
enableScheduleEvent()
toggles the selected Schedule from the table between enabled and disabled. |
private void |
errorMessageBox(java.lang.String msg)
Draws a (not so) friendly error message dialog. |
org.eclipse.swt.widgets.Composite |
getComposite()
If Azureus wants access to my main Composite, here it is. |
java.lang.String |
getFullTitle()
Azureus wants to know my long name: Here it is. |
java.lang.String |
getPluginViewName()
Azureus wants to know my name: Here it is. |
private java.lang.String |
getTimeLabelString()
|
void |
initialize(org.eclipse.swt.widgets.Composite parent)
Called by the Azureus plugin system when my plugin is loaded. |
void |
initView(org.eclipse.swt.widgets.Composite parent)
Initializes all the graphical controls and loads the saved schedules to display the view. |
private boolean |
isActive(Schedule t)
|
private void |
limitDownloadRateIfNeeded()
Checks the upload rate and sees if it violates the <5 rule. |
private void |
newScheduleEvent()
Pops up a new Schedule dialog for creating a new Schedule. |
protected void |
refeshScheduleTable()
Refreshes the Schedule table based on the contents of the schedules vector. |
void |
refresh()
Called periodically while the user is looking at my view (like more than once a second). |
void |
scheduleSelectionChanged(java.util.Vector newActiveSchedules)
Called by the SpeedSchedulerThread to indicate that it has selected a new schedule. |
private void |
setAllWidgetsEnabled(boolean enabled)
Enables or disables all widgets that have been added to the allWidets Vector. |
private void |
setEditScheduleButtonsEnabledState()
Sets the edit/delete buttons enabled if there is a schedule selected in the table, sets them disabled if there is no schedule currently selected. |
Methods inherited from class org.gudy.azureus2.ui.swt.views.AbstractIView |
---|
dataSourceChanged, generateDiagnostics, getData, getShortTitle, isEnabled, isSelected, itemActivated, updateLanguage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector schedules
private static final int BUTTON_PADDING
private static final int MARGIN_WIDTH
private static final int MARGIN_HEIGHT
private static final java.lang.String HELP_URL
private org.eclipse.swt.widgets.Table scheduleTable
private org.eclipse.swt.graphics.Image watchImage
private org.eclipse.swt.graphics.Image watchImageDisabled
private org.eclipse.swt.graphics.Image checkImage
private org.eclipse.swt.graphics.Image defaultImage
private org.eclipse.swt.widgets.Composite mainComposite
private org.eclipse.swt.widgets.Menu contextMenu
private org.eclipse.swt.widgets.MenuItem newItem
private org.eclipse.swt.widgets.MenuItem editItem
private org.eclipse.swt.widgets.MenuItem deleteItem
private org.eclipse.swt.widgets.MenuItem enableItem
private org.eclipse.swt.widgets.Shell shell
private org.eclipse.swt.widgets.Display display
private SchedulePersistencyManager schedulePersistencyManager
private int defaultMaxUploadRate
private int defaultMaxDownloadRate
private java.util.Vector allWidgets
private IntegerInput defaultMaxUploadRateInput
private IntegerInput defaultMaxDownloadRateInput
private java.util.Vector activeSchedules
private org.eclipse.swt.widgets.Button editScheduleButton
private org.eclipse.swt.widgets.Button newScheduleButton
private org.eclipse.swt.widgets.Button deleteScheduleButton
private org.eclipse.swt.widgets.Button enableScheduleButton
private static org.eclipse.swt.graphics.Color gray
private static org.eclipse.swt.graphics.Color blue
private static org.eclipse.swt.graphics.Cursor handCursor
private boolean viewIsDisposed
org.eclipse.swt.widgets.Composite defaultSpeedsImageComposite
Constructor Detail |
---|
public SpeedSchedulerView()
Method Detail |
---|
public void initialize(org.eclipse.swt.widgets.Composite parent)
initialize
in interface org.gudy.azureus2.ui.swt.views.IView
initialize
in class org.gudy.azureus2.ui.swt.views.AbstractIView
public void delete()
delete
in interface org.gudy.azureus2.ui.swt.views.IView
delete
in class org.gudy.azureus2.ui.swt.views.AbstractIView
public void refresh()
refresh
in interface org.gudy.azureus2.ui.swt.views.IView
refresh
in class org.gudy.azureus2.ui.swt.views.AbstractIView
public org.eclipse.swt.widgets.Composite getComposite()
getComposite
in interface org.gudy.azureus2.ui.swt.views.IView
getComposite
in class org.gudy.azureus2.ui.swt.views.AbstractIView
public void initView(org.eclipse.swt.widgets.Composite parent)
private java.lang.String getTimeLabelString()
private void setEditScheduleButtonsEnabledState()
private void limitDownloadRateIfNeeded()
private void setAllWidgetsEnabled(boolean enabled)
enabled
- True to enable all widgets, and false to disable.private void editScheduleEvent()
private void newScheduleEvent()
private void deleteScheduleEvent()
private void enableScheduleEvent()
public java.lang.String getPluginViewName()
getPluginViewName
in class org.gudy.azureus2.plugins.PluginView
public java.lang.String getFullTitle()
getFullTitle
in interface org.gudy.azureus2.ui.swt.views.IView
getFullTitle
in class org.gudy.azureus2.ui.swt.views.AbstractIView
protected void refeshScheduleTable()
private boolean isActive(Schedule t)
private void errorMessageBox(java.lang.String msg)
msg
- The message to display in the dialog.public void scheduleSelectionChanged(java.util.Vector newActiveSchedules)
scheduleSelectionChanged
in interface ScheduleSelectionChangeListener
newActiveSchedules
- A vector of Schedules that the SpeedSchedulerThread just selected.
Empty to indicate that no schedule is currently active.speedscheduler.ScheduleSelectionChangeListener#scheduleSelectionChanged(speedscheduler.Schedule)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |