01: package org.enhydra.jawe.components.graph;
02:
03: import java.awt.geom.Point2D;
04:
05: import org.jgraph.graph.CellViewRenderer;
06: import org.jgraph.graph.EdgeView;
07:
08: /**
09: * Represents a view for a model's End object.
10: * @author Sasa Bojanic
11: */
12: public class DefaultGraphBubbleActivityView extends
13: DefaultGraphActivityView {
14:
15: /**
16: * Constructs a End view for the specified model object.
17: *
18: * @param cell reference to the model object
19: */
20: public DefaultGraphBubbleActivityView(Object cell) {
21: super (cell);
22: }
23:
24: public CellViewRenderer getRenderer() {
25: String type = ((GraphActivityInterface) super .getCell())
26: .getType();
27: GraphActivityRendererInterface garenderer = (GraphActivityRendererInterface) renderers
28: .get(type);
29: if (garenderer == null) {
30: garenderer = createRenderer(type);
31: renderers.put(type, garenderer);
32: }
33: return garenderer;
34: }
35:
36: protected GraphActivityRendererInterface createRenderer(String type) {
37: return GraphUtilities.getGraphController()
38: .getGraphObjectRendererFactory().createBubbleRenderer(
39: type);
40: }
41:
42: public Point2D getPerimeterPoint(EdgeView edge, Point2D source,
43: Point2D p) {
44: return ((DefaultGraphBubbleActivityRenderer) getRenderer())
45: .getPerimeterPoint(this, p);
46: }
47: }
|