org.jpedal.objects.acroforms.creation.DashBorder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of OpenViewerFX Show documentation
Show all versions of OpenViewerFX Show documentation
Open Source (LGPL) JavaFX PDF Viewer for NetBeans plugin
/*
* ===========================================
* 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();
}
}