Changeset 2644 in josm for trunk/src/org
- Timestamp:
- 2009-12-16T20:23:20+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java
r2626 r2644 9 9 import java.awt.Dimension; 10 10 import java.awt.FlowLayout; 11 import java.awt.GridBagConstraints; 12 import java.awt.GridBagLayout; 11 import java.awt.Font; 13 12 import java.awt.event.ActionEvent; 14 13 import java.awt.event.WindowAdapter; 15 14 import java.awt.event.WindowEvent; 15 import java.text.MessageFormat; 16 16 import java.util.ArrayList; 17 17 import java.util.Collection; … … 23 23 import javax.swing.AbstractAction; 24 24 import javax.swing.BorderFactory; 25 import javax.swing.JComponent;26 25 import javax.swing.JDialog; 27 import javax.swing.J Label;26 import javax.swing.JEditorPane; 28 27 import javax.swing.JOptionPane; 29 28 import javax.swing.JPanel; 30 29 import javax.swing.JScrollPane; 31 30 import javax.swing.JTable; 31 import javax.swing.UIManager; 32 32 import javax.swing.event.TableModelEvent; 33 33 import javax.swing.event.TableModelListener; … … 35 35 import javax.swing.table.DefaultTableModel; 36 36 import javax.swing.table.TableColumn; 37 import javax.swing.text.html.HTMLEditorKit; 38 import javax.swing.text.html.StyleSheet; 37 39 38 40 import org.openstreetmap.josm.Main; … … 71 73 /** the data model */ 72 74 private RelationMemberTableModel model; 73 private J Label lblMessage;75 private JEditorPane jepMessage; 74 76 private boolean canceled; 75 77 private SideButton btnOK; 76 78 77 79 protected JPanel buildMessagePanel() { 78 JPanel pnl = new JPanel(); 79 pnl.setLayout(new GridBagLayout()); 80 GridBagConstraints gc = new GridBagConstraints(); 81 gc.anchor = GridBagConstraints.NORTHWEST; 82 gc.fill = GridBagConstraints.BOTH; 83 pnl.add(lblMessage = new JLabel(), gc); 84 lblMessage.setAlignmentX(JComponent.LEFT_ALIGNMENT); 80 JPanel pnl = new JPanel(new BorderLayout()); 81 jepMessage = new JEditorPane("text/html", ""); 82 jepMessage.setOpaque(false); 83 jepMessage.setEditable(false); 84 Font f = UIManager.getFont("Label.font"); 85 StyleSheet ss = new StyleSheet(); 86 String rule = MessageFormat.format( 87 "font-family: ''{0}'';font-size: {1,number}pt; font-weight: {2}; font-style: {3}", 88 f.getName(), 89 f.getSize(), 90 f.isBold() ? "bold" : "normal", 91 f.isItalic() ? "italic" : "normal" 92 ); 93 rule = "body {" + rule + "}"; 94 rule = MessageFormat.format( 95 "font-family: ''{0}'';font-size: {1,number}pt; font-weight: {2}; font-style: {3}", 96 f.getName(), 97 f.getSize(), 98 "bold", 99 f.isItalic() ? "italic" : "normal" 100 ); 101 rule = "strong {" + rule + "}"; 102 ss.addRule(rule); 103 ss.addRule("a {text-decoration: underline; color: blue}"); 104 HTMLEditorKit kit = new HTMLEditorKit(); 105 kit.setStyleSheet(ss); 106 jepMessage.setEditorKit(kit); 107 108 pnl.setLayout(new BorderLayout()); 109 pnl.add(jepMessage, BorderLayout.CENTER); 85 110 pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 86 111 return pnl; … … 131 156 msg = tr("<html>Please confirm to remove <strong>{0} objects</strong> from <strong>{1} relations</strong>.</html>", numObjectsToDelete,numParentRelations); 132 157 } 133 lblMessage.setText(msg);158 jepMessage.setText(msg); 134 159 invalidate(); 135 160 }
Note:
See TracChangeset
for help on using the changeset viewer.