001/* 002 * flattr4j - A Java library for Flattr 003 * 004 * Copyright (C) 2011 Richard "Shred" Körber 005 * http://flattr4j.shredzone.org 006 * 007 * This program is free software: you can redistribute it and/or modify 008 * it under the terms of the GNU General Public License / GNU Lesser 009 * General Public License as published by the Free Software Foundation, 010 * either version 3 of the License, or (at your option) any later version. 011 * 012 * Licensed under the Apache License, Version 2.0 (the "License"); 013 * you may not use this file except in compliance with the License. 014 * 015 * This program is distributed in the hope that it will be useful, 016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 018 */ 019package org.shredzone.flattr4j.web; 020 021/** 022 * Enumeration of static Flattr badges that can be used. 023 * 024 * @author Richard "Shred" Körber 025 */ 026public enum BadgeType { 027 028 /** 029 * A static badge with default size (93 x 20) 030 */ 031 DEFAULT(93, 20, "http://api.flattr.com/button/flattr-badge-large.png"), 032 033 /** 034 * A static badge with small size (16 x 16) 035 */ 036 SMALL(16, 16, "http://api.flattr.com/button/flattr-badge-small.png"); 037 038 private final int width; 039 private final int height; 040 private final String url; 041 042 /** 043 * Creates an enumeration object. 044 */ 045 private BadgeType(int width, int height, String url) { 046 this.width = width; 047 this.height = height; 048 this.url = url; 049 } 050 051 /** 052 * Image width of the badge. 053 */ 054 public int getWidth() { 055 return width; 056 } 057 058 /** 059 * Image height of the badge. 060 */ 061 public int getHeight() { 062 return height; 063 } 064 065 /** 066 * Gets the URL of a static badge image. 067 */ 068 public String getUrl() { 069 return url; 070 } 071 072}