Coverage details for edu.uci.ics.jung.visualization.transform.shape.PluggableRendererDecorator

LineHitsSource
1 /*
2  * Copyright (c) 2005, the JUNG Project and the Regents of the University of
3  * California All rights reserved.
4  *
5  * This software is open-source under the BSD license; see either "license.txt"
6  * or http://jung.sourceforge.net/license.txt for a description.
7  *
8  * Created on Jul 21, 2005
9  */
10  
11 package edu.uci.ics.jung.visualization.transform.shape;
12  
13 import java.awt.Component;
14 import java.awt.Graphics;
15 import java.awt.Graphics2D;
16 import java.awt.Shape;
17 import java.awt.geom.AffineTransform;
18 import java.awt.geom.GeneralPath;
19 import java.awt.geom.Line2D;
20  
21 import javax.swing.CellRendererPane;
22 import javax.swing.JComponent;
23  
24 import org.apache.commons.collections.Predicate;
25  
26 import edu.uci.ics.jung.graph.ArchetypeEdge;
27 import edu.uci.ics.jung.graph.ArchetypeVertex;
28 import edu.uci.ics.jung.graph.Edge;
29 import edu.uci.ics.jung.graph.Vertex;
30 import edu.uci.ics.jung.graph.decorators.EdgeArrowFunction;
31 import edu.uci.ics.jung.graph.decorators.EdgeColorFunction;
32 import edu.uci.ics.jung.graph.decorators.EdgeFontFunction;
33 import edu.uci.ics.jung.graph.decorators.EdgePaintFunction;
34 import edu.uci.ics.jung.graph.decorators.EdgeShapeFunction;
35 import edu.uci.ics.jung.graph.decorators.EdgeStringer;
36 import edu.uci.ics.jung.graph.decorators.EdgeStrokeFunction;
37 import edu.uci.ics.jung.graph.decorators.NumberEdgeValue;
38 import edu.uci.ics.jung.graph.decorators.VertexColorFunction;
39 import edu.uci.ics.jung.graph.decorators.VertexFontFunction;
40 import edu.uci.ics.jung.graph.decorators.VertexIconFunction;
41 import edu.uci.ics.jung.graph.decorators.VertexPaintFunction;
42 import edu.uci.ics.jung.graph.decorators.VertexShapeFunction;
43 import edu.uci.ics.jung.graph.decorators.VertexStringer;
44 import edu.uci.ics.jung.graph.decorators.VertexStrokeFunction;
45 import edu.uci.ics.jung.utils.ParallelEdgeIndexFunction;
46 import edu.uci.ics.jung.visualization.GraphLabelRenderer;
47 import edu.uci.ics.jung.visualization.HasShapeFunctions;
48 import edu.uci.ics.jung.visualization.PickedInfo;
49 import edu.uci.ics.jung.visualization.PluggableRenderer;
50 import edu.uci.ics.jung.visualization.Renderer;
51 import edu.uci.ics.jung.visualization.transform.MutableTransformer;
52  
53 /**
54  * A complete wrapping of PluggableRenderer, used as a base class
55  *
56  * @author Tom Nelson - RABA Technologies
57  *
58  */
59 public abstract class PluggableRendererDecorator implements Renderer, PickedInfo, HasShapeFunctions {
60  
61     protected PluggableRenderer delegate;
62     
630    public PluggableRendererDecorator(PluggableRenderer delegate) {
640        this.delegate = delegate;
650    }
66     
67     /* (non-Javadoc)
68      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeArrowFunction()
69      */
70     public EdgeArrowFunction getEdgeArrowFunction() {
710        return delegate.getEdgeArrowFunction();
72     }
73  
74     /* (non-Javadoc)
75      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeArrowPredicate()
76      */
77     public Predicate getEdgeArrowPredicate() {
780        return delegate.getEdgeArrowPredicate();
79     }
80  
81     /* (non-Javadoc)
82      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeFontFunction()
83      */
84     public EdgeFontFunction getEdgeFontFunction() {
850        return delegate.getEdgeFontFunction();
86     }
87  
88     /* (non-Javadoc)
89      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeIncludePredicate()
90      */
91     public Predicate getEdgeIncludePredicate() {
920        return delegate.getEdgeIncludePredicate();
93     }
94  
95     /* (non-Javadoc)
96      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeLabelClosenessFunction()
97      */
98     public NumberEdgeValue getEdgeLabelClosenessFunction() {
990        return delegate.getEdgeLabelClosenessFunction();
100     }
101  
102     /* (non-Javadoc)
103      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgePaintFunction()
104      */
105     public EdgePaintFunction getEdgePaintFunction() {
1060        return delegate.getEdgePaintFunction();
107     }
108  
109     /* (non-Javadoc)
110      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeStringer()
111      */
112     public EdgeStringer getEdgeStringer() {
1130        return delegate.getEdgeStringer();
114     }
115  
116     /* (non-Javadoc)
117      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeStrokeFunction()
118      */
119     public EdgeStrokeFunction getEdgeStrokeFunction() {
1200        return delegate.getEdgeStrokeFunction();
121     }
122  
123     /* (non-Javadoc)
124      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getRendererPane()
125      */
126     public CellRendererPane getRendererPane() {
1270        return delegate.getRendererPane();
128     }
129  
130     /* (non-Javadoc)
131      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getScreenDevice()
132      */
133     public JComponent getScreenDevice() {
1340        return delegate.getScreenDevice();
135     }
136  
137     /* (non-Javadoc)
138      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexFontFunction()
139      */
140     public VertexFontFunction getVertexFontFunction() {
1410        return delegate.getVertexFontFunction();
142     }
143  
144     /* (non-Javadoc)
145      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexIncludePredicate()
146      */
147     public Predicate getVertexIncludePredicate() {
1480        return delegate.getVertexIncludePredicate();
149     }
150  
151     /* (non-Javadoc)
152      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexPaintFunction()
153      */
154     public VertexPaintFunction getVertexPaintFunction() {
1550        return delegate.getVertexPaintFunction();
156     }
157  
158     /* (non-Javadoc)
159      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexStringer()
160      */
161     public VertexStringer getVertexStringer() {
1620        return delegate.getVertexStringer();
163     }
164  
165     /* (non-Javadoc)
166      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexStrokeFunction()
167      */
168     public VertexStrokeFunction getVertexStrokeFunction() {
1690        return delegate.getVertexStrokeFunction();
170     }
171  
172     /* (non-Javadoc)
173      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setRendererPane(javax.swing.CellRendererPane)
174      */
175     public void setRendererPane(CellRendererPane rendererPane) {
1760        delegate.setRendererPane(rendererPane);
1770    }
178  
179     /**
180      * @return Returns the delegate.
181      */
182     public PluggableRenderer getDelegate() {
1830        return delegate;
184     }
185  
186  
187     /**
188      * @param delegate The delegate to set.
189      */
190     public void setDelegate(PluggableRenderer delegate) {
1910        this.delegate = delegate;
1920    }
193  
194  
195     /* (non-Javadoc)
196      * @see java.lang.Object#equals(java.lang.Object)
197      */
198     public boolean equals(Object obj) {
1990        return delegate.equals(obj);
200     }
201  
202     /* (non-Javadoc)
203      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getEdgeShapeFunction()
204      */
205     public EdgeShapeFunction getEdgeShapeFunction() {
2060        return delegate.getEdgeShapeFunction();
207     }
208  
209     /* (non-Javadoc)
210      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getGraphLabelRenderer()
211      */
212     public GraphLabelRenderer getGraphLabelRenderer() {
2130        return delegate.getGraphLabelRenderer();
214     }
215  
216     /* (non-Javadoc)
217      * @see edu.uci.ics.jung.visualization.AbstractRenderer#getPickedKey()
218      */
219     public PickedInfo getPickedKey() {
2200        return delegate.getPickedKey();
221     }
222  
223     /* (non-Javadoc)
224      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexLabelCentering()
225      */
226     public boolean getVertexLabelCentering() {
2270        return delegate.getVertexLabelCentering();
228     }
229  
230     /* (non-Javadoc)
231      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexShapeFunction()
232      */
233     public VertexShapeFunction getVertexShapeFunction() {
2340        return delegate.getVertexShapeFunction();
235     }
236  
237     /* (non-Javadoc)
238      * @see java.lang.Object#hashCode()
239      */
240     public int hashCode() {
2410        return delegate.hashCode();
242     }
243  
244     /* (non-Javadoc)
245      * @see edu.uci.ics.jung.visualization.PluggableRenderer#isPicked(edu.uci.ics.jung.graph.Edge)
246      */
247     public boolean isPicked(ArchetypeEdge e) {
2480        return delegate.isPicked(e);
249     }
250  
251     /* (non-Javadoc)
252      * @see edu.uci.ics.jung.visualization.PluggableRenderer#isPicked(edu.uci.ics.jung.graph.Vertex)
253      */
254     public boolean isPicked(ArchetypeVertex v) {
2550        return delegate.isPicked(v);
256     }
257  
258     /* (non-Javadoc)
259      * @see edu.uci.ics.jung.visualization.PluggableRenderer#paintEdge(java.awt.Graphics, edu.uci.ics.jung.graph.Edge, int, int, int, int)
260      */
261     public void paintEdge(Graphics g, Edge e, int x1, int y1, int x2, int y2) {
2620        delegate.paintEdge(g, e, x1, y1, x2, y2);
2630    }
264  
265     /* (non-Javadoc)
266      * @see edu.uci.ics.jung.visualization.PluggableRenderer#paintVertex(java.awt.Graphics, edu.uci.ics.jung.graph.Vertex, int, int)
267      */
268     public void paintVertex(Graphics g, Vertex v, int x, int y) {
2690        delegate.paintVertex(g, v, x, y);
2700    }
271     
272     public void paintIconForVertex(Graphics g, Vertex v, int x, int y) {
2730            delegate.paintIconForVertex(g, v, x, y);
2740    }
275  
276     /* (non-Javadoc)
277      * @see edu.uci.ics.jung.visualization.PluggableRenderer#prepareRenderer(edu.uci.ics.jung.visualization.GraphLabelRenderer, java.lang.Object, boolean, edu.uci.ics.jung.graph.Edge)
278      */
279     public Component prepareRenderer(GraphLabelRenderer renderer, Object value, boolean isSelected, Edge edge) {
2800        return delegate.prepareRenderer(renderer, value, isSelected, edge);
281     }
282  
283     /* (non-Javadoc)
284      * @see edu.uci.ics.jung.visualization.PluggableRenderer#prepareRenderer(edu.uci.ics.jung.visualization.GraphLabelRenderer, java.lang.Object, boolean, edu.uci.ics.jung.graph.Vertex)
285      */
286     public Component prepareRenderer(GraphLabelRenderer graphLabelRenderer, Object value, boolean isSelected, Vertex vertex) {
2870        return delegate.prepareRenderer(graphLabelRenderer, value, isSelected, vertex);
288     }
289  
290     /* (non-Javadoc)
291      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setArrowPlacementTolerance(float)
292      */
293     public void setArrowPlacementTolerance(float tolerance) {
2940        delegate.setArrowPlacementTolerance(tolerance);
2950    }
296  
297     /* (non-Javadoc)
298      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeArrowFunction(edu.uci.ics.jung.graph.decorators.EdgeArrowFunction)
299      */
300     public void setEdgeArrowFunction(EdgeArrowFunction eaf) {
3010        delegate.setEdgeArrowFunction(eaf);
3020    }
303  
304     /* (non-Javadoc)
305      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeArrowPredicate(org.apache.commons.collections.Predicate)
306      */
307     public void setEdgeArrowPredicate(Predicate p) {
3080        delegate.setEdgeArrowPredicate(p);
3090    }
310  
311     /* (non-Javadoc)
312      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeColorFunction(edu.uci.ics.jung.graph.decorators.EdgeColorFunction)
313      */
314     public void setEdgeColorFunction(EdgeColorFunction ecf) {
3150        delegate.setEdgeColorFunction(ecf);
3160    }
317  
318     /* (non-Javadoc)
319      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeFontFunction(edu.uci.ics.jung.graph.decorators.EdgeFontFunction)
320      */
321     public void setEdgeFontFunction(EdgeFontFunction eff) {
3220        delegate.setEdgeFontFunction(eff);
3230    }
324  
325     /* (non-Javadoc)
326      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeIncludePredicate(org.apache.commons.collections.Predicate)
327      */
328     public void setEdgeIncludePredicate(Predicate p) {
3290        delegate.setEdgeIncludePredicate(p);
3300    }
331  
332     /* (non-Javadoc)
333      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeLabelClosenessFunction(edu.uci.ics.jung.graph.decorators.NumberEdgeValue)
334      */
335     public void setEdgeLabelClosenessFunction(NumberEdgeValue nev) {
3360        delegate.setEdgeLabelClosenessFunction(nev);
3370    }
338  
339     /* (non-Javadoc)
340      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgePaintFunction(edu.uci.ics.jung.graph.decorators.EdgePaintFunction)
341      */
342     public void setEdgePaintFunction(EdgePaintFunction impl) {
3430        delegate.setEdgePaintFunction(impl);
3440    }
345  
346     /* (non-Javadoc)
347      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeShapeFunction(edu.uci.ics.jung.graph.decorators.EdgeShapeFunction)
348      */
349     public void setEdgeShapeFunction(EdgeShapeFunction impl) {
3500        delegate.setEdgeShapeFunction(impl);
3510    }
352  
353     /* (non-Javadoc)
354      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeStringer(edu.uci.ics.jung.graph.decorators.EdgeStringer)
355      */
356     public void setEdgeStringer(EdgeStringer es) {
3570        delegate.setEdgeStringer(es);
3580    }
359  
360     /* (non-Javadoc)
361      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setEdgeStrokeFunction(edu.uci.ics.jung.graph.decorators.EdgeStrokeFunction)
362      */
363     public void setEdgeStrokeFunction(EdgeStrokeFunction esf) {
3640        delegate.setEdgeStrokeFunction(esf);
3650    }
366  
367     /* (non-Javadoc)
368      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setGraphLabelRenderer(edu.uci.ics.jung.visualization.GraphLabelRenderer)
369      */
370     public void setGraphLabelRenderer(GraphLabelRenderer graphLabelRenderer) {
3710        delegate.setGraphLabelRenderer(graphLabelRenderer);
3720    }
373  
374     /* (non-Javadoc)
375      * @see edu.uci.ics.jung.visualization.AbstractRenderer#setPickedKey(edu.uci.ics.jung.visualization.PickedInfo)
376      */
377     public void setPickedKey(PickedInfo pk) {
3780        delegate.setPickedKey(pk);
3790    }
380  
381     /* (non-Javadoc)
382      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setScreenDevice(javax.swing.JComponent)
383      */
384     public void setScreenDevice(JComponent screenDevice) {
3850        delegate.setScreenDevice(screenDevice);
3860    }
387  
388     /* (non-Javadoc)
389      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexColorFunction(edu.uci.ics.jung.graph.decorators.VertexColorFunction)
390      */
391     public void setVertexColorFunction(VertexColorFunction vcf) {
3920        delegate.setVertexColorFunction(vcf);
3930    }
394  
395     /* (non-Javadoc)
396      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexFontFunction(edu.uci.ics.jung.graph.decorators.VertexFontFunction)
397      */
398     public void setVertexFontFunction(VertexFontFunction vff) {
3990        delegate.setVertexFontFunction(vff);
4000    }
401  
402     /* (non-Javadoc)
403      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexIncludePredicate(org.apache.commons.collections.Predicate)
404      */
405     public void setVertexIncludePredicate(Predicate p) {
4060        delegate.setVertexIncludePredicate(p);
4070    }
408  
409     /* (non-Javadoc)
410      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexLabelCentering(boolean)
411      */
412     public void setVertexLabelCentering(boolean b) {
4130        delegate.setVertexLabelCentering(b);
4140    }
415  
416     /* (non-Javadoc)
417      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexPaintFunction(edu.uci.ics.jung.graph.decorators.VertexPaintFunction)
418      */
419     public void setVertexPaintFunction(VertexPaintFunction vpf) {
4200        delegate.setVertexPaintFunction(vpf);
4210    }
422  
423     /* (non-Javadoc)
424      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexShapeFunction(edu.uci.ics.jung.graph.decorators.VertexShapeFunction)
425      */
426     public void setVertexShapeFunction(VertexShapeFunction vsf) {
4270        delegate.setVertexShapeFunction(vsf);
4280    }
429  
430     /* (non-Javadoc)
431      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexStringer(edu.uci.ics.jung.graph.decorators.VertexStringer)
432      */
433     public void setVertexStringer(VertexStringer vs) {
4340        delegate.setVertexStringer(vs);
4350    }
436  
437     /* (non-Javadoc)
438      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexStrokeFunction(edu.uci.ics.jung.graph.decorators.VertexStrokeFunction)
439      */
440     public void setVertexStrokeFunction(VertexStrokeFunction vsf) {
4410        delegate.setVertexStrokeFunction(vsf);
4420    }
443  
444     /* (non-Javadoc)
445      * @see java.lang.Object#toString()
446      */
447     public String toString() {
4480        return delegate.toString();
449     }
450  
451     /* (non-Javadoc)
452      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getVertexImager()
453      */
454     public VertexIconFunction getVertexIconFunction() {
4550        return delegate.getVertexIconFunction();
456     }
457  
458     /* (non-Javadoc)
459      * @see edu.uci.ics.jung.visualization.PluggableRenderer#setVertexImager(edu.uci.ics.jung.graph.decorators.VertexIconFunction)
460      */
461     public void setVertexIconFunction(VertexIconFunction vertexImager) {
4620        delegate.setVertexIconFunction(vertexImager);
4630    }
464  
465     /* (non-Javadoc)
466      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getArrowTransform(java.awt.geom.GeneralPath, java.awt.Shape)
467      */
468     public AffineTransform getArrowTransform(GeneralPath edgeShape, Shape vertexShape) {
4690        return delegate.getArrowTransform(edgeShape, vertexShape);
470     }
471  
472     /* (non-Javadoc)
473      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getReverseArrowTransform(java.awt.geom.GeneralPath, java.awt.Shape)
474      */
475     public AffineTransform getReverseArrowTransform(GeneralPath edgeShape, Shape vertexShape) {
4760        return delegate.getReverseArrowTransform(edgeShape, vertexShape);
477     }
478  
479     /* (non-Javadoc)
480      * @see edu.uci.ics.jung.visualization.PluggableRenderer#paintShapeForVertex(java.awt.Graphics2D, edu.uci.ics.jung.graph.Vertex, java.awt.Shape)
481      */
482     public void paintShapeForVertex(Graphics2D g2d, Vertex v, Shape shape) {
4830        delegate.paintShapeForVertex(g2d, v, shape);
4840    }
485  
486     /* (non-Javadoc)
487      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getArrowTransform(java.awt.geom.Line2D, java.awt.Shape)
488      */
489     public AffineTransform getArrowTransform(Line2D edgeShape, Shape vertexShape) {
4900        return delegate.getArrowTransform(edgeShape, vertexShape);
491     }
492  
493     /* (non-Javadoc)
494      * @see edu.uci.ics.jung.visualization.PluggableRenderer#getReverseArrowTransform(java.awt.geom.GeneralPath, java.awt.Shape, boolean)
495      */
496     public AffineTransform getReverseArrowTransform(GeneralPath edgeShape, Shape vertexShape, boolean passedGo) {
4970        return delegate.getReverseArrowTransform(edgeShape, vertexShape, passedGo);
498     }
499  
500     public ParallelEdgeIndexFunction getParallelEdgeIndexFunction() {
5010        return delegate.getParallelEdgeIndexFunction();
502     }
503  
504     public void setParallelEdgeIndexFunction(ParallelEdgeIndexFunction parallelEdgeIndexFunction) {
5050        delegate.setParallelEdgeIndexFunction(parallelEdgeIndexFunction);
5060    }
507  
508     public void setViewTransformer(MutableTransformer viewTransformer) {
5090        delegate.setViewTransformer(viewTransformer);
5100    }
511 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.