Changeset 29995 in osm for applications/editors/josm/plugins/smed2/src/panels
- Timestamp:
- 2013-10-05T20:05:27+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r29992 r29995 7 7 import java.awt.Rectangle; 8 8 import java.awt.event.ActionListener; 9 import java.util.ArrayList; 10 import java.util.Iterator; 9 11 10 12 import javax.swing.*; 11 13 12 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 16 17 import s57.S57att.Att; 18 import s57.S57obj.Obj; 19 import s57.S57val; 20 import seamap.SeaMap; 21 import seamap.SeaMap.*; 22 import smed2.S57en; 14 23 import smed2.Smed2Action; 15 24 16 25 public class PanelMain extends JPanel { 17 26 27 public static JTextArea decode = null; 18 28 public static JTextField messageBar = null; 19 29 public JButton saveButton = null; … … 78 88 saveButton.addActionListener(alSave); 79 89 90 decode = new JTextArea(); 91 decode.setBounds(0, 0, 480, 420); 92 decode.setTabSize(1); 93 add(decode); 94 } 95 96 public void parseMark(Feature feature) { 97 decode.setText("Selected feature:\n"); 98 decode.append("\tType: " + S57en.ObjEN.get(feature.type) + "\n"); 99 if (feature.atts.get(Att.OBJNAM) != null) { 100 decode.append("\tName: " + feature.atts.get(Att.OBJNAM).val + "\n"); 101 } 102 decode.append("\tObjects:\n"); 103 for (Obj obj : feature.objs.keySet()) { 104 decode.append("\t\t" + S57en.ObjEN.get(obj) + "\n"); 105 if (feature.objs.get(obj).size() != 0) { 106 for (AttMap atts : feature.objs.get(obj).values()) { 107 for (Att att : atts.keySet()) { 108 AttItem item = atts.get(att); 109 switch (item.conv) { 110 case E: 111 decode.append("\t\t\t" + S57en.AttEN.get(att) + ": " + S57en.enums.get(att).get(item.val) + "\n"); 112 break; 113 case L: 114 decode.append("\t\t\t" + S57en.AttEN.get(att) + ": "); 115 Iterator it = ((ArrayList)item.val).iterator(); 116 while (it.hasNext()) { 117 Object val = it.next(); 118 decode.append((String)S57en.enums.get(att).get(val)); 119 if (it.hasNext()) { 120 decode.append(", "); 121 } 122 } 123 decode.append("\n"); 124 break; 125 default: 126 decode.append("\t\t\t" + S57en.AttEN.get(att) + ": " + item.val + "\n"); 127 } 128 } 129 } 130 } 131 } 80 132 } 81 133
Note:
See TracChangeset
for help on using the changeset viewer.