Changeset 30737 in osm for applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPanel.java
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/NanoLog/src/nanolog/NanoLogPanel.java
r30701 r30737 20 20 /** 21 21 * NanoLog Panel. Displays the selected log item, along with surrounding 30-50 lines. 22 * 22 * 23 23 * @author zverik 24 24 */ … … 26 26 private JList<String> logPanel; 27 27 private LogListModel listModel; 28 28 29 29 public NanoLogPanel() { 30 30 super(tr("NanoLog"), "nanolog", tr("Open NanoLog panel"), null, 150, false); 31 31 32 32 listModel = new LogListModel(); 33 logPanel = new JList< String>(listModel);33 logPanel = new JList<>(listModel); 34 34 createLayout(logPanel, true, null); 35 35 } 36 36 37 37 public void updateMarkers() { 38 List<NanoLogEntry> entries = new ArrayList< NanoLogEntry>();38 List<NanoLogEntry> entries = new ArrayList<>(); 39 39 for( NanoLogLayer l : Main.map.mapView.getLayersOfType(NanoLogLayer.class) ) { 40 40 entries.addAll(l.getEntries()); … … 74 74 } 75 75 } 76 76 77 77 private class LogListModel extends AbstractListModel<String> { 78 78 private List<NanoLogEntry> entries; 79 79 private final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss"); 80 80 81 public int getSize() { 81 @Override 82 public int getSize() { 82 83 return entries.size(); 83 84 } 84 85 85 public String getElementAt( int index ) { 86 @Override 87 public String getElementAt( int index ) { 86 88 return TIME_FORMAT.format(entries.get(index).getTime()) + " " + entries.get(index).getMessage(); 87 89 }
Note:
See TracChangeset
for help on using the changeset viewer.