Examples of XYDataPoint


Examples of com.arjuna.ats.tools.perfgraph.graphbean.XYDataPoint

        _maxX = Double.MIN_VALUE;
        _maxY = Double.MIN_VALUE;

        for (int count=0;count<_points.size();count++)
        {
            XYDataPoint p = (XYDataPoint)_points.get(count);

            _minX = (p.getX() < _minX) ? p.getX() : _minX;
            _maxX = (p.getX() > _maxX) ? p.getX() : _maxX;
            _minY = (p.getY() < _minY) ? p.getY() : _minY;
            _maxY = (p.getY() > _maxY) ? p.getY() : _maxY;
        }
    }
View Full Code Here

Examples of com.arjuna.ats.tools.perfgraph.graphbean.XYDataPoint

        for (int count=0;count<_dataSeries.size();count++)
        {
            XYDataSeries dataSeries = ((XYDataSeries)_dataSeries.elementAt(count));
            XYDataPoint[] points = dataSeries.getDataSeries();
            XYDataPoint previous = null;

      if ( _visibleSeries.contains(dataSeries) )
      {
        if (dataSeries.getBeginAtOrigin())
        {
          previous = new XYDataPoint(_minX,_minY);
        }
        else
        {
          if (points.length!=0)
          {
            previous = points[0];
          }
          else
          {
            previous = new XYDataPoint(_minX, _minY);
          }
        }

        g.setColor(dataSeries.getSeriesColour());

        for (int pCount=0;pCount<points.length;pCount++)
        {
          int xPosition = (int)graphRect.getX() + (int)( ( points[pCount].getX() - _minX ) * scaleX );
          int xPreviousPosition = (int)graphRect.getX() + (int)( ( previous.getX() - _minX ) * scaleX );
          int yPosition = ( (int)graphRect.getY() + (int)graphRect.getHeight() ) - (int)( (points[pCount].getY() - _minY) * scaleY );
          int yPreviousPosition = ( (int)graphRect.getY() + (int)graphRect.getHeight() ) - (int)( (previous.getY() - _minY) * scaleY );
          g.drawLine( xPreviousPosition, yPreviousPosition, xPosition, yPosition );

          previous = points[pCount];
        }
      }
View Full Code Here

Examples of no.uib.jsparklines.data.XYDataPoint

                                        sortPValues(pValues, indexes);

                                        ((ValueAndBooleanDataPoint) ((DefaultTableModel) goMappingsTable.getModel()).getValueAt(
                                                indexes.get(0), goMappingsTable.getColumn("Log2 Diff").getModelIndex())).setSignificant(
                                                        pValues.get(0) < significanceLevel);
                                        ((DefaultTableModel) goMappingsTable.getModel()).setValueAt(new XYDataPoint(pValues.get(0), pValues.get(0)), indexes.get(0),
                                                goMappingsTable.getColumn("p-value").getModelIndex());

                                        if (pValues.get(0) < significanceLevel) {
                                            significantCounter++;
                                        }

                                        for (int i = 1; i < pValues.size(); i++) {

                                            if (progressDialog.isRunCanceled()) {
                                                break;
                                            }

                                            double tempPvalue = pValues.get(i) * pValues.size() / (pValues.size() - i);

                                            // have to check if the correction results in a p-value bigger than 1
                                            if (tempPvalue > 1) {
                                                tempPvalue = 1;
                                            }

                                            ((ValueAndBooleanDataPoint) ((DefaultTableModel) goMappingsTable.getModel()).getValueAt(
                                                    indexes.get(i), goMappingsTable.getColumn("Log2 Diff").getModelIndex())).setSignificant(tempPvalue < significanceLevel);
                                            ((DefaultTableModel) goMappingsTable.getModel()).setValueAt(new XYDataPoint(tempPvalue, tempPvalue), indexes.get(i),
                                                    goMappingsTable.getColumn("p-value").getModelIndex());

                                            if (tempPvalue < significanceLevel) {
                                                significantCounter++;
                                            }
View Full Code Here

Examples of no.uib.jsparklines.data.XYDataPoint

                // @TODO: the code below does not pick up domain information, but rather shows multiple hits for chain. could perhaps be improved?
                // add the chain information to the table
                for (int j = 0; j < chains.length; j++) {

                    XYDataPoint temp = new XYDataPoint(chains[j].getStartProtein(), chains[j].getEndProtein());

                    if (chains[j].getStartProtein() != chains[j].getEndProtein()) {
                        ((DefaultTableModel) pdbChainsJTable.getModel()).addRow(new Object[]{
                            (j + 1),
                            chains[j].getBlock(),
                            temp,
                            (((double) chains[j].getEndProtein() - chains[j].getStartProtein()) / proteinSequenceLength) * 100
                        });
                    }
                }

                ((JSparklinesIntervalChartTableCellRenderer) pdbChainsJTable.getColumn("PDB-Protein").getCellRenderer()).setMaxValue(proteinSequenceLength);

                if (pdbChainsJTable.getRowCount() > 0) {
                    ((TitledBorder) pdbChainsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PDB Chains (" + pdbChainsJTable.getRowCount() + ")"
                            + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
                } else {
                    ((TitledBorder) pdbChainsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PDB Chains"
                            + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
                }

                pdbChainsPanel.repaint();

                if (pdbChainsJTable.getRowCount() > 0) {
                    pdbChainsJTable.setRowSelectionInterval(0, 0);
                    pdbChainsJTable.scrollRectToVisible(pdbChainsJTable.getCellRect(0, 0, false));
                    pdbChainsJTableMouseReleased(null);
                }
            } else {
                ((TitledBorder) pdbChainsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PDB Chains"
                        + PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING);
                pdbChainsPanel.repaint();
            }

            // give the power back to the user ;)
            this.setEnabled(true);
        } else {

            // open protein link in web browser
            if (pdbMatchesJTable.getSelectedColumn() == pdbMatchesJTable.getColumn("PDB").getModelIndex() && evt.getButton() == MouseEvent.BUTTON1
                    && ((String) pdbMatchesJTable.getValueAt(pdbMatchesJTable.getSelectedRow(), pdbMatchesJTable.getSelectedColumn())).lastIndexOf("<html>") != -1) {

                String temp = currentlyDisplayedPdbFile.substring(currentlyDisplayedPdbFile.indexOf("\"") + 1);
                currentlyDisplayedPdbFile = temp.substring(0, temp.indexOf("\""));

                this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
                BareBonesBrowserLaunch.openURL(currentlyDisplayedPdbFile);
                this.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            }
View Full Code Here

Examples of no.uib.jsparklines.data.XYDataPoint

                            writer.write("\tChain\tPDB-Start\tPDB-End\tCoverage" + System.getProperty("line.separator"));

                            for (int i = 0; i < pdbChainsJTable.getRowCount(); i++) {
                                writer.write(pdbChainsJTable.getValueAt(i, 0) + "\t");
                                writer.write(pdbChainsJTable.getValueAt(i, 1) + "\t");
                                XYDataPoint pdbCoverage = (XYDataPoint) pdbChainsJTable.getValueAt(i, 2);
                                writer.write(pdbCoverage.getX() + "\t" + pdbCoverage.getY() + "\t");
                                writer.write(pdbChainsJTable.getValueAt(i, 3) + System.getProperty("line.separator"));
                            }

                            JOptionPane.showMessageDialog(peptideShakerGUI, "Data copied to file:\n" + selectedFile.getPath(), "Data Exported.", JOptionPane.INFORMATION_MESSAGE);
                        } else if (tableIndex == TableIndex.PDB_MATCHES) {
View Full Code Here

Examples of no.uib.jsparklines.data.XYDataPoint

            String filePath = spectrumFileNameMap.get((String) fractionTable.getValueAt(i, fractionTable.getColumn("Fraction").getModelIndex()));
            spectrumFiles.add(filePath);

            Double lower = (Double) fractionTable.getValueAt(i, fractionTable.getColumn("Lower Range (kDa)").getModelIndex());
            Double upper = (Double) fractionTable.getValueAt(i, fractionTable.getColumn("Upper Range (kDa)").getModelIndex());
            fractionRanges.put(filePath, new XYDataPoint(lower, upper));
        }

        peptideShakerGUI.setUpdated(PeptideShakerGUI.PROTEIN_FRACTIONS_TAB_INDEX, false);

        if (peptideShakerGUI.getSelectedTab() == PeptideShakerGUI.PROTEIN_FRACTIONS_TAB_INDEX) {
View Full Code Here

Examples of no.uib.jsparklines.data.XYDataPoint

                BufferedReader br = new BufferedReader(r);
                String line = br.readLine();

                while (line != null) {
                    String[] values = line.split("\\t");
                    lowerAndUpper.add(new XYDataPoint(new Double(values[0]), new Double(values[1])));
                    line = br.readLine();
                }

                br.close();
                r.close();
View Full Code Here

Examples of org.jsflot.xydata.XYDataPoint

    @Ignore
    public void test_that_XYDataCollection_returns_correct_json() throws JSONException {
        XYDataSetCollection xyCollection = new XYDataSetCollection();
        XYDataList xyList = new XYDataList();
        xyList.setLabel("Set1");
        xyList.addDataPoint(new XYDataPoint(1, 1));
        xyList.addDataPoint(new XYDataPoint(2, 2));
        xyList.addDataPoint(new XYDataPoint(3, 3));
        xyList.addDataPoint(new XYDataPoint(5, 5));
        xyCollection.addDataList(xyList);

        StringBuilder expected = new StringBuilder();
        expected.append("{\"chart\": [ {\"label\": \"Set1\", \"data\": [[1,1], [2,2], [3,3], [5,5]]}],\"instrumentationNode\":\"chartId\"}");
        String jsonString = BuildJsonObjectsUtil.generateChartData("chartId", "something", xyCollection, 0l);
View Full Code Here

Examples of org.jsflot.xydata.XYDataPoint

        dataArraySB.append("{\"chart_model\": {\"id\": \"" + chartId + "\", \"chart_value\": \"[ ");
        int collectionIndex = 0;
        for (XYDataList list : xyCollection.getDataList()) {
            dataArraySB.append("{\\\"key\\\": \\\"").append(list.getLabel().replaceAll("\\%20", " ")).append("\\\", \\\"values\\\": [");
            for (int i = 0; i < list.size() - 1; i++) {
                XYDataPoint p = list.get(i);
                String pointLabel = "";
                if (p.getPointLabel() != null) {
                    pointLabel = ", '" + p.getPointLabel() + "'";
                }

                String yVal = null;
                if (p.getY() != null) {
                    yVal = nf.format(p.getY());
                }

                dataArraySB.append("[").append(nf.format(p.getX().longValue() + chartOffsetMs)).append(",").append(yVal).append("").append(pointLabel).append("]").append(", ");
            }

            // Last Row
            if (list.size() > 0) {
                XYDataPoint p = list.get(list.size() - 1);
                String pointLabel = "";
                if (p.getPointLabel() != null) {
                    pointLabel = ", '" + p.getPointLabel() + "'";
                }

                String yVal = null;
                if (p.getY() != null) {
                    yVal = nf.format(p.getY());
                }

                dataArraySB.append("[").append(nf.format(p.getX().longValue() + chartOffsetMs)).append(",").append(yVal).append(pointLabel).append("]");
            }

            collectionIndex++;
            dataArraySB.append("]");
            /*if (list.getColor() != null && list.getColor().length() >= 6) {
View Full Code Here

Examples of org.jsflot.xydata.XYDataPoint

        Long currentMillis = millisStart;

        //Iterate over the time-range given and average ticks based on resolution
        while (currentMillis <= (millisEnd - (resolution * 1000))) {
            XYDataPoint currentTick = new XYDataPoint();
            currentTick.setX(currentMillis);
            currentTick.setY(null);
            double aggregatedValue = 0.0d;
            double averageValue = 0.0d;
            ValueType valueType = null;

            int numStatsInCurrentTick = 0;

            for (int i = 0; i < numTicksInResolution; i++) {
                LiveStatistics currStat = liveHash.get(currentMillis);
                if (currStat == null || currStat.getValue() == null) {
                    //No stat for this timeperiod, skipping
                } else {
                    if (valueType == null) {
                        valueType = ValueType.fromValue(currStat.getValueType());
                    }
                    //Add to current
                    aggregatedValue += currStat.getValue();
                    numStatsInCurrentTick++;
                }

                currentMillis += 15000;
            }

            if (numStatsInCurrentTick > 0) {
                //If value type is aggregate, return the aggregate value
                if (ValueType.AGGREGATE.equals(valueType)) {
                    currentTick.setY(aggregatedValue);
                } else {
                    //Otherwise return the average
                    currentTick.setY(aggregatedValue / numStatsInCurrentTick);
                }
            }

            valueList.addDataPoint(currentTick);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.