1 7 8 package javax.swing.plaf.synth; 9 10 import java.awt.*; 11 import javax.swing.*; 12 import javax.swing.text.*; 13 import javax.swing.plaf.*; 14 15 25 class SynthPasswordFieldUI extends SynthTextFieldUI { 26 27 33 public static ComponentUI createUI(JComponent c) { 34 return new SynthPasswordFieldUI (); 35 } 36 37 44 protected String getPropertyPrefix() { 45 return "PasswordField"; 46 } 47 48 54 public View create(Element elem) { 55 return new PasswordView(elem); 56 } 57 58 void paintBackground(SynthContext context, Graphics g, JComponent c) { 59 context.getPainter().paintPasswordFieldBackground(context, g, 0, 0, 60 c.getWidth(), c.getHeight()); 61 } 62 63 public void paintBorder(SynthContext context, Graphics g, int x, 64 int y, int w, int h) { 65 context.getPainter().paintPasswordFieldBorder(context, g, x, y, w, h); 66 } 67 68 protected void installKeyboardActions() { 69 super.installKeyboardActions(); 70 ActionMap map = SwingUtilities.getUIActionMap(getComponent()); 71 if (map != null && map.get(DefaultEditorKit.selectWordAction) != null) { 72 Action a = map.get(DefaultEditorKit.selectLineAction); 73 if (a != null) { 74 map.put(DefaultEditorKit.selectWordAction, a); 75 } 76 } 77 } 78 } 79 | Popular Tags |