org.jfree.chart.needle.ShipNeedle Java Examples

The following examples show how to use org.jfree.chart.needle.ShipNeedle. 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: ShipNeedleTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that the equals() method can distinguish all fields.
 */
public void testEquals() {
   ShipNeedle n1 = new ShipNeedle();
   ShipNeedle n2 = new ShipNeedle();
   assertTrue(n1.equals(n2));
   assertTrue(n2.equals(n1));
}
 
Example #2
Source File: ShipNeedleTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that the equals() method can distinguish all fields.
 */
public void testEquals() {
   ShipNeedle n1 = new ShipNeedle();
   ShipNeedle n2 = new ShipNeedle();
   assertTrue(n1.equals(n2));
   assertTrue(n2.equals(n1));
}
 
Example #3
Source File: CompassPlot.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #4
Source File: CompassPlot.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #5
Source File: CompassPlot.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #6
Source File: CompassPlot.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #7
Source File: CompassPlot.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #8
Source File: CompassPlot.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 * 
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #9
Source File: CompassPlot.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 * 
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #10
Source File: CompassPlot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}
 
Example #11
Source File: CompassPlot.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Sets the needle for a series.  The needle type is one of the following:
 * <ul>
 * <li>0 = {@link ArrowNeedle};</li>
 * <li>1 = {@link LineNeedle};</li>
 * <li>2 = {@link LongNeedle};</li>
 * <li>3 = {@link PinNeedle};</li>
 * <li>4 = {@link PlumNeedle};</li>
 * <li>5 = {@link PointerNeedle};</li>
 * <li>6 = {@link ShipNeedle};</li>
 * <li>7 = {@link WindNeedle};</li>
 * <li>8 = {@link ArrowNeedle};</li>
 * <li>9 = {@link MiddlePinNeedle};</li>
 * </ul>
 * @param index  the series index.
 * @param type  the needle type.
 *
 * @see #setSeriesNeedle(int)
 */
public void setSeriesNeedle(int index, int type) {
    switch (type) {
        case 0:
            setSeriesNeedle(index, new ArrowNeedle(true));
            setSeriesPaint(index, Color.red);
            this.seriesNeedle[index].setHighlightPaint(Color.white);
            break;
        case 1:
            setSeriesNeedle(index, new LineNeedle());
            break;
        case 2:
            MeterNeedle longNeedle = new LongNeedle();
            longNeedle.setRotateY(0.5);
            setSeriesNeedle(index, longNeedle);
            break;
        case 3:
            setSeriesNeedle(index, new PinNeedle());
            break;
        case 4:
            setSeriesNeedle(index, new PlumNeedle());
            break;
        case 5:
            setSeriesNeedle(index, new PointerNeedle());
            break;
        case 6:
            setSeriesPaint(index, null);
            setSeriesOutlineStroke(index, new BasicStroke(3));
            setSeriesNeedle(index, new ShipNeedle());
            break;
        case 7:
            setSeriesPaint(index, Color.blue);
            setSeriesNeedle(index, new WindNeedle());
            break;
        case 8:
            setSeriesNeedle(index, new ArrowNeedle(true));
            break;
        case 9:
            setSeriesNeedle(index, new MiddlePinNeedle());
            break;

        default:
            throw new IllegalArgumentException("Unrecognised type.");
    }

}