Class SpeedGraphic
- java.lang.Object
-
- com.biglybt.ui.swt.components.graphics.BackGroundGraphic
-
- com.biglybt.ui.swt.components.graphics.ScaledGraphic
-
- com.biglybt.ui.swt.components.graphics.SpeedGraphic
-
- All Implemented Interfaces:
ParameterListener
,Graphic
public class SpeedGraphic extends ScaledGraphic implements ParameterListener
-
-
Field Summary
Fields Modifier and Type Field Description private int[]
ages
private int[][]
all_values
protected org.eclipse.swt.graphics.Image
bufferImage
static int
COLOR_AVERAGE
static int
COLOR_LIMIT
static int
COLOR_MAINSPEED
static int
COLOR_OTHERS
static int
COLOR_OVERHEAD
static int
COLOR_TRIMMED
org.eclipse.swt.graphics.Color[]
colors
private int
currentPosition
private static int
DEFAULT_ENTRIES
private int
graphicsUpdate
private int
internalLoop
private int
maxEntries
private int
nbValues
private org.eclipse.swt.graphics.Point
oldSize
private long
startTime
private java.text.SimpleDateFormat
timeFormatter
-
Fields inherited from class com.biglybt.ui.swt.components.graphics.ScaledGraphic
bufferScale, formater, scale
-
Fields inherited from class com.biglybt.ui.swt.components.graphics.BackGroundGraphic
bufferBackground, colorWhite, drawCanvas, lightGrey, lightGrey2, this_mon
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SpeedGraphic(Scale scale, ValueFormater formater)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIntsValue(int[] new_values)
void
addIntValue(int value)
protected void
addMenuItems(org.eclipse.swt.widgets.Menu menu)
protected int
computeAverage(int position)
void
dispose()
protected void
drawChart(boolean sizeChanged)
static SpeedGraphic
getInstance()
static SpeedGraphic
getInstance(Scale scale, ValueFormater formatter)
static SpeedGraphic
getInstance(ValueFormater formatter)
void
initialize(org.eclipse.swt.widgets.Canvas canvas)
void
parameterChanged(java.lang.String parameter)
Called, when a parameter has changed.void
refresh(boolean force)
void
setLineColors(org.eclipse.swt.graphics.Color[] newChangeableColorSet)
void
setLineColors(org.eclipse.swt.graphics.Color average, org.eclipse.swt.graphics.Color speed, org.eclipse.swt.graphics.Color overhead, org.eclipse.swt.graphics.Color limit, org.eclipse.swt.graphics.Color others, org.eclipse.swt.graphics.Color trimmed)
-
Methods inherited from class com.biglybt.ui.swt.components.graphics.ScaledGraphic
drawScale, setUpdateDividerWidth
-
Methods inherited from class com.biglybt.ui.swt.components.graphics.BackGroundGraphic
drawBackGround, setColors, setSIIECSensitive
-
-
-
-
Field Detail
-
DEFAULT_ENTRIES
private static final int DEFAULT_ENTRIES
- See Also:
- Constant Field Values
-
COLOR_AVERAGE
public static final int COLOR_AVERAGE
- See Also:
- Constant Field Values
-
COLOR_MAINSPEED
public static final int COLOR_MAINSPEED
- See Also:
- Constant Field Values
-
COLOR_OVERHEAD
public static final int COLOR_OVERHEAD
- See Also:
- Constant Field Values
-
COLOR_LIMIT
public static final int COLOR_LIMIT
- See Also:
- Constant Field Values
-
COLOR_OTHERS
public static final int COLOR_OTHERS
- See Also:
- Constant Field Values
-
COLOR_TRIMMED
public static final int COLOR_TRIMMED
- See Also:
- Constant Field Values
-
colors
public org.eclipse.swt.graphics.Color[] colors
-
internalLoop
private int internalLoop
-
graphicsUpdate
private int graphicsUpdate
-
oldSize
private org.eclipse.swt.graphics.Point oldSize
-
bufferImage
protected org.eclipse.swt.graphics.Image bufferImage
-
nbValues
private int nbValues
-
maxEntries
private int maxEntries
-
all_values
private int[][] all_values
-
startTime
private long startTime
-
ages
private int[] ages
-
currentPosition
private int currentPosition
-
timeFormatter
private java.text.SimpleDateFormat timeFormatter
-
-
Constructor Detail
-
SpeedGraphic
private SpeedGraphic(Scale scale, ValueFormater formater)
-
-
Method Detail
-
initialize
public void initialize(org.eclipse.swt.widgets.Canvas canvas)
- Specified by:
initialize
in interfaceGraphic
- Overrides:
initialize
in classBackGroundGraphic
-
getInstance
public static SpeedGraphic getInstance()
-
getInstance
public static SpeedGraphic getInstance(ValueFormater formatter)
-
getInstance
public static SpeedGraphic getInstance(Scale scale, ValueFormater formatter)
-
addMenuItems
protected void addMenuItems(org.eclipse.swt.widgets.Menu menu)
- Overrides:
addMenuItems
in classBackGroundGraphic
-
addIntsValue
public void addIntsValue(int[] new_values)
-
addIntValue
public void addIntValue(int value)
-
refresh
public void refresh(boolean force)
- Specified by:
refresh
in interfaceGraphic
- Overrides:
refresh
in classBackGroundGraphic
-
drawChart
protected void drawChart(boolean sizeChanged)
-
computeAverage
protected int computeAverage(int position)
-
parameterChanged
public void parameterChanged(java.lang.String parameter)
Description copied from interface:ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.- Specified by:
parameterChanged
in interfaceParameterListener
- Parameters:
parameter
- the name of the parameter that has changed
-
dispose
public void dispose()
- Overrides:
dispose
in classScaledGraphic
-
setLineColors
public void setLineColors(org.eclipse.swt.graphics.Color average, org.eclipse.swt.graphics.Color speed, org.eclipse.swt.graphics.Color overhead, org.eclipse.swt.graphics.Color limit, org.eclipse.swt.graphics.Color others, org.eclipse.swt.graphics.Color trimmed)
-
setLineColors
public void setLineColors(org.eclipse.swt.graphics.Color[] newChangeableColorSet)
-
-