List of usage examples for org.jfree.data.general HeatMapUtilities extractColumnFromHeatMapDataset
public static XYDataset extractColumnFromHeatMapDataset(HeatMapDataset dataset, int column, Comparable seriesName)
From source file:gov.llnl.lc.infiniband.opensm.plugin.gui.chart.PortHeatMapPlotPanel.java
public void stateChanged(ChangeEvent e) { // handles both slider events if (e.getSource() == PortSlider) { //System.err.println("Port Slider is changing " + PortSlider.getValue()); // this is the vertical slider (moves the horizontal xhair), which moves through ports on vertical axis PortXhair.setValue(PortSlider.getValue()); int xIndex = PortSlider.getValue() - PortSlider.getMinimum(); if (pHeatMap != null) { // extract this slice from the heatmap, and display it XYDataset d = HeatMapUtilities.extractRowFromHeatMapDataset(pHeatMap, xIndex, "Y1"); SinglePortChart.getXYPlot().setDataset(d); SinglePortChart.setTitle(pHeatMap.getPortId(xIndex) + " (port " + xIndex + ")"); }/*from w ww .j ava 2s. c o m*/ } else if (e.getSource() == TimeSlider) { //System.err.println("Time Slider is changing " + TimeSlider.getValue()); // this is the horizontal slider (moves vertical xhair), which moves through time on the horizontal axis TimeXhair.setValue(TimeSlider.getValue()); int xIndex = TimeSlider.getValue() - TimeSlider.getMinimum(); if (pHeatMap != null) { // extract this slice from the heatmap, and display it XYDataset d = HeatMapUtilities.extractColumnFromHeatMapDataset(pHeatMap, xIndex, "Y2"); SingleTimeChart.getXYPlot().setDataset(d); SingleTimeChart.setTitle(new TimeStamp(pHeatMap.getXTimeValue(xIndex)).toString()); } } }