- Timestamp:
- 2018-04-23T02:05:41+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r13636 r13662 101 101 102 102 /** 103 * Replies true, if this primitive is disabled. (E.g. a filter applies) 104 * @return {@code true} if this object has the "disabled" flag enabled 105 * @since 13662 106 */ 107 default boolean isDisabled() { 108 return false; 109 } 110 111 /** 112 * Replies true, if this primitive is disabled and marked as completely hidden on the map. 113 * @return {@code true} if this object has both the "disabled" and "hide if disabled" flags enabled 114 * @since 13662 115 */ 116 default boolean isDisabledAndHidden() { 117 return false; 118 } 119 120 /** 103 121 * Replies the id of this primitive. 104 122 * … … 251 269 return getType(); 252 270 } 271 272 /** 273 * Determines if this object is considered "tagged". To be "tagged", an object 274 * must have one or more "interesting" tags. "created_by" and "source" 275 * are typically considered "uninteresting" and do not make an object "tagged". 276 * @return true if this object is considered "tagged" 277 * @since 13662 278 */ 279 boolean isTagged(); 280 281 /** 282 * Determines if this object is considered "annotated". To be "annotated", an object 283 * must have one or more "work in progress" tags, such as "note" or "fixme". 284 * @return true if this object is considered "annotated" 285 * @since 13662 286 */ 287 boolean isAnnotated(); 288 289 /** 290 * true if this object has direction dependent tags (e.g. oneway) 291 * @return {@code true} if this object has direction dependent tags 292 * @since 13662 293 */ 294 boolean hasDirectionKeys(); 295 296 /** 297 * true if this object has the "reversed direction" flag enabled 298 * @return {@code true} if this object has the "reversed direction" flag enabled 299 * @since 13662 300 */ 301 boolean reversedDirection(); 253 302 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r13636 r13662 445 445 } 446 446 447 /** 448 * Replies true, if this primitive is disabled. (E.g. a filter applies) 449 * @return {@code true} if this object has the "disabled" flag enabled 450 */ 447 @Override 451 448 public boolean isDisabled() { 452 449 return (flags & FLAG_DISABLED) != 0; 453 450 } 454 451 455 /** 456 * Replies true, if this primitive is disabled and marked as completely hidden on the map. 457 * @return {@code true} if this object has both the "disabled" and "hide if disabled" flags enabled 458 */ 452 @Override 459 453 public boolean isDisabledAndHidden() { 460 454 return ((flags & FLAG_DISABLED) != 0) && ((flags & FLAG_HIDE_IF_DISABLED) != 0); … … 825 819 } 826 820 827 /** 828 * Determines if this object is considered "tagged". To be "tagged", an object 829 * must have one or more "interesting" tags. "created_by" and "source" 830 * are typically considered "uninteresting" and do not make an object 831 * "tagged". 832 * @return true if this object is considered "tagged" 833 */ 821 @Override 834 822 public boolean isTagged() { 835 823 return (flags & FLAG_TAGGED) != 0; 836 824 } 837 825 838 /** 839 * Determines if this object is considered "annotated". To be "annotated", an object 840 * must have one or more "work in progress" tags, such as "note" or "fixme". 841 * @return true if this object is considered "annotated" 842 * @since 5754 843 */ 826 @Override 844 827 public boolean isAnnotated() { 845 828 return (flags & FLAG_ANNOTATED) != 0; … … 861 844 } 862 845 863 /** 864 * true if this object has direction dependent tags (e.g. oneway) 865 * @return {@code true} if this object has direction dependent tags 866 */ 846 @Override 867 847 public boolean hasDirectionKeys() { 868 848 return (flags & FLAG_HAS_DIRECTIONS) != 0; 869 849 } 870 850 871 /** 872 * true if this object has the "reversed diretion" flag enabled 873 * @return {@code true} if this object has the "reversed diretion" flag enabled 874 */ 851 @Override 875 852 public boolean reversedDirection() { 876 853 return (flags & FLAG_DIRECTION_REVERSED) != 0; -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
r13636 r13662 134 134 135 135 @Override 136 public boolean isTagged() { 137 return hasKeys(); 138 } 139 140 @Override 141 public boolean isAnnotated() { 142 return false; 143 } 144 145 @Override 146 public boolean hasDirectionKeys() { 147 return false; 148 } 149 150 @Override 151 public boolean reversedDirection() { 152 return false; 153 } 154 155 @Override 136 156 public StyleCache getCachedStyle() { 137 157 return null; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r13657 r13662 47 47 import org.openstreetmap.josm.data.osm.BBox; 48 48 import org.openstreetmap.josm.data.osm.DataSet; 49 import org.openstreetmap.josm.data.osm.IPrimitive; 49 50 import org.openstreetmap.josm.data.osm.Node; 50 51 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 754 755 * @since 11670 755 756 */ 756 public void drawAreaIcon( OsmPrimitive osm, MapImage img, boolean disabled, boolean selected, boolean member, double theta,757 public void drawAreaIcon(IPrimitive osm, MapImage img, boolean disabled, boolean selected, boolean member, double theta, 757 758 PositionForAreaStrategy iconPosition) { 758 759 Rectangle2D.Double iconRect = new Rectangle2D.Double(-img.getWidth() / 2.0, -img.getHeight() / 2.0, img.getWidth(), img.getHeight()); … … 1090 1091 * @since 11722 1091 1092 */ 1092 public void drawText( OsmPrimitive osm, TextLabel text, PositionForAreaStrategy labelPositionStrategy) {1093 public void drawText(IPrimitive osm, TextLabel text, PositionForAreaStrategy labelPositionStrategy) { 1093 1094 if (!isShowNames()) { 1094 1095 return; … … 1126 1127 } 1127 1128 1128 private void displayText( OsmPrimitive osm, TextLabel text, String name, Rectangle2D nb,1129 private void displayText(IPrimitive osm, TextLabel text, String name, Rectangle2D nb, 1129 1130 MapViewPositionAndRotation center) { 1130 1131 AffineTransform at = new AffineTransform(); … … 1182 1183 * @param consumer The consumer to call. 1183 1184 */ 1184 private void forEachPolygon( OsmPrimitive osm, Consumer<MapViewPath> consumer) {1185 private void forEachPolygon(IPrimitive osm, Consumer<MapViewPath> consumer) { 1185 1186 if (osm instanceof Way) { 1186 1187 consumer.accept(getPath((Way) osm)); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
r13368 r13662 7 7 import java.util.Objects; 8 8 9 import org.openstreetmap.josm.data.osm. OsmPrimitive;9 import org.openstreetmap.josm.data.osm.IPrimitive; 10 10 import org.openstreetmap.josm.data.osm.Relation; 11 11 import org.openstreetmap.josm.data.osm.Way; … … 120 120 121 121 @Override 122 public void paintPrimitive( OsmPrimitive osm, MapPaintSettings paintSettings, StyledMapRenderer painter,122 public void paintPrimitive(IPrimitive osm, MapPaintSettings paintSettings, StyledMapRenderer painter, 123 123 boolean selected, boolean outermember, boolean member) { 124 124 Color myColor = color; -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaIconElement.java
r12756 r13662 4 4 import java.util.Objects; 5 5 6 import org.openstreetmap.josm.data.osm. OsmPrimitive;6 import org.openstreetmap.josm.data.osm.IPrimitive; 7 7 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 8 8 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; … … 43 43 44 44 @Override 45 public void paintPrimitive( OsmPrimitive osm, MapPaintSettings paintSettings, StyledMapRenderer painter,45 public void paintPrimitive(IPrimitive osm, MapPaintSettings paintSettings, StyledMapRenderer painter, 46 46 boolean selected, boolean outermember, boolean member) { 47 47 if (painter.isShowIcons()) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
r12476 r13662 7 7 import java.util.Objects; 8 8 9 import org.openstreetmap.josm.data.osm.IPrimitive; 9 10 import org.openstreetmap.josm.data.osm.Node; 10 import org.openstreetmap.josm.data.osm.OsmPrimitive;11 11 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 12 12 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; … … 282 282 283 283 @Override 284 public void paintPrimitive( OsmPrimitive osm, MapPaintSettings settings, StyledMapRenderer painter,284 public void paintPrimitive(IPrimitive osm, MapPaintSettings settings, StyledMapRenderer painter, 285 285 boolean selected, boolean outermember, boolean member) { 286 286 if (osm instanceof Node) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r13013 r13662 8 8 import java.util.Optional; 9 9 10 import org.openstreetmap.josm.data.osm.IPrimitive; 10 11 import org.openstreetmap.josm.data.osm.Node; 11 import org.openstreetmap.josm.data.osm.OsmPrimitive;12 12 import org.openstreetmap.josm.data.osm.Way; 13 13 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; … … 110 110 111 111 @Override 112 public void paintPrimitive( OsmPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter,112 public void paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, 113 113 boolean selected, boolean outermember, boolean member) { 114 114 /* show direction arrows, if draw.segment.relevant_directions_only is not set, -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r12846 r13662 10 10 import java.util.stream.IntStream; 11 11 12 import org.openstreetmap.josm.data.osm.IPrimitive; 12 13 import org.openstreetmap.josm.data.osm.Node; 13 import org.openstreetmap.josm.data.osm.OsmPrimitive;14 14 import org.openstreetmap.josm.data.osm.Relation; 15 15 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; … … 267 267 268 268 @Override 269 public void paintPrimitive( OsmPrimitive primitive, MapPaintSettings settings, StyledMapRenderer painter,269 public void paintPrimitive(IPrimitive primitive, MapPaintSettings settings, StyledMapRenderer painter, 270 270 boolean selected, boolean outermember, boolean member) { 271 271 if (primitive instanceof Node) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r12303 r13662 4 4 import java.util.Objects; 5 5 6 import org.openstreetmap.josm.data.osm. OsmPrimitive;6 import org.openstreetmap.josm.data.osm.IPrimitive; 7 7 import org.openstreetmap.josm.data.osm.Way; 8 8 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; … … 120 120 121 121 @Override 122 public void paintPrimitive( OsmPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter,122 public void paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, 123 123 boolean selected, boolean outermember, boolean member) { 124 124 if (primitive instanceof Way) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r12846 r13662 7 7 import java.util.Objects; 8 8 9 import org.openstreetmap.josm.data.osm.IPrimitive; 9 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 11 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; … … 88 89 * @param outermember true, if primitive is not selected and outer member of a selected multipolygon relation 89 90 * @param member true, if primitive is not selected and member of a selected relation 90 */ 91 public abstract void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, 91 * @since 13662 (signature) 92 */ 93 public abstract void paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, 92 94 boolean selected, boolean outermember, boolean member); 93 95 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextElement.java
r12476 r13662 4 4 import java.util.Objects; 5 5 6 import org.openstreetmap.josm.data.osm. OsmPrimitive;6 import org.openstreetmap.josm.data.osm.IPrimitive; 7 7 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 8 8 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; … … 88 88 89 89 @Override 90 public void paintPrimitive( OsmPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter,90 public void paintPrimitive(IPrimitive primitive, MapPaintSettings paintSettings, StyledMapRenderer painter, 91 91 boolean selected, boolean outermember, boolean member) { 92 92 painter.drawText(primitive, text, getLabelPositionStrategy()); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java
r12476 r13662 7 7 import java.util.Objects; 8 8 9 import org.openstreetmap.josm.data.osm.IPrimitive; 9 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 11 import org.openstreetmap.josm.gui.mappaint.Cascade; … … 184 185 * derived for {@code osm} 185 186 */ 186 public String getString( OsmPrimitive osm) {187 public String getString(IPrimitive osm) { 187 188 if (labelCompositionStrategy == null) return null; 188 189 return labelCompositionStrategy.compose(osm);
Note:
See TracChangeset
for help on using the changeset viewer.