com.googlecode.whatswrong
Interface NLPCanvasRenderer

All Known Implementing Classes:
AlignmentRenderer, SingleSentenceRenderer

public interface NLPCanvasRenderer

An NLPCanvasRenderer renders a given NLPInstance to a Graphics object and returns the dimension of the created image.

Author:
Sebastian Riedel

Method Summary
 int getHeightFactor()
          Returns an integer that reflects the height of the graph.
 int getMargin()
          Returns the margin between tokens.
 boolean isAntiAliasing()
          Should anti-aliasing be used when drawing the graph.
 boolean isCurved()
          Returns whether the renderer draws a more curved graph or not.
 java.awt.Dimension render(NLPInstance instance, java.awt.Graphics2D graphics2D)
          Renders the given instance to the given Graphics object and returns the dimension of the rendered image
 void setAntiAliasing(boolean antiAliasing)
          Should anti-aliasing be used when drawing the graph.
 void setCurved(boolean isCurved)
          Controls whether the graph should be curved or rectangular.
 void setEdgeTypeColor(java.lang.String edgeType, java.awt.Color color)
          Set the color for edges of a certain type.
 void setEdgeTypeOrder(java.lang.String edgeType, int order)
          Sets the order/vertical layer in which the area of a certain type should be drawn.
 void setHeightFactor(int heightFactor)
          Controls the height of the graph.
 void setMargin(int margin)
          Sets the margin between tokens.
 

Method Detail

render

java.awt.Dimension render(NLPInstance instance,
                          java.awt.Graphics2D graphics2D)
Renders the given instance to the given Graphics object and returns the dimension of the rendered image

Parameters:
instance - the instance to render
graphics2D - the graphics object to draw upon
Returns:
the width and height of the drawn object.

setAntiAliasing

void setAntiAliasing(boolean antiAliasing)
Should anti-aliasing be used when drawing the graph.

Parameters:
antiAliasing - rue iff anti-aliasing should be used when drawing the graph.

setMargin

void setMargin(int margin)
Sets the margin between tokens.

Parameters:
margin - the margin between tokens.

getMargin

int getMargin()
Returns the margin between tokens.

Returns:
the margin between tokens.

setHeightFactor

void setHeightFactor(int heightFactor)
Controls the height of the graph.

Parameters:
heightFactor - an integer that indicates how high the graph should be.

getHeightFactor

int getHeightFactor()
Returns an integer that reflects the height of the graph.

Returns:
an integer that reflects the height of the graph. The higher this value, the higher the graph.

setCurved

void setCurved(boolean isCurved)
Controls whether the graph should be curved or rectangular. This switch may have slightly different meanings for different renderers. For example, a dependency graph might contain curved edges, a span type graph might contain curved blocks.

Parameters:
isCurved - should the graph be more curved.

isCurved

boolean isCurved()
Returns whether the renderer draws a more curved graph or not.

Returns:
true iff the renderer draws a more curved graph.

setEdgeTypeColor

void setEdgeTypeColor(java.lang.String edgeType,
                      java.awt.Color color)
Set the color for edges of a certain type.

Parameters:
edgeType - the type of the edges we want to change the color for.
color - the color of the edges of the given type.

setEdgeTypeOrder

void setEdgeTypeOrder(java.lang.String edgeType,
                      int order)
Sets the order/vertical layer in which the area of a certain type should be drawn.

Parameters:
edgeType - the type we want to change the order for.
order - the order/vertical layer in which the area of the given type should be drawn.

isAntiAliasing

boolean isAntiAliasing()
Should anti-aliasing be used when drawing the graph.

Returns:
true iff anti-aliasing should be used when drawing the graph.


Copyright © 2009. All Rights Reserved.