Class MultiPlotGraphic
- java.lang.Object
-
- com.biglybt.ui.swt.components.graphics.BackGroundGraphic
-
- com.biglybt.ui.swt.components.graphics.ScaledGraphic
-
- com.biglybt.ui.swt.components.graphics.MultiPlotGraphic
-
- All Implemented Interfaces:
ParameterListener
,Graphic
public class MultiPlotGraphic extends ScaledGraphic implements ParameterListener
-
-
Field Summary
Fields Modifier and Type Field Description private int[][]
all_values
private org.eclipse.swt.graphics.Image
bufferImage
private int
currentPosition
private static int
DEFAULT_ENTRIES
private int
graphicsUpdate
private int
internalLoop
private boolean
maintain_history
private int
maxEntries
private int
nbValues
private org.eclipse.swt.graphics.Point
oldSize
private java.text.SimpleDateFormat
timeFormatter
private TimerEventPeriodic
update_event
private boolean
update_outstanding
private int
update_period_millis
private ValueSource[]
value_sources
-
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
MultiPlotGraphic(Scale scale, ValueSource[] sources, ValueFormater formater, int num_entries)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addIntsValue(int[] new_values)
protected void
addMenuItems(org.eclipse.swt.widgets.Menu menu)
private int
computeAverage(int line_index, int position)
void
dispose()
void
dispose(boolean _maintain_history)
protected void
drawChart(boolean sizeChanged)
int[]
getAverage(int num_entries)
int[][]
getHistory()
static MultiPlotGraphic
getInstance(int num_entries, ValueSource[] sources, ValueFormater formatter)
static MultiPlotGraphic
getInstance(ValueSource[] sources, ValueFormater formatter)
private void
init(int[][] history)
void
initialize(org.eclipse.swt.widgets.Canvas canvas)
void
initialize(org.eclipse.swt.widgets.Canvas canvas, boolean is_active)
void
parameterChanged(java.lang.String parameter)
Called, when a parameter has changed.void
refresh(boolean force)
void
reset(int[][] history)
void
setActive(boolean active)
void
setActive(boolean active, int period_millis)
-
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
-
value_sources
private ValueSource[] value_sources
-
internalLoop
private int internalLoop
-
graphicsUpdate
private int graphicsUpdate
-
oldSize
private org.eclipse.swt.graphics.Point oldSize
-
bufferImage
private org.eclipse.swt.graphics.Image bufferImage
-
nbValues
private int nbValues
-
maxEntries
private int maxEntries
-
all_values
private int[][] all_values
-
currentPosition
private int currentPosition
-
update_outstanding
private boolean update_outstanding
-
update_period_millis
private int update_period_millis
-
update_event
private TimerEventPeriodic update_event
-
maintain_history
private boolean maintain_history
-
timeFormatter
private java.text.SimpleDateFormat timeFormatter
-
-
Constructor Detail
-
MultiPlotGraphic
private MultiPlotGraphic(Scale scale, ValueSource[] sources, ValueFormater formater, int num_entries)
-
-
Method Detail
-
getInstance
public static MultiPlotGraphic getInstance(ValueSource[] sources, ValueFormater formatter)
-
getInstance
public static MultiPlotGraphic getInstance(int num_entries, ValueSource[] sources, ValueFormater formatter)
-
init
private void init(int[][] history)
-
getHistory
public int[][] getHistory()
-
initialize
public void initialize(org.eclipse.swt.widgets.Canvas canvas)
- Specified by:
initialize
in interfaceGraphic
- Overrides:
initialize
in classBackGroundGraphic
-
initialize
public void initialize(org.eclipse.swt.widgets.Canvas canvas, boolean is_active)
-
addMenuItems
protected void addMenuItems(org.eclipse.swt.widgets.Menu menu)
- Overrides:
addMenuItems
in classBackGroundGraphic
-
setActive
public void setActive(boolean active)
-
setActive
public void setActive(boolean active, int period_millis)
-
reset
public void reset(int[][] history)
-
getAverage
public int[] getAverage(int num_entries)
-
addIntsValue
private void addIntsValue(int[] new_values)
-
refresh
public void refresh(boolean force)
- Specified by:
refresh
in interfaceGraphic
- Overrides:
refresh
in classBackGroundGraphic
-
drawChart
protected void drawChart(boolean sizeChanged)
-
computeAverage
private int computeAverage(int line_index, 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
-
dispose
public void dispose(boolean _maintain_history)
-
-