Package cz.vutbr.fit.layout.impl
Class DefaultAreaTree
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.BaseArtifact
-
- cz.vutbr.fit.layout.impl.DefaultAreaTree
-
- All Implemented Interfaces:
AreaTree,Artifact,SearchableAreaContainer
- Direct Known Subclasses:
RDFAreaTree,SegmentationAreaTree
public class DefaultAreaTree extends BaseArtifact implements AreaTree
Default Page implementation.- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description DefaultAreaTree(AreaTree src)Creates a copy of an area tree.DefaultAreaTree(org.eclipse.rdf4j.model.IRI pageIri)Creates an area tree from a page.DefaultAreaTree(org.eclipse.rdf4j.model.IRI parentIri, org.eclipse.rdf4j.model.IRI pageIri)Creates an area tree from another artifact
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AreacreateArea(Area other)Creates a new area in the tree by copying another area.AreacreateArea(Box box)Creates a new area in the tree from a box.AreacreateArea(Rectangular r)Creates a new empty area in the tree.AreacreateArea(List<Box> boxes)Creates a new area in the tree from a list of boxes.AreagetAreaAt(int x, int y)Finds the bottom-most area node present at the given coordinates in the area tree.AreagetAreaByName(String name)Finds an area by the given name.List<Area>getAreasAt(int x, int y)Finds all the area nodes present at the given coordinates in the area tree.org.eclipse.rdf4j.model.IRIgetArtifactType()Gets the artifact type.intgetMaxAreaId(Area root)protected intgetNextAreaId()org.eclipse.rdf4j.model.IRIgetPageIri()Gets the IRI of the page the area tree was build from.AreagetRoot()Obtains the root node of the area tree.voidsetNextAreaId(int nextId)voidsetPageIri(org.eclipse.rdf4j.model.IRI pageIri)voidsetRoot(Area root)StringtoString()voidupdateNextAreaId()voidupdateTopologies()Updates the topology structures (e.g. grids) for all the areas in the tree.-
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
-
-
-
-
Constructor Detail
-
DefaultAreaTree
public DefaultAreaTree(org.eclipse.rdf4j.model.IRI pageIri)
Creates an area tree from a page.- Parameters:
pageIri- the IRI of the source page
-
DefaultAreaTree
public DefaultAreaTree(org.eclipse.rdf4j.model.IRI parentIri, org.eclipse.rdf4j.model.IRI pageIri)Creates an area tree from another artifact- Parameters:
parentIri- the parent artifact IRIpageIri- the associated page IRI
-
DefaultAreaTree
public DefaultAreaTree(AreaTree src)
Creates a copy of an area tree.- Parameters:
src- the source area tree
-
-
Method Detail
-
getArtifactType
public org.eclipse.rdf4j.model.IRI getArtifactType()
Description copied from interface:ArtifactGets the artifact type.- Specified by:
getArtifactTypein interfaceArtifact- Returns:
- the IRI of the artifact type.
-
getPageIri
public org.eclipse.rdf4j.model.IRI getPageIri()
Description copied from interface:AreaTreeGets the IRI of the page the area tree was build from. This may be equal to the parent IRI when the tree was built from the page directly.- Specified by:
getPageIriin interfaceAreaTree- Returns:
- the source page IRI
-
setPageIri
public void setPageIri(org.eclipse.rdf4j.model.IRI pageIri)
-
getRoot
public Area getRoot()
Description copied from interface:AreaTreeObtains the root node of the area tree.
-
setRoot
public void setRoot(Area root)
-
updateTopologies
public void updateTopologies()
Description copied from interface:AreaTreeUpdates the topology structures (e.g. grids) for all the areas in the tree.- Specified by:
updateTopologiesin interfaceAreaTree
-
getAreaAt
public Area getAreaAt(int x, int y)
Description copied from interface:SearchableAreaContainerFinds the bottom-most area node present at the given coordinates in the area tree.- Specified by:
getAreaAtin interfaceSearchableAreaContainer- Parameters:
x- the X coordinatey- the Y coordinate- Returns:
- the area node present at the given coordinates or
nullwhen no node is found.
-
getAreasAt
public List<Area> getAreasAt(int x, int y)
Description copied from interface:SearchableAreaContainerFinds all the area nodes present at the given coordinates in the area tree.- Specified by:
getAreasAtin interfaceSearchableAreaContainer- Parameters:
x- the X coordinatey- the Y coordinate- Returns:
- a list of the area nodes present at the given coordinates ordered from the topmost to the bottommost one.
-
getAreaByName
public Area getAreaByName(String name)
Description copied from interface:SearchableAreaContainerFinds an area by the given name.- Specified by:
getAreaByNamein interfaceSearchableAreaContainer- Parameters:
name- the name of the area- Returns:
- the area with the given name or
nullwhen nothing is found.
-
createArea
public Area createArea(Rectangular r)
Description copied from interface:AreaTreeCreates a new empty area in the tree.- Specified by:
createAreain interfaceAreaTree- Parameters:
r- the new area bounds.- Returns:
- the new area
-
createArea
public Area createArea(Box box)
Description copied from interface:AreaTreeCreates a new area in the tree from a box.- Specified by:
createAreain interfaceAreaTree- Parameters:
box- source box- Returns:
- the new area containing the box.
-
createArea
public Area createArea(Area other)
Description copied from interface:AreaTreeCreates a new area in the tree by copying another area.- Specified by:
createAreain interfaceAreaTree- Parameters:
other- the other area to copy- Returns:
- the new area containing the box.
-
createArea
public Area createArea(List<Box> boxes)
Description copied from interface:AreaTreeCreates a new area in the tree from a list of boxes.- Specified by:
createAreain interfaceAreaTree- Parameters:
boxes- a list of boxes- Returns:
- the new area containing all the boxes.
-
getNextAreaId
protected int getNextAreaId()
-
setNextAreaId
public void setNextAreaId(int nextId)
-
updateNextAreaId
public void updateNextAreaId()
-
getMaxAreaId
public int getMaxAreaId(Area root)
-
-