org.grinvin.gui.icons
Class ChemicalIcon
- GraphIcon, Icon, SelectUnselectIcon
public class ChemicalIcon
Creates an icon for the first embedding of a graph. Specifically created for chemical graphs,
the annotations (atom types) are drawn for the vertices, and the edges don't touch the vertices.
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) - First paints the edges and then the atom types
|
protected void | paintVertices(Graphics2D g2) - Paint all vertices of the graph.
|
void | setSize(int size) - Set or change the size of the bounding square of this icon.
|
ChemicalIcon
public ChemicalIcon(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.
embedding
- Two-dimensional embedding of a graphsize
- Size in pixels for the width and height of the enclosing square
ChemicalIcon
public ChemicalIcon(GraphBundleView bundle,
int size)
Create a graph icon based on the first embedding stored in the given
graph bundle.
paintEdges
protected void paintEdges(Graphics2D g2)
paintVertices
protected void paintVertices(Graphics2D g2)
Paint all vertices of the graph. The annotation (atom type) is painted at
the center of the vertex.
setSize
public void setSize(int size)
Set or change the size of the bounding square of this icon.