public class NodeAttributeReaderImpl<V,E extends Edge<V>> extends Object implements NodeAttributesReader<V>
Modifier and Type | Field and Description |
---|---|
static NodeBorder |
border |
static int |
hSW |
static NodeShape |
shape |
static int |
SW |
static String |
VERTEX_BG |
static String |
VERTEX_BORDER |
static String |
VERTEX_FG |
static String |
VERTEX_HEIGHT |
static String |
VERTEX_SHAPE |
static String |
VERTEX_TEXT |
static String |
VERTEX_WIDTH |
Constructor and Description |
---|
NodeAttributeReaderImpl(StyleManager<V,E> styleManager,
Graph<V,E> graph,
GraphBackend<V,E> backend) |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(NodeAttributesReader fvreader) |
void |
damage()
The current item will be changed: mark its current area as damaged if needed.
|
Color |
getBackgroundColor() |
NodeBorder |
getBorder() |
Rectangle |
getBounds()
get the boundary rectangle for the selected item.
|
NodeStyle |
getDefaultNodeStyle()
Get the default style for the nodes in this graph.
|
Color |
getForegroundColor() |
int |
getHeight() |
NodeShape |
getShape() |
NodeStyle<V> |
getStyle() |
Color |
getTextColor() |
int |
getWidth() |
int |
getX() |
int |
getY() |
void |
move(int dx,
int dy)
Move the item.
|
void |
refresh()
Let listeners know that the item has been updated
|
void |
render(Graphics2D g)
Render the current node on a given graphics.
|
void |
renderMoving(Graphics2D g,
int movex,
int movey)
Render the current node while moving it.
|
boolean |
select(Point p)
Test if a point can be used to select the current item.
|
void |
setNode(V node)
change the edited node.
|
void |
setNode(V node,
boolean selected)
change the edited node, knowing that it is selected
|
void |
setPos(int x,
int y)
change the node's position.
|
void |
setStyle(NodeStyle<V> style) |
void |
writeGINML(XMLWriter writer)
Save the visual settings in GINML.
|
public static final int SW
public static final int hSW
public static final String VERTEX_BG
public static final String VERTEX_FG
public static final String VERTEX_TEXT
public static final String VERTEX_HEIGHT
public static final String VERTEX_WIDTH
public static final String VERTEX_SHAPE
public static final String VERTEX_BORDER
public static NodeShape shape
public static NodeBorder border
public NodeAttributeReaderImpl(StyleManager<V,E> styleManager, Graph<V,E> graph, GraphBackend<V,E> backend)
styleManager
- backend
- backend
- public void setNode(V node)
NodeAttributesReader
setNode
in interface NodeAttributesReader<V>
node
- the node to editpublic void setNode(V node, boolean selected)
NodeAttributesReader
setNode
in interface NodeAttributesReader<V>
public int getX()
getX
in interface NodeAttributesReader<V>
public int getY()
getY
in interface NodeAttributesReader<V>
public int getHeight()
getHeight
in interface NodeAttributesReader<V>
public int getWidth()
getWidth
in interface NodeAttributesReader<V>
public Rectangle getBounds()
AttributesReader
getBounds
in interface AttributesReader
public Color getForegroundColor()
getForegroundColor
in interface NodeAttributesReader<V>
public Color getTextColor()
getTextColor
in interface NodeAttributesReader<V>
public Color getBackgroundColor()
getBackgroundColor
in interface NodeAttributesReader<V>
public void refresh()
AttributesReader
refresh
in interface AttributesReader
public void damage()
AttributesReader
damage
in interface AttributesReader
public void setPos(int x, int y)
NodeAttributesReader
setPos
in interface NodeAttributesReader<V>
public void move(int dx, int dy)
AttributesReader
move
in interface AttributesReader
public NodeBorder getBorder()
getBorder
in interface NodeAttributesReader<V>
public NodeShape getShape()
getShape
in interface NodeAttributesReader<V>
public void copyFrom(NodeAttributesReader fvreader)
copyFrom
in interface NodeAttributesReader<V>
public void render(Graphics2D g)
NodeAttributesReader
render
in interface NodeAttributesReader<V>
public void renderMoving(Graphics2D g, int movex, int movey)
NodeAttributesReader
renderMoving
in interface NodeAttributesReader<V>
public boolean select(Point p)
AttributesReader
select
in interface AttributesReader
public NodeStyle getDefaultNodeStyle()
NodeAttributesReader
getDefaultNodeStyle
in interface NodeAttributesReader<V>
public void writeGINML(XMLWriter writer) throws IOException
AttributesReader
writeGINML
in interface AttributesReader
IOException
public void setStyle(NodeStyle<V> style)
setStyle
in interface NodeAttributesReader<V>
public NodeStyle<V> getStyle()
getStyle
in interface NodeAttributesReader<V>
Copyright © 2005–2020. All rights reserved.