- Timestamp:
- 2011-09-17T12:27:45+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ImageryPreference.java
r4432 r4433 379 379 final JMapViewer map; 380 380 final PreferenceTabbedPane gui; 381 382 private class ImageryTableCellRenderer extends DefaultTableCellRenderer { 383 384 private List<ImageryInfo> layers; 385 386 public ImageryTableCellRenderer(List<ImageryInfo> layers) { 387 this.layers = layers; 388 } 389 390 @Override 391 public Component getTableCellRendererComponent(JTable table, Object value, boolean 392 isSelected, boolean hasFocus, int row, int column) { 393 JLabel label = (JLabel) super.getTableCellRendererComponent( 394 table, value, isSelected, hasFocus, row, column); 395 String t = value.toString(); 396 label.setBackground(Main.pref.getUIColor("Table.background")); 397 if (isSelected) { 398 label.setForeground(Main.pref.getUIColor("Table.foreground")); 399 } 400 for(ImageryInfo l : layers) 401 { 402 if(l.getExtendedUrl().equals(t)) { 403 label.setBackground(Main.pref.getColor( 404 marktr("Imagery Background: Default"), 405 new Color(200,255,200))); 406 break; 407 } 408 } 409 return label; 410 } 411 } 381 412 382 413 public ImageryProvidersPanel(final PreferenceTabbedPane gui, ImageryLayerInfo layerInfoArg) { … … 423 454 TableColumnModel mod = listdef.getColumnModel(); 424 455 mod.getColumn(2).setPreferredWidth(800); 456 mod.getColumn(2).setCellRenderer(new ImageryTableCellRenderer(layerInfo.getLayers())); 425 457 mod.getColumn(1).setPreferredWidth(400); 426 458 mod.getColumn(0).setPreferredWidth(50); 427 459 428 mod.getColumn(2).setCellRenderer(new DefaultTableCellRenderer() {429 @Override430 public Component getTableCellRendererComponent(JTable table,431 Object value, boolean isSelected, boolean hasFocus, int row,432 int column) {433 JLabel label = (JLabel) super.getTableCellRendererComponent(434 table, value, isSelected, hasFocus, row, column);435 String t = value.toString();436 label.setBackground(Main.pref.getUIColor("Table.background"));437 for(ImageryInfo l : layerInfo.getLayers())438 {439 if(l.getExtendedUrl().equals(t)) {440 label.setBackground(Main.pref.getColor(441 marktr("Imagery Background: Default"),442 new Color(200,255,200)));443 break;444 }445 }446 return label;447 };448 });449 450 460 mod = listActive.getColumnModel(); 451 461 mod.getColumn(1).setPreferredWidth(800); 462 mod.getColumn(1).setCellRenderer(new ImageryTableCellRenderer(layerInfo.getDefaultLayers())); 452 463 mod.getColumn(0).setPreferredWidth(200); 453 454 mod.getColumn(1).setCellRenderer(new DefaultTableCellRenderer() {455 @Override456 public Component getTableCellRendererComponent(JTable table,457 Object value, boolean isSelected, boolean hasFocus, int row,458 int column) {459 JLabel label = (JLabel) super.getTableCellRendererComponent(460 table, value, isSelected, hasFocus, row, column);461 String t = value.toString();462 label.setBackground(Main.pref.getUIColor("Table.background"));463 for(ImageryInfo l : layerInfo.getDefaultLayers())464 {465 if(l.getExtendedUrl().equals(t)) {466 label.setBackground(Main.pref.getColor(467 marktr("Imagery Background: Default"),468 new Color(200,255,200)));469 break;470 }471 }472 return label;473 };474 });475 464 476 465 RemoveEntryAction remove = new RemoveEntryAction();
Note:
See TracChangeset
for help on using the changeset viewer.