Package cz.vutbr.fit.layout.io
Class HTMLOutputOperator
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.BaseService
-
- cz.vutbr.fit.layout.impl.BaseParametrizedOperation
-
- cz.vutbr.fit.layout.impl.BaseOperator
-
- cz.vutbr.fit.layout.io.HTMLOutputOperator
-
- All Implemented Interfaces:
AreaTreeOperator,ParametrizedOperation,Service
public class HTMLOutputOperator extends BaseOperator
This operator serializes the area tree to an HTML file.- Author:
- burgetr
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHTMLOutputOperator.StyleElement style representation.
-
Field Summary
Fields Modifier and Type Field Description protected booleanboxTreeOnlyShould we produce the box tree only or should we rely on the area tree?protected StringfilenamePath to the output file/protected booleanproduceHeaderShould we produce the HTML header and footer?protected static StringUNITDefault length unit
-
Constructor Summary
Constructors Constructor Description HTMLOutputOperator()HTMLOutputOperator(String filename, boolean produceHeader, boolean boxTreeOnly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(AreaTree atree)voidapply(AreaTree atree, Area root)StringcolorString(String spec)Converts the CSS specification rgb(r,g,b) to #rrggbbList<Parameter>defineParams()voiddumpTo(AreaTree tree, Page sourcePage, PrintWriter out)Formats the complete area tree to an output stream.voiddumpTo(Page page, PrintWriter out)Formats the complete box tree to an output stream.protected StringgetAreaStyle(Area a)protected HTMLOutputOperator.StylegetBoxStyle(Box box, int px, int py)protected HTMLOutputOperator.StylegetBoxStyle(ContentRect parent, Box box)booleangetBoxTreeOnly()StringgetCategory()StringgetDescription()StringgetFilename()StringgetId()StringgetName()booleangetProduceHeader()voidsetBoxTreeOnly(boolean boxTreeOnly)voidsetFilename(String filename)voidsetProduceHeader(boolean produceHeader)-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseOperator
toString
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseParametrizedOperation
getParam, getParams, getParamString, setParam
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseService
getServiceManager, setServiceManager
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cz.vutbr.fit.layout.api.ParametrizedOperation
getParam, getParams, getParamString, setParam
-
Methods inherited from interface cz.vutbr.fit.layout.api.Service
setServiceManager
-
-
-
-
Field Detail
-
UNIT
protected static final String UNIT
Default length unit- See Also:
- Constant Field Values
-
produceHeader
protected boolean produceHeader
Should we produce the HTML header and footer?
-
boxTreeOnly
protected boolean boxTreeOnly
Should we produce the box tree only or should we rely on the area tree?
-
filename
protected String filename
Path to the output file/
-
-
Constructor Detail
-
HTMLOutputOperator
public HTMLOutputOperator()
-
HTMLOutputOperator
public HTMLOutputOperator(String filename, boolean produceHeader, boolean boxTreeOnly)
-
-
Method Detail
-
getId
public String getId()
-
getName
public String getName()
-
getDescription
public String getDescription()
-
getCategory
public String getCategory()
-
defineParams
public List<Parameter> defineParams()
- Overrides:
defineParamsin classBaseParametrizedOperation
-
getProduceHeader
public boolean getProduceHeader()
-
setProduceHeader
public void setProduceHeader(boolean produceHeader)
-
getBoxTreeOnly
public boolean getBoxTreeOnly()
-
setBoxTreeOnly
public void setBoxTreeOnly(boolean boxTreeOnly)
-
getFilename
public String getFilename()
-
setFilename
public void setFilename(String filename)
-
apply
public void apply(AreaTree atree)
-
dumpTo
public void dumpTo(AreaTree tree, Page sourcePage, PrintWriter out)
Formats the complete area tree to an output stream.- Parameters:
tree- the area tree to be printedout- a writer to be used for output
-
dumpTo
public void dumpTo(Page page, PrintWriter out)
Formats the complete box tree to an output stream.- Parameters:
tree- the area tree to be printedout- a writer to be used for output
-
getBoxStyle
protected HTMLOutputOperator.Style getBoxStyle(ContentRect parent, Box box)
-
getBoxStyle
protected HTMLOutputOperator.Style getBoxStyle(Box box, int px, int py)
-
-