Changeset 3078 in osm for applications/editors/josm/plugins/surveyor
- Timestamp:
- 2007-06-01T10:39:50+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java
r2974 r3078 4 4 package at.dallermassl.josm.plugin.surveyor; 5 5 6 import java.awt.BorderLayout; 6 7 import java.awt.Dimension; 7 8 import java.awt.GridLayout; … … 15 16 import javax.swing.JComponent; 16 17 import javax.swing.JFrame; 18 import javax.swing.JLabel; 19 import javax.swing.JPanel; 17 20 18 21 import livegps.LiveGpsData; 19 22 23 import org.openstreetmap.josm.Main; 20 24 import org.openstreetmap.josm.tools.XmlObjectParser; 21 25 import org.xml.sax.SAXException; … … 32 36 private int width = 0; 33 37 private int height = 0; 38 private JLabel streetLabel; 39 private JPanel buttonPanel; 34 40 35 41 public SurveyorComponent() { 36 42 super(); 43 setLayout(new BorderLayout()); 44 streetLabel = new JLabel("Way: "); 45 float fontSize = Float.parseFloat(Main.pref.get(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, "35")); 46 Main.pref.put(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, String.valueOf(fontSize)); 47 streetLabel.setFont(streetLabel.getFont().deriveFont(35f)); 48 add(streetLabel, BorderLayout.NORTH); 49 buttonPanel = new JPanel(); 50 add(buttonPanel, BorderLayout.CENTER); 37 51 } 38 52 … … 43 57 public void setRows(String rowsString) { 44 58 rows = Integer.parseInt(rowsString); 45 setLayout(new GridLayout(rows, columns));59 buttonPanel.setLayout(new GridLayout(rows, columns)); 46 60 } 47 61 … … 52 66 public void setColumns(String columnsString) { 53 67 columns = Integer.parseInt(columnsString); 54 setLayout(new GridLayout(rows, columns));68 buttonPanel.setLayout(new GridLayout(rows, columns)); 55 69 } 56 70 … … 83 97 public void addButton(ButtonDescription description) { 84 98 description.setGpsDataSource(this); 85 add(description.createComponent());99 buttonPanel.add(description.createComponent()); 86 100 } 87 101 … … 147 161 if("gpsdata".equals(evt.getPropertyName())) { 148 162 gpsData = (LiveGpsData) evt.getNewValue(); 163 streetLabel.setText("Way: " + gpsData.getWay()); 149 164 } 150 165
Note:
See TracChangeset
for help on using the changeset viewer.