alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Lucene example source code file (corner-imports.svg.xslt)

This example Lucene source code file (corner-imports.svg.xslt) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Lucene tags/keywords

apache, as, asf, asf, conditions, kind, license, license, see, see, software, without, you, you

The Lucene corner-imports.svg.xslt source code

<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:param name="orientation-tb"/>
  <xsl:param name="orientation-lr"/>
  <xsl:param name="size"/>
  <xsl:param name="bg-color-name"/>
  <xsl:param name="stroke-color-name"/>
  <xsl:param name="fg-color-name"/>
<!-- if not all colors are present, don't even try to render the corners -->
  <xsl:variable name="isize">
    <xsl:choose>
      <xsl:when test="$bg-color-name and $stroke-color-name and $fg-color-name">
        <xsl:value-of select="$size"/>
      </xsl:when>
      <xsl:otherwise>0
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="smallersize" select="number($isize)-1"/>
  <xsl:variable name="biggersize" select="number($isize)+1"/>
  <xsl:variable name="bg">
    <xsl:if test="skinconfig/colors/color[@name=$bg-color-name]">fill:;
  </xsl:variable>
  <xsl:variable name="fill">
    <xsl:if test="skinconfig/colors/color[@name=$stroke-color-name]">fill:;
  </xsl:variable>
  <xsl:variable name="stroke">
    <xsl:if test="skinconfig/colors/color[@name=$fg-color-name]">stroke:;
  </xsl:variable>
  <xsl:template match="skinconfig">
    <svg width="{$isize}" height="{$isize}">
<!-- background-->
      <rect x="-1" y="-1" width="{$biggersize}" height="{$biggersize}" style="{$bg}stroke-width:0"/>
<!-- 0,0 0,-4 4,0 4,-4-->
      <xsl:variable name="flip-tb-scale">
        <xsl:choose>
          <xsl:when test="$orientation-tb='t'">1
          <xsl:otherwise>-1
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="flip-lr-scale">
        <xsl:choose>
          <xsl:when test="$orientation-lr='l'">1
          <xsl:otherwise>-1
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="flip-tb-translate">
        <xsl:choose>
          <xsl:when test="$orientation-tb='t'">0
          <xsl:otherwise>-
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="flip-lr-translate">
        <xsl:choose>
          <xsl:when test="$orientation-lr='l'">0
          <xsl:otherwise>-
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
<!-- flip transform -->
      <g transform="scale({$flip-lr-scale},{$flip-tb-scale}) translate({$flip-lr-translate}, {$flip-tb-translate})">
        <xsl:call-template name="figure" />
      </g>
    </svg>
  </xsl:template>
  <xsl:template name="figure">
<!-- Just change shape here -->
    <g transform="translate(0.5 0.5)">
      <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
				 style="{$fill}{$stroke}stroke-width:1"/>
    </g>
<!-- end -->
  </xsl:template>
  <xsl:template match="*">
  <xsl:template match="text()">
</xsl:stylesheet>

Other Lucene examples (source code examples)

Here is a short list of links related to this Lucene corner-imports.svg.xslt source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.