net.alantea.swing.mindmap.MindMapNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swingplus Show documentation
Show all versions of swingplus Show documentation
Addons over swing package.
The newest version!
package net.alantea.swing.mindmap;
import java.util.ArrayList;
import java.util.List;
public class MindMapNode
{
private T data;
private MindMapNode parent;
private List> children = new ArrayList<>();
public MindMapNode(MindMapNode parent, T data)
{
this.parent = parent;
this.data = data;
if (parent != null)
{
parent.addNode(this);
}
}
private void addNode(MindMapNode mindMapNode)
{
children.add(mindMapNode);
}
public T getData()
{
return data;
}
public void setData(T data)
{
this.data = data;
}
public MindMapNode getParent()
{
return parent;
}
public void setParent(MindMapNode parent)
{
this.parent = parent;
}
public List> getChildren()
{
return children;
}
public void setChildren(List> children)
{
this.children = children;
}
@Override
public String toString()
{
if (data == null)
{
return "null";
}
return data.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy