Constructor and Description |
---|
StyleManager(Graph<V,E> g,
GraphBackend<V,E> backend,
GraphFactory factory)
Create a style manager, defining default styles.
|
Modifier and Type | Method and Description |
---|---|
EdgeStyle<V,E> |
addEdgeStyle()
Create a new edge style.
|
NodeStyle<V> |
addNodeStyle()
Create a new node style.
|
void |
applyEdgeStyle(Collection<E> edges,
EdgeStyle<V,E> style)
Apply a style to a group of edges.
|
void |
applyEdgeStyle(E edge,
EdgeStyle<V,E> style)
Apply a style to a single edge.
|
void |
applyNodeStyle(Collection<V> nodes,
NodeStyle<V> style)
Apply a style to a group of nodes.
|
void |
applyNodeStyle(V node,
NodeStyle<V> style)
Apply a style to a single node.
|
void |
clearEdgeRouting(E selected) |
void |
deleteStyle(Style style) |
EdgeStyle<V,E> |
getDefaultEdgeStyle()
Retrieve the default style for edges
|
NodeStyle<V> |
getDefaultNodeStyle()
Retrieve the default style for nodes
|
EdgeAnchor |
getEdgeAnchor(E edge) |
boolean |
getEdgeCurved(E edge) |
EdgeStyle<V,E> |
getEdgeStyle(String name)
Retrieve an edge style based on its name.
|
List<EdgeStyle<V,E>> |
getEdgeStyles()
Get the list of all edge styles
|
NodeStyle<V> |
getNodeStyle(String name)
Retrieve a node style based on its name.
|
List<NodeStyle<V>> |
getNodeStyles()
Get the list of all node styles
|
StyleProvider |
getStyleProvider()
Retrieve the current style provider.
|
EdgeStyle |
getUsedEdgeStyle(E edge)
Get the edge style stored in the graph.
|
NodeStyle<V> |
getUsedNodeStyle(V node)
Get the node style stored in the graph.
|
EdgeStyle |
getViewEdgeStyle(E edge)
Get the edge style used for the view.
|
NodeStyle<V> |
getViewNodeStyle(V node)
Get the node style used for the view.
|
EdgeStyle |
guessEdgeStyle(String qName,
Attributes attributes)
Find an edge style corresponding to the desired attributes.
|
NodeStyle |
guessNodeStyle(String qName,
Attributes attributes)
Find a node style corresponding to the desired attributes.
|
boolean |
isCompatMode()
Check if the styles are disabled (for backward compatibility when saving).
|
void |
parseStyle(String qName,
Attributes attributes) |
void |
renameStyle(Style style,
String newname) |
void |
setCompatMode(boolean b)
Enable or disable styles.
|
void |
setEdgeAnchor(E edge,
EdgeAnchor anchor) |
void |
setEdgeCurved(E edge,
boolean curved) |
void |
setStyleProvider(StyleProvider<V,E> provider)
Define the style provider, it will override graph's style until it is removed.
|
void |
styles2ginml(XMLWriter writer)
Save all styles to GINML
|
void |
stylesUpdated()
Called when all styling has been modified, it will refresh the view.
|
void |
styleUpdated(Style style)
Called when a style has been modified, it will refresh the view.
|
public StyleManager(Graph<V,E> g, GraphBackend<V,E> backend, GraphFactory factory)
g
- the graph to managebackend
- the graph backend in which the data is storedbackend
- factory the factory providing the default stylespublic boolean isCompatMode()
public void setCompatMode(boolean b)
b
- public NodeStyle<V> getDefaultNodeStyle()
public EdgeStyle<V,E> getDefaultEdgeStyle()
public void styles2ginml(XMLWriter writer) throws IOException
writer
- IOException
public void parseStyle(String qName, Attributes attributes)
public NodeStyle<V> getNodeStyle(String name)
name
- public EdgeStyle<V,E> getEdgeStyle(String name)
name
- public boolean getEdgeCurved(E edge)
public void setEdgeCurved(E edge, boolean curved)
public EdgeAnchor getEdgeAnchor(E edge)
public void setEdgeAnchor(E edge, EdgeAnchor anchor)
public void clearEdgeRouting(E selected)
public NodeStyle guessNodeStyle(String qName, Attributes attributes)
qName
- attributes
- public EdgeStyle guessEdgeStyle(String qName, Attributes attributes)
qName
- attributes
- public List<NodeStyle<V>> getNodeStyles()
public List<EdgeStyle<V,E>> getEdgeStyles()
public NodeStyle<V> getViewNodeStyle(V node)
node
- public NodeStyle<V> getUsedNodeStyle(V node)
node
- public EdgeStyle getViewEdgeStyle(E edge)
edge
- public EdgeStyle getUsedEdgeStyle(E edge)
edge
- public void applyNodeStyle(Collection<V> nodes, NodeStyle<V> style)
nodes
- style
- public void applyNodeStyle(V node, NodeStyle<V> style)
node
- style
- public void applyEdgeStyle(Collection<E> edges, EdgeStyle<V,E> style)
edges
- style
- public void applyEdgeStyle(E edge, EdgeStyle<V,E> style)
edge
- style
- public void stylesUpdated()
public void styleUpdated(Style style)
style
- the updated stylepublic void setStyleProvider(StyleProvider<V,E> provider)
provider
- the provider to use or null to remove itpublic StyleProvider getStyleProvider()
public void deleteStyle(Style style)
Copyright © 2005–2020. All rights reserved.