Examples of PaintMap


Examples of org.jfree.chart.PaintMap

    /** The base outline stroke (fallback). */
    private transient Stroke baseOutlineStroke;

    public StandardDiscItemRenderer() {
        this.discPaintMap = new PaintMap();
        this.baseDiscPaint = Color.gray;
        this.labelPaintMap = new PaintMap();
        this.labelPadding = 5;
        this.minLabelChars = 4;
        this.outlinePaintMap = new PaintMap();
        this.baseOutlinePaint = null;
        this.outlineStrokeMap = new StrokeMap();
        this.baseOutlineStroke = Plot.DEFAULT_OUTLINE_STROKE;
    }
View Full Code Here

Examples of org.jfree.chart.PaintMap

    private StrokeMap strokeMap;

    public RangeXYItemRenderer() {
        super();
        this.line = new Line2D.Double(0.0, 0.0, 0.0, 0.0);
        this.paintMap = new PaintMap();
        this.strokeMap = new StrokeMap();
    }
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * Some checks for the getPaint() method.
     */
    public void testGetPaint() {
        PaintMap m1 = new PaintMap();
        assertEquals(null, m1.getPaint("A"));
        m1.put("A", Color.red);
        assertEquals(Color.red, m1.getPaint("A"));
        m1.put("A", null);
        assertEquals(null, m1.getPaint("A"));

        // a null key should throw an IllegalArgumentException
        boolean pass = false;
        try {
            m1.getPaint(null);
        }
        catch (IllegalArgumentException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * Some checks for the put() method.
     */
    public void testPut() {
        PaintMap m1 = new PaintMap();
        m1.put("A", Color.red);
        assertEquals(Color.red, m1.getPaint("A"));

        // a null key should throw an IllegalArgumentException
        boolean pass = false;
        try {
            m1.put(null, Color.blue);
        }
        catch (IllegalArgumentException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * Some checks for the equals() method.
     */
    public void testEquals() {
        PaintMap m1 = new PaintMap();
        PaintMap m2 = new PaintMap();
        assertTrue(m1.equals(m1));
        assertTrue(m1.equals(m2));
        assertFalse(m1.equals(null));
        assertFalse(m1.equals("ABC"));

        m1.put("K1", Color.red);
        assertFalse(m1.equals(m2));
        m2.put("K1", Color.red);
        assertTrue(m1.equals(m2));

        m1.put("K2", new GradientPaint(1.0f, 2.0f, Color.green, 3.0f, 4.0f,
                Color.yellow));
        assertFalse(m1.equals(m2));
        m2.put("K2", new GradientPaint(1.0f, 2.0f, Color.green, 3.0f, 4.0f,
                Color.yellow));
        assertTrue(m1.equals(m2));

        m1.put("K2", null);
        assertFalse(m1.equals(m2));
        m2.put("K2", null);
        assertTrue(m1.equals(m2));
    }
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * Some checks for cloning.
     */
    public void testCloning() {
        PaintMap m1 = new PaintMap();
        PaintMap m2 = null;
        try {
            m2 = (PaintMap) m1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * A check for serialization.
     */
    public void testSerialization1() {
        PaintMap m1 = new PaintMap();
        PaintMap m2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * A check for serialization.
     */
    public void testSerialization2() {
        PaintMap m1 = new PaintMap();
        m1.put("K1", Color.red);
        m1.put("K2", new GradientPaint(1.0f, 2.0f, Color.green, 3.0f, 4.0f,
                Color.yellow));
        PaintMap m2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(m1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.PaintMap

     * This test covers a bug reported in the forum:
     *
     * http://www.jfree.org/phpBB2/viewtopic.php?t=19980
     */
    public void testKeysOfDifferentClasses() {
        PaintMap m = new PaintMap();
        m.put("ABC", Color.red);
        m.put(new Integer(99), Color.blue);
        assertEquals(Color.blue, m.getPaint(new Integer(99)));
    }
View Full Code Here

Examples of org.jfree.chart.PaintMap

    /**
     * Some checks for the getPaint() method.
     */
    public void testGetPaint() {
        PaintMap m1 = new PaintMap();
        assertEquals(null, m1.getPaint("A"));
        m1.put("A", Color.red);
        assertEquals(Color.red, m1.getPaint("A"));
        m1.put("A", null);
        assertEquals(null, m1.getPaint("A"));

        // a null key should throw an IllegalArgumentException
        boolean pass = false;
        try {
            m1.getPaint(null);
        }
        catch (IllegalArgumentException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.