public class SVGServiceGraphGenerator extends Object
Constructor and Description |
---|
SVGServiceGraphGenerator()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
generate(ServiceGraph sg,
int maxWidth,
OutputStream os)
This method generates the SVG representation of the supplied
service graph to the output stream.
|
protected void |
generateInvocationLink(InvocationLink il,
double ratio,
Element container,
Node insertPoint)
This method generates the invocation link.
|
protected void |
generateMetrics(Element container,
String description,
InvocationMetric metrics)
This method generates the tooltip information to show
metrics.
|
protected void |
generateOperation(OperationNode opn,
double ratio,
Element container,
Node insertPoint)
This method generates the operation node.
|
protected void |
generateService(ServiceNode sn,
double ratio,
Element container,
Node insertPoint)
This method generates the service node.
|
protected void |
generateSituations(Element container,
Node insertPoint,
int x,
int y,
double ratio,
List<Situation> situations)
This method generates the situations associated with the supplied
position and list.
|
protected void |
generateUsageLink(UsageLink ul,
double ratio,
Element container,
Node insertPoint)
This method generates the usage link.
|
protected static Severity |
getAverageSeverity(Severity[] severities)
Determine the average severity based on the supplied array.
|
protected String |
getColor(Severity severity)
This method returns the colour code associated with the severity.
|
protected String |
getDescription(InvocationLink il)
This method returns the description to be used for the
invocation link.
|
protected String |
getDescription(UsageLink ul)
This method returns the description to be used for the
usage link.
|
protected Severity |
getInvocationSeverity(List<InvocationDefinition> invocations)
This method returns the invocation metrics associated with the
supplied invocation definitions.
|
protected String |
getLocalName(String qname)
This method returns the local name associated with the supplied
fully qualified name.
|
SeverityAnalyzer |
getSeverityAnalyzer()
This method returns the color selector.
|
protected String |
getSituationSeverityColor(Situation.Severity severity)
This method returns the color associated with the supplied
situation severity.
|
protected String |
getSituationText(Situation s)
This method returns the text to display for the supplied
situation.
|
protected boolean |
isGenerateText(double ratio)
This method determines whether to generate the text.
|
protected boolean |
isGenerateToolTips(double ratio)
This method determines whether to generate the tool tips.
|
protected Document |
loadTemplate(String name)
This method returns the named template file.
|
protected void |
saveDocument(Document doc,
OutputStream os)
This method saves the supplied document to the output stream.
|
void |
setSeverityAnalyzer(SeverityAnalyzer analyzer)
This method sets the severity analyzer.
|
public SVGServiceGraphGenerator()
public SeverityAnalyzer getSeverityAnalyzer()
public void setSeverityAnalyzer(SeverityAnalyzer analyzer)
analyzer
- The severity analyzerpublic void generate(ServiceGraph sg, int maxWidth, OutputStream os) throws Exception
sg
- The service graphmaxWidth
- The maximum width, or 0 if not relevantos
- The output streamException
- Failed to generate SVGprotected void generateUsageLink(UsageLink ul, double ratio, Element container, Node insertPoint)
ul
- The usage linkratio
- The ratiocontainer
- The containerinsertPoint
- The insertion pointprotected String getDescription(UsageLink ul)
ul
- The usage linkprotected String getColor(Severity severity)
severity
- The severityprotected void generateInvocationLink(InvocationLink il, double ratio, Element container, Node insertPoint)
il
- The invocation linkratio
- The ratiocontainer
- The containerinsertPoint
- The insertion pointprotected String getDescription(InvocationLink il)
il
- The invocation linkprotected void generateService(ServiceNode sn, double ratio, Element container, Node insertPoint)
sn
- The service noderatio
- The ratio, 1 if normal sizecontainer
- The containerinsertPoint
- The insertion pointprotected String getLocalName(String qname)
qname
- The fully qualified nameprotected boolean isGenerateToolTips(double ratio)
ratio
- The ratioprotected boolean isGenerateText(double ratio)
ratio
- The ratioprotected void generateSituations(Element container, Node insertPoint, int x, int y, double ratio, List<Situation> situations)
container
- The containerx
- The x positiony
- The y positionratio
- The ratiosituations
- The list of situationsprotected String getSituationText(Situation s)
s
- The situationprotected String getSituationSeverityColor(Situation.Severity severity)
severity
- The situation severityprotected Severity getInvocationSeverity(List<InvocationDefinition> invocations)
invocations
- The invocation definitionsprotected static Severity getAverageSeverity(Severity[] severities)
severities
- The severitiesprotected void generateMetrics(Element container, String description, InvocationMetric metrics)
container
- The containerdescription
- The descriptionmetrics
- The metricsprotected void generateOperation(OperationNode opn, double ratio, Element container, Node insertPoint)
opn
- The operation noderatio
- The ratiocontainer
- The container elementinsertPoint
- The insertion pointprotected void saveDocument(Document doc, OutputStream os) throws Exception
doc
- The SVG documentos
- The output streamException
- Failed to save SVG documentCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.