Changeset 16322 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-04-17T20:50:39+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
r14153 r16322 7 7 import java.awt.Dimension; 8 8 import java.awt.GridBagLayout; 9 import java.io.PrintWriter; 10 import java.io.StringWriter; 9 11 import java.text.Collator; 10 12 import java.util.ArrayList; … … 118 120 double scale = nc.getDist100Pixel(); 119 121 120 final StringBuilder txtMappaint = new StringBuilder(); 122 final StringWriter stringWriter = new StringWriter(); 123 final PrintWriter txtMappaint = new PrintWriter(stringWriter); 121 124 MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock(); 122 125 try { 123 126 for (IPrimitive osm : sel) { 124 txtMappaint.append(tr("Styles Cache for \"{0}\":", osm.getDisplayName(DefaultNameFormatter.getInstance()))); 127 String heading = tr("Styles for \"{0}\":", osm.getDisplayName(DefaultNameFormatter.getInstance())); 128 txtMappaint.println(heading); 129 txtMappaint.println(repeatString("=", heading.length())); 125 130 126 131 MultiCascade mc = new MultiCascade(); … … 128 133 for (StyleSource s : elemstyles.getStyleSources()) { 129 134 if (s.active) { 130 txtMappaint.append(tr("\n\n> applying {0} style \"{1}\"\n", getSort(s), s.getDisplayString())); 135 heading = tr("{0} style \"{1}\"", getSort(s), s.getDisplayString()); 136 txtMappaint.println(heading); 137 txtMappaint.println(repeatString("-", heading.length())); 131 138 s.apply(mc, osm, scale, false); 132 txtMappaint. append(tr("\nRange:{0}", mc.range));139 txtMappaint.println(tr("Display range: {0}", mc.range)); 133 140 for (Entry<String, Cascade> e : mc.getLayers()) { 134 txtMappaint.append("\n ").append(e.getKey()).append(": \n").append(e.getValue()); 141 txtMappaint.println(tr("Layer {0}", e.getKey())); 142 txtMappaint.print(" * "); 143 txtMappaint.println(e.getValue()); 135 144 } 136 } else {137 txtMappaint.append(tr("\n\n> skipping \"{0}\" (not active)", s.getDisplayString()));138 145 } 139 146 } 140 txtMappaint.append(tr("\n\nList of generated Styles:\n")); 147 txtMappaint.println(); 148 heading = tr("List of generated Styles:"); 149 txtMappaint.println(heading); 150 txtMappaint.println(repeatString("-", heading.length())); 141 151 StyleElementList sl = elemstyles.get(osm, scale, nc); 142 152 for (StyleElement s : sl) { 143 txtMappaint.append(" * ").append(s).append('\n'); 153 txtMappaint.print(" * "); 154 txtMappaint.println(s); 144 155 } 145 txtMappaint.append("\n\n"); 156 txtMappaint.println(); 157 txtMappaint.println(); 146 158 } 147 159 } finally { … … 153 165 StyleCache sc2 = selList.get(1).getCachedStyle(); 154 166 if (sc1 == sc2) { 155 txtMappaint. append(tr("The 2 selected objects have identical style caches."));167 txtMappaint.println(tr("The 2 selected objects have identical style caches.")); 156 168 } 157 169 if (!sc1.equals(sc2)) { 158 txtMappaint. append(tr("The 2 selected objects have different style caches."));170 txtMappaint.println(tr("The 2 selected objects have different style caches.")); 159 171 } 160 172 if (sc1 != sc2 && sc1.equals(sc2)) { 161 txtMappaint.append(tr("Warning: The 2 selected objects have equal, but not identical style caches.")); 162 } 163 } 164 return txtMappaint.toString(); 173 txtMappaint.println(tr("Warning: The 2 selected objects have equal, but not identical style caches.")); 174 } 175 } 176 return stringWriter.toString(); 177 } 178 179 private static String repeatString(String string, int count) { 180 // Java 11: use String.repeat 181 return new String(new char[count]).replace("\0", string); 165 182 } 166 183 … … 201 218 private static String getSort(StyleSource s) { 202 219 if (s instanceof MapCSSStyleSource) { 203 return tr("mapcss");220 return "MapCSS"; 204 221 } else { 205 return tr(" unknown");222 return tr("UNKNOWN"); 206 223 } 207 224 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java
r14353 r16322 103 103 @Override 104 104 public String toString() { 105 return String.format("| s%s-%s", lower, upper);105 return String.format("|z%.4f-%.4f", lower, upper); 106 106 } 107 107
Note:
See TracChangeset
for help on using the changeset viewer.