Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2011-12-14 12:00:02 -0500
committerRoland Grunberg2011-12-20 13:35:19 -0500
commite00ae967654548f700766347dc05417d59f09ccf (patch)
tree1ff0455561737100c8621c6f6b8c25073c6e8580 /valgrind
parentc5d8e01fbbf0f5bb881c2025dba257a3e7e4d03e (diff)
downloadorg.eclipse.linuxtools-e00ae967654548f700766347dc05417d59f09ccf.tar.gz
org.eclipse.linuxtools-e00ae967654548f700766347dc05417d59f09ccf.tar.xz
org.eclipse.linuxtools-e00ae967654548f700766347dc05417d59f09ccf.zip
Make Massif chart as similar as possible to the original BIRT chart.
Diffstat (limited to 'valgrind')
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java10
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditor.java107
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/HeapChart.java244
3 files changed, 84 insertions, 277 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java
index 2857f23861..9445a38120 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java
@@ -250,8 +250,11 @@ public class MassifViewPart extends ViewPart implements IValgrindToolView {
ChartEditorInput currentInput = getChartInput(pid);
String path = getChartSavePath(currentInput.getName() + ".svg"); //$NON-NLS-1$
if (path != null) {
- ChartSVG renderer = new ChartSVG(currentInput.getChart(), MassifViewPart.this);
- renderer.renderSVG(Path.fromOSString(path));
+ /**
+ * TODO : Implement this
+ */
+// ChartSVG renderer = new ChartSVG(currentInput.getChart(), MassifViewPart.this);
+// renderer.renderSVG(Path.fromOSString(path));
}
}
};
@@ -294,9 +297,8 @@ public class MassifViewPart extends ViewPart implements IValgrindToolView {
}
protected void createChart(MassifSnapshot[] snapshots) {
- HeapChart chart = new HeapChart(snapshots);
String title = chartName + " [PID: " + pid + "]"; //$NON-NLS-1$//$NON-NLS-2$
- chart.getTitle().getLabel().getCaption().setValue(title);
+ HeapChart chart = new HeapChart(snapshots, title);
String name = getInputName(title);
ChartEditorInput input = new ChartEditorInput(chart, this, name, pid);
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditor.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditor.java
index 7170bb2b69..e408219b4f 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditor.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditor.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.internal.valgrind.massif.birt;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.window.Window;
@@ -21,6 +22,8 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
@@ -35,9 +38,14 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.EditorPart;
import org.swtchart.Chart;
+import org.swtchart.IAxis;
+import org.swtchart.IAxisSet;
import org.swtchart.ILineSeries;
import org.swtchart.ILineSeries.PlotSymbolType;
import org.swtchart.ISeries.SeriesType;
+import org.swtchart.IAxis;
+import org.swtchart.ITitle;
+import org.swtchart.LineStyle;
import org.swtchart.Range;
public class ChartEditor extends EditorPart {
@@ -77,58 +85,96 @@ public class ChartEditor extends EditorPart {
@Override
public void createPartControl(Composite parent) {
final ChartEditorInput input = (ChartEditorInput) getEditorInput();
+ final HeapChart heapChart = input.getChart();
control = new Chart(parent, SWT.FILL);
- Color color = new Color(Display.getDefault(), 255, 128, 128);
-
- control.setBackground(color);
- control.setBackgroundInPlotArea(color);
-
- control.getTitle().setText("Valgrind Title");
- control.getAxisSet().getXAxis(0).getTitle().setText(input.getChart().xUnits);
- control.getAxisSet().getYAxis(0).getTitle().setText(input.getChart().yUnits);
-
- final HeapChart heapChart = input.getChart();
-
- // x-axis range
- double min = Double.MAX_VALUE;
- double max = 0.0;
- double [] heapChartTime = heapChart.time;
- for (int i=0; i < heapChartTime.length; i++){
- if (min > heapChartTime[i]){
- min = heapChartTime[i];
- }
- if (max < heapChartTime[i]){
- max = heapChartTime[i];
- }
- }
+ final Color LIGHTYELLOW = new Color(Display.getDefault(), 255, 255, 225);
+ final Color WHITE = new Color(Display.getDefault(), 255, 255, 255);
+ final Color BLACK = new Color(Display.getDefault(), 0, 0, 0);
+ final Color RED = new Color(Display.getDefault(), 255, 0, 0);
+ final Color ORANGE = new Color(Display.getDefault(), 255, 165, 0);
+ final Color GREEN = new Color(Display.getDefault(), 0, 255, 0);
+
+ control.setBackground(WHITE);
+ control.setBackgroundInPlotArea(LIGHTYELLOW);
+
+ FontData fd = JFaceResources.getDialogFont().getFontData()[0];
+ fd.setStyle(SWT.BOLD);
+
+ Font font = new Font(Display.getDefault(), fd);
+ fd.setHeight(fd.getHeight() + 2);
+ Font titleFont = new Font(Display.getDefault(), fd);
+
+ ITitle title = control.getTitle();
+ title.setFont(titleFont);
+ title.setForeground(BLACK);
+ title.setText(heapChart.title);
+
+ IAxis xAxis = control.getAxisSet().getXAxis(0);
+ xAxis.getGrid().setStyle(LineStyle.NONE);
+ xAxis.getTick().setForeground(BLACK);
+ ITitle xTitle = xAxis.getTitle();
+ xTitle.setFont(font);
+ xTitle.setForeground(BLACK);
+ xTitle.setText(heapChart.xUnits);
+
+ IAxis yAxis = control.getAxisSet().getYAxis(0);
+ yAxis.getGrid().setStyle(LineStyle.SOLID);
+ yAxis.getTick().setForeground(BLACK);
+ ITitle yTitle = yAxis.getTitle();
+ yTitle.setFont(font);
+ yTitle.setText(heapChart.yUnits);
+ yTitle.setForeground(BLACK);
+
+ control.getLegend().setPosition(SWT.BOTTOM);
// data
- final ILineSeries lsUseful = (ILineSeries) control.getSeriesSet().createSeries(SeriesType.LINE, "line 1");
+ final ILineSeries lsUseful = (ILineSeries) control.getSeriesSet().
+ createSeries(SeriesType.LINE, Messages.getString("HeapChart.Useful_Heap")); //$NON-NLS-1$);
lsUseful.setXSeries(heapChart.time);
lsUseful.setYSeries(heapChart.dataUseful);
lsUseful.setSymbolType(PlotSymbolType.DIAMOND);
+ lsUseful.setSymbolColor(RED);
+ lsUseful.setLineColor(RED);
- final ILineSeries lsExtra = (ILineSeries) control.getSeriesSet().createSeries(SeriesType.LINE, "line 2");
+ final ILineSeries lsExtra = (ILineSeries) control.getSeriesSet().
+ createSeries(SeriesType.LINE, Messages.getString("HeapChart.Extra_Heap")); //$NON-NLS-1$);
lsExtra.setXSeries(heapChart.time);
lsExtra.setYSeries(heapChart.dataExtra);
lsExtra.setSymbolType(PlotSymbolType.DIAMOND);
+ lsExtra.setSymbolColor(ORANGE);
+ lsExtra.setLineColor(ORANGE);
if (heapChart.dataStacks != null){
- final ILineSeries lsStack = (ILineSeries) control.getSeriesSet().createSeries(SeriesType.LINE, "line 3");
+ final ILineSeries lsStack = (ILineSeries) control.getSeriesSet().
+ createSeries(SeriesType.LINE, Messages.getString("HeapChart.Stacks")); //$NON-NLS-1$);
lsStack.setXSeries(heapChart.time);
lsStack.setYSeries(heapChart.dataStacks);
lsStack.setSymbolType(PlotSymbolType.DIAMOND);
+ lsUseful.setSymbolColor(RED);
+ lsUseful.setLineColor(RED);
}
- final ILineSeries lsTotal = (ILineSeries) control.getSeriesSet().createSeries(SeriesType.LINE, "line 4");
+ final ILineSeries lsTotal = (ILineSeries) control.getSeriesSet().
+ createSeries(SeriesType.LINE, Messages.getString("HeapChart.Total_Heap")); //$NON-NLS-1$);
lsTotal.setXSeries(heapChart.time);
lsTotal.setYSeries(heapChart.dataTotal);
lsTotal.setSymbolType(PlotSymbolType.DIAMOND);
+ lsTotal.setSymbolColor(GREEN);
+ lsTotal.setLineColor(GREEN);
// adjust axes
control.getAxisSet().adjustRange();
- control.getAxisSet().getXAxis(0).setRange(new Range(min, max + 1.0));
+
+ IAxisSet axisSet = control.getAxisSet();
+ Range xRange = axisSet.getXAxis(0).getRange();
+ Range yRange = axisSet.getYAxis(0).getRange();
+
+ double xExtra = 0.05 * (xRange.upper - xRange.lower);
+ double yExtra = 0.05 * (yRange.upper - yRange.lower);
+
+ axisSet.getXAxis(0).setRange(new Range(xRange.lower, xRange.upper + xExtra));
+ axisSet.getYAxis(0).setRange(new Range(yRange.lower, yRange.upper + yExtra));
// listeners
control.getPlotArea().addMouseListener(new MouseListener() {
@@ -143,7 +189,6 @@ public class ChartEditor extends EditorPart {
input.getView().setTopControl(viewer.getControl());
Point p = new Point(e.x, e.y);
-// System.out.println(e.x + " " + e.y);
int closest = 0;
double d1, d2, d3, currMin;
@@ -161,10 +206,6 @@ public class ChartEditor extends EditorPart {
}
}
-// System.out.println(lsUseful.getPixelCoordinates(closest));
-// System.out.println(lsExtra.getPixelCoordinates(closest));
-// System.out.println(lsTotal.getPixelCoordinates(closest));
-
MassifSnapshot snapshot = (MassifSnapshot) viewer.getElementAt(closest);
viewer.setSelection(new StructuredSelection(snapshot));
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/HeapChart.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/HeapChart.java
index 80e77fe2ca..dde8b0ba43 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/HeapChart.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/HeapChart.java
@@ -11,45 +11,10 @@
***********************************************************************/
package org.eclipse.linuxtools.internal.valgrind.massif.birt;
-import org.eclipse.birt.chart.model.attribute.ActionType;
-import org.eclipse.birt.chart.model.attribute.AxisType;
-import org.eclipse.birt.chart.model.attribute.ChartDimension;
-import org.eclipse.birt.chart.model.attribute.FontDefinition;
-import org.eclipse.birt.chart.model.attribute.IntersectionType;
-import org.eclipse.birt.chart.model.attribute.Marker;
-import org.eclipse.birt.chart.model.attribute.MarkerType;
-import org.eclipse.birt.chart.model.attribute.Orientation;
-import org.eclipse.birt.chart.model.attribute.Position;
-import org.eclipse.birt.chart.model.attribute.TickStyle;
-import org.eclipse.birt.chart.model.attribute.TriggerCondition;
-import org.eclipse.birt.chart.model.attribute.impl.CallBackValueImpl;
-import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl;
-import org.eclipse.birt.chart.model.component.Axis;
-import org.eclipse.birt.chart.model.component.Series;
-import org.eclipse.birt.chart.model.component.impl.SeriesImpl;
-import org.eclipse.birt.chart.model.data.BaseSampleData;
-import org.eclipse.birt.chart.model.data.DataFactory;
-import org.eclipse.birt.chart.model.data.NumberDataSet;
-import org.eclipse.birt.chart.model.data.OrthogonalSampleData;
-import org.eclipse.birt.chart.model.data.SampleData;
-import org.eclipse.birt.chart.model.data.SeriesDefinition;
-import org.eclipse.birt.chart.model.data.Trigger;
-import org.eclipse.birt.chart.model.data.impl.ActionImpl;
-import org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl;
-import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl;
-import org.eclipse.birt.chart.model.data.impl.TriggerImpl;
-import org.eclipse.birt.chart.model.impl.ChartWithAxesImpl;
-import org.eclipse.birt.chart.model.layout.Legend;
-import org.eclipse.birt.chart.model.layout.Plot;
-import org.eclipse.birt.chart.model.type.LineSeries;
-import org.eclipse.birt.chart.model.type.impl.LineSeriesImpl;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot;
import org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot.TimeUnit;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-public class HeapChart extends ChartWithAxesImpl {
+public class HeapChart {
private static String[] byteUnits = { Messages.getString("HeapChart.B"), //$NON-NLS-1$
Messages.getString("HeapChart.KiB"), //$NON-NLS-1$
@@ -76,15 +41,17 @@ public class HeapChart extends ChartWithAxesImpl {
protected static final int SCALING_THRESHOLD = 20;
+ protected String title;
protected String xUnits;
protected String yUnits;
protected double [] time, dataUseful, dataExtra, dataStacks, dataTotal;
- public HeapChart(MassifSnapshot[] snapshots) {
+ public HeapChart(MassifSnapshot[] snapshots, String title) {
TimeUnit timeUnit = snapshots[0].getUnit();
long xScaling = getXScaling(snapshots, timeUnit);
long yScaling = getYScaling(snapshots);
+ this.title = title;
time = new double[snapshots.length];
dataUseful = new double[snapshots.length];
dataExtra = new double[snapshots.length];
@@ -105,209 +72,6 @@ public class HeapChart extends ChartWithAxesImpl {
}
}
- initialize();
- setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
- setType("Line Chart"); //$NON-NLS-1$
- setSubType("Overlay"); //$NON-NLS-1$
-
- Font font = JFaceResources.getDialogFont();
- FontData fd = font.getFontData()[0];
-
- // Title
- FontDefinition titleFont = getTitle().getLabel().getCaption().getFont();
- titleFont.setName(fd.getName());
- titleFont.setSize(fd.getHeight() + 2);
-
- // Plot
- getBlock().setBackground(ColorDefinitionImpl.WHITE());
- Plot p = getPlot();
- p.getClientArea().setBackground(
- ColorDefinitionImpl.create(255, 255, 225));
-
- // X-Axis
- Axis xAxisPrimary = getPrimaryBaseAxes()[0];
- xAxisPrimary.setType(AxisType.LINEAR_LITERAL);
- xAxisPrimary.getMajorGrid().setTickStyle(TickStyle.BELOW_LITERAL);
- xAxisPrimary.getOrigin().setType(IntersectionType.VALUE_LITERAL);
- xAxisPrimary.getTitle().getCaption().setValue(xUnits);
- xAxisPrimary.getTitle().setVisible(true);
-
- FontDefinition xAxisFont = xAxisPrimary.getTitle().getCaption()
- .getFont();
- xAxisFont.setName(fd.getName());
- xAxisFont.setSize(fd.getHeight());
-
- xAxisFont = xAxisPrimary.getLabel().getCaption().getFont();
- xAxisFont.setName(fd.getName());
- xAxisFont.setSize(fd.getHeight());
-
- // Y-Axis
- Axis yAxisPrimary = getPrimaryOrthogonalAxis(xAxisPrimary);
- yAxisPrimary.getMajorGrid().setTickStyle(TickStyle.LEFT_LITERAL);
- yAxisPrimary.getMajorGrid().getLineAttributes().setVisible(true);
- yAxisPrimary.getTitle().getCaption().setValue(yUnits);
- yAxisPrimary.getTitle().setVisible(true);
-
- FontDefinition yAxisFont = yAxisPrimary.getTitle().getCaption()
- .getFont();
- yAxisFont.setName(fd.getName());
- yAxisFont.setSize(fd.getHeight());
-
- yAxisFont = yAxisPrimary.getLabel().getCaption().getFont();
- yAxisFont.setName(fd.getName());
- yAxisFont.setSize(fd.getHeight());
-
- // // Z-Axis
- // Axis zAxis = AxisImpl.create(Axis.ANCILLARY_BASE);
- // zAxis.setType(AxisType.LINEAR_LITERAL);
- // zAxis.setLabelPosition(Position.BELOW_LITERAL);
- // zAxis.setTitlePosition(Position.BELOW_LITERAL);
- // zAxis.getMajorGrid().setTickStyle(TickStyle.BELOW_LITERAL);
- // zAxis.setOrientation(Orientation.HORIZONTAL_LITERAL);
- // xAxisPrimary.getAncillaryAxes().add(zAxis);
-
- // Legend
- Legend legend = getLegend();
- legend.setPosition(Position.BELOW_LITERAL);
- legend.setOrientation(Orientation.HORIZONTAL_LITERAL);
-
- FontDefinition legendFont = legend.getText().getFont();
- legendFont.setName(fd.getName());
- legendFont.setSize(fd.getHeight());
-
- // Data Set
- NumberDataSet mainValues = NumberDataSetImpl.create(time);
- NumberDataSet orthoValues1 = NumberDataSetImpl.create(dataUseful);
- NumberDataSet orthoValues2 = NumberDataSetImpl.create(dataExtra);
- NumberDataSet orthoValuesS = null;
- if (isStack) {
- orthoValuesS = NumberDataSetImpl.create(dataStacks);
- }
- NumberDataSet orthoValues3 = NumberDataSetImpl.create(dataTotal);
-
- SampleData sd = DataFactory.eINSTANCE.createSampleData();
- BaseSampleData sdBase = DataFactory.eINSTANCE.createBaseSampleData();
- sdBase.setDataSetRepresentation("");//$NON-NLS-1$
- sd.getBaseSampleData().add(sdBase);
-
- OrthogonalSampleData sdOrthogonal1 = DataFactory.eINSTANCE
- .createOrthogonalSampleData();
- sdOrthogonal1.setDataSetRepresentation("");//$NON-NLS-1$
- sdOrthogonal1.setSeriesDefinitionIndex(0);
- sd.getOrthogonalSampleData().add(sdOrthogonal1);
-
- OrthogonalSampleData sdOrthogonal2 = DataFactory.eINSTANCE
- .createOrthogonalSampleData();
- sdOrthogonal2.setDataSetRepresentation("");//$NON-NLS-1$
- sdOrthogonal2.setSeriesDefinitionIndex(1);
- sd.getOrthogonalSampleData().add(sdOrthogonal2);
-
- if (isStack) {
- OrthogonalSampleData sdOrthogonalS = DataFactory.eINSTANCE
- .createOrthogonalSampleData();
- sdOrthogonalS.setDataSetRepresentation("");//$NON-NLS-1$
- sdOrthogonalS.setSeriesDefinitionIndex(2);
- sd.getOrthogonalSampleData().add(sdOrthogonalS);
- }
-
- OrthogonalSampleData sdOrthogonal3 = DataFactory.eINSTANCE
- .createOrthogonalSampleData();
- sdOrthogonal3.setDataSetRepresentation("");//$NON-NLS-1$
- sdOrthogonal3.setSeriesDefinitionIndex(isStack ? 3 : 2);
- sd.getOrthogonalSampleData().add(sdOrthogonal3);
-
- setSampleData(sd);
-
- // X-Series
- Series seCategory = SeriesImpl.create();
- seCategory.setDataSet(mainValues);
- SeriesDefinition sdX = SeriesDefinitionImpl.create();
- xAxisPrimary.getSeriesDefinitions().add(sdX);
- sdX.getSeries().add(seCategory);
-
- // Y-Series
- LineSeries ls1 = (LineSeries) LineSeriesImpl.create();
- ls1.setDataSet(orthoValues1);
- ls1.getLineAttributes().setColor(ColorDefinitionImpl.CREAM());
- for (int i = 0; i < ls1.getMarkers().size(); i++) {
- Marker marker = (Marker) ls1.getMarkers().get(i);
- marker.setType(MarkerType.DIAMOND_LITERAL);
- }
-
- ls1.setPaletteLineColor(true);
- ls1.setSeriesIdentifier(Messages.getString("HeapChart.Useful_Heap")); //$NON-NLS-1$
- ls1.getTriggers().add(getClickTrigger(ls1));
- ls1.getTriggers().add(getDblClickTrigger(ls1));
-
- // Y-Series
- LineSeries ls2 = (LineSeries) LineSeriesImpl.create();
- ls2.setDataSet(orthoValues2);
- ls2.getLineAttributes().setColor(ColorDefinitionImpl.CREAM());
- for (int i = 0; i < ls2.getMarkers().size(); i++) {
- Marker marker = (Marker) ls2.getMarkers().get(i);
- marker.setType(MarkerType.DIAMOND_LITERAL);
- }
- ls2.setPaletteLineColor(true);
- ls2.setSeriesIdentifier(Messages.getString("HeapChart.Extra_Heap")); //$NON-NLS-1$
- ls2.getTriggers().add(getClickTrigger(ls2));
- ls2.getTriggers().add(getDblClickTrigger(ls2));
-
- // Y-Series
- LineSeries lsS = null;
- if (isStack) {
- lsS = (LineSeries) LineSeriesImpl.create();
- lsS.setDataSet(orthoValuesS);
- lsS.getLineAttributes().setColor(ColorDefinitionImpl.CREAM());
- for (int i = 0; i < lsS.getMarkers().size(); i++) {
- Marker marker = (Marker) lsS.getMarkers().get(i);
- marker.setType(MarkerType.DIAMOND_LITERAL);
- }
- lsS.setPaletteLineColor(true);
- lsS.setSeriesIdentifier(Messages.getString("HeapChart.Stacks")); //$NON-NLS-1$
- lsS.getTriggers().add(getClickTrigger(lsS));
- lsS.getTriggers().add(getDblClickTrigger(lsS));
- }
-
- // Y-Series
- LineSeries ls3 = (LineSeries) LineSeriesImpl.create();
- ls3.setDataSet(orthoValues3);
- ls3.getLineAttributes().setColor(ColorDefinitionImpl.CREAM());
- for (int i = 0; i < ls3.getMarkers().size(); i++) {
- Marker marker = (Marker) ls3.getMarkers().get(i);
- marker.setType(MarkerType.DIAMOND_LITERAL);
- }
- ls3.setPaletteLineColor(true);
- ls3.setSeriesIdentifier(Messages.getString("HeapChart.Total_Heap")); //$NON-NLS-1$
- ls3.getTriggers().add(getClickTrigger(ls3));
- ls3.getTriggers().add(getDblClickTrigger(ls3));
-
- SeriesDefinition sdY = SeriesDefinitionImpl.create();
- sdY.getSeriesPalette().shift(-1);
- yAxisPrimary.getSeriesDefinitions().add(sdY);
- sdY.getSeries().add(ls1);
- sdY.getSeries().add(ls2);
- if (isStack) {
- sdY.getSeries().add(lsS);
- }
- sdY.getSeries().add(ls3);
-
- // // Z-Series
- // SeriesDefinition sdZ = SeriesDefinitionImpl.create();
- // zAxis.getSeriesDefinitions().add(sdZ);
- }
-
- private Trigger getClickTrigger(LineSeries ls) {
- return TriggerImpl.create(TriggerCondition.ONCLICK_LITERAL, ActionImpl
- .create(ActionType.CALL_BACK_LITERAL, CallBackValueImpl
- .create(String.valueOf(ls
- .getSeriesIdentifier()))));
- }
-
- private Trigger getDblClickTrigger(LineSeries ls) {
- return TriggerImpl.create(TriggerCondition.ONDBLCLICK_LITERAL, ActionImpl
- .create(ActionType.CALL_BACK_LITERAL, CallBackValueImpl
- .create(String.valueOf(ls
- .getSeriesIdentifier()))));
}
private boolean isStackProfiled(MassifSnapshot[] snapshots) {

Back to the top