Changeset 8426 in josm for trunk/src/org/openstreetmap/josm/gui/io
- Timestamp:
- 2015-05-26T01:37:50+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/io
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r8378 r8426 49 49 50 50 /** Temporary layer where downloaded primitives are put */ 51 private OsmDataLayer tmpLayer;51 private final OsmDataLayer tmpLayer; 52 52 /** Reference to the task that download requested primitives */ 53 53 private DownloadPrimitivesTask mainTask; … … 209 209 JPanel p = new JPanel(new GridBagLayout()); 210 210 p.add(new HtmlPanel(text), GBC.eop()); 211 JosmTextArea txt = new JosmTextArea(); 211 212 if (listLabel != null) { 212 213 JLabel missing = new JLabel(listLabel); 213 214 missing.setFont(missing.getFont().deriveFont(Font.PLAIN)); 215 missing.setLabelFor(txt); 214 216 p.add(missing, GBC.eol()); 215 217 } 216 JosmTextArea txt = new JosmTextArea();217 218 txt.setFont(GuiHelper.getMonospacedFont(txt)); 218 219 txt.setEditable(false); … … 227 228 Main.parent, 228 229 title, 229 new String[] { tr("Ok")})230 .setButtonIcons(new String[] { "ok"})230 new String[] {tr("Ok")}) 231 .setButtonIcons(new String[] {"ok"}) 231 232 .setIcon(msgType) 232 233 .setContent(p, false); -
trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
r8379 r8426 54 54 lblFilename.setPreferredSize(new Dimension(lblFilename.getPreferredSize().width, 19)); 55 55 lblFilename.setOpaque(true); 56 lblFilename.setLabelFor(btnFileChooser); 56 57 57 58 tfFilename.setToolTipText(tr("Either edit the path manually in the text field or click the \"...\" button to open a file chooser.")); -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r6889 r8426 25 25 private static final GBC defaultCellStyle = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0); 26 26 27 /** 28 * Constructs a new {@code RecommendedActionsTableCell}. 29 */ 27 30 public RecommendedActionsTableCell() { 28 31 pnlEmpty.setPreferredSize(new Dimension(1, 19)); … … 36 39 JPanel panel = new JPanel(new GridBagLayout()); 37 40 SaveLayerInfo info = (SaveLayerInfo)value; 38 StringBuilder sb = new StringBuilder( );41 StringBuilder sb = new StringBuilder(24); 39 42 sb.append("<html>"); 40 43 if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) { … … 54 57 if (info.getLayer().requiresSaveToFile()) { 55 58 panel.add(needsSave, defaultCellStyle); 56 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", info.getName(), info.getFile().toString())); 59 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", 60 info.getName(), info.getFile().toString())); 57 61 } else { 58 62 panel.add(pnlEmpty, defaultCellStyle); … … 63 67 return panel; 64 68 } 69 } 70 71 /** 72 * Constructs a new {@code SaveLayersTableColumnModel}. 73 */ 74 public SaveLayersTableColumnModel() { 75 build(); 65 76 } 66 77 … … 97 108 addColumn(col); 98 109 } 99 100 public SaveLayersTableColumnModel() {101 build();102 }103 110 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRenderer.java
r6084 r8426 20 20 private JLabel lblCustomText; 21 21 private JProgressBar progressBar; 22 23 /** 24 * Constructs a new {@code UploadAndSaveProgressRenderer}. 25 */ 26 public UploadAndSaveProgressRenderer() { 27 build(); 28 // initially not visible 29 setVisible(false); 30 } 22 31 23 32 protected void build() { … … 47 56 gc.insets = new Insets(5,0,0,5); 48 57 add(progressBar = new JProgressBar(JProgressBar.HORIZONTAL), gc); 49 }50 51 public UploadAndSaveProgressRenderer() {52 build();53 // initially not visible54 setVisible(false);55 58 } 56 59 -
trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
r8390 r8426 31 31 private transient ConfigurationParameterRequestHandler configHandler; 32 32 33 /** 34 * Constructs a new {@code UploadParameterSummaryPanel}. 35 */ 36 public UploadParameterSummaryPanel() { 37 build(); 38 updateSummary(); 39 } 40 33 41 protected String buildChangesetSummary() { 34 42 StringBuilder msg = new StringBuilder(96); … … 56 64 if (spec == null) 57 65 return ""; 58 // check whether we can use one changeset only or whether we have to use 59 // multiple changesets 66 // check whether we can use one changeset only or whether we have to use multiple changesets 60 67 // 61 68 boolean useOneChangeset = true; … … 113 120 } 114 121 115 /**116 * Constructs a new {@code UploadParameterSummaryPanel}.117 */118 public UploadParameterSummaryPanel() {119 build();120 updateSummary();121 }122 123 122 public void setConfigurationParameterRequestListener(ConfigurationParameterRequestHandler handler) { 124 123 this.configHandler = handler; … … 141 140 142 141 protected void updateSummary() { 143 StringBuilder sb = new StringBuilder( );142 StringBuilder sb = new StringBuilder(32); 144 143 sb.append("<html>") 145 144 .append(buildStrategySummary()) -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r8415 r8426 47 47 * This dialog can be used to select individual object for uploading. 48 48 * 49 * 49 * @since 2250 50 50 */ 51 51 public class UploadSelectionDialog extends JDialog { … … 57 57 private SideButton btnContinue; 58 58 59 /** 60 * Constructs a new {@code UploadSelectionDialog}. 61 */ 62 public UploadSelectionDialog() { 63 super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL); 64 build(); 65 } 66 59 67 protected JPanel buildSelectedPrimitivesPanel() { 60 68 JPanel pnl = new JPanel(); 61 69 pnl.setLayout(new BorderLayout()); 62 JLabel lbl = new JLabel(tr("<html>Mark modified objects <strong>from the current selection</strong> to be uploaded to the server.</html>")); 70 JLabel lbl = new JLabel( 71 tr("<html>Mark modified objects <strong>from the current selection</strong> to be uploaded to the server.</html>")); 63 72 lbl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 64 73 pnl.add(lbl, BorderLayout.NORTH); 65 74 pnl.add(new JScrollPane(lstSelectedPrimitives = new OsmPrimitiveList()), BorderLayout.CENTER); 75 lbl.setLabelFor(lstSelectedPrimitives); 66 76 return pnl; 67 77 } … … 74 84 pnl.add(lbl, BorderLayout.NORTH); 75 85 pnl.add(new JScrollPane(lstDeletedPrimitives = new OsmPrimitiveList()), BorderLayout.CENTER); 86 lbl.setLabelFor(lstDeletedPrimitives); 76 87 return pnl; 77 88 } … … 114 125 setTitle(tr("Select objects to upload")); 115 126 HelpUtil.setHelpContext(getRootPane(), HelpUtil.ht("/Dialog/UploadSelection")); 116 }117 118 public UploadSelectionDialog() {119 super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL);120 build();121 127 } 122 128 -
trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java
r8308 r8426 20 20 21 21 /** 22 * This panel displays a summary of the objects to upload. It is displayed in 23 * the upper part of the {@link UploadDialog}. 24 * 22 * This panel displays a summary of the objects to upload. It is displayed in the upper part of the {@link UploadDialog}. 23 * @since 2599 25 24 */ 26 25 public class UploadedObjectsSummaryPanel extends JPanel { … … 40 39 private JScrollPane spDelete; 41 40 41 /** 42 * Constructs a new {@code UploadedObjectsSummaryPanel}. 43 */ 44 public UploadedObjectsSummaryPanel() { 45 build(); 46 } 47 42 48 protected void build() { 43 49 setLayout(new GridBagLayout()); 44 50 OsmPrimitivRenderer renderer = new OsmPrimitivRenderer(); 45 // initialize the three lists for uploaded primitives, but don't add 46 // them to the dialog yet, see setUploadedPrimitives() 51 // initialize the three lists for uploaded primitives, but don't add them to the dialog yet, see setUploadedPrimitives() 47 52 // 48 53 lstAdd = new PrimitiveList(); … … 51 56 spAdd = new JScrollPane(lstAdd); 52 57 lblAdd = new JLabel(tr("Objects to add:")); 58 lblAdd.setLabelFor(lstAdd); 53 59 54 60 lstUpdate = new PrimitiveList(); … … 57 63 spUpdate = new JScrollPane(lstUpdate); 58 64 lblUpdate = new JLabel(tr("Objects to modify:")); 65 lblUpdate.setLabelFor(lstUpdate); 59 66 60 67 lstDelete = new PrimitiveList(); … … 63 70 spDelete = new JScrollPane(lstDelete); 64 71 lblDelete = new JLabel(tr("Objects to delete:")); 72 lblDelete.setLabelFor(lstDelete); 65 73 } 66 74 … … 121 129 } 122 130 123 public UploadedObjectsSummaryPanel() {124 build();125 }126 127 131 /** 128 132 * Replies the number of objects to upload … … 138 142 /** 139 143 * A simple list of OSM primitives. 140 *141 144 */ 142 145 static class PrimitiveList extends JList<OsmPrimitive> { 146 /** 147 * Constructs a new {@code PrimitiveList}. 148 */ 143 149 public PrimitiveList() { 144 150 super(new PrimitiveListModel()); … … 152 158 /** 153 159 * A list model for a list of OSM primitives. 154 *155 160 */ 156 161 static class PrimitiveListModel extends AbstractListModel<OsmPrimitive> { 157 162 private transient List<OsmPrimitive> primitives; 158 163 164 /** 165 * Constructs a new {@code PrimitiveListModel}. 166 */ 159 167 public PrimitiveListModel() { 160 168 primitives = new ArrayList<>();
Note:
See TracChangeset
for help on using the changeset viewer.