grim/purple-objects-docbook

Parents f3e4feb954f2
Children c1781792d7c2
cleaned up the hierarchy template a bit (was kind of messy, more cleaning is possible, but right now it works
made the title for the hierarchy template optional
removed the titles from the object key and the relationship key
cleaned up the graphs page and added xref's to the newly created figures
--- a/graphs/objects.key Thu Apr 30 21:13:52 2009 -0500
+++ b/graphs/objects.key Thu Apr 30 21:27:58 2009 -0500
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hierarchy name="Object Key">
+<hierarchy>
<objects>
<object name="AbstractClass" type="abstract"/>
<object name="ConcreteClass" type="concrete"/>
--- a/graphs/relationships.key Thu Apr 30 21:13:52 2009 -0500
+++ b/graphs/relationships.key Thu Apr 30 21:27:58 2009 -0500
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<hierarchy name="Relationship Key">
+<hierarchy>
<objects>
<object name="Abstract" type="abstract"/>
<object name="Concrete" type="concrete"/>
--- a/sheets/hierarchy.xsl Thu Apr 30 21:13:52 2009 -0500
+++ b/sheets/hierarchy.xsl Thu Apr 30 21:27:58 2009 -0500
@@ -6,11 +6,23 @@
<xsl:variable name="concrete-color" select="'lightpink'"/>
<xsl:variable name="interface-color" select="'powderblue'"/>
<xsl:variable name="boxed-color" select="'lightyellow'"/>
+
+ <!-- relation templates -->
+ <xsl:template name="relation.is-a">
+ <xsl:text>[arrowhead="onormal"];</xsl:text>
+ </xsl:template>
- <xsl:variable name="default-arrow" select="'normal'"/>
- <xsl:variable name="is-a-arrow" select="'onormal'"/>
- <xsl:variable name="has-a-arrow" select="'odiamond'"/>
- <xsl:variable name="implements-arrow" select="'odot'"/>
+ <xsl:template name="relation.has-a">
+ <xsl:text>[arrowhead="odiamond"];</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="relation.implements">
+ <xsl:text>[arrowhead="odot"];</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="relation.default">
+ <xsl:text>[arrowhead="normal"];</xsl:text>
+ </xsl:template>
<!-- object template -->
<xsl:template name="object">
@@ -66,27 +78,22 @@
<xsl:value-of select="@end"/>
<xsl:if test="@type">
- <xsl:text>[arrowhead="</xsl:text>
-
<xsl:choose>
<xsl:when test="@type = 'is-a'">
- <xsl:value-of select="$is-a-arrow"/>
+ <xsl:call-template name="relation.is-a"/>
</xsl:when>
<xsl:when test="@type = 'has-a'">
- <xsl:value-of select="$has-a-arrow"/>
+ <xsl:call-template name="relation.has-a"/>
</xsl:when>
<xsl:when test="@type = 'implements'">
- <xsl:value-of select="$implements-arrow"/>
+ <xsl:call-template name="relation.implements"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="$default-arrow"/>
+ <xsl:call-template name="relation.default"/>
</xsl:otherwise>
</xsl:choose>
-
- <xsl:text>"]</xsl:text>
</xsl:if>
- <xsl:text>;</xsl:text>
<xsl:value-of select="$newline-tab"/>
</xsl:template>
@@ -97,13 +104,17 @@
<xsl:value-of select="$newline-tab"/>
<!-- output some basic stuff -->
- <xsl:text>label="</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>";</xsl:text>
- <xsl:value-of select="$newline-tab"/>
- <xsl:text>labelloc="t";</xsl:text>
- <xsl:value-of select="$newline-tab"/>
+ <!-- don't set a label if we don't have one -->
+ <xsl:if test="@name">
+ <xsl:text>label="</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>";</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <xsl:text>labelloc="t";</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+ </xsl:if>
<xsl:text>splines=true;</xsl:text>
<xsl:value-of select="$newline-tab"/>
--- a/xml/graphs.xml Thu Apr 30 21:13:52 2009 -0500
+++ b/xml/graphs.xml Thu Apr 30 21:27:58 2009 -0500
@@ -2,44 +2,39 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<chapter id="graphs">
- <title>All about the graphs</title>
+ <title>About the graphs</title>
<para>
There are many graphs in use in this document. All of the graphs
- are generated by the graphviz package.
+ are generated by the tools in the graphviz package.
</para>
- <sect1>
+ <para>
+ All object and interfaces are represented by a rectangle. The color is
+ used to describe the type of object. We see that In
+ <xref linkend="key-objects"/> abstract classes are pale green, concrete
+ classes are light pink, and interfaces are powder blue.
+ </para>
+
+ <figure id="key-objects">
<title>Object Key</title>
- <imageobject>
- <imagedata fileref="graphs/objects.png"/>
- </imageobject>
+ <graphic fileref="graphs/objects.png"/>
+ </figure>
- <para>
- All object and interfaces are represented by a rectangle. The
- color is used to describe the type of object. In the key above
- we see that abstract classes are pale green, concrete classes
- are light pink, and interfaces are powder blue.
- </para>
- </sect1>
+ <para>
+ Similar to the object key, the <xref linkend="key-relationships"/>
+ shows how objects relate to one another. Subclasses point to their
+ parent class with an open arrow. Classes that implement interfaces
+ point to the interface they're implementing with an open circle.
+ Classes that have an instance of another class, are pointed to by that
+ class with an open diamond.
+ </para>
- <sect1>
+ <figure id="key-relationships">
<title>Relationship Key</title>
- <imageobject>
- <imagedata fileref="graphs/relationships.png"/>
- </imageobject>
-
- <para>
- Similar to the object key, the relationship key shows how
- objects relate to one another. Subclasses point to their
- parent class with a solid line with an open arrow. Classes
- that implement interfaces point to the interface they're
- implementing with a dotted line with an open circle. Classes
- that have an instance of another class, are pointed to by that
- class with an open diamond.
- </para>
- </sect1>
+ <graphic fileref="graphs/relationships.png"/>
+ </figure>
</chapter>