com.pdfjet.RadioButton Maven / Gradle / Ivy
/* */ package com.pdfjet;
/* */
/* */ public class RadioButton
/* */ implements Drawable
/* */ {
/* 39 */ private boolean selected = false;
/* */ private float x;
/* */ private float y;
/* */ private float r1;
/* */ private float r2;
/* */ private float penWidth;
/* 45 */ private Font font = null;
/* 46 */ private String label = "";
/* 47 */ private String uri = null;
/* */
/* 49 */ private String language = null;
/* 50 */ private String altDescription = " ";
/* 51 */ private String actualText = " ";
/* */
/* */ public RadioButton(Font paramFont, String paramString)
/* */ {
/* 59 */ this.font = paramFont;
/* 60 */ this.label = paramString;
/* */ }
/* */
/* */ public RadioButton setFontSize(float paramFloat)
/* */ {
/* 71 */ this.font.setSize(paramFloat);
/* 72 */ return this;
/* */ }
/* */
/* */ public RadioButton setPosition(float paramFloat1, float paramFloat2)
/* */ {
/* 84 */ return setLocation(paramFloat1, paramFloat2);
/* */ }
/* */
/* */ public RadioButton setLocation(float paramFloat1, float paramFloat2)
/* */ {
/* 96 */ this.x = paramFloat1;
/* 97 */ this.y = paramFloat2;
/* 98 */ return this;
/* */ }
/* */
/* */ public RadioButton setURIAction(String paramString)
/* */ {
/* 109 */ this.uri = paramString;
/* 110 */ return this;
/* */ }
/* */
/* */ public RadioButton select(boolean paramBoolean)
/* */ {
/* 121 */ this.selected = paramBoolean;
/* 122 */ return this;
/* */ }
/* */
/* */ public RadioButton setAltDescription(String paramString)
/* */ {
/* 133 */ this.altDescription = paramString;
/* 134 */ return this;
/* */ }
/* */
/* */ public RadioButton setActualText(String paramString)
/* */ {
/* 145 */ this.actualText = paramString;
/* 146 */ return this;
/* */ }
/* */
/* */ public float[] drawOn(Page paramPage)
/* */ throws Exception
/* */ {
/* 158 */ paramPage.addBMC("Span", this.language, this.altDescription, this.actualText);
/* */
/* 160 */ this.r1 = (this.font.getAscent() / 2.0F);
/* 161 */ this.r2 = (this.r1 / 2.0F);
/* 162 */ this.penWidth = (this.r1 / 10.0F);
/* */
/* 164 */ float f = this.y - this.font.getAscent();
/* 165 */ paramPage.setPenWidth(1.0F);
/* 166 */ paramPage.setPenColor(0);
/* 167 */ paramPage.setLinePattern("[] 0");
/* 168 */ paramPage.setBrushColor(0);
/* 169 */ paramPage.drawCircle(this.x + this.r1, f + this.r1, this.r1);
/* */
/* 171 */ if (this.selected) {
/* 172 */ paramPage.drawCircle(this.x + this.r1, f + this.r1, this.r2, Operation.FILL);
/* */ }
/* */
/* 175 */ if (this.uri != null) {
/* 176 */ paramPage.setBrushColor(255);
/* */ }
/* 178 */ paramPage.drawString(this.font, this.label, this.x + 3.0F * this.r1, this.y);
/* 179 */ paramPage.setPenWidth(0.0F);
/* 180 */ paramPage.setBrushColor(0);
/* */
/* 182 */ paramPage.addEMC();
/* */
/* 184 */ if (this.uri != null)
/* */ {
/* 186 */ paramPage.addAnnotation(new Annotation(this.uri, null, this.x + 3.0F * this.r1, paramPage.height - this.y, this.x + 3.0F * this.r1 + this.font.stringWidth(this.label), paramPage.height - (this.y - this.font.getAscent()), this.language, this.altDescription, this.actualText));
/* */ }
/* */
/* 198 */ return new float[] { this.x + 6.0F * this.r1 + this.font.stringWidth(this.label), this.y + this.font.getDescent() };
/* */ }
/* */ }
/* Location: E:\EGGWIFI\Customer\trunk\src\Workspace\Customer\Customer Maven Webapp\src\main\webapp\WEB-INF\lib\PDFjet.jar
* Qualified Name: com.pdfjet.RadioButton
* JD-Core Version: 0.6.2
*/