4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sfjp.mikutoga.pmd.model;
13 public class ShadeInfo {
15 private ToonMap toonMap = new ToonMap();
18 private String textureFileName = null;
19 private String spheremapFileName = null;
35 public void setToonMap(ToonMap map){
44 public ToonMap getToonMap(){
50 * @param idx トゥーンインデックス
52 public void setToonIndex(int idx){
61 public int getToonIndex(){
66 * トゥーンインデックス値が有効か判定する。
67 * 現時点では0から9までの値を有効とする。
70 public boolean isValidToonIndex(){
72 result = (0 <= this.toonIdx)
73 && (this.toonIdx < ToonMap.MAX_CUSTOM_TOON);
80 * @throws IllegalStateException トゥーンマップが設定されていない。
82 public String getToonFileName() throws IllegalStateException{
83 if(this.toonMap == null) throw new IllegalStateException();
84 String result = this.toonMap.getIndexedToon(this.toonIdx);
90 * @param fileName テクスチャファイル名
92 public void setTextureFileName(String fileName){
93 this.textureFileName = fileName;
101 public String getTextureFileName(){
102 return this.textureFileName;
107 * @param fileName スフィアマップファイル名
109 public void setSpheremapFileName(String fileName){
110 this.spheremapFileName = fileName;
116 * @return スフィアマップファイル名
118 public String getSpheremapFileName(){
119 return this.spheremapFileName;
124 * @return {@inheritDoc}
127 public String toString(){
128 StringBuilder result = new StringBuilder();
130 result.append("toon(")
131 .append(this.toonIdx)
133 .append(getToonFileName())
135 result.append("texture=")
136 .append(this.textureFileName)
138 result.append("sphere=")
139 .append(this.spheremapFileName);
141 return result.toString();