List of usage examples for org.jfree.chart.axis NumberAxis equals
@Override public boolean equals(Object obj)
From source file:org.cds06.speleograph.data.fileio.SpeleoFileWriter.java
private Integer writeHeaders(List<Series> series, Integer[][] columns) { ArrayList<NumberAxis> axes = new ArrayList<>(); for (Series s : series) { NumberAxis axis = s.getAxis(); if (axes.contains(axis)) continue; axes.add(axis);/*from w w w . j a v a 2s. c om*/ int id = axes.indexOf(axis); boolean typeAxis = axis.equals(s.getType().getAxis()); try { write("axis", Integer.toString(id), '"' + axis.getLabel() + '"', DecimalFormat.getInstance().format(axis.getLowerBound()), DecimalFormat.getInstance().format(axis.getUpperBound()), "type:" + (typeAxis ? "1" : "0")); } catch (Exception e) { log.error("Can not write axis to file", e); } } write("date", "", Integer.toString(allocatedColumns), "d/M/y H:m:s"); allocatedColumns++; for (Series s : series) { String[] seriesDescriptor = { Integer.toString(allocatedColumns), s.getType().getName(), s.getType().getUnit() }; if (s.isMinMax()) { seriesDescriptor = ArrayUtils.add(seriesDescriptor, "min-max:1"); // NON-NLS seriesDescriptor = ArrayUtils.add(seriesDescriptor, "min:" + Integer.toString(allocatedColumns)); // NON-NLS seriesDescriptor = ArrayUtils.add(seriesDescriptor, "max:" + Integer.toString(allocatedColumns + 1)); // NON-NLS columns[series.indexOf(s)] = new Integer[] { allocatedColumns, allocatedColumns + 1 }; allocatedColumns++; allocatedColumns++; } else { columns[series.indexOf(s)] = new Integer[] { allocatedColumns }; allocatedColumns++; } if (s.isShow()) seriesDescriptor = ArrayUtils.add(seriesDescriptor, "show:1"); // NON-NLS if (s.getColor() != null) seriesDescriptor = ArrayUtils.add(seriesDescriptor, "color:" + s.getColor().getRGB()); // NON-NLS if (s.isMinMax()) seriesDescriptor = ArrayUtils.add(seriesDescriptor, "stepped:1"); // NON-NLS if (s.getStyle() != null) { seriesDescriptor = ArrayUtils.add(seriesDescriptor, "style:" + s.getStyle().toString()); // NON-NLS } if (s.isNameHumanSet()) { seriesDescriptor = ArrayUtils.add(seriesDescriptor, "name:" + s.getName()); // NON-NLS } seriesDescriptor = ArrayUtils.add(seriesDescriptor, "axis:" + axes.indexOf(s.getAxis())); write(seriesDescriptor); } return allocatedColumns; }