All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jpedal.objects.acroforms.creation.DashBorder Maven / Gradle / Ivy

There is a newer version: 7.15.25
Show newest version
/*
 * ===========================================
 * Java Pdf Extraction Decoding Access Library
 * ===========================================
 *
 * Project Info:  http://www.idrsolutions.com
 * Help section for developers at http://www.idrsolutions.com/support/
 *
 * (C) Copyright 1997-2017 IDRsolutions and Contributors.
 *
 * This file is part of JPedal/JPDF2HTML5
 *
 @LICENSE@
 *
 * ---------------
 * DashBorder.java
 * ---------------
 */
package org.jpedal.objects.acroforms.creation;

import java.awt.*;
import javax.swing.border.LineBorder;

class DashBorder extends LineBorder {

    //make getters and setters for stroke as exercise
    Stroke stroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1, new float[]{5, 5}, 10);

    DashBorder(final Stroke stroke, final Color borderColor) {

        super(borderColor);
        this.stroke = stroke;
    }

    @Override
    public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
        final Graphics2D g2d = (Graphics2D) g.create();
        g2d.setStroke(stroke);

        super.paintBorder(c, g2d, x, y, width, height);
        g2d.dispose();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy