Changeset 6730 in josm for trunk/src/org
- Timestamp:
- 2014-01-19T11:59:33+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6643 r6730 214 214 215 215 /** 216 * Logging level ( 4 = debug, 3 = info, 2 = warn, 1 = error, 0 = none).216 * Logging level (5 = trace, 4 = debug, 3 = info, 2 = warn, 1 = error, 0 = none). 217 217 * @since 6248 218 218 */ … … 265 265 if (msg != null && !msg.isEmpty()) { 266 266 System.out.println(tr("DEBUG: {0}", msg)); 267 } 268 } 269 270 /** 271 * Prints a trace message if logging is on. 272 * @param msg The message to print. 273 */ 274 public static void trace(String msg) { 275 if (logLevel < 5) 276 return; 277 if (msg != null && !msg.isEmpty()) { 278 System.out.print("TRACE: "); 279 System.out.println(msg); 267 280 } 268 281 } -
trunk/src/org/openstreetmap/josm/gui/FileDrop.java
r6643 r6730 130 130 { @Override 131 131 public void dragEnter( DropTargetDragEvent evt ) 132 { Main. debug("FileDrop: dragEnter event." );132 { Main.trace("FileDrop: dragEnter event." ); 133 133 134 134 // Is this an acceptable drag event? … … 139 139 { JComponent jc = (JComponent) c; 140 140 normalBorder = jc.getBorder(); 141 Main. debug("FileDrop: normal border saved." );141 Main.trace("FileDrop: normal border saved." ); 142 142 jc.setBorder( dragBorder ); 143 Main. debug("FileDrop: drag border set." );143 Main.trace("FileDrop: drag border set." ); 144 144 } // end if: JComponent 145 145 146 146 // Acknowledge that it's okay to enter 147 147 evt.acceptDrag( DnDConstants.ACTION_COPY ); 148 Main. debug("FileDrop: event accepted." );148 Main.trace("FileDrop: event accepted." ); 149 149 } // end if: drag ok 150 150 else 151 151 { // Reject the drag event 152 152 evt.rejectDrag(); 153 Main. debug("FileDrop: event rejected." );153 Main.trace("FileDrop: event rejected." ); 154 154 } // end else: drag not ok 155 155 } // end dragEnter … … 163 163 @Override 164 164 public void drop( DropTargetDropEvent evt ) 165 { Main. debug("FileDrop: drop event." );165 { Main.trace("FileDrop: drop event." ); 166 166 try 167 167 { // Get whatever was dropped … … 173 173 // Say we'll take it. 174 174 evt.acceptDrop ( DnDConstants.ACTION_COPY ); 175 Main. debug("FileDrop: file list accepted." );175 Main.trace("FileDrop: file list accepted." ); 176 176 177 177 // Get a useful list … … 188 188 // Mark that drop is completed. 189 189 evt.getDropTargetContext().dropComplete(true); 190 Main. debug("FileDrop: drop complete." );190 Main.trace("FileDrop: drop complete." ); 191 191 } // end if: file list 192 192 else // this section will check for a reader flavor. … … 200 200 // Say we'll take it. 201 201 evt.acceptDrop(DnDConstants.ACTION_COPY); 202 Main. debug("FileDrop: reader accepted.");202 Main.trace("FileDrop: reader accepted."); 203 203 204 204 Reader reader = flavor.getReaderForText(tr); … … 212 212 // Mark that drop is completed. 213 213 evt.getDropTargetContext().dropComplete(true); 214 Main. debug("FileDrop: drop complete.");214 Main.trace("FileDrop: drop complete."); 215 215 handled = true; 216 216 break; … … 218 218 } 219 219 if(!handled){ 220 Main. debug("FileDrop: not a file list or reader - abort." );220 Main.trace("FileDrop: not a file list or reader - abort." ); 221 221 evt.rejectDrop(); 222 222 } … … 341 341 { @Override 342 342 public void hierarchyChanged( HierarchyEvent evt ) 343 { Main. debug("FileDrop: Hierarchy changed." );343 { Main.trace("FileDrop: Hierarchy changed." ); 344 344 Component parent = c.getParent(); 345 345 if( parent == null ) 346 346 { c.setDropTarget( null ); 347 Main. debug("FileDrop: Drop target cleared from component." );347 Main.trace("FileDrop: Drop target cleared from component." ); 348 348 } // end if: null parent 349 349 else 350 350 { new DropTarget(c, dropListener); 351 Main. debug("FileDrop: Drop target added to component." );351 Main.trace("FileDrop: Drop target added to component." ); 352 352 } // end else: parent not null 353 353 } // end hierarchyChanged … … 396 396 // show data flavors 397 397 if( flavors.length == 0 ) { 398 Main. debug("FileDrop: no data flavors." );398 Main.trace("FileDrop: no data flavors." ); 399 399 } 400 400 for( i = 0; i < flavors.length; i++ ) { 401 Main. debug(flavors[i].toString() );401 Main.trace(flavors[i].toString() ); 402 402 } 403 403 … … 431 431 { // Make sure we support dnd. 432 432 if (supportsDnD()) { 433 Main. debug("FileDrop: Removing drag-and-drop hooks.");433 Main.trace("FileDrop: Removing drag-and-drop hooks."); 434 434 c.setDropTarget(null); 435 435 if (recursive && (c instanceof Container)) { -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r6642 r6730 122 122 "\t--language=<language> "+tr("Set the language")+"\n\n"+ 123 123 "\t--version "+tr("Displays the JOSM version and exits")+"\n\n"+ 124 "\t--debug "+tr("Print debugging messages to console")+"\n\n"+ 124 125 tr("options provided as Java system properties")+":\n"+ 125 126 "\t-Djosm.home="+tr("/PATH/TO/JOSM/FOLDER/ ")+tr("Change the folder for all user settings")+"\n\n"+ … … 149 150 /** --version Displays the JOSM version and exits */ 150 151 VERSION(false), 152 /** --debug Print debugging messages to console */ 153 DEBUG(false), 151 154 /** --language=<language> Set the language */ 152 155 LANGUAGE(true), … … 316 319 } 317 320 321 if (args.containsKey(Option.DEBUG)) { 322 logLevel = 4; 323 Main.debug(tr("Print debugging messages to console")); 324 } 325 318 326 Main.pref.init(args.containsKey(Option.RESET_PREFERENCES)); 319 327
Note:
See TracChangeset
for help on using the changeset viewer.