Class TLcdNoDeclutterLabelConflictChecker
- All Implemented Interfaces:
ILcdCloneable,ILcdLabelConflictChecker,Cloneable
ILcdLabelConflictChecker doesn't check if label placements overlap with
other label placements. It does check if labels overlap with label obstacles or the view. The
latter is done using the delegate ILcdLabelConflictChecker that can be set in the
constructor. This delegate should never be a TLcdNoDeclutterLabelConflictChecker.- Since:
- 10.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.labeling.algorithm.ILcdLabelConflictChecker
ILcdLabelConflictChecker.Conflict -
Constructor Summary
ConstructorsConstructorDescriptionCreates an newTLcdNoDeclutterLabelConflictCheckerusing the given delegateILcdLabelConflictCheckerused for finding conflicts with label obstacles or the view bounds. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLabelObstacle(TLcdLabelObstacle aLabelObstacle) Add the given obstacle to this label conflict checker.voidaddLabelPlacement(TLcdLabelPlacement aPlacement) Add the given label placement to this label conflict checker.clone()MakesObject.clone()public.getConflict(TLcdLabelPlacement aPlacement) Checks if the given label placement is valid, i.e. if it doesn't overlap with already added label placements or label obstacles.Returns all label obstacles that were added to (and not removed from) this conflict checker.Returns all label placements that were added to (and not removed from) this conflict checker.voidremoveLabelObstacle(TLcdLabelObstacle aLabelObstacle) Removes the given obstacle from the conflict checker.voidremoveLabelPlacement(TLcdLabelPlacement aPlacement) Removes the given label placement from the conflict checker.voidResets the conflict checker.
-
Constructor Details
-
TLcdNoDeclutterLabelConflictChecker
Creates an newTLcdNoDeclutterLabelConflictCheckerusing the given delegateILcdLabelConflictCheckerused for finding conflicts with label obstacles or the view bounds.- Parameters:
aDelegate- a delegateILcdLabelConflictChecker.
-
-
Method Details
-
clone
Description copied from interface:ILcdCloneableMakes
When for example extending fromObject.clone()public.java.lang.Object, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classObject- See Also:
-
reset
Description copied from interface:ILcdLabelConflictCheckerResets the conflict checker. After calling this method the conflict checker behaves as if no placements or obstacles are added.- Specified by:
resetin interfaceILcdLabelConflictChecker- Parameters:
aViewBounds- the view bounds.
-
addLabelObstacle
Description copied from interface:ILcdLabelConflictCheckerAdd the given obstacle to this label conflict checker. After this method is called, thegetConflictmethod can use the given obstacle to detect conflicts.After calling this method, it is possible that this bounds conflict checker keeps a reference to the given obstacle. By consequence, the given obstacle should not be changed outside this method. The given obstacle cannot be changed inside this method.
Adding the same obstacle instance twice should have the exact same effect as adding the obstacle instance only once.
- Specified by:
addLabelObstaclein interfaceILcdLabelConflictChecker- Parameters:
aLabelObstacle- an obstacle.
-
removeLabelObstacle
Description copied from interface:ILcdLabelConflictCheckerRemoves the given obstacle from the conflict checker. This method should only be called for the given obstacle if it had been added before byaddLabelObstacle.After calling this method, it is possible that this bounds conflict checker keeps a reference to the given obstacle. By consequence, the given obstacle should never be changed outside this method. The given obstacle cannot be changed inside this method.
- Specified by:
removeLabelObstaclein interfaceILcdLabelConflictChecker- Parameters:
aLabelObstacle- a label obstacle.
-
getLabelObstacles
Description copied from interface:ILcdLabelConflictCheckerReturns all label obstacles that were added to (and not removed from) this conflict checker. Adjusting the returned list should not influence the working of this conflict checker. The returned obstacles should not be adjusted.- Specified by:
getLabelObstaclesin interfaceILcdLabelConflictChecker- Returns:
- a list of all added obstacles.
-
addLabelPlacement
Description copied from interface:ILcdLabelConflictCheckerAdd the given label placement to this label conflict checker. The given label placement should be properly initialized and should contain a valid bounds. After this method is called, thegetConflictmethod can use the given placement to detect conflicts.After calling this method, it is possible that this bounds conflict checker keeps a reference to the given label placement. By consequence, the bounds information in the given placement should not be changed outside this method. The given label placement cannot be changed inside this method.
Adding the same label placement instance twice should have the exact same effect as adding the label placement instance only once.
- Specified by:
addLabelPlacementin interfaceILcdLabelConflictChecker- Parameters:
aPlacement- a label placement.
-
removeLabelPlacement
Description copied from interface:ILcdLabelConflictCheckerRemoves the given label placement from the conflict checker. The given label placement should be properly initialized and should contain a valid bounds. This method should only be called for the given label placement if it had been added before usingaddLabelPlacement.After calling this method, it is possible that this bounds conflict checker keeps a reference to the given label placement. By consequence, the bounds inside the given label placement should never be changed outside this method. The given bounds cannot be changed inside this method.
- Specified by:
removeLabelPlacementin interfaceILcdLabelConflictChecker- Parameters:
aPlacement- a label placement.
-
getLabelPlacements
Description copied from interface:ILcdLabelConflictCheckerReturns all label placements that were added to (and not removed from) this conflict checker. Adjusting the returned list should not influence the working of this conflict checker. The bounds inside the returned label placements should not be adjusted.- Specified by:
getLabelPlacementsin interfaceILcdLabelConflictChecker- Returns:
- a list of all added label placements.
-
getConflict
Description copied from interface:ILcdLabelConflictCheckerChecks if the given label placement is valid, i.e. if it doesn't overlap with already added label placements or label obstacles. It also checks if the given label placement at least partially overlaps with the view bounds. The given label placement should be properly initialized and should contain a valid bounds. The given label placement cannot be changed inside this method.When no conflict is found, the returned
Conflictshould benull.- Specified by:
getConflictin interfaceILcdLabelConflictChecker- Parameters:
aPlacement- a label placement.- Returns:
- a conflict object containing information about the cause(s) of the conflict,
or
nullif no conflict was found.
-