Changeset 3078 in osm


Ignore:
Timestamp:
2007-06-01T10:39:50+02:00 (17 years ago)
Author:
christofd
Message:

added large label for the current way information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java

    r2974 r3078  
    44package at.dallermassl.josm.plugin.surveyor;
    55
     6import java.awt.BorderLayout;
    67import java.awt.Dimension;
    78import java.awt.GridLayout;
     
    1516import javax.swing.JComponent;
    1617import javax.swing.JFrame;
     18import javax.swing.JLabel;
     19import javax.swing.JPanel;
    1720
    1821import livegps.LiveGpsData;
    1922
     23import org.openstreetmap.josm.Main;
    2024import org.openstreetmap.josm.tools.XmlObjectParser;
    2125import org.xml.sax.SAXException;
     
    3236    private int width = 0;
    3337    private int height = 0;
     38    private JLabel streetLabel;
     39    private JPanel buttonPanel;
    3440
    3541    public SurveyorComponent() {
    3642        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);
    3751    }
    3852   
     
    4357    public void setRows(String rowsString) {
    4458        rows = Integer.parseInt(rowsString);
    45         setLayout(new GridLayout(rows, columns));
     59        buttonPanel.setLayout(new GridLayout(rows, columns));
    4660    }
    4761   
     
    5266    public void setColumns(String columnsString) {
    5367        columns = Integer.parseInt(columnsString);
    54         setLayout(new GridLayout(rows, columns));
     68        buttonPanel.setLayout(new GridLayout(rows, columns));
    5569    }
    5670   
     
    8397    public void addButton(ButtonDescription description) {
    8498        description.setGpsDataSource(this);
    85         add(description.createComponent());
     99        buttonPanel.add(description.createComponent());
    86100    }
    87101   
     
    147161        if("gpsdata".equals(evt.getPropertyName())) {
    148162            gpsData = (LiveGpsData) evt.getNewValue();
     163            streetLabel.setText("Way: " + gpsData.getWay());
    149164        }
    150165       
Note: See TracChangeset for help on using the changeset viewer.