public class ComputeStyleListWorker extends java.util.concurrent.RecursiveTask<java.util.List<StyledMapRenderer.StyleRecord>> implements OsmPrimitiveVisitor
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 OsmPrimitive> |
input |
private NavigatableComponent |
nc |
private java.util.List<StyledMapRenderer.StyleRecord> |
output |
private ElemStyles |
styles |
Constructor and Description |
---|
ComputeStyleListWorker(double circum,
NavigatableComponent nc,
java.util.List<? extends OsmPrimitive> input,
java.util.List<StyledMapRenderer.StyleRecord> output,
int directExecutionTaskSize)
Constructs a new
ComputeStyleListWorker . |
ComputeStyleListWorker(double circum,
NavigatableComponent nc,
java.util.List<? extends OsmPrimitive> input,
java.util.List<StyledMapRenderer.StyleRecord> output,
int directExecutionTaskSize,
ElemStyles styles)
Constructs a new
ComputeStyleListWorker . |
Modifier and Type | Method and Description |
---|---|
private void |
acceptDrawable(OsmPrimitive osm) |
void |
add(Node osm,
int flags)
Add new style records for the given node.
|
void |
add(Relation osm,
int flags)
Add new style records for the given relation.
|
void |
add(Way 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(Node n)
Visiting call for points.
|
void |
visit(Relation r)
Visiting call for relations.
|
void |
visit(Way w)
Visiting call for lines.
|
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 final transient java.util.List<? extends OsmPrimitive> 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 OsmPrimitive> 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 OsmPrimitive> 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(OsmPrimitive osm)
public void visit(Node n)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
n
- The node to inspect.public void visit(Way w)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
w
- The way to inspect.public void visit(Relation r)
OsmPrimitiveVisitor
visit
in interface OsmPrimitiveVisitor
r
- The relation to inspect.public void add(Node osm, int flags)
osm
- nodeflags
- flagspublic void add(Way osm, int flags)
osm
- wayflags
- flagspublic void add(Relation osm, int flags)
osm
- relationflags
- flagsprivate boolean drawAreaElement(int flags, StyleElement s)