org.grinvin.gui.icons

Class EdgesOnlyIcon

Implemented Interfaces:
GraphIcon, Icon, SelectUnselectIcon

public class EdgesOnlyIcon
extends AbstractGraphIcon

Creates an icon for the first embedding of a graph, but draws only the edges. Typically used for chemical graphs.

Field Summary

Fields inherited from class org.grinvin.gui.icons.AbstractSelectUnselectIcon

selected

Constructor Summary

EdgesOnlyIcon(EmbeddingView embedding, int size)
Create a graph icon for the given embedded graph.
EdgesOnlyIcon(GraphBundleView bundle, int size)
Create a graph icon based on the first embedding stored in the given graph bundle.

Method Summary

int
getIconHeight()
int
getIconWidth()
protected void
paintEdges(Graphics2D g2)
Paint all edges of the graph using the current renderer.
void
paintIcon(Component c, Graphics g, int x, int y)
Only paints the edges, first as a shadow and then as true edges.
void
setSize(int size)
Set or change the size of the bounding square of this icon.

Methods inherited from class org.grinvin.gui.icons.AbstractSelectUnselectIcon

getIconHeight, getIconWidth, isSelected, paintIcon, setSelected

Constructor Details

EdgesOnlyIcon

public EdgesOnlyIcon(EmbeddingView embedding,
                     int size)
Create a graph icon for the given embedded graph. The (two-dimensional) embedding is assumed to be restricted to coordinates in the range (-1.0,-1.0) - (1.0,1.0) which will be scaled to a square of the indicated size.
Parameters:
embedding - Two-dimensional embedding of a graph
size - Size in pixels for the width and height of the enclosing square

EdgesOnlyIcon

public EdgesOnlyIcon(GraphBundleView bundle,
                     int size)
Create a graph icon based on the first embedding stored in the given graph bundle.

Method Details

getIconHeight

public int getIconHeight()
Overrides:
getIconHeight in interface AbstractSelectUnselectIcon

getIconWidth

public int getIconWidth()
Overrides:
getIconWidth in interface AbstractSelectUnselectIcon

paintEdges

protected void paintEdges(Graphics2D g2)

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Only paints the edges, first as a shadow and then as true edges.
Overrides:
paintIcon in interface AbstractSelectUnselectIcon

setSize

public void setSize(int size)
Set or change the size of the bounding square of this icon.