Package cz.vutbr.fit.layout.model
Interface Area
-
- All Superinterfaces:
ContentRect
,GenericTreeNode<Area>
,Rect
,Taggable
- All Known Implementing Classes:
DefaultArea
,RDFArea
public interface Area extends ContentRect, GenericTreeNode<Area>, Taggable
An area containing several visual boxes.- Author:
- burgetr
-
-
Field Summary
-
Fields inherited from interface cz.vutbr.fit.layout.model.ContentRect
ATTR_SAME_AS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addBox(Box box)
Adds a new box to the area.Area
copy()
Creates a copy of the area and makes it a next sibling of the source area.Area
createSuperArea(Rectangular gp, List<Area> selected, String name)
Creates a new subarea from a specified region of the area and moves the selected child nodes to the new area.List<Box>
getAllBoxes()
Obtains all the boxes from this area and all the child areas.AreaTree
getAreaTree()
Obtains the tree the node belongs to.List<Box>
getBoxes()
Returns the list of boxes that belong directly to this area.Color
getEffectiveBackgroundColor()
Obtains the effective background color visible under the area.Rectangular
getGridPosition()
Gets the grid position of this area within the parent topology.int
getLevel()
Area grouping level.String
getName()
Obtains the area name.String
getText()
Returns the complete text contained in this area and its sub areas concatenated using the default concatenator defined byConcatenators.getDefaultAreaConcatenator()
.String
getText(AreaConcatenator concatenator)
Returns the complete text contained in this area and its sub areas concatenated using the specified concatenator.String
getText(String separator)
Deprecated.Deprecated in favor ofgetText(AreaConcatenator)
AreaTopology
getTopology()
Returns the topology of this area.void
insertParent(Area newParent, Area child)
Inserts a new area as a new parent of the given child area.boolean
isExplicitlySeparated()
When set to true, the area is considered to be separated from other areas explicitly, i.e. independently on its real borders or background.boolean
isHorizontalSeparator()
Checks whether the area can be interpreted as a horizontal separator.boolean
isReplaced()
Checks whether this area is formed by replaced boxes.boolean
isSeparator()
Checks whether the area can be interpreted as any kind of separator.boolean
isVerticalSeparator()
Checks whether the area can be interpreted as a vertical separator.void
setAreaTree(AreaTree tree)
void
setBorderStyle(Border.Side side, Border style)
Sets the style of the box border at the given side.void
setExplicitlySeparated(boolean explicitlySeparated)
When set to true, the area is considered to be separated from other areas explicitly, i.e. independently on its real borders or background.void
setGridPosition(Rectangular gp)
Sets the grid position of this area within the parent topology.void
setLevel(int level)
Sets the area level.void
setName(String name)
Sets the name of the area that may be later used for its identification usinggetName()
.void
updateTopologies()
Updates the topologies of the child areas.-
Methods inherited from interface cz.vutbr.fit.layout.model.ContentRect
addUserAttribute, getBackgroundColor, getBackgroundImagePng, getBorderCount, getBorderStyle, getBottomBorder, getBounds, getId, getLeftBorder, getLine, getPageIri, getRightBorder, getTextStyle, getTopBorder, getUserAttribute, hasBackground, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparated, setBackgroundSeparated, setBounds, setLine
-
Methods inherited from interface cz.vutbr.fit.layout.model.GenericTreeNode
appendChild, appendChildren, getDepth, getChildAt, getChildCount, getChildren, getIndex, getLeafCount, getNextSibling, getParent, getPreviousSibling, getRoot, childrenChanged, insertChild, isLeaf, isRoot, removeAllChildren, removeChild, removeChild, setParent, setRoot
-
Methods inherited from interface cz.vutbr.fit.layout.model.Rect
getHeight, getWidth, getX1, getX2, getY1, getY2, move
-
Methods inherited from interface cz.vutbr.fit.layout.model.Taggable
addTag, getMostSupportedTag, getSupportedTags, getTags, getTagSupport, hasTag, hasTag, removeTag
-
-
-
-
Method Detail
-
setName
void setName(String name)
Sets the name of the area that may be later used for its identification usinggetName()
.- Parameters:
name
- the name to be set
-
getName
String getName()
Obtains the area name.- Returns:
- the area name set previously using
setName(String)
or a default name when nothing has been previously set.
-
getAreaTree
AreaTree getAreaTree()
Obtains the tree the node belongs to.- Returns:
- the tree or
null
when the node does not form part of any tree.
-
setAreaTree
void setAreaTree(AreaTree tree)
-
addBox
void addBox(Box box)
Adds a new box to the area.- Parameters:
box
- the box to add
-
getBoxes
List<Box> getBoxes()
Returns the list of boxes that belong directly to this area.- Returns:
- the list of boxes (possibly empty)
-
getAllBoxes
List<Box> getAllBoxes()
Obtains all the boxes from this area and all the child areas.- Returns:
- The list of boxes
-
getText
String getText()
Returns the complete text contained in this area and its sub areas concatenated using the default concatenator defined byConcatenators.getDefaultAreaConcatenator()
.- Returns:
- A text string (possibly empty)
-
getText
String getText(String separator)
Deprecated.Deprecated in favor ofgetText(AreaConcatenator)
Returns the complete text contained in this area and its sub area. The individual areas are separated by the given string separator.- Parameters:
separator
- the string separating the individual areas- Returns:
- A text string (possibly empty)
-
getText
String getText(AreaConcatenator concatenator)
Returns the complete text contained in this area and its sub areas concatenated using the specified concatenator.- Parameters:
concatenator
- The concatenator to be used to join the areas (and boxes in leaf areas)- Returns:
- A text string (possibly empty)
-
isReplaced
boolean isReplaced()
Checks whether this area is formed by replaced boxes.- Returns:
true
if the area contains replaced boxes only
-
getLevel
int getLevel()
Area grouping level. Area level 0 corresponds to the areas formed by boxes, greater numbers represent greater level of grouping (artificial areas).- Returns:
- the area level
-
setLevel
void setLevel(int level)
Sets the area level. Area level 0 corresponds to the areas formed by boxes, greater numbers represent greater level of grouping (artificial areas).- Parameters:
level
- the new level to set.
-
setBorderStyle
void setBorderStyle(Border.Side side, Border style)
Sets the style of the box border at the given side.- Parameters:
side
- the border side.style
- the new border style
-
getTopology
AreaTopology getTopology()
Returns the topology of this area.- Returns:
- The area topology.
-
setGridPosition
void setGridPosition(Rectangular gp)
Sets the grid position of this area within the parent topology.- Parameters:
gp
- the new grid position
-
getGridPosition
Rectangular getGridPosition()
Gets the grid position of this area within the parent topology.- Returns:
- the grid position or a unit rectangle when there is no parent
-
updateTopologies
void updateTopologies()
Updates the topologies of the child areas. This should be called when some nodes have been inserted, removed or changed in this area.
-
getEffectiveBackgroundColor
Color getEffectiveBackgroundColor()
Obtains the effective background color visible under the area.- Returns:
- The background color.
-
isHorizontalSeparator
boolean isHorizontalSeparator()
Checks whether the area can be interpreted as a horizontal separator.- Returns:
true
when this area is a horizontal separator
-
isVerticalSeparator
boolean isVerticalSeparator()
Checks whether the area can be interpreted as a vertical separator.- Returns:
true
when this area is a vertical separator
-
isSeparator
boolean isSeparator()
Checks whether the area can be interpreted as any kind of separator.- Returns:
true
when this area is a separator
-
isExplicitlySeparated
boolean isExplicitlySeparated()
When set to true, the area is considered to be separated from other areas explicitly, i.e. independently on its real borders or background. This is usually used for some new superareas.- Returns:
true
, if the area is explicitly separated
-
setExplicitlySeparated
void setExplicitlySeparated(boolean explicitlySeparated)
When set to true, the area is considered to be separated from other areas explicitly, i.e. independently on its real borders or background. This is usually used for some new superareas.- Parameters:
explicitlySeparated
-true
, if the area should be explicitly separated
-
createSuperArea
Area createSuperArea(Rectangular gp, List<Area> selected, String name)
Creates a new subarea from a specified region of the area and moves the selected child nodes to the new area.- Parameters:
gp
- the subarea boundsselected
- nodes to be moved to the new areaname
- the name (identification) of the new area- Returns:
- the new AreaNode created in the tree or null, if nothing was created
-
insertParent
void insertParent(Area newParent, Area child)
Inserts a new area as a new parent of the given child area. The given area is replaced by the new parent and it becomes a child area of the parent.- Parameters:
newParent
- the new parent area (replacement)child
- the child area that should be replaced
-
copy
Area copy()
Creates a copy of the area and makes it a next sibling of the source area.- Returns:
- the new area
-
-