org.grinvin.gui.icons
Class DefaultGraphIconFactory
java.lang.Object
org.grinvin.gui.icons.DefaultGraphIconFactory
- GraphIconFactory
public class DefaultGraphIconFactory
extends java.lang.Object
Factory which is to be used when a graph bundle does not explicitely
request an icon factory.
DefaultGraphIconFactory
protected DefaultGraphIconFactory()
Default constructor. Can be overridden, but should not
be called directly.
createIconForLargeGraph
protected GraphIcon createIconForLargeGraph(GraphBundleView bundle,
int size)
Create an icon for a 'large' graph.
createIconForMissingGraph
protected GraphIcon createIconForMissingGraph(GraphBundleView bundle,
int size)
Create an icon for a graph bundle whose graph is missing.
createIconForSmallGraph
protected GraphIcon createIconForSmallGraph(GraphBundleView bundle,
int size)
Create an icon for a 'small' graph.
getBackgroundIcon
protected Icon getBackgroundIcon(int size)
Return the background icon for the large graph icon.
getInstance
public static GraphIconFactory getInstance()
Return the sole instance of this class.
getVertexLimitFactor
protected int getVertexLimitFactor()
Return the vertex limit factor used to determine whether a graph should
be classified as 'small' or 'large'.
isSmallGraph
protected boolean isSmallGraph(GraphBundleView bundle,
int size)
Determine whether a graph qualifies as 'small'. Tyically
small graphs use an icon that closely represents the graph
embedding while large graphs use a more general icon.
This implementation checks whether the number of vertices
is smaller than the square of the size divide by the
vertex limit factor.