mev-4.0.01/source/org/tigr/microarray/mev/cgh/CGHGuiObj/CGHBrowser/CGHChartPanel.java

Code
Comments
Other
Rev Date Author Line
2 26 Feb 07 jari 1 /*
2 26 Feb 07 jari 2  * CGHChartPanel.java
2 26 Feb 07 jari 3  *
2 26 Feb 07 jari 4  * Created on March 26, 2003, 1:57 PM
2 26 Feb 07 jari 5  */
2 26 Feb 07 jari 6
2 26 Feb 07 jari 7 package org.tigr.microarray.mev.cgh.CGHGuiObj.CGHBrowser;
2 26 Feb 07 jari 8
2 26 Feb 07 jari 9 import java.awt.event.InputEvent;
2 26 Feb 07 jari 10
2 26 Feb 07 jari 11 import javax.swing.ListSelectionModel;
2 26 Feb 07 jari 12 import javax.swing.event.ListSelectionEvent;
2 26 Feb 07 jari 13 import javax.swing.event.ListSelectionListener;
2 26 Feb 07 jari 14
2 26 Feb 07 jari 15 import org.tigr.microarray.mev.cgh.CGHDataModel.CGHBrowserModelAdaptor;
2 26 Feb 07 jari 16 import org.tigr.microarray.mev.cgh.CGHDataModel.CGHChartDataModel;
2 26 Feb 07 jari 17 import org.tigr.microarray.mev.cgh.CGHDataModel.CGHTableDataModel;
2 26 Feb 07 jari 18 import org.tigr.microarray.mev.cgh.CGHDataObj.CGHClone;
2 26 Feb 07 jari 19 import org.tigr.microarray.mev.cgh.CGHDataObj.FlankingRegion;
2 26 Feb 07 jari 20 import org.tigr.microarray.mev.cgh.CGHDataObj.ICGHDataRegion;
2 26 Feb 07 jari 21
2 26 Feb 07 jari 22 import com.klg.jclass.chart.ChartDataViewSeries;
2 26 Feb 07 jari 23 import com.klg.jclass.chart.ChartText;
2 26 Feb 07 jari 24 import com.klg.jclass.chart.EventTrigger;
2 26 Feb 07 jari 25 import com.klg.jclass.chart.JCAxis;
2 26 Feb 07 jari 26 import com.klg.jclass.chart.JCDataIndex;
2 26 Feb 07 jari 27 import com.klg.jclass.chart.JCPickListener;
2 26 Feb 07 jari 28 import com.klg.jclass.util.legend.JCLegend;
2 26 Feb 07 jari 29
2 26 Feb 07 jari 30 /**
2 26 Feb 07 jari 31  *
2 26 Feb 07 jari 32  * @author  Adam Margolin
2 26 Feb 07 jari 33  * @author Raktim Sinha
2 26 Feb 07 jari 34  */
2 26 Feb 07 jari 35
2 26 Feb 07 jari 36 public class CGHChartPanel extends javax.swing.JPanel implements JCPickListener{
2 26 Feb 07 jari 37
2 26 Feb 07 jari 38     private int experimentIndex;
2 26 Feb 07 jari 39     private int chromosomeIndex;
2 26 Feb 07 jari 40
2 26 Feb 07 jari 41     private CGHChartDataModel chartModel;
2 26 Feb 07 jari 42     private CGHTableDataModel tableModel;
2 26 Feb 07 jari 43
2 26 Feb 07 jari 44     private ICGHDataRegion selectedRegion = null;
2 26 Feb 07 jari 45
2 26 Feb 07 jari 46     CGHBrowserModelAdaptor browserModel;
2 26 Feb 07 jari 47
2 26 Feb 07 jari 48     public CGHChartPanel(int experimentIndex, int chromosomeIndex, CGHBrowserModelAdaptor browserModel){
2 26 Feb 07 jari 49         this.browserModel = browserModel;
2 26 Feb 07 jari 50         this.experimentIndex = experimentIndex;
2 26 Feb 07 jari 51         this.chromosomeIndex = chromosomeIndex;
2 26 Feb 07 jari 52         initComponents();
2 26 Feb 07 jari 53         initCustomComponents();
2 26 Feb 07 jari 54     }
2 26 Feb 07 jari 55
2 26 Feb 07 jari 56     /** This method is called from within the constructor to
2 26 Feb 07 jari 57      * initialize the form.
2 26 Feb 07 jari 58      * WARNING: Do NOT modify this code. The content of this method is
2 26 Feb 07 jari 59      * always regenerated by the Form Editor.
2 26 Feb 07 jari 60      */
2 26 Feb 07 jari 61     private void initComponents() {//GEN-BEGIN:initComponents
2 26 Feb 07 jari 62         jSplitPane1 = new javax.swing.JSplitPane();
2 26 Feb 07 jari 63         chart = new CGHPaintableChart();
2 26 Feb 07 jari 64         jScrollPane1 = new javax.swing.JScrollPane();
2 26 Feb 07 jari 65         tblData = new javax.swing.JTable();
2 26 Feb 07 jari 66
2 26 Feb 07 jari 67         setLayout(new java.awt.BorderLayout());
2 26 Feb 07 jari 68
2 26 Feb 07 jari 69         jSplitPane1.setDividerLocation(400);
2 26 Feb 07 jari 70         jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
2 26 Feb 07 jari 71         chart.setBackground(java.awt.Color.white);
2 26 Feb 07 jari 72         chart.setXAxisAnnotationMethod(com.klg.jclass.chart.JCAxis.VALUE_LABELS);
2 26 Feb 07 jari 73         chart.setYAxisGridVisible(true);
2 26 Feb 07 jari 74         //chart.setYAxisMinMax("-1,3");
2 26 Feb 07 jari 75         chart.setYAxisMinMax("-4,4");
2 26 Feb 07 jari 76         jSplitPane1.setLeftComponent(chart);
2 26 Feb 07 jari 77
2 26 Feb 07 jari 78         tblData.setModel(new javax.swing.table.DefaultTableModel(
2 26 Feb 07 jari 79             new Object [][] {
2 26 Feb 07 jari 80                 {null, null, null, null},
2 26 Feb 07 jari 81                 {null, null, null, null},
2 26 Feb 07 jari 82                 {null, null, null, null},
2 26 Feb 07 jari 83                 {null, null, null, null}
2 26 Feb 07 jari 84             },
2 26 Feb 07 jari 85             new String [] {
2 26 Feb 07 jari 86                 "Title 1", "Title 2", "Title 3", "Title 4"
2 26 Feb 07 jari 87             }
2 26 Feb 07 jari 88         ));
2 26 Feb 07 jari 89         jScrollPane1.setViewportView(tblData);
2 26 Feb 07 jari 90
2 26 Feb 07 jari 91         jSplitPane1.setRightComponent(jScrollPane1);
2 26 Feb 07 jari 92
2 26 Feb 07 jari 93         add(jSplitPane1, java.awt.BorderLayout.CENTER);
2 26 Feb 07 jari 94
2 26 Feb 07 jari 95     }//GEN-END:initComponents
2 26 Feb 07 jari 96
2 26 Feb 07 jari 97     private void initCustomComponents(){
2 26 Feb 07 jari 98         //chartModel = new CGHChartDataModel(experimentSet, experimentIndex, chromosomeIndex);
2 26 Feb 07 jari 99         //tableModel = new CGHTableDataModel(experimentSet, experimentIndex, chromosomeIndex);
2 26 Feb 07 jari 100
2 26 Feb 07 jari 101         //chart.getDataView(0).setDataSource(chartModel);
2 26 Feb 07 jari 102         initTable();
2 26 Feb 07 jari 103         initChart();
2 26 Feb 07 jari 104     }
2 26 Feb 07 jari 105
2 26 Feb 07 jari 106
2 26 Feb 07 jari 107
2 26 Feb 07 jari 108     private void initChart(){
2 26 Feb 07 jari 109         setPointSize(3);
2 26 Feb 07 jari 110
2 26 Feb 07 jari 111         chart.setFont(new java.awt.Font("Dialog.bold", 1, 10));
2 26 Feb 07 jari 112         chart.getChartArea().getXAxis(0).setAnnotationRotation(JCAxis.ROTATE_270);
2 26 Feb 07 jari 113         chart.getDataView(0).getYAxis().getTitle().setRotation(ChartText.DEG_270);
2 26 Feb 07 jari 114         chart.getDataView(0).getYAxis().getTitle().setPlacement(JCLegend.WEST);
2 26 Feb 07 jari 115         chart.setTrigger(0, new EventTrigger(InputEvent.BUTTON1_MASK, EventTrigger.PICK));
2 26 Feb 07 jari 116         chart.setTrigger(1, new EventTrigger(InputEvent.SHIFT_MASK, EventTrigger.ZOOM));
2 26 Feb 07 jari 117         chart.setTrigger(2, new EventTrigger(InputEvent.CTRL_MASK, EventTrigger.TRANSLATE));
2 26 Feb 07 jari 118         chart.addPickListener(this);
2 26 Feb 07 jari 119
2 26 Feb 07 jari 120         chart.getDataView(0).getYAxis().setEditable(false);
2 26 Feb 07 jari 121     }
2 26 Feb 07 jari 122
2 26 Feb 07 jari 123     public void setPointSize(int size){
2 26 Feb 07 jari 124         java.util.List seriesList = chart.getDataView(0).getSeries();
2 26 Feb 07 jari 125         for (java.util.Iterator it = seriesList.iterator(); it.hasNext(); ) {
2 26 Feb 07 jari 126             ((ChartDataViewSeries)it.next()).getStyle().setSymbolSize(size);
2 26 Feb 07 jari 127         }
2 26 Feb 07 jari 128     }
2 26 Feb 07 jari 129
2 26 Feb 07 jari 130     private void initTable(){
2 26 Feb 07 jari 131         //tblData.setModel(tableModel);
2 26 Feb 07 jari 132         tblData.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
2 26 Feb 07 jari 133         ListSelectionModel rowSM = tblData.getSelectionModel();
2 26 Feb 07 jari 134         rowSM.addListSelectionListener(new ListSelectionListener() {
2 26 Feb 07 jari 135             public void valueChanged(ListSelectionEvent e) {
2 26 Feb 07 jari 136                 //Ignore extra messages.
2 26 Feb 07 jari 137                 if (e.getValueIsAdjusting()) return;
2 26 Feb 07 jari 138
2 26 Feb 07 jari 139                 ListSelectionModel lsm =
2 26 Feb 07 jari 140                 (ListSelectionModel)e.getSource();
2 26 Feb 07 jari 141                 if (lsm.isSelectionEmpty()) {
2 26 Feb 07 jari 142                 } else {
2 26 Feb 07 jari 143                     int selectedStartRow = lsm.getMinSelectionIndex();
2 26 Feb 07 jari 144                     int selectedStopRow = lsm.getMaxSelectionIndex();
2 26 Feb 07 jari 145
2 26 Feb 07 jari 146                     if(selectedStartRow == selectedStopRow){
2 26 Feb 07 jari 147                         highlightChartData(selectedStartRow);
2 26 Feb 07 jari 148                     }else{
2 26 Feb 07 jari 149                         highlightChartData(selectedStartRow - 1, selectedStopRow + 1);
2 26 Feb 07 jari 150                     }
2 26 Feb 07 jari 151                 }
2 26 Feb 07 jari 152             }
2 26 Feb 07 jari 153         });
2 26 Feb 07 jari 154
2 26 Feb 07 jari 155     }
2 26 Feb 07 jari 156
2 26 Feb 07 jari 157     public void highlightChartData(int dataIndex){
2 26 Feb 07 jari 158         ((CGHPaintableChart)chart).setSelectedCoordinates(dataIndex);
2 26 Feb 07 jari 159     }
2 26 Feb 07 jari 160
2 26 Feb 07 jari 161     public void highlightChartData(int startIndex, int stopIndex){
2 26 Feb 07 jari 162         if(startIndex < 0){
2 26 Feb 07 jari 163             startIndex = 0;
2 26 Feb 07 jari 164         }
2 26 Feb 07 jari 165
2 26 Feb 07 jari 166         if(stopIndex > chartModel.getSeriesSize() - 1){
2 26 Feb 07 jari 167             stopIndex = chartModel.getSeriesSize() - 1;
2 26 Feb 07 jari 168         }
2 26 Feb 07 jari 169         ((CGHPaintableChart)chart).setSelectedCoordinates(startIndex, stopIndex);
2 26 Feb 07 jari 170     }
2 26 Feb 07 jari 171
2 26 Feb 07 jari 172     public void deleteHighlightedRect(){
2 26 Feb 07 jari 173         this.selectedRegion = null;
2 26 Feb 07 jari 174         ((CGHPaintableChart)chart).deleteRect();
2 26 Feb 07 jari 175     }
2 26 Feb 07 jari 176
2 26 Feb 07 jari 177     public void smoothUnconfirmed(boolean smooth){
2 26 Feb 07 jari 178         chartModel.smoothUnconfirmed(smooth);
2 26 Feb 07 jari 179     }
2 26 Feb 07 jari 180
2 26 Feb 07 jari 181     public void setShowLegend(boolean show){
2 26 Feb 07 jari 182         chart.setLegendVisible(show);
2 26 Feb 07 jari 183     }
2 26 Feb 07 jari 184
2 26 Feb 07 jari 185     public void setChromosomeIndex(int chromaIndex){
2 26 Feb 07 jari 186         this.chromosomeIndex = chromaIndex;
2 26 Feb 07 jari 187         browserModel.setChromosomeIndex(chromaIndex);
2 26 Feb 07 jari 188         deleteHighlightedRect();
2 26 Feb 07 jari 189     }
2 26 Feb 07 jari 190
2 26 Feb 07 jari 191     public void setExperimentIndex(int expIndex){
2 26 Feb 07 jari 192       //Raktim
2 26 Feb 07 jari 193       //System.out.println("CGHChartPanel.setExperiment expIndex value: " + expIndex);
2 26 Feb 07 jari 194         this.experimentIndex = expIndex;
2 26 Feb 07 jari 195         browserModel.setExperimentIndex(expIndex);
2 26 Feb 07 jari 196         deleteHighlightedRect();
2 26 Feb 07 jari 197     }
2 26 Feb 07 jari 198
2 26 Feb 07 jari 199     public void setChartType(int chartType){
2 26 Feb 07 jari 200         chart.setChartType(chartType);
2 26 Feb 07 jari 201     }
2 26 Feb 07 jari 202
2 26 Feb 07 jari 203     public void setXAxisPositionsByLinearOrder(){
2 26 Feb 07 jari 204         chartModel.setXAxisPositions(CGHChartDataModel.LINEAR_ORDER );
2 26 Feb 07 jari 205         chart.repaint();
2 26 Feb 07 jari 206     }
2 26 Feb 07 jari 207
2 26 Feb 07 jari 208     public void setXAxisPositionsByChromLocation(){
2 26 Feb 07 jari 209         chartModel.setXAxisPositions(CGHChartDataModel.CHROM_LOCATION);
2 26 Feb 07 jari 210         chart.repaint();
2 26 Feb 07 jari 211     }
2 26 Feb 07 jari 212
2 26 Feb 07 jari 213     public void setXAxisLabelsByValue(){
2 26 Feb 07 jari 214         chart.setXAxisAnnotationMethod(JCAxis.VALUE);
2 26 Feb 07 jari 215     }
2 26 Feb 07 jari 216
2 26 Feb 07 jari 217     public void setXAxisLabelsByClone(){
2 26 Feb 07 jari 218         chart.setXAxisAnnotationMethod(JCAxis.POINT_LABELS);
2 26 Feb 07 jari 219
2 26 Feb 07 jari 220     }
2 26 Feb 07 jari 221
2 26 Feb 07 jari 222     public void setXAxisLabelsNone(){
2 26 Feb 07 jari 223         chart.setXAxisAnnotationMethod(JCAxis.VALUE_LABELS);
2 26 Feb 07 jari 224     }
2 26 Feb 07 jari 225
2 26 Feb 07 jari 226     private void updateSelection(){
2 26 Feb 07 jari 227         if(selectedRegion != null){
2 26 Feb 07 jari 228             setSelectedRegion(selectedRegion);
2 26 Feb 07 jari 229         }else{
2 26 Feb 07 jari 230             chart.repaint();
2 26 Feb 07 jari 231         }
2 26 Feb 07 jari 232     }
2 26 Feb 07 jari 233
2 26 Feb 07 jari 234     public void setChartDisplayRange(float min, float max){
2 26 Feb 07 jari 235         String range = min + "," + max;
2 26 Feb 07 jari 236         chart.setYAxisMinMax(range);
2 26 Feb 07 jari 237     }
2 26 Feb 07 jari 238
2 26 Feb 07 jari 239     public void pick(com.klg.jclass.chart.JCPickEvent jCPickEvent) {
2 26 Feb 07 jari 240         JCDataIndex di = jCPickEvent.getPickResult();
2 26 Feb 07 jari 241         if(di != null){
2 26 Feb 07 jari 242             int point = di.getPoint();
2 26 Feb 07 jari 243             int series = di.getSeriesIndex();
2 26 Feb 07 jari 244
2 26 Feb 07 jari 245             tblData.setRowSelectionInterval(point, point);
2 26 Feb 07 jari 246             tblData.scrollRectToVisible(tblData.getCellRect(point, 0, false));
2 26 Feb 07 jari 247         }
2 26 Feb 07 jari 248     }
2 26 Feb 07 jari 249
2 26 Feb 07 jari 250
2 26 Feb 07 jari 251     public void setSelectedRegion(ICGHDataRegion selectedRegion){
2 26 Feb 07 jari 252         this.selectedRegion = selectedRegion;
2 26 Feb 07 jari 253         if(selectedRegion instanceof CGHClone){
2 26 Feb 07 jari 254             setSelectedClone( (CGHClone)selectedRegion);
2 26 Feb 07 jari 255         }else if(selectedRegion instanceof FlankingRegion){
2 26 Feb 07 jari 256             setSelectedFlankingRegion( (FlankingRegion)selectedRegion);
2 26 Feb 07 jari 257         }
2 26 Feb 07 jari 258     }
2 26 Feb 07 jari 259
2 26 Feb 07 jari 260     public void setSelectedClone(CGHClone selectedClone){
2 26 Feb 07 jari 261
2 26 Feb 07 jari 262         int selectionIndex = chartModel.getCloneIndex(selectedClone);
2 26 Feb 07 jari 263         tblData.setRowSelectionInterval(selectionIndex, selectionIndex);
2 26 Feb 07 jari 264         tblData.scrollRectToVisible(tblData.getCellRect(selectionIndex, 0, false));
2 26 Feb 07 jari 265     }
2 26 Feb 07 jari 266
2 26 Feb 07 jari 267     public void setSelectedFlankingRegion(FlankingRegion selectedFlankingRegion){
2 26 Feb 07 jari 268         //Plus and minus one a bit convoluted
2 26 Feb 07 jari 269
2 26 Feb 07 jari 270         //int startCloneIndex = data.getClones().indexOf(selectedFlankingRegion.getStartClone() ) + 1;
2 26 Feb 07 jari 271         //int stopCloneIndex = data.getClones().indexOf(selectedFlankingRegion.getStopClone() ) - 1;
2 26 Feb 07 jari 272
2 26 Feb 07 jari 273         //int startIndex = chartModel.getIndexOf(relativeStartIndex);
2 26 Feb 07 jari 274         //int stopIndex = chartModel.getIndexOf(relativeStopIndex);
2 26 Feb 07 jari 275
2 26 Feb 07 jari 276         //int startIndex = chartModel.getCloneIndex(selectedFlankingRegion.getStartClone()) + 1;
2 26 Feb 07 jari 277         //int stopIndex = chartModel.getCloneIndex(selectedFlankingRegion.getStopClone()) - 1;
2 26 Feb 07 jari 278         CGHClone startClone = selectedFlankingRegion.getStartClone();
2 26 Feb 07 jari 279         if(startClone == null){
2 26 Feb 07 jari 280             startClone = chartModel.getCloneByPosition(selectedFlankingRegion.getStart());
2 26 Feb 07 jari 281         }
2 26 Feb 07 jari 282
2 26 Feb 07 jari 283         CGHClone stopClone = selectedFlankingRegion.getStopClone();
2 26 Feb 07 jari 284         if(stopClone == null){
2 26 Feb 07 jari 285             stopClone = chartModel.getCloneByPosition(selectedFlankingRegion.getStop());
2 26 Feb 07 jari 286         }
2 26 Feb 07 jari 287
2 26 Feb 07 jari 288         if(startClone == null || stopClone == null){
2 26 Feb 07 jari 289             return;
2 26 Feb 07 jari 290         }
2 26 Feb 07 jari 291
2 26 Feb 07 jari 292         int startIndex = chartModel.getStartCloneIndex(startClone);
2 26 Feb 07 jari 293         int stopIndex = chartModel.getStopCloneIndex(stopClone);
2 26 Feb 07 jari 294
2 26 Feb 07 jari 295         tblData.setRowSelectionInterval(startIndex, stopIndex);
2 26 Feb 07 jari 296         tblData.scrollRectToVisible(tblData.getCellRect(startIndex, 0, false));
2 26 Feb 07 jari 297     }
2 26 Feb 07 jari 298
2 26 Feb 07 jari 299
2 26 Feb 07 jari 300
2 26 Feb 07 jari 301     /** Getter for property chartModel.
2 26 Feb 07 jari 302      * @return Value of property chartModel.
2 26 Feb 07 jari 303      */
2 26 Feb 07 jari 304     public CGHChartDataModel getChartModel() {
2 26 Feb 07 jari 305         return chartModel;
2 26 Feb 07 jari 306     }
2 26 Feb 07 jari 307
2 26 Feb 07 jari 308     /** Setter for property chartModel.
2 26 Feb 07 jari 309      * @param chartModel New value of property chartModel.
2 26 Feb 07 jari 310      */
2 26 Feb 07 jari 311     public void setChartModel(CGHChartDataModel chartModel) {
2 26 Feb 07 jari 312         this.chartModel = chartModel;
2 26 Feb 07 jari 313         chart.getDataView(0).setDataSource(chartModel);
2 26 Feb 07 jari 314     }
2 26 Feb 07 jari 315
2 26 Feb 07 jari 316     /** Getter for property tableModel.
2 26 Feb 07 jari 317      * @return Value of property tableModel.
2 26 Feb 07 jari 318      */
2 26 Feb 07 jari 319     public CGHTableDataModel getTableModel() {
2 26 Feb 07 jari 320         return tableModel;
2 26 Feb 07 jari 321     }
2 26 Feb 07 jari 322
2 26 Feb 07 jari 323     /** Setter for property tableModel.
2 26 Feb 07 jari 324      * @param tableModel New value of property tableModel.
2 26 Feb 07 jari 325      */
2 26 Feb 07 jari 326     public void setTableModel(CGHTableDataModel tableModel) {
2 26 Feb 07 jari 327         this.tableModel = tableModel;
2 26 Feb 07 jari 328         tblData.setModel(tableModel);
2 26 Feb 07 jari 329     }
2 26 Feb 07 jari 330
2 26 Feb 07 jari 331     public void setCloneValuesByPScore(){
2 26 Feb 07 jari 332         int startRow = tblData.getSelectionModel().getMinSelectionIndex();
2 26 Feb 07 jari 333         int stopRow = tblData.getSelectionModel().getMaxSelectionIndex();
2 26 Feb 07 jari 334         browserModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_P_SCORE);
2 26 Feb 07 jari 335
2 26 Feb 07 jari 336         //System.out.println("set start " + startRow + " stop " + stopRow);
2 26 Feb 07 jari 337         tblData.setRowSelectionInterval(startRow, stopRow);
2 26 Feb 07 jari 338         //chartModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_P_SCORE);
2 26 Feb 07 jari 339         //tableModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_P_SCORE);
2 26 Feb 07 jari 340         //chart.setYAxisMinMax("0,1.5");
2 26 Feb 07 jari 341     }
2 26 Feb 07 jari 342
2 26 Feb 07 jari 343     public void setCloneValuesByDyeSwap(){
2 26 Feb 07 jari 344         int startRow = tblData.getSelectionModel().getMinSelectionIndex();
2 26 Feb 07 jari 345         int stopRow = tblData.getSelectionModel().getMaxSelectionIndex();
2 26 Feb 07 jari 346         browserModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_DYE_SWAP);
2 26 Feb 07 jari 347         tblData.setRowSelectionInterval(startRow, stopRow);
2 26 Feb 07 jari 348         //chartModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_DYE_SWAP);
2 26 Feb 07 jari 349         //tableModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_DYE_SWAP);
2 26 Feb 07 jari 350         //chart.setYAxisMinMax("-1,3");
2 26 Feb 07 jari 351     }
2 26 Feb 07 jari 352
2 26 Feb 07 jari 353     public void setCloneValuesByLogAverageInverted(){
2 26 Feb 07 jari 354         int startRow = tblData.getSelectionModel().getMinSelectionIndex();
2 26 Feb 07 jari 355         int stopRow = tblData.getSelectionModel().getMaxSelectionIndex();
2 26 Feb 07 jari 356         browserModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_LOG_AVERAGE_INVERTED);
2 26 Feb 07 jari 357         tblData.setRowSelectionInterval(startRow, stopRow);
2 26 Feb 07 jari 358         //chartModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_LOG_AVERAGE_INVERTED);
2 26 Feb 07 jari 359         //tableModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_LOG_AVERAGE_INVERTED);
2 26 Feb 07 jari 360     }
2 26 Feb 07 jari 361
2 26 Feb 07 jari 362     public void setCloneValuesByLogDyeSwap(){
2 26 Feb 07 jari 363         int startRow = tblData.getSelectionModel().getMinSelectionIndex();
2 26 Feb 07 jari 364         int stopRow = tblData.getSelectionModel().getMaxSelectionIndex();
2 26 Feb 07 jari 365
2 26 Feb 07 jari 366         browserModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_LOG_DYE_SWAP);
2 26 Feb 07 jari 367
2 26 Feb 07 jari 368         tblData.setRowSelectionInterval(startRow, stopRow);
2 26 Feb 07 jari 369
2 26 Feb 07 jari 370         //chartModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_LOG_DYE_SWAP);
2 26 Feb 07 jari 371         //tableModel.setCloneValueType(CGHBrowserModelAdaptor.CLONE_VALUES_LOG_DYE_SWAP);
2 26 Feb 07 jari 372     }
2 26 Feb 07 jari 373
2 26 Feb 07 jari 374     /** Getter for property chart.
2 26 Feb 07 jari 375      * @return Value of property chart.
2 26 Feb 07 jari 376      */
2 26 Feb 07 jari 377     public com.klg.jclass.chart.beans.SimpleChart getChart() {
2 26 Feb 07 jari 378         return chart;
2 26 Feb 07 jari 379     }
2 26 Feb 07 jari 380
2 26 Feb 07 jari 381     /** Setter for property chart.
2 26 Feb 07 jari 382      * @param chart New value of property chart.
2 26 Feb 07 jari 383      */
2 26 Feb 07 jari 384     public void setChart(com.klg.jclass.chart.beans.SimpleChart chart) {
2 26 Feb 07 jari 385         this.chart = chart;
2 26 Feb 07 jari 386     }
2 26 Feb 07 jari 387
2 26 Feb 07 jari 388     /** Getter for property tblData.
2 26 Feb 07 jari 389      * @return Value of property tblData.
2 26 Feb 07 jari 390      */
2 26 Feb 07 jari 391     public javax.swing.JTable getTblData() {
2 26 Feb 07 jari 392         return tblData;
2 26 Feb 07 jari 393     }
2 26 Feb 07 jari 394
2 26 Feb 07 jari 395     /** Setter for property tblData.
2 26 Feb 07 jari 396      * @param tblData New value of property tblData.
2 26 Feb 07 jari 397      */
2 26 Feb 07 jari 398     public void setTblData(javax.swing.JTable tblData) {
2 26 Feb 07 jari 399         this.tblData = tblData;
2 26 Feb 07 jari 400     }
2 26 Feb 07 jari 401
2 26 Feb 07 jari 402     // Variables declaration - do not modify//GEN-BEGIN:variables
2 26 Feb 07 jari 403     private javax.swing.JScrollPane jScrollPane1;
2 26 Feb 07 jari 404     private com.klg.jclass.chart.beans.SimpleChart chart;
2 26 Feb 07 jari 405     private javax.swing.JSplitPane jSplitPane1;
2 26 Feb 07 jari 406     private javax.swing.JTable tblData;
2 26 Feb 07 jari 407     // End of variables declaration//GEN-END:variables
2 26 Feb 07 jari 408
2 26 Feb 07 jari 409 }