* @param elem 要素\r
* @param attrName 属性名\r
* @return 文字列\r
- * @throw TogaXmlException 属性値が見つからなかった。\r
+ * @throws TogaXmlException 属性値が見つからなかった。\r
*/\r
private static String getStringAttr(Element elem, String attrName)\r
throws TogaXmlException{\r
* @param elem 要素\r
* @param attrName 属性名\r
* @return 真ならtrue\r
- * @throw TogaXmlException 属性値が見つからなかった。\r
+ * @throws TogaXmlException 属性値が見つからなかった。\r
*/\r
private static boolean getBooleanAttr(Element elem, String attrName)\r
throws TogaXmlException{\r
* @param elem 要素\r
* @param attrName 属性名\r
* @return int値\r
- * @throw TogaXmlException 属性値が見つからなかった。\r
+ * @throws TogaXmlException 属性値が見つからなかった。\r
*/\r
private static int getIntegerAttr(Element elem, String attrName)\r
throws TogaXmlException{\r
* @param elem 要素\r
* @param attrName 属性名\r
* @return float値\r
- * @throw TogaXmlException 属性値が見つからなかった。\r
+ * @throws TogaXmlException 属性値が見つからなかった。\r
*/\r
private static float getFloatAttr(Element elem, String attrName)\r
throws TogaXmlException{\r
* @param elem 要素\r
* @param attrName 属性名\r
* @return ファイル名\r
- * @throw TogaXmlException 属性値が見つからなかった。\r
+ * @throws TogaXmlException 属性値が見つからなかった。\r
*/\r
private static String getSjisFileNameAttr(Element elem, String attrName)\r
throws TogaXmlException{\r
* @param parent 親要素\r
* @param tagName 子要素名\r
* @return 子要素\r
- * @throw TogaXmlException 1つも見つからなかった\r
+ * @throws TogaXmlException 1つも見つからなかった\r
*/\r
private static Element getChild(Element parent, String tagName)\r
throws TogaXmlException{\r
return DomUtils.getEachChild(parent, childTag);\r
}\r
\r
+ /**\r
+ * グローバル名を取得する。\r
+ * 元要素のname属性及びi18nNameタグを持つ子要素が検索対象\r
+ * @param parent 元要素\r
+ * @return グローバル名。なければnull\r
+ */\r
private static String getGlobalName(Element parent){\r
NodeList nodeList = parent.getElementsByTagName("i18nName");\r
int length = nodeList.getLength();\r
return result.toString();\r
}\r
\r
+ /**\r
+ * 多言語名を取得する。\r
+ * @param baseElement 元要素\r
+ * @param text 多言語名\r
+ * @throws TogaXmlException あるべき属性が存在しない。\r
+ */\r
private static void buildI18nName(Element baseElement, I18nText text)\r
throws TogaXmlException{\r
String primaryText;\r
return;\r
}\r
\r
+ /**\r
+ * XMLのパースを開始する。\r
+ * @param source XML入力\r
+ * @return モデルデータ\r
+ * @throws SAXException 構文エラー\r
+ * @throws IOException 入力エラー\r
+ * @throws TogaXmlException 構文エラー\r
+ */\r
public PmdModel parse(InputSource source)\r
throws SAXException, IOException, TogaXmlException{\r
Document document = this.builder.parse(source);\r
for(Element surfaceGroupElem :\r
eachChild(surfaceGroupListElem, "surfaceGroup") ){\r
\r
- String groupId = getStringAttr(surfaceGroupElem, "surfaceGroupId");\r
+ String groupId =\r
+ getStringAttr(surfaceGroupElem, "surfaceGroupId");\r
List<Surface> surfaceList = buildSurface(surfaceGroupElem);\r
\r
this.surfaceGroupMap.put(groupId, surfaceList);\r
ikChainList.add(ikChain);\r
\r
String ikBoneIdRef = getStringAttr(ikChainElem, "ikBoneIdRef");\r
- int rucursiveDepth = getIntegerAttr(ikChainElem, "recursiveDepth");\r
+ int rucursiveDepth =\r
+ getIntegerAttr(ikChainElem, "recursiveDepth");\r
float weight = getFloatAttr(ikChainElem, "weight");\r
\r
BoneInfo ikBone = this.boneMap.get(ikBoneIdRef);\r
MorphType morphType = MorphType.valueOf(type);\r
morphPart.setMorphType(morphType);\r
\r
- List<MorphVertex> morphVertexList = morphPart.getMorphVertexList();\r
+ List<MorphVertex> morphVertexList =\r
+ morphPart.getMorphVertexList();\r
\r
- for(Element morphVertexElem : eachChild(morphElem, "morphVertex")){\r
+ for(Element morphVertexElem\r
+ : eachChild(morphElem, "morphVertex")){\r
String vtxIdRef = getStringAttr(morphVertexElem, "vtxIdRef");\r
Vertex baseVertex = this.vertexMap.get(vtxIdRef);\r
float xOff = getFloatAttr(morphVertexElem, "xOff");\r
BoneGroup defaultGroup = new BoneGroup();\r
boneGroupList.add(defaultGroup);\r
\r
- for(Element boneGroupElem : eachChild(boneGroupListElem, "boneGroup")){\r
+ for(Element boneGroupElem\r
+ : eachChild(boneGroupListElem, "boneGroup")){\r
BoneGroup group = new BoneGroup();\r
boneGroupList.add(group);\r
\r
I18nText name = group.getGroupName();\r
buildI18nName(boneGroupElem, name);\r
\r
- for(Element boneGroupMemberElem : eachChild(boneGroupElem, "boneGroupMember")){\r
- String boneIdRef = getStringAttr(boneGroupMemberElem, "boneIdRef");\r
+ for(Element boneGroupMemberElem\r
+ : eachChild(boneGroupElem, "boneGroupMember")){\r
+ String boneIdRef =\r
+ getStringAttr(boneGroupMemberElem, "boneIdRef");\r
BoneInfo bone = this.boneMap.get(boneIdRef);\r
group.getBoneList().add(bone);\r
}\r
\r
Element dynamicsElem = getChild(rigidElem, "dynamics");\r
float mass = getFloatAttr(dynamicsElem, "mass");\r
- float dampingPosition = getFloatAttr(dynamicsElem, "dampingPosition");\r
- float dampingRotation = getFloatAttr(dynamicsElem, "dampingRotation");\r
+ float dampingPosition =\r
+ getFloatAttr(dynamicsElem, "dampingPosition");\r
+ float dampingRotation =\r
+ getFloatAttr(dynamicsElem, "dampingRotation");\r
float restitution = getFloatAttr(dynamicsElem, "restitution");\r
float friction = getFloatAttr(dynamicsElem, "friction");\r
DynamicsInfo dynamics = rigid.getDynamicsInfo();\r
\r
List<RigidGroup> groupList = this.model.getRigidGroupList();\r
\r
- for(Element rigidGroupElem : eachChild(rigidGroupListElem, "rigidGroup")){\r
+ for(Element rigidGroupElem\r
+ : eachChild(rigidGroupListElem, "rigidGroup")){\r
RigidGroup rigidGroup = new RigidGroup();\r
groupList.add(rigidGroup);\r
\r
- String rigidGroupId = getStringAttr(rigidGroupElem, "rigidGroupId");\r
+ String rigidGroupId =\r
+ getStringAttr(rigidGroupElem, "rigidGroupId");\r
this.rigidGroupMap.put(rigidGroupId, rigidGroup);\r
\r
- for(Element memberElem : eachChild(rigidGroupElem, "rigidGroupMember")){\r
+ for(Element memberElem\r
+ : eachChild(rigidGroupElem, "rigidGroupMember")){\r
String rigidIdRef = getStringAttr(memberElem, "rigidIdRef");\r
RigidInfo rigid = this.rigidMap.get(rigidIdRef);\r
rigidGroup.getRigidList().add(rigid);\r
int serialNum = 0;\r
for(Element rigidElem : eachChild(rigidListElem, "rigid")){\r
RigidInfo rigid = rigidList.get(serialNum++);\r
- for(Element groupElem : eachChild(rigidElem, "throughRigidGroup")){\r
+ for(Element groupElem\r
+ : eachChild(rigidElem, "throughRigidGroup")){\r
String groupId = getStringAttr(groupElem, "rigidGroupIdRef");\r
RigidGroup group = this.rigidGroupMap.get(groupId);\r
rigid.getThroughGroupColl().add(group);\r
limitRotation.setZRange(zFrom, zTo);\r
\r
Pos3d elasticPosition = joint.getElasticPosition();\r
- Element elasticPositionElem = getChild(jointElem, "elasticPosition");\r
+ Element elasticPositionElem =\r
+ getChild(jointElem, "elasticPosition");\r
xVal = getFloatAttr(elasticPositionElem, "x");\r
yVal = getFloatAttr(elasticPositionElem, "y");\r
zVal = getFloatAttr(elasticPositionElem, "z");\r
elasticPosition.setZPos(zVal);\r
\r
Deg3d elasticRotation = joint.getElasticRotation();\r
- Element elasticRotationElem = getChild(jointElem, "elasticRotation");\r
+ Element elasticRotationElem =\r
+ getChild(jointElem, "elasticRotation");\r
xVal = getFloatAttr(elasticRotationElem, "xDeg");\r
yVal = getFloatAttr(elasticRotationElem, "yDeg");\r
zVal = getFloatAttr(elasticRotationElem, "zDeg");\r