bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
compare(String s1, String s2){ CollationElementIterator cei1 = getCollationElementIterator(s1); CollationElementIterator cei2 = getCollationElementIterator(s2); for(;;) { int ord1 = cei1.next(); int ord2 = cei2.next(); // Check for end of string if (ord1 == CollationElementIterator.NULLORDER) if (ord2 == CollationElementIterator.NULLORDER) return(0); else return(-1); else if (ord2 == CollationElementIterator.NULLORDER) return(1); // We know chars are totally equal, so skip if (ord1 == ord2) continue; // Check for primary strength differences int prim1 = CollationElementIterator.primaryOrder(ord1); int prim2 = CollationElementIterator.primaryOrder(ord2); if (prim1 < prim2) return(-1); else if (prim1 > prim2) return(1); else if (getStrength() == PRIMARY) continue; // Check for secondary strength differences int sec1 = CollationElementIterator.secondaryOrder(ord1); int sec2 = CollationElementIterator.secondaryOrder(ord2); if (sec1 < sec2) return(-1); else if (sec1 > sec2) return(1); else if (getStrength() == SECONDARY) continue; // Check for tertiary differences int tert1 = CollationElementIterator.tertiaryOrder(ord1); int tert2 = CollationElementIterator.tertiaryOrder(ord1); if (tert1 < tert2) return(-1); else if (tert1 > tert2) return(1); }}
|
compare(String s1, String s2){ CollationElementIterator cei1 = getCollationElementIterator(s1); CollationElementIterator cei2 = getCollationElementIterator(s2); for(;;) { int ord1 = cei1.next(); int ord2 = cei2.next(); // Check for end of string if (ord1 == CollationElementIterator.NULLORDER) if (ord2 == CollationElementIterator.NULLORDER) return(0); else return(-1); else if (ord2 == CollationElementIterator.NULLORDER) return(1); // We know chars are totally equal, so skip if (ord1 == ord2) continue; // Check for primary strength differences int prim1 = CollationElementIterator.primaryOrder(ord1); int prim2 = CollationElementIterator.primaryOrder(ord2); if (prim1 < prim2) return(-1); else if (prim1 > prim2) return(1); else if (getStrength() == PRIMARY) continue; // Check for secondary strength differences int sec1 = CollationElementIterator.secondaryOrder(ord1); int sec2 = CollationElementIterator.secondaryOrder(ord2); if (sec1 < sec2) return(-1); else if (sec1 > sec2) return(1); else if (getStrength() == SECONDARY) continue; // Check for tertiary differences int tert1 = CollationElementIterator.tertiaryOrder(ord1); int tert2 = CollationElementIterator.tertiaryOrder(ord2); if (tert1 < tert2) return(-1); else if (tert1 > tert2) return(1); }}
| 9,805
|
compare(String s1, String s2){ CollationElementIterator cei1 = getCollationElementIterator(s1); CollationElementIterator cei2 = getCollationElementIterator(s2); for(;;) { int ord1 = cei1.next(); int ord2 = cei2.next(); // Check for end of string if (ord1 == CollationElementIterator.NULLORDER) if (ord2 == CollationElementIterator.NULLORDER) return(0); else return(-1); else if (ord2 == CollationElementIterator.NULLORDER) return(1); // We know chars are totally equal, so skip if (ord1 == ord2) continue; // Check for primary strength differences int prim1 = CollationElementIterator.primaryOrder(ord1); int prim2 = CollationElementIterator.primaryOrder(ord2); if (prim1 < prim2) return(-1); else if (prim1 > prim2) return(1); else if (getStrength() == PRIMARY) continue; // Check for secondary strength differences int sec1 = CollationElementIterator.secondaryOrder(ord1); int sec2 = CollationElementIterator.secondaryOrder(ord2); if (sec1 < sec2) return(-1); else if (sec1 > sec2) return(1); else if (getStrength() == SECONDARY) continue; // Check for tertiary differences int tert1 = CollationElementIterator.tertiaryOrder(ord1); int tert2 = CollationElementIterator.tertiaryOrder(ord1); if (tert1 < tert2) return(-1); else if (tert1 > tert2) return(1); }}
|
compare(String s1, String s2){ CollationElementIterator cei1 = getCollationElementIterator(s1); CollationElementIterator cei2 = getCollationElementIterator(s2); for(;;) { int ord1 = cei1.next(); int ord2 = cei2.next(); // Check for end of string if (ord1 == CollationElementIterator.NULLORDER) if (ord2 == CollationElementIterator.NULLORDER) return(0); else return(-1); else if (ord2 == CollationElementIterator.NULLORDER) return 1; else if (getStrength() == TERTIARY) continue; return ord1block.key.compareTo(ord2block.key); // We know chars are totally equal, so skip if (ord1 == ord2) continue; // Check for primary strength differences int prim1 = CollationElementIterator.primaryOrder(ord1); int prim2 = CollationElementIterator.primaryOrder(ord2); if (prim1 < prim2) return(-1); else if (prim1 > prim2) return 1; else if (getStrength() == TERTIARY) continue; return ord1block.key.compareTo(ord2block.key); else if (getStrength() == PRIMARY) continue; // Check for secondary strength differences int sec1 = CollationElementIterator.secondaryOrder(ord1); int sec2 = CollationElementIterator.secondaryOrder(ord2); if (sec1 < sec2) return(-1); else if (sec1 > sec2) return 1; else if (getStrength() == TERTIARY) continue; return ord1block.key.compareTo(ord2block.key); else if (getStrength() == SECONDARY) continue; // Check for tertiary differences int tert1 = CollationElementIterator.tertiaryOrder(ord1); int tert2 = CollationElementIterator.tertiaryOrder(ord1); if (tert1 < tert2) return(-1); else if (tert1 > tert2) return 1; else if (getStrength() == TERTIARY) continue; return ord1block.key.compareTo(ord2block.key); }}
| 9,806
|
equals(Object obj){ if (obj == this) return(true); else return(false);}
|
equals(Object obj){ if (obj == this) return(true); else return(false);}
| 9,807
|
getCollationElementIterator(String str){ return(new CollationElementIterator(this, str));}
|
getCollationElementIterator(String str){ return(new CollationElementIterator(this, str));}
| 9,808
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
| 9,809
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.primaryOrder(ord) << 8; ord |= CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
| 9,810
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < objarr.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
| 9,811
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
| 9,812
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
|
getCollationKey(String str){ CollationElementIterator cei = getCollationElementIterator(str); Vector vect = new Vector(25); int ord = cei.next(); while (ord != CollationElementIterator.NULLORDER) { switch (getStrength()) { case PRIMARY: ord = CollationElementIterator.primaryOrder(ord); break; case SECONDARY: ord = CollationElementIterator.secondaryOrder(ord); default: break; } vect.add(new Integer(ord)); } Object[] objarr = vect.toArray(); byte[] key = new byte[objarr.length * 4]; for (int i = 0; i < key.length; i++) { int j = ((Integer)objarr[i]).intValue(); key[i++] = (byte)((j & 0xFF000000) >> 24); key[i++] = (byte)((j & 0x00FF0000) >> 16); key[i++] = (byte)((j & 0x0000FF00) >> 8); key[i++] = (byte)(j & 0x000000FF); } return(new CollationKey(this, str, key));}
| 9,813
|
getRules(){ return(rules);}
|
getRules(){ return(rules);}
| 9,814
|
hashCode(){ return(System.identityHashCode(this));}
|
hashCode(){ return(System.identityHashCode(this));}
| 9,815
|
CollationElementIterator(RuleBasedCollator rbc, String str){ this.rbc = rbc; this.str = str;}
|
CollationElementIterator(RuleBasedCollator rbc, String str){ this.rbc = rbc; this.str = str;}
| 9,816
|
next(){ ++pos; if (pos >= str.length()) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
|
next(){ ++pos; if (pos >= str.length()) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
| 9,817
|
next(){ ++pos; if (pos >= str.length()) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
|
next(){ ++pos; if (pos >= str.length()) return(NULLORDER); String s = str.charAt(pos) + ""; return(rbc.getCollationElementValue(s));}
| 9,818
|
reset(){ pos = 0;}
|
reset(){ pos = 0;}
| 9,819
|
CollationKey(Collator collator, String str, byte[] key){ this.collator = collator; this.str = str; this.key = key;}
|
CollationKey(Collator collator, String str, byte[] key){ this.collator = collator; this.str = str; this.key = key;}
| 9,820
|
CollationKey(Collator collator, String str, byte[] key){ this.collator = collator; this.str = str; this.key = key;}
|
CollationKey(Collator collator, String str, byte[] key){ this.collator = collator; this.originalText = originalText; this.key = key;}
| 9,821
|
ActionMap createActionMap() { Action[] actions = textComponent.getActions(); ActionMap am = new ActionMapUIResource(); for (int i = 0; i < actions.length; ++i) { String name = (String) actions[i].getValue(Action.NAME); if (name != null) am.put(name, actions[i]); } return am; }
|
private ActionMap createActionMap() { Action[] actions = textComponent.getActions(); ActionMap am = new ActionMapUIResource(); for (int i = 0; i < actions.length; ++i) { String name = (String) actions[i].getValue(Action.NAME); if (name != null) am.put(name, actions[i]); } return am; }
| 9,822
|
ActionMap createActionMap() { Action[] actions = textComponent.getActions(); ActionMap am = new ActionMapUIResource(); for (int i = 0; i < actions.length; ++i) { String name = (String) actions[i].getValue(Action.NAME); if (name != null) am.put(name, actions[i]); } return am; }
|
ActionMap createActionMap() { Action[] actions = textComponent.getActions(); ActionMap am = new ActionMapUIResource(); for (int i = 0; i < actions.length; ++i) { String name = (String) actions[i].getValue(Action.NAME); if (name != null) am.put(name, actions[i]); } return am; }
| 9,823
|
ActionMap createActionMap() { Action[] actions = textComponent.getActions(); ActionMap am = new ActionMapUIResource(); for (int i = 0; i < actions.length; ++i) { String name = (String) actions[i].getValue(Action.NAME); if (name != null) am.put(name, actions[i]); } return am; }
|
ActionMap createActionMap() { Action[] actions = textComponent.getActions(); ActionMap am = new ActionMapUIResource(); for (int i = 0; i < actions.length; ++i) { String name = (String) actions[i].getValue(Action.NAME); if (name != null) am.put(name, actions[i]); } return am; }
| 9,824
|
InputMap getInputMap(int condition) { String prefix = getPropertyPrefix(); switch (condition) { case JComponent.WHEN_IN_FOCUSED_WINDOW: // FIXME: is this the right string? nobody seems to use it. return (InputMap) UIManager.get(prefix + ".windowInputMap"); case JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: return (InputMap) UIManager.get(prefix + ".ancestorInputMap"); default: case JComponent.WHEN_FOCUSED: return (InputMap) UIManager.get(prefix + ".focusInputMap"); } }
|
private InputMap getInputMap() { String prefix = getPropertyPrefix(); switch (condition) { case JComponent.WHEN_IN_FOCUSED_WINDOW: // FIXME: is this the right string? nobody seems to use it. return (InputMap) UIManager.get(prefix + ".windowInputMap"); case JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: return (InputMap) UIManager.get(prefix + ".ancestorInputMap"); default: case JComponent.WHEN_FOCUSED: return (InputMap) UIManager.get(prefix + ".focusInputMap"); } }
| 9,826
|
InputMap getInputMap(int condition) { String prefix = getPropertyPrefix(); switch (condition) { case JComponent.WHEN_IN_FOCUSED_WINDOW: // FIXME: is this the right string? nobody seems to use it. return (InputMap) UIManager.get(prefix + ".windowInputMap"); case JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: return (InputMap) UIManager.get(prefix + ".ancestorInputMap"); default: case JComponent.WHEN_FOCUSED: return (InputMap) UIManager.get(prefix + ".focusInputMap"); } }
|
InputMap getInputMap(int condition) { String prefix = getPropertyPrefix(); switch (condition) { case JComponent.WHEN_IN_FOCUSED_WINDOW: // FIXME: is this the right string? nobody seems to use it. return (InputMap) UIManager.get(prefix + ".windowInputMap"); case JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: return (InputMap) UIManager.get(prefix + ".ancestorInputMap"); default: case JComponent.WHEN_FOCUSED: return (InputMap) UIManager.get(prefix + ".focusInputMap"); } }
| 9,827
|
protected void installKeyboardActions() { // This is only there for backwards compatibility. textComponent.setKeymap(createKeymap()); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, createActionMap()); ActionMap parentActionMap = new ActionMapUIResource(); Action[] actions = textComponent.getActions(); for (int j = 0; j < actions.length; j++) { Action currAction = actions[j]; parentActionMap.put(currAction.getValue(Action.NAME), currAction); } SwingUtilities.replaceUIActionMap(textComponent, parentActionMap); }
|
protected void installKeyboardActions() { // This is only there for backwards compatibility. textComponent.setKeymap(createKeymap()); // load any bindings for the newer InputMap / ActionMap interface SwingUtilities.replaceUIInputMap(textComponent, JComponent.WHEN_FOCUSED, getInputMap(JComponent.WHEN_FOCUSED)); SwingUtilities.replaceUIActionMap(textComponent, createActionMap()); ActionMap parentActionMap = new ActionMapUIResource(); Action[] actions = textComponent.getActions(); for (int j = 0; j < actions.length; j++) { Action currAction = actions[j]; parentActionMap.put(currAction.getValue(Action.NAME), currAction); } SwingUtilities.replaceUIActionMap(textComponent, parentActionMap); }
| 9,828
|
public void repaint(Rectangle r) { repaint((long) 0, (int) r.getX(), (int) r.getY(), (int) r.getWidth(), (int) r.getHeight()); }
|
public void repaint(long tm, int x, int y, int width, int height) { repaint((long) 0, (int) r.getX(), (int) r.getY(), (int) r.getWidth(), (int) r.getHeight()); }
| 9,829
|
public void repaint(Rectangle r) { repaint((long) 0, (int) r.getX(), (int) r.getY(), (int) r.getWidth(), (int) r.getHeight()); }
|
public void repaint(Rectangle r) { repaint((long) 0, (int) r.getX(), (int) r.getY(), (int) r.getWidth(), (int) r.getHeight()); }
| 9,830
|
public void execute( CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) throws Exception { final Runtime rt = Runtime.getRuntime(); out.println("Memory size: " + rt.totalMemory()); out.println("Free memory: " + rt.freeMemory()); out.println("Starting gc..."); long start = System.currentTimeMillis(); rt.gc(); GCStatistics stats = Vm.getHeapManager().getStatistics(); Thread.yield(); long end = System.currentTimeMillis(); out.println("Memory size: " + rt.totalMemory()); out.println("Free memory: " + rt.freeMemory()); out.println("Time taken : " + (end-start) + "ms"); out.println("Stats : " + stats.toString()); }
|
public void execute( CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) throws Exception { final Runtime rt = Runtime.getRuntime(); out.println("Memory size: " + rt.totalMemory()); out.println("Free memory: " + rt.freeMemory()); out.println("Starting gc..."); long start = System.currentTimeMillis(); rt.gc(); GCStatistics stats = Vm.getHeapManager().getStatistics(); Thread.yield(); long end = System.currentTimeMillis(); out.println("Memory size: " + rt.totalMemory()); out.println("Free memory: " + rt.freeMemory()); out.println("Time taken : " + (end-start) + "ms"); out.println("Stats : " + stats.toString()); }
| 9,831
|
protected AccessibleAbstractButton(AbstractButton component) { super(component); // TODO } // AccessibleAbstractButton()
|
protected AccessibleAbstractButton(AbstractButton component) { super(component); // TODO } // AccessibleAbstractButton()
| 9,832
|
protected void configurePropertiesFromAction(Action a) { //Factory method which sets the ActionEvent source's properties according to values from the Action instance. }
|
protected void configurePropertiesFromAction(Action a) { //Factory method which sets the ActionEvent source's properties according to values from the Action instance. }
| 9,833
|
protected PropertyChangeListener createActionPropertyChangeListener(Action a) { //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance. return null; }
|
protected PropertyChangeListener createActionPropertyChangeListener(Action a) { //Factory method which creates the PropertyChangeListener used to update the ActionEvent source as properties change on its Action instance. return null; }
| 9,834
|
public abstract Component getComponent();
|
Component getComponent();
| 9,835
|
public abstract MenuElement[] getSubElements();
|
MenuElement[] getSubElements();
| 9,836
|
public abstract void menuSelectionChanged(boolean included);
|
void menuSelectionChanged(boolean included);
| 9,837
|
public abstract void processKeyEvent(KeyEvent event, MenuElement[] path, MenuSelectionManager manager);
|
void processKeyEvent(KeyEvent event, MenuElement[] path, MenuSelectionManager manager);
| 9,838
|
public void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager);
|
void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager);
| 9,839
|
public GetDelegateInstanceException(String msg, Throwable next) { super(msg, next); }
|
public GetDelegateInstanceException(String msg) { super(msg, next); }
| 9,840
|
public GetDelegateInstanceException(String msg, Throwable next) { super(msg, next); }
|
public GetDelegateInstanceException(String msg, Throwable next) { super(msg); }
| 9,841
|
public Text createTextNode(char[] buf, int off, int len) { if (checkingCharacters) { checkChar(buf, off, len, "1.1".equals(version)); } return new DomText(this, buf, off, len); }
|
public Text createTextNode(String value) { if (checkingCharacters) { checkChar(buf, off, len, "1.1".equals(version)); } return new DomText(this, buf, off, len); }
| 9,842
|
public Text createTextNode(char[] buf, int off, int len) { if (checkingCharacters) { checkChar(buf, off, len, "1.1".equals(version)); } return new DomText(this, buf, off, len); }
|
public Text createTextNode(char[] buf, int off, int len) { if (checkingCharacters) { checkChar(value, "1.1".equals(version)); } return new DomText(this, buf, off, len); }
| 9,843
|
public Text createTextNode(char[] buf, int off, int len) { if (checkingCharacters) { checkChar(buf, off, len, "1.1".equals(version)); } return new DomText(this, buf, off, len); }
|
public Text createTextNode(char[] buf, int off, int len) { if (checkingCharacters) { checkChar(buf, off, len, "1.1".equals(version)); } return new DomText(this, value); }
| 9,844
|
public Object evaluate(Node context, int pos, int len) { Object val = (arg == null) ? null : arg.evaluate(context, pos, len); return _name(context, (Collection) val); }
|
public Object evaluate(Node context, int pos, int len) { Object val = (arg == null) ? Collections.singleton(context) : arg.evaluate(context, pos, len); return _name(context, (Collection) val); }
| 9,845
|
public boolean isSelected();
|
boolean isSelected();
| 9,846
|
public void setSelectedIndex(int index);
|
void setSelectedIndex(int index);
| 9,847
|
Name add(int posn, String comp) throws InvalidNameException;
|
Name add(String comp) throws InvalidNameException;
| 9,848
|
Name addAll(int posn, Name n) throws InvalidNameException;
|
Name addAll(Name suffix) throws InvalidNameException;
| 9,849
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } } }
|
protected void addImpl(Component comp, Object constraints, int index) { synchronized (getTreeLock ()) { if (index > ncomponents || (index < 0 && index != -1) || comp instanceof Window || (comp instanceof Container && ((Container) comp).isAncestorOf(this))) throw new IllegalArgumentException(); // Reparent component, and make sure component is instantiated if // we are. if (comp.parent != null) comp.parent.remove(comp); comp.parent = this; if (peer != null) { if (comp.isLightweight ()) { enableEvents (comp.eventMask); if (!isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } comp.invalidate(); if (component == null) component = new Component[4]; // FIXME, better initial size? // This isn't the most efficient implementation. We could do less // copying when growing the array. It probably doesn't matter. if (ncomponents >= component.length) { int nl = component.length * 2; Component[] c = new Component[nl]; System.arraycopy(component, 0, c, 0, ncomponents); component = c; } if (index == -1) component[ncomponents++] = comp; else { System.arraycopy(component, index, component, index + 1, ncomponents - index); component[index] = comp; ++ncomponents; } // Notify the layout manager. if (layoutMgr != null) { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; lm2.addLayoutComponent(comp, constraints); } else if (constraints instanceof String) layoutMgr.addLayoutComponent((String) constraints, comp); else layoutMgr.addLayoutComponent(null, comp); } if (isShowing ()) { // Post event to notify of adding the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp); getToolkit().getSystemEventQueue().postEvent(ce); } } }
| 9,850
|
private void addNotifyContainerChildren() { synchronized (getTreeLock ()) { for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); if (component[i].isLightweight ()) { // If we're not lightweight, and we just got a lightweight // child, we need a lightweight dispatcher to feed it events. if (! this.isLightweight()) { if (dispatcher == null) dispatcher = new LightweightDispatcher (this); } enableEvents(component[i].eventMask); if (peer != null && !isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } } }
|
private void addNotifyContainerChildren() { synchronized (getTreeLock ()) { for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); if (component[i].isLightweight ()) { // If we're not lightweight, and we just got a lightweight // child, we need a lightweight dispatcher to feed it events. if (! this.isLightweight()) { if (dispatcher == null) dispatcher = new LightweightDispatcher (this); } enableEvents(component[i].eventMask); if (peer != null && !isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } } }
| 9,852
|
private void addNotifyContainerChildren() { synchronized (getTreeLock ()) { for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); if (component[i].isLightweight ()) { // If we're not lightweight, and we just got a lightweight // child, we need a lightweight dispatcher to feed it events. if (! this.isLightweight()) { if (dispatcher == null) dispatcher = new LightweightDispatcher (this); } enableEvents(component[i].eventMask); if (peer != null && !isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } } }
|
private void addNotifyContainerChildren() { synchronized (getTreeLock ()) { for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); if (component[i].isLightweight ()) { // If we're not lightweight, and we just got a lightweight // child, we need a lightweight dispatcher to feed it events. if (! this.isLightweight()) { if (dispatcher == null) dispatcher = new LightweightDispatcher (this); enableEvents(component[i].eventMask); if (peer != null && !isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK);
| 9,853
|
void dispatchEventImpl(AWTEvent e) { // Give lightweight dispatcher a chance to handle it. if (eventTypeEnabled (e.id) && dispatcher != null && dispatcher.handleEvent (e)) return; if ((e.id <= ContainerEvent.CONTAINER_LAST && e.id >= ContainerEvent.CONTAINER_FIRST) && (containerListener != null || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
void dispatchEventImpl(AWTEvent e) { // Give lightweight dispatcher a chance to handle it. if (eventTypeEnabled (e.id) && dispatcher != null && dispatcher.handleEvent (e)) return; if ((e.id <= ContainerEvent.CONTAINER_LAST && e.id >= ContainerEvent.CONTAINER_FIRST) && (containerListener != null || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
| 9,855
|
public float getAlignmentX() { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.getLayoutAlignmentX(this); } else return super.getAlignmentX(); }
|
public float getAlignmentX() { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.getLayoutAlignmentX(this); } else return super.getAlignmentX(); }
| 9,856
|
public float getAlignmentY() { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.getLayoutAlignmentY(this); } else return super.getAlignmentY(); }
|
public float getAlignmentY() { if (layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.getLayoutAlignmentY(this); } else return super.getAlignmentY(); }
| 9,857
|
public Dimension getMaximumSize() { if (layoutMgr != null && layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.maximumLayoutSize(this); } else return super.getMaximumSize(); }
|
public Dimension getMaximumSize() { if (valid && maxSize != null) return new Dimension(maxSize); LayoutManager layout = getLayout(); if (layout != null && layout instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.maximumLayoutSize(this); } else return super.getMaximumSize(); }
| 9,858
|
public Dimension getMaximumSize() { if (layoutMgr != null && layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.maximumLayoutSize(this); } else return super.getMaximumSize(); }
|
public Dimension getMaximumSize() { if (layoutMgr != null && layoutMgr instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layoutMgr; return lm2.maximumLayoutSize(this); } else return super.getMaximumSize(); }
| 9,859
|
public Dimension minimumSize() { if (layoutMgr != null) return layoutMgr.minimumLayoutSize (this); else return super.minimumSize (); }
|
public Dimension minimumSize() { if (layoutMgr != null) return layoutMgr.minimumLayoutSize (this); else return super.minimumSize (); }
| 9,862
|
public void paint(Graphics g) { if (!isShowing()) return; // Paint self first. super.paint(g); // Visit heavyweights as well, in case they were // erased when we cleared the background for this container. visitChildren(g, GfxPaintVisitor.INSTANCE, false); }
|
public void paint(Graphics g) { if (!isShowing()) return; // Paint self first. // Visit heavyweights as well, in case they were // erased when we cleared the background for this container. visitChildren(g, GfxPaintVisitor.INSTANCE, false); }
| 9,863
|
public Dimension preferredSize() { if (layoutMgr != null) return layoutMgr.preferredLayoutSize (this); else return super.preferredSize (); }
|
public Dimension preferredSize() { if (layoutMgr != null) return layoutMgr.preferredLayoutSize (this); else return super.preferredSize (); }
| 9,864
|
public void setFocusTraversalKeys(int id, Set keystrokes) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException (); if (keystrokes == null) { Container parent = getParent (); while (parent != null) { if (parent.areFocusTraversalKeysSet (id)) { keystrokes = parent.getFocusTraversalKeys (id); break; } parent = parent.getParent (); } if (keystrokes == null) keystrokes = KeyboardFocusManager.getCurrentKeyboardFocusManager (). getDefaultFocusTraversalKeys (id); } Set sa; Set sb; Set sc; String name; switch (id) { case KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS); name = "forwardFocusTraversalKeys"; break; case KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS); name = "backwardFocusTraversalKeys"; break; case KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS); name = "upCycleFocusTraversalKeys"; break; case KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); name = "downCycleFocusTraversalKeys"; break; default: throw new IllegalArgumentException (); } int i = keystrokes.size (); Iterator iter = keystrokes.iterator (); while (--i >= 0) { Object o = iter.next (); if (!(o instanceof AWTKeyStroke) || sa.contains (o) || sb.contains (o) || sc.contains (o) || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED) throw new IllegalArgumentException (); } if (focusTraversalKeys == null) focusTraversalKeys = new Set[3]; keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes)); firePropertyChange (name, focusTraversalKeys[id], keystrokes); focusTraversalKeys[id] = keystrokes; }
|
public void setFocusTraversalKeys(int id, Set keystrokes) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS && id != KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException (); if (keystrokes == null) { Container parent = getParent (); while (parent != null) { if (parent.areFocusTraversalKeysSet (id)) { keystrokes = parent.getFocusTraversalKeys (id); break; } parent = parent.getParent (); } if (keystrokes == null) keystrokes = KeyboardFocusManager.getCurrentKeyboardFocusManager (). getDefaultFocusTraversalKeys (id); } Set sa; Set sb; Set sc; String name; switch (id) { case KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS); name = "forwardFocusTraversalKeys"; break; case KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS); name = "backwardFocusTraversalKeys"; break; case KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS); name = "upCycleFocusTraversalKeys"; break; case KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS: sa = getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); sb = getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); sc = getFocusTraversalKeys (KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS); name = "downCycleFocusTraversalKeys"; break; default: throw new IllegalArgumentException (); } int i = keystrokes.size (); Iterator iter = keystrokes.iterator (); while (--i >= 0) { Object o = iter.next (); if (!(o instanceof AWTKeyStroke) || sa.contains (o) || sb.contains (o) || sc.contains (o) || ((AWTKeyStroke) o).keyCode == KeyEvent.VK_UNDEFINED) throw new IllegalArgumentException (); } if (focusTraversalKeys == null) focusTraversalKeys = new Set[4]; keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes)); firePropertyChange (name, focusTraversalKeys[id], keystrokes); focusTraversalKeys[id] = keystrokes; }
| 9,867
|
public void update(Graphics g) { super.update(g); }
|
public void update(Graphics g) { ComponentPeer p = peer; if (p != null && !(p instanceof LightweightPeer)) g.clearRect(0, 0, getWidth(), getHeight()); paint(g); }
| 9,869
|
private void visitChildren(Graphics gfx, GfxVisitor visitor, boolean lightweightOnly) { synchronized (getTreeLock ()) { for (int i = ncomponents - 1; i >= 0; --i) { Component comp = component[i]; // If we're visiting heavyweights as well, // don't recurse into Containers here. This avoids // painting the same nested child multiple times. boolean applicable = comp.isVisible() && (comp.isLightweight() || !lightweightOnly && ! (comp instanceof Container)); if (applicable) visitChild(gfx, visitor, comp); } } }
|
private void visitChildren(Graphics gfx, GfxVisitor visitor, boolean lightweightOnly) { synchronized (getTreeLock ()) { for (int i = ncomponents - 1; i >= 0; --i) { Component comp = component[i]; // If we're visiting heavyweights as well, // don't recurse into Containers here. This avoids // painting the same nested child multiple times. boolean applicable = comp.isVisible() && (comp.isLightweight() || !lightweightOnly && ! (comp instanceof Container)); if (applicable) visitChild(gfx, visitor, comp); } } }
| 9,870
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,871
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,872
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,873
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,874
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,875
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,876
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,877
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,878
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (SwingUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
|
void acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = SwingUtilities.getDeepestComponentAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = SwingUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (SwingUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); tempComponent = lastComponentEntered; lastComponentEntered = null; tempComponent.dispatchEvent(exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = SwingUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && pressCount > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } }
| 9,879
|
boolean handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(nativeContainer, me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } if (newEvt.isConsumed()) e.consume(); } } return e.isConsumed(); }
|
boolean handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; Component mouseEventTarget = acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(nativeContainer, me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } if (newEvt.isConsumed()) e.consume(); } } return e.isConsumed(); }
| 9,881
|
boolean handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(nativeContainer, me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } if (newEvt.isConsumed()) e.consume(); } } return e.isConsumed(); }
|
boolean handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(nativeContainer, me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } if (newEvt.isConsumed()) e.consume(); } } return e.isConsumed(); }
| 9,882
|
static Policy getCurrentPolicy() { // FIXME: The class name of the Policy provider should really be sourced // from the "java.security" configuration file. For now, just hard-code // a stub implementation. if (currentPolicy == null) { String pp = System.getProperty ("policy.provider"); if (pp != null) try { currentPolicy = (Policy) Class.forName(pp).newInstance(); } catch (Exception ignored) {} if (currentPolicy == null) currentPolicy = new gnu.java.security.provider.DefaultPolicy(); } return currentPolicy; }
|
static Policy getCurrentPolicy() { // FIXME: The class name of the Policy provider should really be sourced // from the "java.security" configuration file. For now, just hard-code // a stub implementation. if (currentPolicy == null) { String pp = System.getProperty ("policy.provider"); if (pp != null) try { currentPolicy = (Policy) Class.forName(pp).newInstance(); } catch (Exception e) { } if (currentPolicy == null) currentPolicy = new gnu.java.security.provider.DefaultPolicy(); } return currentPolicy; }
| 9,884
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
| 9,885
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(perm.getClass(), allPermission); } } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
| 9,886
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
| 9,887
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) pc = perm.newPermissionCollection(); if (pc == null) pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
| 9,888
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
|
public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException( "PermissionCollection is read only"); } final Class permClass = perm.getClass(); if (perm instanceof AllPermission) { if (allPermission == null) { allPermission = perm.newPermissionCollection(); allPermission.add(perm); perms.put(permClass, allPermission); } } else { PermissionCollection pc = (PermissionCollection) perms .get(permClass); if (pc == null) { pc = perm.newPermissionCollection(); if (pc == null) { pc = new PermissionsHash(); } perms.put(permClass, pc); } pc.add(perm); } }
| 9,889
|
public void createImage() throws IOException, DriverException, FileSystemException { final FileDevice newFd = new FileDevice(destFile, "rw"); try { newFd.setLength(getDeviceLength()); formatDevice(newFd); final Device sysDev = getSystemDevice(newFd); final BlockDeviceAPI sysDevApi = (BlockDeviceAPI) sysDev .getAPI(BlockDeviceAPI.class); copySystemFiles(sysDev); sysDevApi.flush(); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on device", ex); } finally { newFd.close(); } }
|
public void createImage() throws IOException, DriverException, FileSystemException { final FileDevice newFd = new FileDevice(destFile, "rw"); try { newFd.setLength(getDeviceLength()); formatDevice(newFd); final Device sysDev = getSystemDevice(newFd); final BlockDeviceAPI sysDevApi = (BlockDeviceAPI) sysDev .getAPI(BlockDeviceAPI.class); copySystemFiles(sysDev); sysDevApi.flush(); } catch (ApiNotFoundException ex) { final IOException ioe = new IOException("BlockDeviceAPI not found on device"); ioe.initCause(ex); throw ioe; } finally { newFd.close(); } }
| 9,890
|
protected void formatDevice(Device dev) throws IOException { GrubFatFormatter ff = createFormatter(); try { ff.format((BlockDeviceAPI) dev.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { throw new IOException("Cannot find BlockDeviceAPI", ex); } }
|
protected void formatDevice(Device dev) throws IOException { GrubFatFormatter ff = createFormatter(); try { ff.format((BlockDeviceAPI) dev.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { final IOException ioe = new IOException("BlockDeviceAPI not found on device"); ioe.initCause(ex); throw ioe; } }
| 9,891
|
public static String dumpString(byte[] data, String m) { return (data == null) ? "null\n" : dumpString(data, 0, data.length, m); }
|
public static String dumpString(byte[] data, int offset, int length, String m) { return (data == null) ? "null\n" : dumpString(data, 0, data.length, m); }
| 9,892
|
public static String dumpString(byte[] data, String m) { return (data == null) ? "null\n" : dumpString(data, 0, data.length, m); }
|
public static String dumpString(byte[] data, String m) { if (data == null) return m + "null\n"; StringBuffer sb = new StringBuffer(length * 3); if (length > 32) sb.append(m).append("Hexadecimal dump of ") .append(length).append(" bytes...\n"); int end = offset + length; String s; int l = Integer.toString(length).length(); if (l < 4) l = 4; for (; offset < end; offset += 32) { if (length > 32) { s = " " + offset; sb.append(m).append(s.substring(s.length() - l)).append(": "); } int i = 0; for (; i < 32 && offset + i + 7 < end; i += 8) sb.append(toString(data, offset + i, 8)).append(' '); if (i < 32) for (; i < 32 && offset + i < end; i++) sb.append(byteToString(data[offset + i])); sb.append('\n'); } return sb.toString(); }
| 9,893
|
public static final byte[] fromBase64(String str) { int len = str.length(); if (len == 0) { throw new NumberFormatException("Empty string"); } byte[] a = new byte[len + 1]; int i, j; for (i = 0; i < len; i++) { try { a[i] = (byte) BASE64_CHARS.indexOf(str.charAt(i)); } catch (ArrayIndexOutOfBoundsException x) { throw new NumberFormatException("Illegal character at #" + i); } } i = len - 1; j = len; try { while (true) { a[j] = a[i]; if (--i < 0) { break; } a[j] |= (a[i] & 0x03) << 6; j--; a[j] = (byte) ((a[i] & 0x3C) >>> 2); if (--i < 0) { break; } a[j] |= (a[i] & 0x0F) << 4; j--; a[j] = (byte) ((a[i] & 0x30) >>> 4); if (--i < 0) { break; } a[j] |= (a[i] << 2); j--; a[j] = 0; if (--i < 0) { break; } } } catch (Exception ignored) { } try { // ignore leading 0-bytes while (a[j] == 0) { j++; } } catch (Exception x) { return new byte[1]; // one 0-byte } byte[] result = new byte[len - j + 1]; System.arraycopy(a, j, result, 0, len - j + 1); return result; }
|
public static final byte[] fromBase64(String str) int len = str.length(); if (len == 0) throw new NumberFormatException("Empty string"); } byte[] a = new byte[len + 1]; int i, j; for (i = 0; i < len; i++) try a[i] = (byte) BASE64_CHARS.indexOf(str.charAt(i)); } catch (ArrayIndexOutOfBoundsException x) throw new NumberFormatException("Illegal character at #" + i); } } i = len - 1; j = len; try while (true) a[j] = a[i]; if (--i < 0) break; } a[j] |= (a[i] & 0x03) << 6; j--; a[j] = (byte) ((a[i] & 0x3C) >>> 2); if (--i < 0) break; } a[j] |= (a[i] & 0x0F) << 4; j--; a[j] = (byte) ((a[i] & 0x30) >>> 4); if (--i < 0) break; } a[j] |= (a[i] << 2); j--; a[j] = 0; if (--i < 0) break; } } } catch (Exception ignored) } try // ignore leading 0-bytes while (a[j] == 0) j++; } } catch (Exception x) return new byte[1]; // one 0-byte } byte[] result = new byte[len - j + 1]; System.arraycopy(a, j, result, 0, len - j + 1); return result; }
| 9,894
|
public static final byte[] fromBase64(String str) { int len = str.length(); if (len == 0) { throw new NumberFormatException("Empty string"); } byte[] a = new byte[len + 1]; int i, j; for (i = 0; i < len; i++) { try { a[i] = (byte) BASE64_CHARS.indexOf(str.charAt(i)); } catch (ArrayIndexOutOfBoundsException x) { throw new NumberFormatException("Illegal character at #" + i); } } i = len - 1; j = len; try { while (true) { a[j] = a[i]; if (--i < 0) { break; } a[j] |= (a[i] & 0x03) << 6; j--; a[j] = (byte) ((a[i] & 0x3C) >>> 2); if (--i < 0) { break; } a[j] |= (a[i] & 0x0F) << 4; j--; a[j] = (byte) ((a[i] & 0x30) >>> 4); if (--i < 0) { break; } a[j] |= (a[i] << 2); j--; a[j] = 0; if (--i < 0) { break; } } } catch (Exception ignored) { } try { // ignore leading 0-bytes while (a[j] == 0) { j++; } } catch (Exception x) { return new byte[1]; // one 0-byte } byte[] result = new byte[len - j + 1]; System.arraycopy(a, j, result, 0, len - j + 1); return result; }
|
public static final byte[] fromBase64(String str) { int len = str.length(); if (len == 0) { throw new NumberFormatException("Empty string"); byte[] a = new byte[len + 1]; int i, j; for (i = 0; i < len; i++) { try { a[i] = (byte) BASE64_CHARS.indexOf(str.charAt(i)); catch (ArrayIndexOutOfBoundsException x) { throw new NumberFormatException("Illegal character at #" + i); i = len - 1; j = len; try { while (true) { a[j] = a[i]; if (--i < 0) { break; a[j] |= (a[i] & 0x03) << 6; j--; a[j] = (byte) ((a[i] & 0x3C) >>> 2); if (--i < 0) { break; a[j] |= (a[i] & 0x0F) << 4; j--; a[j] = (byte) ((a[i] & 0x30) >>> 4); if (--i < 0) { break; a[j] |= (a[i] << 2); j--; a[j] = 0; if (--i < 0) { break; catch (Exception ignored) { try { // ignore leading 0-bytes while (a[j] == 0) { j++; catch (Exception x) { return new byte[1]; // one 0-byte byte[] result = new byte[len - j + 1]; System.arraycopy(a, j, result, 0, len - j + 1); return result;
| 9,895
|
public static int fromDigit(char c) { if (c >= '0' && c <= '9') { return c - '0'; } else if (c >= 'A' && c <= 'F') { return c - 'A' + 10; } else if (c >= 'a' && c <= 'f') { return c - 'a' + 10; } else throw new IllegalArgumentException("Invalid hexadecimal digit: " + c); }
|
public static int fromDigit(char c) if (c >= '0' && c <= '9') return c - '0'; } else if (c >= 'A' && c <= 'F') return c - 'A' + 10; } else if (c >= 'a' && c <= 'f') return c - 'a' + 10; } else throw new IllegalArgumentException("Invalid hexadecimal digit: " + c); }
| 9,896
|
public static int fromDigit(char c) { if (c >= '0' && c <= '9') { return c - '0'; } else if (c >= 'A' && c <= 'F') { return c - 'A' + 10; } else if (c >= 'a' && c <= 'f') { return c - 'a' + 10; } else throw new IllegalArgumentException("Invalid hexadecimal digit: " + c); }
|
public static int fromDigit(char c) { if (c >= '0' && c <= '9') { return c - '0'; else if (c >= 'A' && c <= 'F') { return c - 'A' + 10; else if (c >= 'a' && c <= 'f') { return c - 'a' + 10; else throw new IllegalArgumentException("Invalid hexadecimal digit: " + c);
| 9,897
|
public static final String toBase64(byte[] buffer) { int len = buffer.length, pos = len % 3; byte b0 = 0, b1 = 0, b2 = 0; switch (pos) { case 1: b2 = buffer[0]; break; case 2: b1 = buffer[0]; b2 = buffer[1]; break; } StringBuffer sb = new StringBuffer(); int c; boolean notleading = false; do { c = (b0 & 0xFC) >>> 2; if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } c = ((b0 & 0x03) << 4) | ((b1 & 0xF0) >>> 4); if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } c = ((b1 & 0x0F) << 2) | ((b2 & 0xC0) >>> 6); if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } c = b2 & 0x3F; if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } if (pos >= len) { break; } else { try { b0 = buffer[pos++]; b1 = buffer[pos++]; b2 = buffer[pos++]; } catch (ArrayIndexOutOfBoundsException x) { break; } } } while (true); if (notleading) { return sb.toString(); } return "0"; }
|
public static final String toBase64(byte[] buffer) int len = buffer.length, pos = len % 3; byte b0 = 0, b1 = 0, b2 = 0; switch (pos) case 1: b2 = buffer[0]; break; case 2: b1 = buffer[0]; b2 = buffer[1]; break; } StringBuffer sb = new StringBuffer(); int c; boolean notleading = false; do c = (b0 & 0xFC) >>> 2; if (notleading || c != 0) sb.append(BASE64_CHARSET[c]); notleading = true; } c = ((b0 & 0x03) << 4) | ((b1 & 0xF0) >>> 4); if (notleading || c != 0) sb.append(BASE64_CHARSET[c]); notleading = true; } c = ((b1 & 0x0F) << 2) | ((b2 & 0xC0) >>> 6); if (notleading || c != 0) sb.append(BASE64_CHARSET[c]); notleading = true; } c = b2 & 0x3F; if (notleading || c != 0) sb.append(BASE64_CHARSET[c]); notleading = true; } if (pos >= len) break; } else try b0 = buffer[pos++]; b1 = buffer[pos++]; b2 = buffer[pos++]; } catch (ArrayIndexOutOfBoundsException x) break; } } } while (true); if (notleading) return sb.toString(); } return "0"; }
| 9,898
|
public static final String toBase64(byte[] buffer) { int len = buffer.length, pos = len % 3; byte b0 = 0, b1 = 0, b2 = 0; switch (pos) { case 1: b2 = buffer[0]; break; case 2: b1 = buffer[0]; b2 = buffer[1]; break; } StringBuffer sb = new StringBuffer(); int c; boolean notleading = false; do { c = (b0 & 0xFC) >>> 2; if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } c = ((b0 & 0x03) << 4) | ((b1 & 0xF0) >>> 4); if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } c = ((b1 & 0x0F) << 2) | ((b2 & 0xC0) >>> 6); if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } c = b2 & 0x3F; if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; } if (pos >= len) { break; } else { try { b0 = buffer[pos++]; b1 = buffer[pos++]; b2 = buffer[pos++]; } catch (ArrayIndexOutOfBoundsException x) { break; } } } while (true); if (notleading) { return sb.toString(); } return "0"; }
|
public static final String toBase64(byte[] buffer) { int len = buffer.length, pos = len % 3; byte b0 = 0, b1 = 0, b2 = 0; switch (pos) { case 1: b2 = buffer[0]; break; case 2: b1 = buffer[0]; b2 = buffer[1]; break; StringBuffer sb = new StringBuffer(); int c; boolean notleading = false; do { c = (b0 & 0xFC) >>> 2; if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; c = ((b0 & 0x03) << 4) | ((b1 & 0xF0) >>> 4); if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; c = ((b1 & 0x0F) << 2) | ((b2 & 0xC0) >>> 6); if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; c = b2 & 0x3F; if (notleading || c != 0) { sb.append(BASE64_CHARSET[c]); notleading = true; if (pos >= len) { break; else { try { b0 = buffer[pos++]; b1 = buffer[pos++]; b2 = buffer[pos++]; catch (ArrayIndexOutOfBoundsException x) { break; while (true); if (notleading) { return sb.toString(); return "0";
| 9,899
|
public static byte[] toBytesFromString(String s) { int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0, j = 0; if ((limit % 2) == 1) { result[j++] = (byte) fromDigit(s.charAt(i++)); } while (i < limit) { result[j] = (byte) (fromDigit(s.charAt(i++)) << 4); result[j++] |= (byte) fromDigit(s.charAt(i++)); } return result; }
|
public static byte[] toBytesFromString(String s) int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0, j = 0; if ((limit % 2) == 1) result[j++] = (byte) fromDigit(s.charAt(i++)); } while (i < limit) result[j] = (byte) (fromDigit(s.charAt(i++)) << 4); result[j++] |= (byte) fromDigit(s.charAt(i++)); } return result; }
| 9,900
|
public static byte[] toBytesFromString(String s) { int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0, j = 0; if ((limit % 2) == 1) { result[j++] = (byte) fromDigit(s.charAt(i++)); } while (i < limit) { result[j] = (byte) (fromDigit(s.charAt(i++)) << 4); result[j++] |= (byte) fromDigit(s.charAt(i++)); } return result; }
|
public static byte[] toBytesFromString(String s) { int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0, j = 0; if ((limit % 2) == 1) { result[j++] = (byte) fromDigit(s.charAt(i++)); while (i < limit) { result[j] = (byte) (fromDigit(s.charAt(i++)) << 4); result[j++] |= (byte) fromDigit(s.charAt(i++)); return result;
| 9,901
|
public static byte[] toReversedBytesFromString(String s) { int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0; if ((limit % 2) == 1) { result[i++] = (byte) fromDigit(s.charAt(--limit)); } while (limit > 0) { result[i] = (byte) fromDigit(s.charAt(--limit)); result[i++] |= (byte) (fromDigit(s.charAt(--limit)) << 4); } return result; }
|
public static byte[] toReversedBytesFromString(String s) int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0; if ((limit % 2) == 1) result[i++] = (byte) fromDigit(s.charAt(--limit)); } while (limit > 0) result[i] = (byte) fromDigit(s.charAt(--limit)); result[i++] |= (byte) (fromDigit(s.charAt(--limit)) << 4); } return result; }
| 9,902
|
public static byte[] toReversedBytesFromString(String s) { int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0; if ((limit % 2) == 1) { result[i++] = (byte) fromDigit(s.charAt(--limit)); } while (limit > 0) { result[i] = (byte) fromDigit(s.charAt(--limit)); result[i++] |= (byte) (fromDigit(s.charAt(--limit)) << 4); } return result; }
|
public static byte[] toReversedBytesFromString(String s) { int limit = s.length(); byte[] result = new byte[((limit + 1) / 2)]; int i = 0; if ((limit % 2) == 1) { result[i++] = (byte) fromDigit(s.charAt(--limit)); while (limit > 0) { result[i] = (byte) fromDigit(s.charAt(--limit)); result[i++] |= (byte) (fromDigit(s.charAt(--limit)) << 4); return result;
| 9,903
|
public static final byte[] trim(BigInteger n) { byte[] in = n.toByteArray(); if (in.length == 0 || in[0] != 0) { return in; } int len = in.length; int i = 1; while (in[i] == 0 && i < len) { ++i; } byte[] result = new byte[len - i]; System.arraycopy(in, i, result, 0, len - i); return result; }
|
public static final byte[] trim(BigInteger n) byte[] in = n.toByteArray(); if (in.length == 0 || in[0] != 0) return in; } int len = in.length; int i = 1; while (in[i] == 0 && i < len) ++i; } byte[] result = new byte[len - i]; System.arraycopy(in, i, result, 0, len - i); return result; }
| 9,904
|
public static final byte[] trim(BigInteger n) { byte[] in = n.toByteArray(); if (in.length == 0 || in[0] != 0) { return in; } int len = in.length; int i = 1; while (in[i] == 0 && i < len) { ++i; } byte[] result = new byte[len - i]; System.arraycopy(in, i, result, 0, len - i); return result; }
|
public static final byte[] trim(BigInteger n) { byte[] in = n.toByteArray(); if (in.length == 0 || in[0] != 0) { return in; int len = in.length; int i = 1; while (in[i] == 0 && i < len) { ++i; byte[] result = new byte[len - i]; System.arraycopy(in, i, result, 0, len - i); return result;
| 9,905
|
public NumberFormatException(String s) { super(s); }
|
public NumberFormatException(String s) { super(s); }
| 9,906
|
public int hashCode() { throw new Error("not implemented"); }
|
public int hashCode() { int hash = Float.floatToIntBits(width); hash ^= cap; hash ^= join; hash ^= Float.floatToIntBits(limit); for (int i = 0; i < dash.length; i++) hash ^= Float.floatToIntBits(dash[i]); hash ^= Float.floatToIntBits(phase); return hash; }
| 9,907
|
void setRangeProperties(int value, int extent, int min, int max, boolean adjusting);
|
void setRangeProperties(int value, int extent, int min, int max, boolean adjusting);
| 9,908
|
dispatchEventImpl(AWTEvent e){ if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e);}
|
dispatchEventImpl(AWTEvent e){ if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e);}
| 9,909
|
public void update(byte[] buf, int off, int len) { int c = ~crc; while (--len >= 0) c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8); crc = ~c; }
|
public void update (int bval) { int c = ~crc; while (--len >= 0) c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8); crc = ~c; }
| 9,912
|
public void update(byte[] buf, int off, int len) { int c = ~crc; while (--len >= 0) c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8); crc = ~c; }
|
public void update(byte[] buf, int off, int len) { int c = ~crc; while (--len >= 0) c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8); crc = ~c; }
| 9,913
|
public AnySeqHolder(Any [] a_value) { value = a_value; }
|
public AnySeqHolder() { value = a_value; }
| 9,916
|
public AnySeqHolder(Any [] a_value) { value = a_value; }
|
public AnySeqHolder(Any [] a_value) { }
| 9,917
|
StreamHandler( OutputStream out, String propertyPrefix, Level defaultLevel, Formatter formatter, Class defaultFormatterClass) { this.level = LogManager.getLevelProperty(propertyPrefix + ".level", defaultLevel); this.filter = (Filter) LogManager.getInstanceProperty( propertyPrefix + ".filter", /* must be instance of */ Filter.class, /* default: new instance of */ null); if (formatter != null) this.formatter = formatter; else this.formatter = (Formatter) LogManager.getInstanceProperty( propertyPrefix + ".formatter", /* must be instance of */ Formatter.class, /* default: new instance of */ defaultFormatterClass); try { String enc = LogManager.getLogManager().getProperty(propertyPrefix + ".encoding"); /* make sure enc actually is a valid encoding */ if ((enc != null) && (enc.length() > 0)) new String(new byte[0], enc); this.encoding = enc; } catch (Exception _) { } if (out != null) { try { changeWriter(out, getEncoding()); } catch (UnsupportedEncodingException uex) { /* This should never happen, since the validity of the encoding * name has been checked above. */ throw new RuntimeException(uex.getMessage()); } } }
|
StreamHandler( OutputStream out, String propertyPrefix, Level defaultLevel, Formatter formatter, Class defaultFormatterClass) { this.level = LogManager.getLevelProperty(propertyPrefix + ".level", defaultLevel); this.filter = (Filter) LogManager.getInstanceProperty( propertyPrefix + ".filter", /* must be instance of */ Filter.class, /* default: new instance of */ null); if (formatter != null) this.formatter = formatter; else this.formatter = (Formatter) LogManager.getInstanceProperty( propertyPrefix + ".formatter", /* must be instance of */ Formatter.class, /* default: new instance of */ defaultFormatterClass); try { String enc = LogManager.getLogManager().getProperty(propertyPrefix + ".encoding"); /* make sure enc actually is a valid encoding */ if ((enc != null) && (enc.length() > 0)) new String(new byte[0], enc); this.encoding = enc; } catch (Exception _) { } if (out != null) { try { changeWriter(out, getEncoding()); } catch (UnsupportedEncodingException uex) { /* This should never happen, since the validity of the encoding * name has been checked above. */ throw new RuntimeException(uex.getMessage()); } } }
| 9,918
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.