/**
* Copyright 1999-2009 The Pegadi Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pegadi.storysketch.cells;
import java.util.Date;
import org.jgraph.graph.DefaultGraphCell;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
public abstract class StorySketchCell extends DefaultGraphCell {
Date created = new Date();
public StorySketchCell() {
this(null);
}
public StorySketchCell(Object userObject) {
super(userObject);
}
public void setCreatedDate(Date created) {
this.created = created;
}
public Date getCreatedDate() {
return created;
}
public abstract String getClassDescription();
public abstract Element getCellElement(Document doc);
public abstract void setCellElement(Element e);
public String toHTML() {
return "<html><h3>Ikke implementert</h3><p>userObject.toString() sier: " + userObject.toString();
}
public String toBR(String str) {
StringBuffer sb = new StringBuffer();
String[] split = str.split("\n");
for(int i = 0; i < split.length; i++) {
sb.append(split[i]);
if(i != split.length -1) {
sb.append("<br>");
}
}
return sb.toString();
}
}