cz.kebrt.html2latex
Class CSSStyle

java.lang.Object
  extended by cz.kebrt.html2latex.CSSStyle

 class CSSStyle
extends java.lang.Object

Class representing CSS style definition in program configuration.


Field Summary
private  java.lang.String _end
          Mapping between the style and LaTeX (end command).
private  java.lang.String _name
          Style name.
private  java.util.HashMap<java.lang.String,java.lang.String> _properties
          Style properties.
private  java.lang.String _start
          Mapping between the style and LaTeX (start command).
 
Constructor Summary
CSSStyle(java.lang.String name)
          Cstr.
 
Method Summary
private  void colorProperty(Configuration conf)
          Converts "color" property using "xcolor" LaTeX package.
 void fontFamilyProperty(Configuration conf)
          Converts "font-family" property.
 java.lang.String getEnd()
          Returns mapping between the style and LaTeX (end command).
 java.lang.String getName()
          Returns style name.
 java.util.HashMap<java.lang.String,java.lang.String> getProperties()
          Returns style properties.
 java.lang.String getStart()
          Returns name of the file with configuration.
 void makeLaTeXCommands(Configuration conf)
          Sets start and end commands for the style on the basis of style properties and program configuration.
 void setProperties(java.util.HashMap<java.lang.String,java.lang.String> prop)
          Sets the style properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

private java.lang.String _name
Style name.


_start

private java.lang.String _start
Mapping between the style and LaTeX (start command).


_end

private java.lang.String _end
Mapping between the style and LaTeX (end command).


_properties

private java.util.HashMap<java.lang.String,java.lang.String> _properties
Style properties.

Constructor Detail

CSSStyle

public CSSStyle(java.lang.String name)
Cstr.

Parameters:
name - style name
Method Detail

setProperties

public void setProperties(java.util.HashMap<java.lang.String,java.lang.String> prop)
Sets the style properties.

Parameters:
prop - style properties

makeLaTeXCommands

public void makeLaTeXCommands(Configuration conf)
Sets start and end commands for the style on the basis of style properties and program configuration.

Parameters:
conf - program configuration

colorProperty

private void colorProperty(Configuration conf)
Converts "color" property using "xcolor" LaTeX package. HTML notation (#xxx or #xxxxxx where "x" is a hexa number) and rgb notation (rgb(20,180,60) or rgb(20%, 80%, 15%) are supported. Also the 17 named colours defined defined in the CSS specification are correctly converted.

Parameters:
conf - program configuration

fontFamilyProperty

public void fontFamilyProperty(Configuration conf)
Converts "font-family" property. Tries to find first generic font family (ie. monospace) used in the definition and converts it using the configuration.

Parameters:
conf - program configuration

getStart

public java.lang.String getStart()
Returns name of the file with configuration.

Returns:
mapping between the style and LaTeX (start command)

getEnd

public java.lang.String getEnd()
Returns mapping between the style and LaTeX (end command).

Returns:
mapping between the style and LaTeX (end command)

getName

public java.lang.String getName()
Returns style name.

Returns:
style name

getProperties

public java.util.HashMap<java.lang.String,java.lang.String> getProperties()
Returns style properties.

Returns:
style properties