Last change
on this file since 3824 was 3824, checked in by bastiK, 13 years ago |
Separate styles from style generation. This may seem a little over the top, but its just an intermediate state of development, should make sense later. Regarding performance: execution time is the same, memory use is similar, or a little less (due to intern pool for StyleCache). Tested, but can have still some bugs.
|
-
Property svn:eol-style
set to
native
|
File size:
741 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.mappaint;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.osm.Node;
|
---|
5 | import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter;
|
---|
6 |
|
---|
7 | abstract public class NodeElemStyle extends ElemStyle {
|
---|
8 | public boolean annotate;
|
---|
9 | public String annotation_key;
|
---|
10 |
|
---|
11 | public NodeElemStyle(long minScale, long maxScale) {
|
---|
12 | super(minScale, maxScale);
|
---|
13 | }
|
---|
14 |
|
---|
15 | protected String getName(Node n, MapPainter painter) {
|
---|
16 | if (painter.isShowNames() && annotate) {
|
---|
17 | if (annotation_key != null) {
|
---|
18 | return n.get(annotation_key);
|
---|
19 | } else {
|
---|
20 | return painter.getNodeName(n);
|
---|
21 | }
|
---|
22 | }
|
---|
23 | return null;
|
---|
24 | }
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.