* 通し番号0のボーングループは、
* 暗黙に用意される「デフォルトボーングループ」とする。
*/
-public class BoneGroup implements SerialNumbered , Iterable<BoneInfo> {
+public class BoneGroup implements SerialNumbered, Iterable<BoneInfo> {
private final I18nText groupName = new I18nText();
- private final List<BoneInfo> boneList = new ArrayList<BoneInfo>();
+ private final List<BoneInfo> boneList = new ArrayList<>();
private int serialNo = -1;
private int ikDepth;
private float ikWeight;
- private final List<BoneInfo> chainList = new ArrayList<BoneInfo>();
+ private final List<BoneInfo> chainList = new ArrayList<>();
/**
private boolean edgeAppearance = true;
- private final List<Surface> surfaceList = new ArrayList<Surface>();
+ private final List<Surface> surfaceList = new ArrayList<>();
/**
private MorphType type;
private final List<MorphVertex> morphVertexList =
- new ArrayList<MorphVertex>();
+ new ArrayList<>();
private int morphSerialNo = -1;
private final I18nText modelName = new I18nText();
private final I18nText description = new I18nText();
- private final List<Vertex> vertexList = new ArrayList<Vertex>();
- private final List<Surface> surfaceList = new ArrayList<Surface>();
- private final List<Material> materialList = new LinkedList<Material>();
+ private final List<Vertex> vertexList = new ArrayList<>();
+ private final List<Surface> surfaceList = new ArrayList<>();
+ private final List<Material> materialList = new LinkedList<>();
- private final List<BoneInfo> boneList = new ArrayList<BoneInfo>();
- private final List<BoneGroup> boneGroupList = new ArrayList<BoneGroup>();
+ private final List<BoneInfo> boneList = new ArrayList<>();
+ private final List<BoneGroup> boneGroupList = new ArrayList<>();
- private final List<IKChain> ikChainList = new ArrayList<IKChain>();
+ private final List<IKChain> ikChainList = new ArrayList<>();
private final Map<MorphType, List<MorphPart>> morphMap =
- new EnumMap<MorphType, List<MorphPart>>(MorphType.class);
+ new EnumMap<>(MorphType.class);
- private final List<RigidInfo> rigidList = new ArrayList<RigidInfo>();
+ private final List<RigidInfo> rigidList = new ArrayList<>();
private final List<RigidGroup> rigidGroupList =
- new ArrayList<RigidGroup>();
+ new ArrayList<>();
- private final List<JointInfo> jointList = new ArrayList<JointInfo>();
+ private final List<JointInfo> jointList = new ArrayList<>();
private ToonMap toonMap = new ToonMap();
assert this.vertexList instanceof RandomAccess;
assert this.surfaceList instanceof RandomAccess;
- this.morphMap.put(MorphType.EYEBROW, new ArrayList<MorphPart>());
- this.morphMap.put(MorphType.EYE, new ArrayList<MorphPart>());
- this.morphMap.put(MorphType.LIP, new ArrayList<MorphPart>());
- this.morphMap.put(MorphType.EXTRA, new ArrayList<MorphPart>());
+ this.morphMap.put(MorphType.EYEBROW, new ArrayList<>());
+ this.morphMap.put(MorphType.EYE, new ArrayList<>());
+ this.morphMap.put(MorphType.LIP, new ArrayList<>());
+ this.morphMap.put(MorphType.EXTRA, new ArrayList<>());
return;
}
* @return モーフ頂点リスト
*/
private List<MorphVertex> getAllMorphVertexList(){
- List<MorphVertex> allList = new ArrayList<MorphVertex>();
+ List<MorphVertex> allList = new ArrayList<>();
for(MorphType type : this.morphMap.keySet()){
if(type.isBase()) continue;
*/
private List<MorphVertex> getUniqueMorphVertexList(
List<MorphVertex> allList ){
- List<MorphVertex> result = new ArrayList<MorphVertex>();
+ List<MorphVertex> result = new ArrayList<>();
- Set<Vertex> mergedVertexSet = new HashSet<Vertex>();
+ Set<Vertex> mergedVertexSet = new HashSet<>();
for(MorphVertex morphVertex : allList){
Vertex vertex = morphVertex.getBaseVertex();
ListUtil.assignIndexedSerial(result);
Map<Vertex, MorphVertex> numberedMap =
- new HashMap<Vertex, MorphVertex>();
+ new HashMap<>();
for(MorphVertex morphVertex : result){
Vertex vertex = morphVertex.getBaseVertex();
numberedMap.put(vertex, morphVertex);
* @return トリミングされた面リスト
*/
private List<Surface> trimmingSurfaceList(){
- Set<Surface> materialedSurfaceSet = new HashSet<Surface>();
+ Set<Surface> materialedSurfaceSet = new HashSet<>();
for(Material material : this.materialList){
if(material == null) continue;
for(Surface surface : material){
materialedSurfaceSet.removeAll(this.surfaceList);
- List<Surface> result = new ArrayList<Surface>();
+ List<Surface> result = new ArrayList<>();
for(Surface surface : this.surfaceList){
if(surface == null) continue;
result.add(surface);
* @return トリミングされた頂点リスト
*/
private List<Vertex> trimmingVertexList(){
- Set<Vertex> surfacedVertexSet = new HashSet<Vertex>();
+ Set<Vertex> surfacedVertexSet = new HashSet<>();
for(Surface surface : this.surfaceList){
if(surface == null) continue;
for(Vertex vertex : surface){
surfacedVertexSet.removeAll(this.vertexList);
- List<Vertex> result = new ArrayList<Vertex>();
+ List<Vertex> result = new ArrayList<>();
for(Vertex vertex : this.vertexList){
if(vertex == null) continue;
result.add(vertex);
public static final int MAX_RIGID_GROUP = 16;
- private final List<RigidInfo> rigidList = new ArrayList<RigidInfo>();
+ private final List<RigidInfo> rigidList = new ArrayList<>();
private int rigidGroupSerialNo = -1;
private final DynamicsInfo dynamicsInfo = new DynamicsInfo();
private final Collection<RigidGroup> throughGroupColl =
- new ArrayList<RigidGroup>();
+ new ArrayList<>();
private RigidGroup rigidGroup;
public interface SerialNumbered {
/** 昇順での比較子。 */
- Comparator<SerialNumbered> COMPARATOR = new SerialComparator();
+ public static final Comparator<SerialNumbered> COMPARATOR =
+ new SerialComparator();
/**
* 通し番号を設定する。
+ *
* @param num 通し番号
*/
- void setSerialNumber(int num);
+ public abstract void setSerialNumber(int num);
/**
* 通し番号を返す。
+ *
* @return 通し番号
*/
- int getSerialNumber();
+ public abstract int getSerialNumber();
/**
* 通し番号の昇順を定義づける。
*/
@SuppressWarnings("serial")
- class SerialComparator
+ public static class SerialComparator
implements Comparator<SerialNumbered> {
/**
/**
* {@inheritDoc}
+ *
* @param o1 {@inheritDoc}
* @param o2 {@inheritDoc}
* @return {@inheritDoc}
*/
@Override
public Iterator<Vertex> iterator(){
- List<Vertex> list = new ArrayList<Vertex>(TRIANGLE);
+ List<Vertex> list = new ArrayList<>(TRIANGLE);
list.add(this.vertex1);
list.add(this.vertex2);
private static final int IDX_SP = 0xff; // 特殊トゥーンのインデックス
static{
- Map<Integer, String> map = new TreeMap<Integer, String>();
+ Map<Integer, String> map = new TreeMap<>();
int idx = 0x00;
map.put(idx++, "toon01.bmp");
private final Map<Integer, String> toonDefMap =
- new TreeMap<Integer, String>(DEF_TOONMAP);
+ new TreeMap<>(DEF_TOONMAP);
/**
* 所属グループの無いボーンをデフォルトボーングループへ登録する。
*/
private void pickOrphanBone(){
- List<BoneInfo> orpahnList = new LinkedList<BoneInfo>();
+ List<BoneInfo> orpahnList = new LinkedList<>();
orpahnList.addAll(this.boneList);
for(BoneGroup group : this.boneGroupList){
orpahnList.removeAll(group.getBoneList());
private MorphPart currentMorphPart;
private final List<Vertex> vertexList;
- private final List<Vertex> morphVertexList = new ArrayList<Vertex>();
+ private final List<Vertex> morphVertexList = new ArrayList<>();
/**
* コンストラクタ。
List<MorphPart> partList = this.morphMap.get(type);
if(partList == null){
- partList = new LinkedList<MorphPart>();
+ partList = new LinkedList<>();
this.morphMap.put(type, partList);
}
partList.add(part);
throws IOException, IllegalTextExportException{
Map<MorphType, List<MorphPart>> morphMap = model.getMorphMap();
Set<MorphType> typeSet = morphMap.keySet();
- List<MorphPart> morphPartList = new LinkedList<MorphPart>();
+ List<MorphPart> morphPartList = new LinkedList<>();
for(MorphType type : typeSet){
List<MorphPart> partList = morphMap.get(type);
}
dumpByte(totalMorph);
- List<MorphType> typeList = new LinkedList<MorphType>();
+ List<MorphType> typeList = new LinkedList<>();
for(MorphType type : typeSet){
assert ! type.isBase();
typeList.add(type);
RigidBuilder rigidBuilder = new RigidBuilder(model);
JointBuilder jointBuilder = new JointBuilder(model);
- List<MorphPart> morphPartList = new ArrayList<MorphPart>();
+ List<MorphPart> morphPartList = new ArrayList<>();
morphBuilder.setMorphPartList(morphPartList);
textBuilder.setMorphPartList(morphPartList);
;
private static final Map<String, PmdTag> NAME_MAP =
- new HashMap<String, PmdTag>();
+ new HashMap<>();
static{
for(PmdTag tag : values()){
// マテリアル関連
private final List<IdRefHolder<Material>> materialSfcGroupIdRefList =
- new LinkedList<IdRefHolder<Material>>();
+ new LinkedList<>();
private final List<IdRefHolder<Material>> materialToonIdRefList =
- new LinkedList<IdRefHolder<Material>>();
+ new LinkedList<>();
private final Map<String, Integer> toonIdxMap =
- new HashMap<String, Integer>();
+ new HashMap<>();
// ボーン関連
private final Map<String, BoneInfo> boneIdMap =
- new HashMap<String, BoneInfo>();
+ new HashMap<>();
private final List<IdRefHolder<BoneInfo>> boneChainIdRefList =
- new LinkedList<IdRefHolder<BoneInfo>>();
+ new LinkedList<>();
private final List<IdRefHolder<BoneInfo>> boneSourceIdRefList =
- new LinkedList<IdRefHolder<BoneInfo>>();
+ new LinkedList<>();
// モーフ関連
private final List<IdRefHolder<MorphVertex>> morphVertexIdRefList =
- new LinkedList<IdRefHolder<MorphVertex>>();
+ new LinkedList<>();
// 剛体関連
private final Map<String, RigidInfo> rigidIdMap =
- new HashMap<String, RigidInfo>();
+ new HashMap<>();
private final Map<String, RigidGroup> rigidGroupIdMap =
- new HashMap<String, RigidGroup>();
+ new HashMap<>();
private final List<IdRefHolder<RigidInfo>> thghRigidGroupIdRefList =
- new LinkedList<IdRefHolder<RigidInfo>>();
+ new LinkedList<>();
// 面関連
private final Map<String, List<Surface>> surfaceGroupIdMap =
- new HashMap<String, List<Surface>>();
+ new HashMap<>();
private final List<IdRefHolder<Surface>> surfaceVertexIdRef =
- new LinkedList<IdRefHolder<Surface>>();
+ new LinkedList<>();
// 頂点関連
private final Map<String, Vertex> vertexIdMap =
- new HashMap<String, Vertex>();
+ new HashMap<>();
/**
*/
void addSurfaceGroupIdRef(Material material, String idRef){
IdRefHolder<Material> holder =
- new IdRefHolder<Material>(material, idRef);
+ new IdRefHolder<>(material, idRef);
this.materialSfcGroupIdRefList.add(holder);
return;
List<Surface> surfaceGroup =
this.surfaceGroupIdMap.get(surfaceGroupId);
if(surfaceGroup == null){
- surfaceGroup = new LinkedList<Surface>();
+ surfaceGroup = new LinkedList<>();
this.surfaceGroupIdMap.put(surfaceGroupId, surfaceGroup);
}
*/
void addToonFileIdRef(Material material, String idRef){
IdRefHolder<Material> holder =
- new IdRefHolder<Material>(material, idRef);
+ new IdRefHolder<>(material, idRef);
this.materialToonIdRefList.add(holder);
return;
}
void addBoneChain(BoneInfo bone,
String prevBoneIdRef, String nextBoneIdRef ){
IdRefHolder<BoneInfo> holder =
- new IdRefHolder<BoneInfo>(bone, prevBoneIdRef, nextBoneIdRef);
+ new IdRefHolder<>(bone, prevBoneIdRef, nextBoneIdRef);
this.boneChainIdRefList.add(holder);
return;
}
*/
void addSrcBoneIdRef(BoneInfo bone, String srcBoneIdRef){
IdRefHolder<BoneInfo> holder =
- new IdRefHolder<BoneInfo>(bone, srcBoneIdRef);
+ new IdRefHolder<>(bone, srcBoneIdRef);
this.boneSourceIdRefList.add(holder);
return;
}
*/
void addMorphVertexIdRef(MorphVertex morphVertex, String vertexIdRef){
IdRefHolder<MorphVertex> holder =
- new IdRefHolder<MorphVertex>(morphVertex, vertexIdRef);
+ new IdRefHolder<>(morphVertex, vertexIdRef);
this.morphVertexIdRefList.add(holder);
return;
}
*/
void addThroughRigidGroupIdRef(RigidInfo rigid, String rigidGroupIdRef){
IdRefHolder<RigidInfo> holder =
- new IdRefHolder<RigidInfo>(rigid, rigidGroupIdRef);
+ new IdRefHolder<>(rigid, rigidGroupIdRef);
this.thghRigidGroupIdRefList.add(holder);
return;
}
String vtxIdRef2,
String vtxIdRef3 ){
IdRefHolder<Surface> holder =
- new IdRefHolder<Surface>(surface,
- vtxIdRef1,
- vtxIdRef2,
- vtxIdRef3 );
+ new IdRefHolder<>(surface,
+ vtxIdRef1,
+ vtxIdRef2,
+ vtxIdRef3 );
this.surfaceVertexIdRef.add(holder);
*/
private static Collection<Method> filtMethod(Class<?> klass,
Class<? extends Annotation> filter ){
- Collection<Method> result = new LinkedList<Method>();
+ Collection<Method> result = new LinkedList<>();
for(Method method : klass.getDeclaredMethods()){
int modifiers = method.getModifiers();
*/
private static Map<PmdTag, Method> getOpenDispatcher(Class<?> klass){
Map<PmdTag, Method> result =
- new EnumMap<PmdTag, Method>(PmdTag.class);
+ new EnumMap<>(PmdTag.class);
for(Method method : filtMethod(klass, OpenXmlMark.class)){
Annotation anno = method.getAnnotation(OpenXmlMark.class);
*/
private static Map<PmdTag, Method> getCloseDispatcher(Class<?> klass){
Map<PmdTag, Method> result =
- new EnumMap<PmdTag, Method>(PmdTag.class);
+ new EnumMap<>(PmdTag.class);
for(Method method : filtMethod(klass, CloseXmlMark.class)){
Annotation anno = method.getAnnotation(CloseXmlMark.class);
void closeMorphList(){
Map<MorphType, List<MorphPart>> morphMap =
getPmdModel().getMorphMap();
- List<MorphPart> tempList = new LinkedList<MorphPart>();
+ List<MorphPart> tempList = new LinkedList<>();
tempList.addAll(morphMap.get(MorphType.EYEBROW));
tempList.addAll(morphMap.get(MorphType.EYE));
SaxListener dynamicsListener = new SaxDynamicsListener(helper);
SaxListener shapeListener = new SaxShapeListener(helper);
- this.listenerMap = new EnumMap<PmdTag, SaxListener>(PmdTag.class);
+ this.listenerMap = new EnumMap<>(PmdTag.class);
this.listenerMap.put(PmdTag.PMD_MODEL, modelListener);
this.listenerMap.put(PmdTag.MATERIAL_LIST, materialListener);
this.listenerMap.put(PmdTag.BONE_LIST, boneListener);
* @return 解析されたコマンドライン並び
*/
static List<CmdLine> parse(List<String> argList){
- List<CmdLine> result = new LinkedList<CmdLine>();
+ List<CmdLine> result = new LinkedList<>();
Iterator<String> it = argList.iterator();
while (it.hasNext()) {
if (info.opt != null) {
exArgNum = info.opt.getExArgNum();
}
- info.optArgs = new ArrayList<String>(exArgNum + 1);
+ info.optArgs = new ArrayList<>(exArgNum + 1);
info.optArgs.add(arg);
/**
* コンストラクタ。
*/
- private ModelFileType(){
+ ModelFileType(){
return;
}
private static final Map<String, OptSwitch> MAP_OPT;
static{
- Map<String, OptSwitch> map = new HashMap<String, OptSwitch>();
+ Map<String, OptSwitch> map = new HashMap<>();
for(OptSwitch opt : values()){
for(String cmdarg : opt.cmdopts){
* @param argnum 必要な引数の数
* @param cmdopts オプションスイッチパターン群
*/
- private OptSwitch(int argnum, String... cmdopts) {
+ OptSwitch(int argnum, String... cmdopts) {
this.exArgNum = argnum;
List<String> optlist;