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 double
circum
private int
directExecutionTaskSize
private boolean
drawArea
private boolean
drawMultipolygon
private boolean
drawRestriction
private java.util.List<? extends IPrimitive>
input
private NavigatableComponent
nc
private java.util.List<StyledMapRenderer.StyleRecord>
output
private static long
serialVersionUID
private ElemStyles
styles
-
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 void
acceptDrawable(IPrimitive osm)
void
add(INode osm, int flags)
Add new style records for the given node.void
add(IRelation<?> osm, int flags)
Add new style records for the given relation.void
add(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 boolean
drawAreaElement(int flags, StyleElement s)
void
visit(INode n)
Visiting call for nodes.void
visit(IRelation<?> r)
Visiting call for relations.void
visit(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
- theElemStyles
instance used to generate primitiveStyleElement
s.- Since:
- 12964, 13810 (signature)
-
-
Method Detail
-
compute
protected java.util.List<StyledMapRenderer.StyleRecord> compute()
- Specified by:
compute
in 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:PrimitiveVisitor
Visiting call for nodes.- Specified by:
visit
in interfacePrimitiveVisitor
- Parameters:
n
- The node to inspect.
-
visit
public void visit(IWay<?> w)
Description copied from interface:PrimitiveVisitor
Visiting call for ways.- Specified by:
visit
in interfacePrimitiveVisitor
- Parameters:
w
- The way to inspect.
-
visit
public void visit(IRelation<?> r)
Description copied from interface:PrimitiveVisitor
Visiting call for relations.- Specified by:
visit
in 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)
-
-