| Line | Hits | Source |
|---|---|---|
| 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 Aug 1, 2005 | |
| 9 | */ | |
| 10 | ||
| 11 | package edu.uci.ics.jung.graph.decorators; | |
| 12 | ||
| 13 | import java.util.HashMap; | |
| 14 | import java.util.Map; | |
| 15 | ||
| 16 | import javax.swing.Icon; | |
| 17 | ||
| 18 | import edu.uci.ics.jung.graph.ArchetypeVertex; | |
| 19 | ||
| 20 | /** | |
| 21 | * A simple, stateful VertexIconFunction. | |
| 22 | * Stores icons in a Map keyed on the Vertex | |
| 23 | * | |
| 24 | * @author Tom Nelson - RABA Technologies | |
| 25 | * | |
| 26 | * | |
| 27 | */ | |
| 28 | 0 | public class DefaultVertexIconFunction implements VertexIconFunction { |
| 29 | ||
| 30 | /** | |
| 31 | * icon storage | |
| 32 | */ | |
| 33 | 0 | protected Map iconMap = new HashMap(); |
| 34 | ||
| 35 | /** | |
| 36 | * Returns the icon storage as a <code>Map</code>. | |
| 37 | */ | |
| 38 | public Map getIconMap() { | |
| 39 | 0 | return iconMap; |
| 40 | } | |
| 41 | ||
| 42 | /** | |
| 43 | * Sets the icon storage to the specified <code>Map</code>. | |
| 44 | */ | |
| 45 | public void setIconMap(Map iconMap) { | |
| 46 | 0 | this.iconMap = iconMap; |
| 47 | 0 | } |
| 48 | ||
| 49 | /** | |
| 50 | * Returns the <code>Icon</code> associated with <code>v</code>. | |
| 51 | */ | |
| 52 | public Icon getIcon(ArchetypeVertex v) { | |
| 53 | 0 | return (Icon)iconMap.get(v); |
| 54 | } | |
| 55 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |