Changeset 29588 in osm for applications/editors
- Timestamp:
- 2013-05-13T20:40:53+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/geochat
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/geochat/build.xml
r29571 r29588 15 15 16 16 <!-- enter the SVN commit message --> 17 <property name="commit.message" value=" GeoChat"/>17 <property name="commit.message" value="[josm_geochat] copypaste from keyboard, font size advanced parameters"/> 18 18 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 19 19 <property name="plugin.main.version" value="4666"/> -
applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java
r29584 r29588 10 10 import javax.swing.event.ChangeListener; 11 11 import javax.swing.text.*; 12 import org.openstreetmap.josm.Main; 12 13 import static org.openstreetmap.josm.tools.I18n.tr; 13 14 … … 134 135 chatPane.setEditable(false); 135 136 Font font = chatPane.getFont(); 136 float size = -1.0f; // Main.pref.getInteger("geochat.fontsize", -1); <- we don't need this 137 if( size < 8 ) 138 size += font.getSize2D(); 139 chatPane.setFont(font.deriveFont(size)); 137 float sizeParameter = Main.pref.getInteger("geochat.panel.fontsize", -1); 138 float size = sizeParameter; 139 if ( sizeParameter <= 0 ) size += font.getSize2D(); 140 chatPane.setFont(font.deriveFont( size )); 141 140 142 // DefaultCaret caret = (DefaultCaret)chatPane.getCaret(); // does not work 141 143 // caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); -
applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java
r29584 r29588 56 56 } 57 57 }; 58 58 59 Font font = input.getFont(); 60 float sizeParameter = Main.pref.getInteger("geochat.input.fontsize", 0); 61 float size = sizeParameter; 62 if ( sizeParameter <= 0 ) size += font.getSize2D(); 63 input.setFont(font.deriveFont( size )); 64 59 65 String defaultUserName = constructUserName(); 60 66 loginPanel = createLoginPanel(defaultUserName); -
applications/editors/josm/plugins/geochat/src/geochat/JPanelTextField.java
r29584 r29588 3 3 4 4 import java.awt.KeyboardFocusManager; 5 import java.awt.event.InputEvent; 5 6 import java.awt.event.KeyEvent; 6 import java.util. *;7 import java.util.HashSet; 7 8 import javax.swing.*; 8 9 import javax.swing.text.DefaultEditorKit; … … 18 19 */ 19 20 public class JPanelTextField extends JTextField { 20 21 21 22 public JPanelTextField() { 22 23 setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, new HashSet<KeyStroke>()); 23 24 PopupMenuLauncher launcher = new PopupMenuLauncher(createEditMenu()); 24 25 addMouseListener(launcher); 26 standardKeys = getInputMap(JComponent.WHEN_FOCUSED).allKeys(); 25 27 } 26 28 … … 39 41 return item; 40 42 } 43 44 // list of "standard" OS keys for JTextFiels = cursor moving, selection, copy/paste 45 private final KeyStroke[] standardKeys; 46 private static final int MODIFIERS_MASK = InputEvent.META_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK; 41 47 42 48 @Override … … 74 80 if( Main.map != null && Main.map.mapView != null ) 75 81 Main.map.mapView.requestFocus(); 82 } 83 84 boolean keyIsStandard = false; 85 for (KeyStroke ks: standardKeys) { 86 if (code == ks.getKeyCode() && 87 (e.getModifiersEx() & MODIFIERS_MASK) == (ks.getModifiers() & MODIFIERS_MASK)) { 88 keyIsStandard = true; 89 break; 90 } 76 91 } 77 92 // Do not pass other events to JOSM 78 if( code != KeyEvent.VK_LEFT && code != KeyEvent.VK_HOME && code != KeyEvent.VK_RIGHT && code != KeyEvent.VK_END && code != KeyEvent.VK_BACK_SPACE && code != KeyEvent.VK_DELETE )93 if( !keyIsStandard ) { 79 94 e.consume(); 95 } 80 96 } 81 97 super.processKeyEvent(e);
Note:
See TracChangeset
for help on using the changeset viewer.