@Override public void drawChart(List<Frame> data, List<JointType> types, boolean seatedMode) { String chartTitle = ""; for (JointType type : types) { MotionSeriesComponent sc = new MotionSeriesComponent(dataset); add(sc); sc.setLabels(type); // drawing chart drawMotionChart(sc, data, type); chartTitle += type.getName() + " "; } chart.setTitle(chartTitle); }
private void drawMotionChart(MotionSeriesComponent sc, List<Frame> data, JointType type) { // Processing motions List<JointType> types = new ArrayList<JointType>(); types.add(type); MotionProcessor processor = new MotionProcessor(); processor.setTypes(types); for (Frame frame : data) { if (processor.process(frame)) { sc.updateSeries(processor.getTrajectoryMass(), frame.getTimestamp()); } } }