diff --git a/Doc/Sd1/arrays.xml b/Doc/Sd1/arrays.xml index 3dd718053e8b76451e96b24f1b4231221b32a8e2..8c205e7aad423900c3db8c9ac87a934ed3b3aafd 100644 --- a/Doc/Sd1/arrays.xml +++ b/Doc/Sd1/arrays.xml @@ -11,6 +11,14 @@ xmlns:db="http://docbook.org/ns/docbook"> <title>Arrays</title> + <info> + <abstract> + <para>Multiple values of common type.</para> + + <para>Loop style handling.</para> + </abstract> + </info> + <figure xml:id="sd1_array_fig_arrayMotivate"> <title>Motivating Arrays</title> @@ -894,6 +902,16 @@ final String shapes[] = {"Triangle", "Circle"};</programlisting> xlink:href="https://docs.oracle.com/javase/10/docs/api/java/util/Arrays.html">java.util.Arrays</classname> helpers</title> + <info> + <abstract> + <para>Sorting and searching arrays.</para> + + <para>Fill in values.</para> + + <para>Compare array contents.</para> + </abstract> + </info> + <figure xml:id="sd1_array_fig_arraysToStringSort"> <title><classname xlink:href="https://docs.oracle.com/javase/10/docs/api/java/util/Arrays.html">Arrays</classname>.<methodname @@ -1056,18 +1074,27 @@ sort|find(Mandyer): -4</screen> xlink:href="https://docs.oracle.com/javase/10/docs/api/java/util/Arrays.html">Arrays</classname>.<methodname xlink:href="https://docs.oracle.com/javase/10/docs/api/java/util/Arrays.html#fill(java.lang.Object%5B%5D,int,int,java.lang.Object)">fill(...)</methodname></title> - <programlisting language="none">final String[] names = {"Eve", "Aaron", "Paul", "Mandy"}; + <informaltable border="0"> + <colgroup width="48%"/> -System.out.println("toString: " + Arrays.toString(names)); + <colgroup width="52%"/> -Arrays.<emphasis role="red">fill(names, "N.N")</emphasis>; + <tr> + <td valign="top"><programlisting language="none">final String[] names = + {"Eve", "Aaron", "Paul", "Mandy"}; -System.out.println("toString: " + Arrays.toString(names));</programlisting> +System.out.println("toString: " + + Arrays.toString(names)); - <para>Result:</para> +Arrays.<emphasis role="red">fill(names, "N.N")</emphasis>; + +System.out.println("toString: " + + Arrays.toString(names));</programlisting></td> - <screen>toString: [Eve, Aaron, Paul, Mandy] -toString: [N.N, N.N, N.N, N.N]</screen> + <td valign="top"><screen>toString: [Eve, Aaron, Paul, Mandy] +toString: [N.N, N.N, N.N, N.N]</screen></td> + </tr> + </informaltable> </figure> <figure xml:id="sd1_array_fig_arraysCopyOf"> @@ -1108,7 +1135,13 @@ l1.equals(l3):false</screen> </section> <section xml:id="sd1_array_sect_extend"> - <title>Extending an array</title> + <title>Extending arrays</title> + + <info> + <abstract> + <para>Dealing with fixed size.</para> + </abstract> + </info> <figure xml:id="sd1_array_fig_arraysExtendArrayProblem"> <title>Lack of extendability</title> @@ -1623,6 +1656,15 @@ final int[] sortedValues = Arrays.copyOf(values, values.length); <title>Understanding <methodname>static public int main(String[] args)</methodname></title> + <info> + <abstract> + <para><methodname>main(...)</methodname> and its array + argument.</para> + + <para>Implementing parameter passing.</para> + </abstract> + </info> + <figure xml:id="sd1_array_fig_understandingMain"> <title><methodname>public static void main(String[] args)</methodname></title> @@ -1926,6 +1968,12 @@ public class AppTest { <section xml:id="sd1_array_sect_multidim"> <title>Multi-dimensional arrays</title> + <info> + <abstract> + <para>Multiple dimensions by nesting of arrays.</para> + </abstract> + </info> + <figure xml:id="sd1_array_fig_multidimArray"> <title><methodname>Multidimensional arrays</methodname></title> diff --git a/Doc/Sd1/coreClasses.xml b/Doc/Sd1/coreClasses.xml index 5bd157ebaba782d3465010286ff33a64db4dd407..ab703209ca99f6851e9653d206e6c4bead9a3fad 100644 --- a/Doc/Sd1/coreClasses.xml +++ b/Doc/Sd1/coreClasses.xml @@ -11,6 +11,16 @@ xmlns:db="http://docbook.org/ns/docbook"> <title>Core Classes</title> + <info> + <abstract> + <para>Working with class <classname>String</classname>.</para> + + <para>Operator <code language="java">==</code> pitfalls</para> + + <para>Using <methodname>equals(...)</methodname>.</para> + </abstract> + </info> + <figure xml:id="sd1_coreclasses_fig_object"> <title>Superclass <classname xlink:href="https://docs.oracle.com/javase/10/docs/api/java/lang/Object.html">Object</classname></title> @@ -139,6 +149,18 @@ equals: true</screen></td> <section xml:id="sw1_sect_CoreClasses_hashing"> <title>Objects, equals() and hash-values</title> + <info> + <abstract> + <para>Why using hash values?</para> + + <para><methodname>hashCode()</methodname> and + <methodname>equals(...)</methodname>.</para> + + <para>«Good» <methodname>hashCode()</methodname> + implementations.</para> + </abstract> + </info> + <figure xml:id="sd1_coreclasses_fig_hashPrinciple"> <title>Hashing principle</title> diff --git a/Doc/Sd1/objectsClasses.xml b/Doc/Sd1/objectsClasses.xml index 92c87fc024520187ffbfb5cefd8846383c05a8d9..5324db53c8cde07e03b39e6da08641a851aaa7ec 100644 --- a/Doc/Sd1/objectsClasses.xml +++ b/Doc/Sd1/objectsClasses.xml @@ -244,9 +244,9 @@ if (null == r) { <abstract> <para>Significance for larger projects.</para> - <para>Fully qualified vs. <code>import</code>.</para> + <para>Fully qualified vs. «<code>import</code>».</para> - <para><package>java.lang</package> an other exception rules.</para> + <para><package>java.lang</package> and other exceptions.</para> </abstract> </info> @@ -296,18 +296,16 @@ if (null == r) { </listitem> <listitem> - <para>Packages start with reversed <xref linkend="glo_DNS"/> name - e.g.:</para> + <para>Package names must not contain operators:</para> <para><uri>mi.hdm<emphasis role="red">-</emphasis>stuttgart.de</uri> --> <package>de.hdm<emphasis role="red">_</emphasis>stuttgart.mi</package>.</para> + </listitem> - <caution> - <para>Notice the <quote><emphasis role="red">-</emphasis></quote> - to <quote><emphasis role="red">_</emphasis></quote> - translation.</para> - </caution> + <listitem> + <para>Packages should start with reversed <xref linkend="glo_DNS"/> + avoiding clashes.</para> </listitem> </itemizedlist> </figure> @@ -863,12 +861,12 @@ System.out.println("Perimeter=" + r.getPerimeter());</programlisting></td> <info> <abstract> - <para>Justifying access restrictions: Conserve implementation - flexibility.</para> + <para>Justifying access restrictions.</para> - <para>public, private protected and «package local» rules.</para> + <para><code>public</code>, <code>protected</code> «package local» + and <code>private</code>.</para> - <para>Best practices: Be as restrictive as possible.</para> + <para>Best practices.</para> </abstract> </info> @@ -936,12 +934,14 @@ System.out.println("Perimeter=" + r.getPerimeter());</programlisting></td> <calloutlist role="slideExclude"> <callout arearefs="sd1_callout_publicPrivateInterface-1-co" xml:id="sd1_callout_publicPrivateInterface-1"> - <para>Private attributes only accessible inside class.</para> + <para>Private attributes only accessible by methods belonging to + class.</para> </callout> <callout arearefs="sd1_callout_publicPrivateInterface-2-co" xml:id="sd1_callout_publicPrivateInterface-2"> - <para>Public interface accessible by arbitrary classes.</para> + <para><code language="java">public</code> items accessible also by + alien classes.</para> </callout> </calloutlist> </figure> diff --git a/ws/Docbook/CustomLayer/slide/slideHdm.xsl b/ws/Docbook/CustomLayer/slide/slideHdm.xsl index 9f0c4888156d27033a40d19a68c425815398fcb2..536419ddad5a4ba475828040ca8647dcfa8ff862 100644 --- a/ws/Docbook/CustomLayer/slide/slideHdm.xsl +++ b/ws/Docbook/CustomLayer/slide/slideHdm.xsl @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:d="http://docbook.org/ns/docbook"> + xmlns:d="http://docbook.org/ns/docbook" + xmlns="http://www.w3.org/1999/xhtml"> <xsl:import href="../../docbook-xsl/xhtml/chunk.xsl"/> <xsl:import href="../../docbook-xsl/xhtml/highlight.xsl"/> @@ -13,8 +14,6 @@ <xsl:variable name="topicLookup" select="document('topics.tid.xml', .)"/> - <xsl:param name="slide2lectureref"/> - <xsl:template match="/"> <xsl:apply-templates select="(//d:chapter | //d:section | //d:appendix) [contains(@annotations, 'slide') or descendant::*[contains(@annotations, 'slide')]]" @@ -25,12 +24,11 @@ <xsl:template name="createBreadcrumbHierarchy"> <xsl:param name="nodes"/> <xsl:param name="currentPosition"/> - <ul> - <xsl:if test="$currentPosition = 1"> - <h3>Overview <img src="common/images/compass.svg" width="30ex" + <xsl:if test="$currentPosition = 1"> + <h3>Overview <img src="common/images/compass.svg" width="60" style="border: 0mm; margin-top: 0mm; margin-bottom: 0mm;"/></h3> - </xsl:if> - + </xsl:if> + <ul> <li style="list-style-type: none;"> <xsl:if test="not($currentPosition = 1)"> @@ -41,25 +39,63 @@ <xsl:choose> <xsl:when test="$currentPosition < count($nodes)"> <xsl:variable name="nextPosition" select="$currentPosition + 1"/> - <xsl:call-template name="createBreadcrumbHierarchy" > + <xsl:call-template name="createBreadcrumbHierarchy"> <xsl:with-param name="nodes" select="$nodes"/> <xsl:with-param name="currentPosition" select="$nextPosition"/> </xsl:call-template> </xsl:when> <xsl:otherwise> - <xsl:for-each select="$nodes[$currentPosition]/d:info/d:abstract/d:para"> + <div class="slideSectionOverview"> + <xsl:for-each select="$nodes[$currentPosition]/d:info/d:abstract/d:para"> + <p> + <xsl:value-of select="."/> + </p> + </xsl:for-each> + </div> + <div class ="hdmfooter"> <p> - <xsl:value-of select="."/> + <a target="_blank"> + <xsl:attribute name="href"> + <xsl:for-each select="$nodes[$currentPosition]"> + <xsl:call-template name="href.target.uri"/> + </xsl:for-each> + </xsl:attribute> + <xsl:text>Lecture notes</xsl:text> + </a> </p> - </xsl:for-each> + </div> </xsl:otherwise> - </xsl:choose> + </xsl:choose> + </li> + </ul> + </xsl:template> + + <xsl:template name="createTooltipBreadcrumbHierarchy"> + <xsl:param name="nodes"/> + <xsl:param name="currentPosition"/> + <ul> + <xsl:if test="$currentPosition = 1"> + <xsl:attribute name="class">tooltiptext</xsl:attribute> + </xsl:if> + + <li style="list-style-type: none;"> + <xsl:if test="not($currentPosition = 1)"> + <xsl:text>➟ </xsl:text> + </xsl:if> + <xsl:value-of select="$nodes[$currentPosition]/d:title"/> + <xsl:if test="$currentPosition < count($nodes)"> + <xsl:variable name="nextPosition" select="$currentPosition + 1"/> + <xsl:call-template name="createTooltipBreadcrumbHierarchy"> + <xsl:with-param name="nodes" select="$nodes"/> + <xsl:with-param name="currentPosition" select="$nextPosition"/> + </xsl:call-template> + </xsl:if> </li> </ul> </xsl:template> - + <xsl:template match="*" mode="slideUnit"> <xsl:message> <xsl:text>No template matching '</xsl:text> @@ -68,7 +104,7 @@ </xsl:message> </xsl:template> - <xsl:template match="d:section" mode="slideDescendants"> + <xsl:template match="d:chapter|d:section|d:appendix" mode="slideDescendants"> <section id="{@xml:id}"> <xsl:call-template name="createBreadcrumbHierarchy"> <xsl:with-param name="nodes" @@ -87,13 +123,14 @@ </xsl:variable> <!-- Writing slide series --> - <xsl:document href="{$slideFileName}" method="html" encoding="utf-8" indent="no"> + <xsl:document href="{$slideFileName}" method="html" encoding="utf-8" indent="yes"> <html lang="en"> <head> <title> <xsl:value-of select="d:title"/> </title> + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link href="common/css/positioning.css" rel="stylesheet" /> <link href="reveal.js/css/reveal.css" rel="stylesheet" /> <link href="reveal.js/css/theme/serif.css" id="theme" rel="stylesheet" /> @@ -101,6 +138,53 @@ <!-- Code syntax highlighting --> <link href="reveal.js/lib/css/zenburn.css" rel="stylesheet" /> + <style> + /* Tooltip container */ + .tooltip { + position: relative; + display: inline-block; + border-bottom: 1px dotted black; /* If you want dots under the hoverable text */ + } + + /* Tooltip text */ + .tooltip .tooltiptext { + visibility: hidden; + width: 600px; + background-color: #555; + color: #fff; + padding: 50px; + border-radius: 6px; + + /* Position the tooltip text */ + position: absolute; + z-index: 1; + bottom: 110%; + left: 0%; + margin-left: -300px; + + /* Fade in tooltip */ + opacity: 0; + transition: opacity 0.3s; + } + + /* Tooltip arrow */ + .tooltip .tooltiptext::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + margin-left: -5px; + border-width: 5px; + border-style: solid; + border-color: #555 transparent transparent transparent; + } + + /* Show the tooltip text when you mouse over the tooltip container */ + .tooltip:hover .tooltiptext { + visibility: visible; + opacity: 1; + } + </style> </head> <body> @@ -108,7 +192,10 @@ <div class="reveal"> <!-- Wrap all slides in a single "slides" class --> <div class="slides"> - <xsl:apply-templates select=".//d:figure[not (ancestor::d:qandaset)] | .//d:section[d:figure[not (ancestor::d:qandaset)]]" + <xsl:apply-templates select=".//d:figure[not (ancestor::d:qandaset)] | + descendant-or-self::d:chapter[d:figure[not (ancestor::d:qandaset)]]| + descendant-or-self::d:section[d:figure[not (ancestor::d:qandaset)]] | + descendant-or-self::d:appendix[d:figure[not (ancestor::d:qandaset)]]" mode="slideDescendants"/> </div> </div> @@ -166,10 +253,6 @@ </xsl:choose> </xsl:variable> - <xsl:variable name="webhelpLink"> - <xsl:call-template name="href.target.uri"/> - </xsl:variable> - <xsl:variable name="titleNode" select="d:title"/> <xsl:variable name="baseSupplementDir"> @@ -199,6 +282,7 @@ </xsl:if> </xsl:variable> + <xsl:variable name="currentFigure" select="."/> <xsl:choose> <xsl:when test="1 < count($xfigBasenameSet/*)"> <!-- More than one image: Animation --> <section> @@ -230,18 +314,7 @@ </xsl:attribute> </img> </div> - <xsl:if test="not($slide2lectureref = 'no')"> - <div class ="hdmfooter"> - <p> - <a target="_blank" href="{$webhelpLink}">Lecture notes</a> - <xsl:text> </xsl:text> - <a target="_blank" href="#{parent::*/@xml:id}"> - <img src="common/images/compass.svg" width="30ex" - style="border: 0mm; margin-top: 0mm; margin-bottom: 0mm;"/> - </a> - </p> - </div> - </xsl:if> + <xsl:apply-templates select="$currentFigure" mode="footer"/> </section> </xsl:for-each> </section> @@ -249,34 +322,8 @@ <xsl:otherwise> <!-- no animated image --> <section id="{$primarySectionId}"> - <xsl:apply-templates select="."/> - - <xsl:if test="not($slide2lectureref = 'no')"> - <div class ="hdmfooter"> - <p> - <a target="_blank" href="{$webhelpLink}">Lecture notes</a> - <xsl:text> </xsl:text> - <a target="_blank" href="#{parent::*/@xml:id}"> - <img src="common/images/compass.svg" width="30ex" - style="border: 0mm; margin-top: 0mm; margin-bottom: 0mm;"/> - </a> - <xsl:variable name="qandaId" select="@xml:id"/> - <xsl:if test="$topicLookup/map/entry[@id = $qandaId]"> - <xsl:text> | </xsl:text> - <xsl:variable name="tid" select="$topicLookup/map/entry[@id = $qandaId]/@tid"/> - <a target="_blank"> - <xsl:attribute name="href"> - <xsl:text>https://bb.mi.hdm-stuttgart.de/topic/</xsl:text> - <xsl:value-of select="$tid"/> - </xsl:attribute> - <img src="common/images/comment.svg" width="30ex" style="border: 0mm;"/> - <xsl:text> create comment</xsl:text> - </a> - </xsl:if> - </p> - </div> - </xsl:if> + <xsl:apply-templates select="." mode="footer"/> </section> </xsl:otherwise> </xsl:choose> @@ -313,11 +360,59 @@ </ul> </xsl:otherwise> </xsl:choose> - </section> - + </section> </xsl:if> </xsl:template> + <xsl:template match="*" mode="footer"> + <xsl:message> + <xsl:text>No template defined for element "</xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text>" in mode "footer"</xsl:text> + </xsl:message> + </xsl:template> + + <xsl:template match="d:figure" mode="footer"> + + <div class="hdmfooter"> + <table> + <tr> + <td class="tooltip"> + <a target="_blank"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target.uri"/> + </xsl:attribute> + <img src="common/images/book.svg" width="60" + style="border: 0mm; margin-top: 0mm; margin-bottom: 0mm;"></img> + <p class="tooltiptext">Lecture notes</p> + </a> + </td> + <td class="tooltip"> + <a target="_blank" href="#{parent::*/@xml:id}"> + <img src="common/images/compass.svg" width="60" + style="border: 0mm; margin-top: 0mm; margin-bottom: 0mm;"></img> + </a> + <xsl:call-template name="createTooltipBreadcrumbHierarchy"> + <xsl:with-param name="nodes" + select="ancestor-or-self::d:section|ancestor-or-self::d:chapter|ancestor-or-self::d:appendix"/> + <xsl:with-param name="currentPosition" select="1"/> + </xsl:call-template> + </td> + <xsl:variable name="qandaId" select="@xml:id"/> + <xsl:if test="$topicLookup/map/entry[@id = $qandaId]"> + + <td class="tooltip"> + <a target="_blank" href="https://bb.mi.hdm-stuttgart.de/topic/{$topicLookup/map/entry[@id = $qandaId]/@tid}"> + <img src="common/images/comment.svg" + style="border: 0mm; margin-top: 0mm; margin-bottom: 0mm;" width="60" ></img></a> + <p class="tooltiptext">Create comment</p> + </td> + </xsl:if> + </tr> + </table> + </div> + </xsl:template> + <xsl:template match="d:qandaset" mode="qandaNumber"> <xsl:variable name="parentId" select="ancestor::d:part/@xml:id"/> <xsl:value-of select="count(preceding::d:qandaset[ancestor::d:part/@xml:id = $parentId]) + 1"/> @@ -444,6 +539,5 @@ <xsl:text>Your Browser does not support the video tag</xsl:text> </video> </xsl:template> - - + </xsl:stylesheet> diff --git a/ws/Docbook/CustomLayer/webhelp/positioning.css.patch b/ws/Docbook/CustomLayer/webhelp/positioning.css.patch index 08fa25fca7a94cd518fda1c908d27a28641a2ef8..b23f4b9ef282bc83cdd3e472f6a14cf5b5bb1d9a 100644 --- a/ws/Docbook/CustomLayer/webhelp/positioning.css.patch +++ b/ws/Docbook/CustomLayer/webhelp/positioning.css.patch @@ -1,5 +1,5 @@ ---- positioning.css.orig 2018-11-17 13:48:07.180040443 +0100 -+++ positioning.css 2018-11-17 13:49:03.923387718 +0100 +--- /usr/share/hdm-docbook-xsl/docbook-xsl-1.79.2/webhelp/template/common/css/positioning.css 2016-12-09 23:39:10.000000000 +0100 ++++ positioning.css 2019-05-11 12:28:00.610579125 +0200 @@ -1,3 +1,8 @@ +/* + * patched by: /usr/share/hdm-docbook-xsl/CustomLayer/webhelp/positioning.css.patch @@ -80,7 +80,7 @@ #content .qandaset>table, #content .qandaset>table td, #content .calloutlist table, #content .calloutlist table td, #content .navfooter table, #content .navfooter table td { border: 0px solid; } -@@ -375,3 +394,136 @@ +@@ -375,3 +394,142 @@ } @@ -214,6 +214,12 @@ + border-radius: 2ex; +} + ++.slideSectionOverview { ++ background-color: #FCFFCD; ++ border-radius: 25px; ++ padding-left: 10px; ++} ++ +a:hover { + color: LightSkyBlue; +} diff --git a/ws/Docbook/Extensions/Tdata/Common/Components/exampleSlides.xml b/ws/Docbook/Extensions/Tdata/Common/Components/exampleSlides.xml index 7dcfe69fa36e176aaef1e0ae36a1ab629a2b2d74..26f50fceb1907bf5a623d44bc36599742f522056 100644 --- a/ws/Docbook/Extensions/Tdata/Common/Components/exampleSlides.xml +++ b/ws/Docbook/Extensions/Tdata/Common/Components/exampleSlides.xml @@ -19,6 +19,14 @@ <section xml:id="objectsClassesBasics"> <title>Classes in OO languages</title> + <info> + <abstract> + <para>Some info</para> + + <para>More info</para> + </abstract> + </info> + <figure xml:id="classRationale"> <title>What are classes?</title> @@ -96,7 +104,7 @@ </qandaset> <qandaset defaultlabel="qanda" xml:id="qandaHumanRelated2"> - <title><xref linkend="glo_Unicode"/> representations</title> + <title> Unicode representations</title> <qandadiv> <qandaentry> @@ -229,6 +237,7 @@ drwxr-xr-x 100 goik fb1prof 12288 Jul 13 07:43 .. <section xml:id="MathML"> <title>Mathematical formulas</title> + <info> <abstract> <para>Examples displaying both inline and block formulas.</para>