Class ComputeStyleListWorker
- java.lang.Object
-
- java.util.concurrent.ForkJoinTask<V>
-
- java.util.concurrent.RecursiveTask<java.util.List<StyledMapRenderer.StyleRecord>>
-
- org.openstreetmap.josm.data.osm.visitor.paint.ComputeStyleListWorker
-
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.Future<java.util.List<StyledMapRenderer.StyleRecord>>,PrimitiveVisitor
public class ComputeStyleListWorker extends java.util.concurrent.RecursiveTask<java.util.List<StyledMapRenderer.StyleRecord>> implements PrimitiveVisitor
Helper to compute style list.- Since:
- 11914 (extracted from StyledMapRenderer)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private doublecircumprivate intdirectExecutionTaskSizeprivate booleandrawAreaprivate booleandrawMultipolygonprivate booleandrawRestrictionprivate java.util.List<? extends IPrimitive>inputprivate NavigatableComponentncprivate java.util.List<StyledMapRenderer.StyleRecord>outputprivate static longserialVersionUIDprivate ElemStylesstyles
-
Constructor Summary
Constructors Constructor Description ComputeStyleListWorker(double circum, NavigatableComponent nc, java.util.List<? extends IPrimitive> input, java.util.List<StyledMapRenderer.StyleRecord> output, int directExecutionTaskSize)Constructs a newComputeStyleListWorker.ComputeStyleListWorker(double circum, NavigatableComponent nc, java.util.List<? extends IPrimitive> input, java.util.List<StyledMapRenderer.StyleRecord> output, int directExecutionTaskSize, ElemStyles styles)Constructs a newComputeStyleListWorker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidacceptDrawable(IPrimitive osm)voidadd(INode osm, int flags)Add new style records for the given node.voidadd(IRelation<?> osm, int flags)Add new style records for the given relation.voidadd(IWay<?> osm, int flags)Add new style records for the given way.protected java.util.List<StyledMapRenderer.StyleRecord>compute()java.util.List<StyledMapRenderer.StyleRecord>computeDirectly()Compute directly (without using fork/join) the style list.private booleandrawAreaElement(int flags, StyleElement s)voidvisit(INode n)Visiting call for nodes.voidvisit(IRelation<?> r)Visiting call for relations.voidvisit(IWay<?> w)Visiting call for ways.-
Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
input
private final transient java.util.List<? extends IPrimitive> input
-
output
private final transient java.util.List<StyledMapRenderer.StyleRecord> output
-
styles
private final transient ElemStyles styles
-
directExecutionTaskSize
private final int directExecutionTaskSize
-
circum
private final double circum
-
nc
private final NavigatableComponent nc
-
drawArea
private final boolean drawArea
-
drawMultipolygon
private final boolean drawMultipolygon
-
drawRestriction
private final boolean drawRestriction
-
-
Constructor Detail
-
ComputeStyleListWorker
ComputeStyleListWorker(double circum, NavigatableComponent nc, java.util.List<? extends IPrimitive> input, java.util.List<StyledMapRenderer.StyleRecord> output, int directExecutionTaskSize)
Constructs a newComputeStyleListWorker.- Parameters:
circum- distance on the map in meters that 100 screen pixels representnc- navigable componentinput- the primitives to processoutput- the list of styles to which styles will be addeddirectExecutionTaskSize- the threshold deciding whether to subdivide the tasks- Since:
- 13810 (signature)
-
ComputeStyleListWorker
ComputeStyleListWorker(double circum, NavigatableComponent nc, java.util.List<? extends IPrimitive> input, java.util.List<StyledMapRenderer.StyleRecord> output, int directExecutionTaskSize, ElemStyles styles)
Constructs a newComputeStyleListWorker.- Parameters:
circum- distance on the map in meters that 100 screen pixels representnc- navigable componentinput- the primitives to processoutput- the list of styles to which styles will be addeddirectExecutionTaskSize- the threshold deciding whether to subdivide the tasksstyles- theElemStylesinstance used to generate primitiveStyleElements.- Since:
- 12964, 13810 (signature)
-
-
Method Detail
-
compute
protected java.util.List<StyledMapRenderer.StyleRecord> compute()
- Specified by:
computein classjava.util.concurrent.RecursiveTask<java.util.List<StyledMapRenderer.StyleRecord>>
-
computeDirectly
public java.util.List<StyledMapRenderer.StyleRecord> computeDirectly()
Compute directly (without using fork/join) the style list. Only called for small input.- Returns:
- list of computed style records
-
acceptDrawable
private void acceptDrawable(IPrimitive osm)
-
visit
public void visit(INode n)
Description copied from interface:PrimitiveVisitorVisiting call for nodes.- Specified by:
visitin interfacePrimitiveVisitor- Parameters:
n- The node to inspect.
-
visit
public void visit(IWay<?> w)
Description copied from interface:PrimitiveVisitorVisiting call for ways.- Specified by:
visitin interfacePrimitiveVisitor- Parameters:
w- The way to inspect.
-
visit
public void visit(IRelation<?> r)
Description copied from interface:PrimitiveVisitorVisiting call for relations.- Specified by:
visitin interfacePrimitiveVisitor- Parameters:
r- The relation to inspect.
-
add
public void add(INode osm, int flags)
Add new style records for the given node.- Parameters:
osm- nodeflags- flags- Since:
- 13810 (signature)
-
add
public void add(IWay<?> osm, int flags)
Add new style records for the given way.- Parameters:
osm- wayflags- flags- Since:
- 13810 (signature)
-
add
public void add(IRelation<?> osm, int flags)
Add new style records for the given relation.- Parameters:
osm- relationflags- flags- Since:
- 13810 (signature)
-
drawAreaElement
private boolean drawAreaElement(int flags, StyleElement s)
-
-