import java.awt.*;
import java.applet.*;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.awt.image.*;
import java.awt.event.*;
import java.net.*;

class DirFilter implements FilenameFilter {
	public boolean accept(File dir, String name) {
		// System.out.println(name + " " + dir.isDirectory());
		return dir.isDirectory();
		
	}
}

public class ModelName {
	
	int curModel = 0;
	String[] names;
	
	ModelName() {
		read();
	}
	
	public void nextModel() {
		if(curModel > 0) curModel --;
		else curModel = names.length - 1;
	}
	
	public void prevModel() {
		curModel ++;
		curModel %= names.length;
	}
	
	public void read() {
		File path = new File("models\\");
		names = path.list(new DirFilter());
		Arrays.sort(names);
	}
	
	public String current() {
		return names[curModel];
	}
	
	public String currentMd2() {
		return "models\\" + current() + "\\tris.md2"; 
	}
	
	public String currentJmdl() {
		return "models\\" + current() + "\\tris.jmdl"; 
	}
	
	public String currentJaux() {
		return "models\\" + current() + "\\tris.jaux"; 
	}
	
	public int currentModelNumber() {
		return curModel;
	}
	
	public void print() {
		for(int i=0;i<names.length;i++) {
			System.out.println(names[i]);
		}
	}
	
	public static void main(String args[]) {
		ModelName mN = new ModelName();
		mN.read();
		mN.print();
		System.out.println(mN.currentMd2());
		System.out.println(mN.currentJmdl());
	}
}