Class TLspNoDeclutterLabelConflictChecker
- All Implemented Interfaces:
ILcdCloneable
,ILspLabelConflictChecker
,Cloneable
ILspLabelConflictChecker
does not check if placements overlap with
other placements. It does check if they overlap with obstacles or the view. The
latter is done using the delegate ILspLabelConflictChecker
that can be set in the
constructor. This delegate should never be a TLspNoDeclutterLabelConflictChecker
.- Since:
- 2012.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.label.ILspLabelConflictChecker
ILspLabelConflictChecker.Conflict
-
Constructor Summary
ConstructorDescriptionCreates an newTLspNoDeclutterLabelConflictChecker
using the given delegateILspLabelConflictChecker
used for finding conflicts with obstacles or the view bounds. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addObstacle
(TLspLabelObstacle aObstacle) Add the given obstacle to this conflict checker.void
addPlacement
(TLspLabelPlacement aPlacement) Add the given label placement to this conflict checker.clone()
MakesObject.clone()
public.getConflict
(TLspLabelPlacement aPlacement) Checks if the given placement is valid, that is if it does not overlap with already added placements or obstacles.Returns all 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.void
removeObstacle
(TLspLabelObstacle aObstacle) Removes the given obstacle from the conflict checker.void
removePlacement
(TLspLabelPlacement aPlacement) Removes the given label placement from the conflict checker.void
Resets the conflict checker.
-
Constructor Details
-
TLspNoDeclutterLabelConflictChecker
Creates an newTLspNoDeclutterLabelConflictChecker
using the given delegateILspLabelConflictChecker
used for finding conflicts with obstacles or the view bounds.- Parameters:
aDelegate
- a delegateILspLabelConflictChecker
.
-
-
Method Details
-
clone
Description copied from interface:ILcdCloneable
Makes
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:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
reset
Description copied from interface:ILspLabelConflictChecker
Resets the conflict checker. After calling this method the conflict checker behaves as if no placements or obstacles are added.- Specified by:
reset
in interfaceILspLabelConflictChecker
- Parameters:
aViewBounds
- the view bounds.
-
addObstacle
Description copied from interface:ILspLabelConflictChecker
Add the given obstacle to this conflict checker. After this method is called, thegetConflict
method 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:
addObstacle
in interfaceILspLabelConflictChecker
- Parameters:
aObstacle
- an obstacle.
-
removeObstacle
Description copied from interface:ILspLabelConflictChecker
Removes the given obstacle from the conflict checker. This method should only be called for the given obstacle if it had been added before byaddObstacle
.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:
removeObstacle
in interfaceILspLabelConflictChecker
- Parameters:
aObstacle
- an obstacle.
-
getObstacles
Description copied from interface:ILspLabelConflictChecker
Returns all 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:
getObstacles
in interfaceILspLabelConflictChecker
- Returns:
- a list of all added obstacles.
-
addPlacement
Description copied from interface:ILspLabelConflictChecker
Add the given label placement to this conflict checker. The given label placement should be properly initialized and should contain a valid bounds. After this method is called, thegetConflict
method 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:
addPlacement
in interfaceILspLabelConflictChecker
- Parameters:
aPlacement
- a label placement.
-
removePlacement
Description copied from interface:ILspLabelConflictChecker
Removes 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 usingaddPlacement
.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:
removePlacement
in interfaceILspLabelConflictChecker
- Parameters:
aPlacement
- a label placement.
-
getPlacements
Description copied from interface:ILspLabelConflictChecker
Returns 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:
getPlacements
in interfaceILspLabelConflictChecker
- Returns:
- a list of all added label placements.
-
getConflict
Description copied from interface:ILspLabelConflictChecker
Checks if the given placement is valid, that is if it does not overlap with already added placements or obstacles. It also checks if the given placement at least partially overlaps with the view bounds. The given placement should be properly initialized and should contain a valid bounds. The given placement cannot be changed inside this method.When no conflict is found, the returned
Conflict
should benull
.- Specified by:
getConflict
in interfaceILspLabelConflictChecker
- Parameters:
aPlacement
- a label placement.- Returns:
- a conflict object containing information about the cause(s) of the conflict,
or
null
if no conflict was found.
-