16 package net.squiz.matrix.matrixtree;
18 import net.squiz.matrix.core.*;
19 import javax.swing.tree.*;
22 import java.awt.datatransfer.*;
33 implements Serializable {
37 private final String linkid;
45 private int sort_order;
49 private String webPath;
52 protected String name;
61 public MatrixTreeNode(
Asset asset, String linkid,
int linkType, String url, String webPath, String name,
int sort_order) {
64 this.linkType = linkType;
66 this.webPath = webPath;
68 this.sort_order = sort_order;
71 public String toString() {
72 return getName() +
" Linkid : " + linkid;
76 public void setName(String name) {
80 public String getName() {
84 public void setSortOrder(
int sort_order) {
85 this.sort_order = sort_order;
88 public int getSortOrder() {
89 return this.sort_order;
98 return (
Asset) getUserObject();
101 public int getLinkType() {
105 public void setLinkType(
int linkType) {
106 this.linkType = linkType;
118 public boolean isShadowAsset() {
119 return (linkid.equals(
"0") && linkid.split(
":").length > 1);
133 return (
getAsset().getNumKids() == 0);
144 }
else if (webPath == null) {
147 return url +
"/" + webPath;
159 return (getChildWithLinkid(linkid) == null) ?
false :
true;
163 Enumeration children = children();
164 while (children.hasMoreElements()) {
173 public void propagateUrl(String url) {
175 Enumeration children = children();
176 while (children.hasMoreElements()) {
178 node.propagateUrl(
getURL());
182 public void propagateWebPath(String webPath) {
183 this.webPath = webPath;
184 Enumeration children = children();
185 while (children.hasMoreElements()) {
190 node.propagateUrl(
getURL());
202 Object[] path = getPath();
203 StringBuffer assetPath =
new StringBuffer();
204 for (
int i = 0; i < path.length; i++) {
207 return assetPath.toString();
218 Object[] path = getPath();
219 StringBuffer linkPath =
new StringBuffer();
220 for (
int i = 0; i < path.length; i++) {
223 return linkPath.toString();
230 if (getChildCount() != 0) {
243 if (getChildCount() != 0) {