public class ComputeStyleListWorker extends java.util.concurrent.RecursiveTask<java.util.List<StyledMapRenderer.StyleRecord>> implements PrimitiveVisitor
Modifier and Type | Field and 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 and Description |
---|
ComputeStyleListWorker(double circum,
NavigatableComponent nc,
java.util.List<? extends IPrimitive> input,
java.util.List<StyledMapRenderer.StyleRecord> output,
int directExecutionTaskSize)
Constructs a new
ComputeStyleListWorker . |
ComputeStyleListWorker(double circum,
NavigatableComponent nc,
java.util.List<? extends IPrimitive> input,
java.util.List<StyledMapRenderer.StyleRecord> output,
int directExecutionTaskSize,
ElemStyles styles)
Constructs a new
ComputeStyleListWorker . |
Modifier and Type | Method and 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.
|
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, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnfork
private static final long serialVersionUID
private final transient java.util.List<? extends IPrimitive> input
private final transient java.util.List<StyledMapRenderer.StyleRecord> output
private final transient ElemStyles styles
private final int directExecutionTaskSize
private final double circum
private final NavigatableComponent nc
private final boolean drawArea
private final boolean drawMultipolygon
private final boolean drawRestriction
ComputeStyleListWorker(double circum, NavigatableComponent nc, java.util.List<? extends IPrimitive> input, java.util.List<StyledMapRenderer.StyleRecord> output, int directExecutionTaskSize)
ComputeStyleListWorker
.circum
- distance on the map in meters that 100 screen pixels representnc
- navigatable componentinput
- the primitives to processoutput
- the list of styles to which styles will be addeddirectExecutionTaskSize
- the threshold deciding whether to subdivide the tasksComputeStyleListWorker(double circum, NavigatableComponent nc, java.util.List<? extends IPrimitive> input, java.util.List<StyledMapRenderer.StyleRecord> output, int directExecutionTaskSize, ElemStyles styles)
ComputeStyleListWorker
.circum
- distance on the map in meters that 100 screen pixels representnc
- navigatable componentinput
- the primitives to processoutput
- the list of styles to which styles will be addeddirectExecutionTaskSize
- the threshold deciding whether to subdivide the tasksstyles
- the ElemStyles
instance used to generate primitive StyleElement
s.protected java.util.List<StyledMapRenderer.StyleRecord> compute()
compute
in class java.util.concurrent.RecursiveTask<java.util.List<StyledMapRenderer.StyleRecord>>
public java.util.List<StyledMapRenderer.StyleRecord> computeDirectly()
private void acceptDrawable(IPrimitive osm)
public void visit(INode n)
PrimitiveVisitor
visit
in interface PrimitiveVisitor
n
- The node to inspect.public void visit(IWay<?> w)
PrimitiveVisitor
visit
in interface PrimitiveVisitor
w
- The way to inspect.public void visit(IRelation<?> r)
PrimitiveVisitor
visit
in interface PrimitiveVisitor
r
- The relation to inspect.public void add(INode osm, int flags)
osm
- nodeflags
- flagspublic void add(IWay<?> osm, int flags)
osm
- wayflags
- flagspublic void add(IRelation<?> osm, int flags)
osm
- relationflags
- flagsprivate boolean drawAreaElement(int flags, StyleElement s)