4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sourceforge.mikutoga.pmd;
13 public class ShadeInfo {
15 private ToonMap toonMap = new ToonMap();
18 private String textureFileName = null;
19 private String spheremapFileName = null;
33 public void setToonMap(ToonMap map){
42 public ToonMap getToonMap(){
48 * @param idx トゥーンインデックス
50 public void setToonIndex(int idx){
59 public int getToonIndex(){
64 * トゥーンインデックス値が有効か判定する。
65 * 現時点では0から9までの値を有効とする。
68 public boolean isValidToonIndex(){
69 if(0 <= this.toonIdx && this.toonIdx <= 9) return true;
76 * @throws IllegalStateException トゥーンマップが設定されていない。
78 public String getToonFileName() throws IllegalStateException{
79 if(this.toonMap == null) throw new IllegalStateException();
80 String result = this.toonMap.getIndexedToon(this.toonIdx);
86 * @param fileName テクスチャファイル名
88 public void setTextureFileName(String fileName){
89 this.textureFileName = fileName;
97 public String getTextureFileName(){
98 return this.textureFileName;
103 * @param fileName スフィアマップファイル名
105 public void setSpheremapFileName(String fileName){
106 this.spheremapFileName = fileName;
112 * @return スフィアマップファイル名
114 public String getSpheremapFileName(){
115 return this.spheremapFileName;
120 * @return {@inheritDoc}
123 public String toString(){
124 StringBuilder result = new StringBuilder();
126 result.append("toon(")
127 .append(this.toonIdx)
129 .append(getToonFileName())
131 result.append("texture=")
132 .append(this.textureFileName)
134 result.append("sphere=")
135 .append(this.spheremapFileName);
137 return result.toString();