private XYPlot createTaskAssignmentPlot(TangoColorFactory tangoColorFactory, CheapTimeSolution solution) { OHLCSeriesCollection seriesCollection = new OHLCSeriesCollection(); Map<Machine, OHLCSeries> machineSeriesMap = new LinkedHashMap<>( solution.getMachineList().size()); renderer.setTickLength(0.0); int seriesIndex = 0; OHLCSeries unassignedProjectSeries = new OHLCSeries("Unassigned"); seriesCollection.addSeries(unassignedProjectSeries); machineSeriesMap.put(null, unassignedProjectSeries); renderer.setSeriesStroke(seriesIndex, new BasicStroke(3.0f)); seriesIndex++; for (Machine machine : solution.getMachineList()) { OHLCSeries machineSeries = new OHLCSeries(machine.getLabel()); seriesCollection.addSeries(machineSeries); machineSeriesMap.put(machine, machineSeries); renderer.setSeriesStroke(seriesIndex, new BasicStroke(3.0f)); machineSeries.add(new FixedMillisecond(pixelIndex), task.getStartPeriodRangeFrom(), startPeriod, endPeriod, task.getStartPeriodRangeTo() + task.getDuration()); pixelIndex++;
/** * Returns the time period for the specified item. * * @param index the item index. * * @return The time period. */ public RegularTimePeriod getPeriod(int index) { OHLCItem item = (OHLCItem) getDataItem(index); return item.getPeriod(); }
/** * Returns the x-value for an item within a series. * * @param series the series index. * @param item the item index. * * @return The x-value. */ public double getXValue(int series, int item) { OHLCSeries s = (OHLCSeries) this.data.get(series); OHLCItem di = (OHLCItem) s.getDataItem(item); RegularTimePeriod period = di.getPeriod(); return getX(period); }
/** * Returns the number of items in the specified series. * * @param series the series (zero-based index). * * @return The item count. * * @throws IllegalArgumentException if <code>series</code> is not in the * range <code>0</code> to <code>getSeriesCount() - 1</code>. */ public int getItemCount(int series) { // defer argument checking return getSeries(series).getItemCount(); }
/** * Returns the y-value. * * @return The y-value. */ public double getYValue() { return getCloseValue(); }
/** * Creates a new instance of <code>OHLCItem</code>. * * @param period the time period. * @param open the open-value. * @param high the high-value. * @param low the low-value. * @param close the close-value. */ public OHLCItem(RegularTimePeriod period, double open, double high, double low, double close) { super(period, new OHLC(open, high, low, close)); }
/** * Returns the period. * * @return The period (never {@code null}). */ public RegularTimePeriod getPeriod() { return (RegularTimePeriod) getComparable(); }
/** * Returns the x-value for an item within a series. * * @param series the series index. * @param item the item index. * * @return The x-value. */ @Override public double getXValue(int series, int item) { OHLCSeries s = (OHLCSeries) this.data.get(series); OHLCItem di = (OHLCItem) s.getDataItem(item); RegularTimePeriod period = di.getPeriod(); return getX(period); }
/** * Returns the time period for the specified item. * * @param index the item index. * * @return The time period. */ public RegularTimePeriod getPeriod(int index) { OHLCItem item = (OHLCItem) getDataItem(index); return item.getPeriod(); }
/** * Returns the number of items in the specified series. * * @param series the series (zero-based index). * * @return The item count. * * @throws IllegalArgumentException if {@code series} is not in the * range {@code 0} to {@code getSeriesCount() - 1}. */ @Override public int getItemCount(int series) { // defer argument checking return getSeries(series).getItemCount(); }
/** * Returns the y-value. * * @return The y-value. */ public double getYValue() { return getCloseValue(); }
/** * Creates a new instance of {@code OHLCItem}. * * @param period the time period. * @param open the open-value. * @param high the high-value. * @param low the low-value. * @param close the close-value. */ public OHLCItem(RegularTimePeriod period, double open, double high, double low, double close) { super(period, new OHLC(open, high, low, close)); }