org.jpedal.parser.shape.J Maven / Gradle / Ivy
/*
* ===========================================
* 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@
*
* ---------------
* J.java
* ---------------
*/
package org.jpedal.parser.shape;
import java.awt.BasicStroke;
import org.jpedal.objects.GraphicsState;
public class J {
public static void execute(final boolean isLowerCase, final int value, final GraphicsState gs) {
int style = 0;
if (isLowerCase) {
//map join style
if (value == 0) {
style = BasicStroke.JOIN_MITER;
}
if (value == 1) {
style = BasicStroke.JOIN_ROUND;
}
if (value == 2) {
style = BasicStroke.JOIN_BEVEL;
}
//set value
gs.setJoinStyle(style);
} else {
//map cap style
if (value == 0) {
style = BasicStroke.CAP_BUTT;
}
if (value == 1) {
style = BasicStroke.CAP_ROUND;
}
if (value == 2) {
style = BasicStroke.CAP_SQUARE;
}
//set value
gs.setCapStyle(style);
}
}
}