org.jfree.data.general.Series Java Examples

The following examples show how to use org.jfree.data.general.Series. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TimeSeriesCollection.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.17
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #2
Source File: XYSeriesCollection.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.14
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #3
Source File: TimeSeriesCollection.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.17
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #4
Source File: XYSeriesCollection.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.14
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #5
Source File: TimeSeriesCollection.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.17
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #6
Source File: XYSeriesCollection.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.14
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #7
Source File: TimeSeriesCollection.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.17
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #8
Source File: XYSeriesCollection.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.14
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #9
Source File: TimeSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.17
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #10
Source File: XYSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.14
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #11
Source File: TimeSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.17
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #12
Source File: XYSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Receives notification that the key for one of the series in the 
 * collection has changed, and vetos it if the key is already present in 
 * the collection.
 * 
 * @param e  the event.
 * 
 * @since 1.0.14
 */
@Override
public void vetoableChange(PropertyChangeEvent e)
        throws PropertyVetoException {
    // if it is not the series name, then we have no interest
    if (!"Key".equals(e.getPropertyName())) {
        return;
    }
    
    // to be defensive, let's check that the source series does in fact
    // belong to this collection
    Series s = (Series) e.getSource();
    if (getSeriesIndex(s.getKey()) == -1) {
        throw new IllegalStateException("Receiving events from a series " +
                "that does not belong to this collection.");
    }
    // check if the new series name already exists for another series
    Comparable key = (Comparable) e.getNewValue();
    if (getSeriesIndex(key) >= 0) {
        throw new PropertyVetoException("Duplicate key2", e);
    }
}
 
Example #13
Source File: XYChartBuilder.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Applies {@link #strongCircleShape} and {@link #strongStroke} if set to all series entries.
 * @param renderer
 * @param visibleInLegend
 * @param series
 * @return
 */
public XYChartBuilder setStrongStyle(final XYItemRenderer renderer, final boolean visibleInLegend, final Series... series)
{
  if (series == null || series.length == 0) {
    return this;
  }
  for (int i = 0; i < series.length; i++) {
    renderer.setSeriesShape(i, strongCircleShape);
  }
  for (int i = 0; i < series.length; i++) {
    renderer.setSeriesStroke(i, strongStroke);
    renderer.setSeriesVisibleInLegend(i, visibleInLegend);
  }
  return this;
}
 
Example #14
Source File: XYChartBuilder.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Applies {@link #strongCircleShape} and {@link #strongStroke} if set to all series entries.
 * @param renderer
 * @param visibleInLegend
 * @param series
 * @return
 */
public XYChartBuilder setNormalStyle(final XYItemRenderer renderer, final boolean visibleInLegend, final Series... series)
{
  if (series == null || series.length == 0) {
    return this;
  }
  for (int i = 0; i < series.length; i++) {
    renderer.setSeriesShape(i, circleShape);
  }
  for (int i = 0; i < series.length; i++) {
    renderer.setSeriesStroke(i, stroke);
    renderer.setSeriesVisibleInLegend(i, visibleInLegend);
  }
  return this;
}