Package cz.vutbr.fit.layout.segm.op
Class SortByLinesOperator
- 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.segm.op.SortByPositionOperator
-
- cz.vutbr.fit.layout.segm.op.SortByLinesOperator
-
- All Implemented Interfaces:
AreaTreeOperator
,ParametrizedOperation
,Service
public class SortByLinesOperator extends SortByPositionOperator
- Author:
- burgetr
-
-
Field Summary
-
Fields inherited from class cz.vutbr.fit.layout.segm.op.SortByPositionOperator
columnFirst
-
-
Constructor Summary
Constructors Constructor Description SortByLinesOperator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(AreaTree atree)
Applies the operation to the given tree.void
apply(AreaTree atree, Area root)
Applies the operation to the given subtree of the tree.List<Parameter>
defineParams()
Creates the parameter definition for this operation.String
getDescription()
Obtains a longer description of the service.String
getId()
Obtains a unique ID of the serviceString
getName()
Obtains a descriptive name of the service that may be presented to the user.protected boolean
isOnSameLine(Area a1, Area a2, int threshold)
Checks if the given areas are on the same line.protected void
recursiveSortLines(Area root)
Goes through all the areas in the tree and sorts their sub-areas.protected void
sortChildLines(Area root)
Goes through the grid of areas and sorts the adjacent visual areas that are not separated by anything-
Methods inherited from class cz.vutbr.fit.layout.segm.op.SortByPositionOperator
getCategory, getColumnFirst, recursivelySortChildAreas, setColumnFirst
-
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
-
-
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:Service
Obtains a unique ID of the service- Specified by:
getId
in interfaceService
- Overrides:
getId
in classSortByPositionOperator
-
getName
public String getName()
Description copied from interface:Service
Obtains a descriptive name of the service that may be presented to the user.- Specified by:
getName
in interfaceService
- Overrides:
getName
in classSortByPositionOperator
- Returns:
- the operator name
-
getDescription
public String getDescription()
Description copied from interface:Service
Obtains a longer description of the service.- Specified by:
getDescription
in interfaceService
- Overrides:
getDescription
in classSortByPositionOperator
- Returns:
- the description
-
defineParams
public List<Parameter> defineParams()
Description copied from class:BaseParametrizedOperation
Creates the parameter definition for this operation.- Overrides:
defineParams
in classSortByPositionOperator
- Returns:
- The list of parameters.
-
apply
public void apply(AreaTree atree)
Description copied from interface:AreaTreeOperator
Applies the operation to the given tree.- Specified by:
apply
in interfaceAreaTreeOperator
- Overrides:
apply
in classSortByPositionOperator
- Parameters:
atree
- the area tree to be modified.
-
apply
public void apply(AreaTree atree, Area root)
Description copied from interface:AreaTreeOperator
Applies the operation to the given subtree of the tree.- Specified by:
apply
in interfaceAreaTreeOperator
- Overrides:
apply
in classSortByPositionOperator
- Parameters:
atree
- the area tree to be modified.root
- the root node of the affected subtree.
-
recursiveSortLines
protected void recursiveSortLines(Area root)
Goes through all the areas in the tree and sorts their sub-areas.
-
sortChildLines
protected void sortChildLines(Area root)
Goes through the grid of areas and sorts the adjacent visual areas that are not separated by anything
-
-