~ubuntu-branches/ubuntu/precise/triplea/precise

« back to all changes in this revision

Viewing changes to src/games/strategy/triplea/image/FlagIconImageFactory.java

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2011-11-11 21:40:11 UTC
  • Revision ID: package-import@ubuntu.com-20111111214011-sehf2rwat36o2xqf
Tags: upstream-1.3.2.2
ImportĀ upstreamĀ versionĀ 1.3.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This program is free software; you can redistribute it and/or modify
 
3
 * it under the terms of the GNU General Public License as published by
 
4
 * the Free Software Foundation; either version 2 of the License, or
 
5
 * (at your option) any later version.
 
6
 * This program is distributed in the hope that it will be useful,
 
7
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
8
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
9
 * GNU General Public License for more details.
 
10
 * You should have received a copy of the GNU General Public License
 
11
 * along with this program; if not, write to the Free Software
 
12
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
13
 */
 
14
 
 
15
/*
 
16
 * FlagIconImageFactory.java
 
17
 *
 
18
 * Created on November 26, 2001, 8:27 PM
 
19
 */
 
20
 
 
21
package games.strategy.triplea.image;
 
22
 
 
23
import games.strategy.engine.data.PlayerID;
 
24
 
 
25
import java.awt.Image;
 
26
 
 
27
/**
 
28
 * 
 
29
 * @author Sean Bridges
 
30
 * @version 1.0
 
31
 */
 
32
public class FlagIconImageFactory extends ImageFactory
 
33
{
 
34
 
 
35
    public static final int FLAG_ICON_WIDTH = 30;
 
36
    public static final int FLAG_ICON_HEIGHT = 15;
 
37
    public static final int SMALL_FLAG_ICON_WIDTH = 12;
 
38
    public static final int SMALL_FLAG_ICON_HEIGHT = 7;
 
39
 
 
40
 
 
41
    private final String PREFIX = "flags/";
 
42
    
 
43
    /** Creates new IconImageFactory */
 
44
    public FlagIconImageFactory()
 
45
    {
 
46
    }
 
47
 
 
48
    public Image getFlag(PlayerID id)
 
49
    {
 
50
        String key = PREFIX + id.getName() + ".gif";
 
51
        String key2 = PREFIX + id.getName() + ".png";
 
52
        
 
53
        return getImage(key, key2, true);
 
54
    }
 
55
 
 
56
  
 
57
    public Image getSmallFlag(PlayerID id)
 
58
    {
 
59
        String key = PREFIX + id.getName() + "_small.gif";
 
60
        String key2 = PREFIX + id.getName() + "_small.png";
 
61
        return getImage(key, key2, true);
 
62
    }
 
63
 
 
64
    public Image getLargeFlag(PlayerID id)
 
65
    {
 
66
        String key = PREFIX + id.getName() +  "_large.png";
 
67
        return getImage(key, true);
 
68
    }
 
69
 
 
70
    public Image getFadedFlag(PlayerID id)
 
71
    {
 
72
        String key = PREFIX + id.getName() +  "_fade.gif";
 
73
        String key2 = PREFIX + id.getName() +  "_fade.png";
 
74
        return getImage(key, key2, true);
 
75
    }
 
76
 
 
77
    public Image getConvoyFlag(PlayerID id)
 
78
    {
 
79
        String key = PREFIX + id.getName() +  "_convoy.gif";
 
80
        String key2 = PREFIX + id.getName() +  "_convoy.png";
 
81
        return getImage(key, key2, true);
 
82
    }
 
83
 
 
84
    
 
85
}
 
 
b'\\ No newline at end of file'