net.xqhs.graphs.matcher
Class MatchingVisualizer

java.lang.Object
  extended by net.xqhs.util.config.Config
      extended by net.xqhs.util.logging.Unit
          extended by net.xqhs.graphs.matcher.MatchingVisualizer
All Implemented Interfaces:
net.xqhs.util.config.Configurable

public class MatchingVisualizer
extends net.xqhs.util.logging.Unit

Visualizer for the matching process. Uses a GCanvas that is passed to the respective graphical representations.

Author:
Andrei Olaru

Nested Class Summary
 
Nested classes/interfaces inherited from class net.xqhs.util.config.Config
net.xqhs.util.config.Config.ConfigLockedException
 
Field Summary
(package private)  int fontSize
          Size of the font to use for writing.
(package private)  int lineHeight
          The height of a line.
(package private)  float lineSpacing
          Fraction of the line height to consider as spacing between lines.
(package private)  net.xqhs.graphical.GCanvas theCanvas
          The canvas to use.
(package private)  java.awt.Point topleftLine
          The current position - top left corner for the current line.
 
Fields inherited from class net.xqhs.util.logging.Unit
DEFAULT_LEVEL, DEFAULT_UNIT_NAME
 
Constructor Summary
MatchingVisualizer()
           
 
Method Summary
 MatchingVisualizer feedLine(Graph graph, VisualizableGraphComponent highlight, java.lang.String comment)
          Displays in the visualizer a line showing a graphical representation of the specified graph, with the specified component highlighted, and the specified comment next to the representation.
 MatchingVisualizer feedLine(java.util.List<Match> ms, java.lang.String comment)
          Outputs a line of the matching process visualization to the canvas, also adding the specified comment.
 MatchingVisualizer feedLine(Match m1, Match m2, Match m3, java.lang.String comment)
          Outputs a line of the matching process visualization to the canvas, consisting of three match, also adding the specified comment.
 MatchingVisualizer feedLine(Match m1, Match m2, java.lang.String comment)
          Outputs a line of the matching process visualization to the canvas, consisting of two matches, also adding the specified comment.
 MatchingVisualizer feedLine(Match m1, java.lang.String comment)
          Outputs a line of the matching process visualization to the canvas, consisting of only one match, also adding the specified comment.
 MatchingVisualizer feedLine(java.lang.String comment)
          Displays in the visualizer a line showing only one comment.
 MatchingVisualizer setCanvas(net.xqhs.graphical.GCanvas canvas)
           
 MatchingVisualizer setLineHeight(int height)
           
 MatchingVisualizer setTopLeft(java.awt.Point topleft)
           
 
Methods inherited from class net.xqhs.util.logging.Unit
compose, dbg, doExit, getDefaultUnitName, getUnitName, l, le, lf, li, lock, lockedR, lr, lr, lw, setLink, setLink, setLogDisplay, setLogEnsureNew, setLoggerClass, setLoggerType, setLoggerTypeClass, setLogLevel, setLogReporter, setUnitName, setUnitName
 
Methods inherited from class net.xqhs.util.config.Config
build, ensureLocked, locked, lockedEx, makeDefaults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theCanvas

net.xqhs.graphical.GCanvas theCanvas
The canvas to use.


topleftLine

java.awt.Point topleftLine
The current position - top left corner for the current line.


lineHeight

int lineHeight
The height of a line.


lineSpacing

float lineSpacing
Fraction of the line height to consider as spacing between lines.


fontSize

int fontSize
Size of the font to use for writing.

Constructor Detail

MatchingVisualizer

public MatchingVisualizer()
Method Detail

setCanvas

public MatchingVisualizer setCanvas(net.xqhs.graphical.GCanvas canvas)
Parameters:
canvas - - the GCanvas to use
Returns:
the instance itself

setTopLeft

public MatchingVisualizer setTopLeft(java.awt.Point topleft)
Parameters:
topleft - - the coordinate on the canvas to use as top left corner for the visualization
Returns:
the instance itself

setLineHeight

public MatchingVisualizer setLineHeight(int height)
Parameters:
height - - the height of a feed line
Returns:
the instance itself

feedLine

public MatchingVisualizer feedLine(Match m1,
                                   java.lang.String comment)
Outputs a line of the matching process visualization to the canvas, consisting of only one match, also adding the specified comment.

Parameters:
m1 - - the match.
comment - - the comment.
Returns:
- the instance itself.

feedLine

public MatchingVisualizer feedLine(Match m1,
                                   Match m2,
                                   java.lang.String comment)
Outputs a line of the matching process visualization to the canvas, consisting of two matches, also adding the specified comment.

Parameters:
m1 - - the first match.
m2 - - the second match.
comment - - the comment.
Returns:
- the instance itself.

feedLine

public MatchingVisualizer feedLine(Match m1,
                                   Match m2,
                                   Match m3,
                                   java.lang.String comment)
Outputs a line of the matching process visualization to the canvas, consisting of three match, also adding the specified comment.

Parameters:
m1 - - the first match.
m2 - - the second match.
m3 - - the third match.
comment - - the comment.
Returns:
- the instance itself.

feedLine

public MatchingVisualizer feedLine(java.util.List<Match> ms,
                                   java.lang.String comment)
Outputs a line of the matching process visualization to the canvas, also adding the specified comment.

Parameters:
ms - - matches to add to the visualization.
comment - - comment to add to the visualization.
Returns:
the instance itself.

feedLine

public MatchingVisualizer feedLine(Graph graph,
                                   VisualizableGraphComponent highlight,
                                   java.lang.String comment)
Displays in the visualizer a line showing a graphical representation of the specified graph, with the specified component highlighted, and the specified comment next to the representation.

Parameters:
graph - - the graph
highlight - - the highlighted component
comment - - the comment / message to display
Returns:
the instance itself

feedLine

public MatchingVisualizer feedLine(java.lang.String comment)
Displays in the visualizer a line showing only one comment.

Parameters:
comment - - the comment
Returns:
the instance itself