10 package com.generalrobotix.ui.view.graph;
13 import org.eclipse.swt.graphics.RGB;
26 private static final double LOG10 = Math.log(10);
32 private static final String[]
colorTable_ = {
"green",
"yellow",
"cyan",
"magenta",
"red",
"blue" };
36 numColors_ = colorTable_.length;
40 tmpcolorCounter_ = tmpcolorCounter_ + index;
41 if (tmpcolorCounter_ >= numColors_) {
85 dataItemInfoMap_ =
new HashMap<String, DataItemInfo>();
149 if (dataKind ==
null) {
152 if (dataKind_ !=
null) {
153 if (!dataKind.equals(dataKind_)) {
157 dataKind_ = dataKind;
182 if (++colorCounter_ >= numColors_)
200 dataItemInfoMap_.remove(key);
201 if (dataItemInfoMap_.isEmpty()) {
224 return dataItemInfoMap_.size();
232 return dataItemInfoMap_.values().toArray(
new DataItemInfo[0]);
293 return yAxisInfo_.
base;
463 if (dataItemInfoMap_.containsKey(key)) {
467 dataItemInfoMap_.put(key, dataItemInfo);
471 ds, xAxisInfo_, yAxisInfo_,
513 yAxisInfo_.
base = base;
514 yAxisInfo_.
extent = extent;
522 String _getDataItemNodeName(
DataItem di) {
523 StringBuffer sb =
new StringBuffer(nodeName_);
525 sb.append(nodeName_);
539 return sb.toString();
542 String getNodeName() {
563 int eMin = (
int)Math.floor(Math.log(sMin) /
LOG10);
567 boolean found =
false;
570 for (
int i = 1;
i <= 3;
i++) {
571 step = m * Math.pow(10.0, e);
574 char[]
c =
new char[-e + 2];
577 for (
int j = 0; j < -e; j++) {
580 format =
new String(c);
597 for (
int j = 0; j < info.length; j++)
void setAxisInfo(int axis, AxisInfo ai)
String getFullAttributeName()
#define null
our own NULL pointer
static final int AXIS_BOTTOM
AxisInfo getTimeAxisInfo()
void _setRange(double base, double extent)
void removeDataSeries(DataSeries ds)
static final int numColors_
static final double MAX_DIV
static final int SUCCEEDED
static final int NOT_SUPPORTED
HashMap< String, DataItemInfo > dataItemInfoMap_
static Activator getDefault()
void removeDataItem(DataItemInfo dataItemInfo)
static final int NOT_MATCHED
int addDataItem(DataItemInfo di)
RGB getGraphColor(int index)
void setGraph(XYLineGraph graph, LegendPanel legend)
void setLegend(LegendPanel legend)
DataSeries addDataItem(DataItem dataItem)
void addDataSeries(DataSeries ds, AxisInfo xai, AxisInfo yai, RGB rgb, String legend)
Font getFont(String fontName)
static final int AXIS_LEFT
void setRangeAndPos(double timeRange, double markerPos)
void _setDataItemInfo(DataItemInfo dii)
void setDataItemInfo(DataItemInfo dii)
void _setTimeRangeAndPos(double timeRange, double markerPos)
static final double LOG10
void setStyle(DataSeries ds, RGB rgb)
void setTimeRangeAndPos(double timeRange, double markerPos)
DataItemInfo [] getDataItemInfoList()
boolean _addDataItem(DataItemInfo dataItemInfo)
void removeDataItem(DataItem dataItem)
static final String [] colorTable_
void setRange(double base, double extent)
static DataKind getDataKindFromAttr(String attribute)
TrendGraph(TrendGraphModel model, String node)
void setLegendLabel(DataSeries ds, String legend)