class cTreePath extends java.util.Vector<Object3D> // javax.swing.tree.TreePath
|
{
|
public cTreePath(Object3D r, cTreePath cp)
|
{
|
add(r);
|
|
for (Object3D o : cp)
|
{
|
add(o);
|
}
|
|
//System.out.println("TP = " + this);
|
}
|
|
public cTreePath(cTreePath pp, Object3D l)
|
{
|
//super(pp, o);
|
|
for (Object3D o : pp)
|
{
|
add(o);
|
}
|
|
add(l);
|
|
//System.out.println("TP = " + this);
|
}
|
|
public cTreePath(Object3D o)
|
{
|
//super(o);
|
add(o);
|
//System.out.println("Root = " + this);
|
}
|
|
public cTreePath(java.util.Collection<Object3D> c)
|
{
|
super(c);
|
}
|
|
public Object3D Leaf()
|
{
|
if (size() == 0)
|
return null;
|
|
return get(size()-1);
|
}
|
|
public cTreePath Raise2Material()
|
{
|
if (lastElement().material != null || size() <= 1)
|
return this;
|
|
return new cTreePath(subList(0,size()-1)).Raise2Material();
|
}
|
|
public String toString()
|
{
|
String string = "";
|
|
for (Object3D o : this)
|
{
|
string += "/" + o.GetName();
|
}
|
|
return string;
|
}
|
|
javax.swing.tree.TreePath GetTreePath()
|
{
|
return new javax.swing.tree.TreePath(toArray());
|
}
|
}
|