Package cz.vutbr.fit.layout.impl
Class DefaultPage
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.BaseArtifact
-
- cz.vutbr.fit.layout.impl.DefaultPage
-
-
Constructor Summary
Constructors Constructor Description DefaultPage(Page src)
DefaultPage(URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Box
createBox()
Creates a new empty box wihtin this page.Box
createBox(Box src)
Creates a new box within this page by copying an existing one.org.eclipse.rdf4j.model.IRI
getArtifactType()
Gets the artifact type.List<Box>
getBoxesAt(int x, int y)
Finds all the boxes that contain the given point within their visual bounds.List<Box>
getBoxesInRegion(Rectangular r)
Finds the root boxes of subtrees that are fully contained in the given region based on their visual bounds.int
getHeight()
Obtains the page height.protected int
getNextBoxId()
byte[]
getPngImage()
Gets the PNG image of the rendered page if provided by the renderer.Box
getRoot()
Returns the root box of the page.URL
getSourceURL()
Obtains the source URL of the page.String
getTitle()
Obtains the page title specified using the<title>
tag.int
getWidth()
Obtains the page width.void
setHeight(int height)
void
setPngImage(byte[] pngImage)
void
setRoot(Box root)
void
setTitle(String title)
void
setWidth(int width)
String
toString()
-
Methods inherited from class cz.vutbr.fit.layout.impl.BaseArtifact
equals, getCreatedOn, getCreator, getCreatorParams, getIri, getLabel, getMetadata, getParentIri, hashCode, setCreatedOn, setCreator, setCreatorParams, setIri, setLabel, setMetadata, setParentIri
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface cz.vutbr.fit.layout.model.Artifact
getCreatedOn, getCreator, getCreatorParams, getIri, getLabel, getMetadata, getParentIri, setIri
-
-
-
-
Method Detail
-
getArtifactType
public org.eclipse.rdf4j.model.IRI getArtifactType()
Description copied from interface:Artifact
Gets the artifact type.- Specified by:
getArtifactType
in interfaceArtifact
- Returns:
- the IRI of the artifact type.
-
getSourceURL
public URL getSourceURL()
Description copied from interface:Page
Obtains the source URL of the page.- Specified by:
getSourceURL
in interfacePage
- Returns:
- the URL
-
getTitle
public String getTitle()
Description copied from interface:Page
Obtains the page title specified using the<title>
tag.
-
setTitle
public void setTitle(String title)
-
getRoot
public Box getRoot()
Description copied from interface:Page
Returns the root box of the page.
-
setRoot
public void setRoot(Box root)
-
getWidth
public int getWidth()
Description copied from interface:Page
Obtains the page width.
-
setWidth
public void setWidth(int width)
-
getHeight
public int getHeight()
Description copied from interface:Page
Obtains the page height.
-
setHeight
public void setHeight(int height)
-
getPngImage
public byte[] getPngImage()
Description copied from interface:Page
Gets the PNG image of the rendered page if provided by the renderer.- Specified by:
getPngImage
in interfacePage
- Returns:
- PNG image data array or
null
when the page image was not provided by the renderer.
-
setPngImage
public void setPngImage(byte[] pngImage)
-
getBoxesAt
public List<Box> getBoxesAt(int x, int y)
Description copied from interface:Page
Finds all the boxes that contain the given point within their visual bounds.- Specified by:
getBoxesAt
in interfacePage
- Parameters:
x
- The point X coordinatey
- The point Y coordinate- Returns:
- A list of boxes that contain [x, y] within their visual bounds.
-
getBoxesInRegion
public List<Box> getBoxesInRegion(Rectangular r)
Description copied from interface:Page
Finds the root boxes of subtrees that are fully contained in the given region based on their visual bounds.- Specified by:
getBoxesInRegion
in interfacePage
- Parameters:
r
- The region to be tested- Returns:
- A list of subtree root boxes (possibly empty)
-
createBox
public Box createBox()
Description copied from interface:Page
Creates a new empty box wihtin this page.
-
createBox
public Box createBox(Box src)
Description copied from interface:Page
Creates a new box within this page by copying an existing one.
-
getNextBoxId
protected int getNextBoxId()
-
-