bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public BigDecimal (String num) throws NumberFormatException { int len = num.length(); int start = 0, point = 0; int dot = -1; boolean negative = false; if (num.charAt(0) == '+') { ++start; ++point; } else if (num.charAt(0) == '-') { ++start; ++point; negative = true; } while (point < len) { char c = num.charAt (point); if (c == '.') { if (dot >= 0) throw new NumberFormatException ("multiple `.'s in number"); dot = point; } else if (c == 'e' || c == 'E') break; else if (Character.digit (c, 10) < 0) throw new NumberFormatException ("unrecognized character: " + c); ++point; } String val; if (dot >= 0) { val = num.substring (start, dot) + num.substring (dot + 1, point); scale = point - 1 - dot; } else { val = num.substring (start, point); scale = 0; } if (val.length () == 0) throw new NumberFormatException ("no digits seen"); if (negative) val = "-" + val; intVal = new BigInteger (val); // Now parse exponent. if (point < len) { point++; if (num.charAt(point) == '+') point++; if (point >= len ) throw new NumberFormatException ("no exponent following e or E"); try { int exp = Integer.parseInt (num.substring (point)); exp -= scale; if (signum () == 0) scale = 0; else if (exp > 0) { intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp)); scale = 0; } else scale = - exp; } catch (NumberFormatException ex) { throw new NumberFormatException ("malformed exponent"); } } }
|
public BigDecimal (BigInteger num) { int len = num.length(); int start = 0, point = 0; int dot = -1; boolean negative = false; if (num.charAt(0) == '+') { ++start; ++point; } else if (num.charAt(0) == '-') { ++start; ++point; negative = true; } while (point < len) { char c = num.charAt (point); if (c == '.') { if (dot >= 0) throw new NumberFormatException ("multiple `.'s in number"); dot = point; } else if (c == 'e' || c == 'E') break; else if (Character.digit (c, 10) < 0) throw new NumberFormatException ("unrecognized character: " + c); ++point; } String val; if (dot >= 0) { val = num.substring (start, dot) + num.substring (dot + 1, point); scale = point - 1 - dot; } else { val = num.substring (start, point); scale = 0; } if (val.length () == 0) throw new NumberFormatException ("no digits seen"); if (negative) val = "-" + val; intVal = new BigInteger (val); // Now parse exponent. if (point < len) { point++; if (num.charAt(point) == '+') point++; if (point >= len ) throw new NumberFormatException ("no exponent following e or E"); try { int exp = Integer.parseInt (num.substring (point)); exp -= scale; if (signum () == 0) scale = 0; else if (exp > 0) { intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp)); scale = 0; } else scale = - exp; } catch (NumberFormatException ex) { throw new NumberFormatException ("malformed exponent"); } } }
| 1,447
|
public BigDecimal (String num) throws NumberFormatException { int len = num.length(); int start = 0, point = 0; int dot = -1; boolean negative = false; if (num.charAt(0) == '+') { ++start; ++point; } else if (num.charAt(0) == '-') { ++start; ++point; negative = true; } while (point < len) { char c = num.charAt (point); if (c == '.') { if (dot >= 0) throw new NumberFormatException ("multiple `.'s in number"); dot = point; } else if (c == 'e' || c == 'E') break; else if (Character.digit (c, 10) < 0) throw new NumberFormatException ("unrecognized character: " + c); ++point; } String val; if (dot >= 0) { val = num.substring (start, dot) + num.substring (dot + 1, point); scale = point - 1 - dot; } else { val = num.substring (start, point); scale = 0; } if (val.length () == 0) throw new NumberFormatException ("no digits seen"); if (negative) val = "-" + val; intVal = new BigInteger (val); // Now parse exponent. if (point < len) { point++; if (num.charAt(point) == '+') point++; if (point >= len ) throw new NumberFormatException ("no exponent following e or E"); try { int exp = Integer.parseInt (num.substring (point)); exp -= scale; if (signum () == 0) scale = 0; else if (exp > 0) { intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp)); scale = 0; } else scale = - exp; } catch (NumberFormatException ex) { throw new NumberFormatException ("malformed exponent"); } } }
|
public BigDecimal (String num) throws NumberFormatException { int len = num.length(); int start = 0, point = 0; int dot = -1; boolean negative = false; if (num.charAt(0) == '+') { ++start; ++point; } else if (num.charAt(0) == '-') { ++start; ++point; negative = true; } while (point < len) { char c = num.charAt (point); if (c == '.') { if (dot >= 0) throw new NumberFormatException ("multiple `.'s in number"); dot = point; } else if (c == 'e' || c == 'E') break; else if (Character.digit (c, 10) < 0) throw new NumberFormatException ("unrecognized character: " + c); ++point; } String val; if (dot >= 0) { val = num.substring (start, dot) + num.substring (dot + 1, point); scale = point - 1 - dot; } else { val = num.substring (start, point); scale = 0; } if (val.length () == 0) throw new NumberFormatException ("no digits seen"); if (negative) val = "-" + val; intVal = new BigInteger (val); // Now parse exponent. if (point < len) { point++; if (num.charAt(point) == '+') point++; if (point >= len ) throw new NumberFormatException ("no exponent following e or E"); try { int exp = Integer.parseInt (num.substring (point)); exp -= scale; if (signum () == 0) scale = 0; else if (exp > 0) { intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp)); scale = 0; } else scale = - exp; } catch (NumberFormatException ex) { throw new NumberFormatException ("malformed exponent"); } } }
| 1,448
|
private void expireOldRange(LiveRange lr) { for (int i=0; i<active.size(); i+=1) { LiveRange l = (LiveRange) active.get(i); if (l.getLastUseAddress() >= lr.getAssignAddress()) { return; } active.remove(l); registerPool.release(l.getLocation()); } }
|
private void expireOldRange(LiveRange lr) { for (int i=0; i<active.size(); i+=1) { LiveRange l = (LiveRange) active.get(i); if (l.getLastUseAddress() >= lr.getAssignAddress()) { return; } active.remove(l); RegisterLocation regLoc = (RegisterLocation) l.getLocation(); registerPool.release(regLoc.getRegister()); } }
| 1,449
|
public StackLocation() { this(0); }
|
public StackLocation() { this(0); }
| 1,450
|
HelpException(String message) { super(message); }
|
HelpException(String message) { super(message); }
| 1,451
|
public void append(SocketBuffer skbuf) { if (next != null) { next.append(skbuf); } else { next = skbuf; } testBuffer(); }
|
public void append(int count) { if (next != null) { next.append(skbuf); } else { next = skbuf; } testBuffer(); }
| 1,452
|
public void append(SocketBuffer skbuf) { if (next != null) { next.append(skbuf); } else { next = skbuf; } testBuffer(); }
|
public void append(SocketBuffer skbuf) { if (next != null) { next.append(count); } else { next = skbuf; } testBuffer(); }
| 1,453
|
public void append(SocketBuffer skbuf) { if (next != null) { next.append(skbuf); } else { next = skbuf; } testBuffer(); }
|
public void append(SocketBuffer skbuf) { if (next != null) { next.append(skbuf); } else { setSize(size + count); } testBuffer(); }
| 1,454
|
public void sendKeys(String text) { if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { bufferedKeys = ""; keysBuffered = false; simulateMnemonic(getMnemonicValue(text)); } else { keysBuffered = true; if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; } } } } }
|
public void sendKeys(String text) { if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { bufferedKeys = ""; keysBuffered = false; simulateMnemonic(getMnemonicValue(text)); } else { keysBuffered = true; if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; done = true; } } } } }
| 1,457
|
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { setCursorOff(); screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); setCursorOn(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : setCursorOff(); // we toggle it insertMode = insertMode ? false : true; setCursorOn(); break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { setCursorOff(); screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : restoreErrorLine(); setStatus(STATUS_ERROR_CODE,STATUS_VALUE_OFF,""); isInField(lastPos); simulated = true; updateDirty(); break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
|
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { setCursorOff(); screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); setCursorOn(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : setCursorOff(); // we toggle it insertMode = insertMode ? false : true; setCursorOn(); break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { setCursorOff(); screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : restoreErrorLine(); setStatus(STATUS_ERROR_CODE,STATUS_VALUE_OFF,""); isInField(lastPos); simulated = true; updateDirty(); break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
| 1,459
|
public Dimension getMaximumSize(JComponent c) { return getPreferredSize(c); }
|
public Dimension getMaximumSize(JComponent c) { Dimension d = getPreferredSize(c); View view = (View) c.getClientProperty(BasicHTML.propertyKey); if (view != null) d.width += view.getMaximumSpan(View.X_AXIS) - view.getPreferredSpan(View.X_AXIS); return d; }
| 1,460
|
public Dimension getMinimumSize(JComponent c) { return getPreferredSize(c); }
|
public Dimension getMinimumSize(JComponent c) { Dimension d = getPreferredSize(c); View view = (View) c.getClientProperty(BasicHTML.propertyKey); if (view != null) d.width -= view.getPreferredSpan(View.X_AXIS) - view.getMinimumSpan(View.X_AXIS); return d; }
| 1,461
|
public Dimension getPreferredSize(JComponent c) { JToolTip tip = (JToolTip) c; FontMetrics fm; Toolkit g = tip.getToolkit(); text = tip.getTipText(); Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = tip.getInsets(); fm = g.getFontMetrics(tip.getFont()); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); return new Dimension(insets.left + tr.width + insets.right, insets.top + tr.height + insets.bottom); }
|
public Dimension getPreferredSize(JComponent c) { JToolTip tip = (JToolTip) c; FontMetrics fm; Toolkit g = tip.getToolkit(); text = tip.getTipText(); Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = tip.getInsets(); fm = g.getFontMetrics(tip.getFont()); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); return new Dimension(insets.left + tr.width + insets.right, insets.top + tr.height + insets.bottom); }
| 1,462
|
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); Toolkit t = tip.getToolkit(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawString(text, vr.x, vr.y + ascent); g.setColor(saved); }
|
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); Toolkit t = tip.getToolkit(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawString(text, vr.x, vr.y + ascent); g.setColor(saved); }
| 1,465
|
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); Toolkit t = tip.getToolkit(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawString(text, vr.x, vr.y + ascent); g.setColor(saved); }
|
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); Toolkit t = tip.getToolkit(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawString(text, vr.x, vr.y + ascent); g.setColor(saved); }
| 1,466
|
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); Toolkit t = tip.getToolkit(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawString(text, vr.x, vr.y + ascent); g.setColor(saved); }
|
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); Toolkit t = tip.getToolkit(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, SwingConstants.CENTER, vr, ir, tr, 0); Color saved = g.getColor(); g.setColor(Color.BLACK); View view = (View) c.getClientProperty(BasicHTML.propertyKey); if (view != null) view.paint(g, paintR); else g.drawString(text, paintR.x + 3, paintR.y + ascent); g.setColor(saved); }
| 1,467
|
public static Icon getCheckBoxIcon() { return new Icon() { public int getIconHeight() { return 10; } public int getIconWidth() { return 10; } public void paintIcon(Component c, Graphics g, int x, int y) { if (c instanceof AbstractButton) { UIDefaults defaults; defaults = UIManager.getLookAndFeelDefaults(); Color hi = defaults.getColor("CheckBox.highlight"); Color low = defaults.getColor("CheckBox.darkShadow"); Color sel = defaults.getColor("CheckBox.foreground"); Color dim = defaults.getColor("CheckBox.shadow"); Polygon check = new Polygon(new int[] {x+3, x+3, x+8}, new int[] {y+5, y+9, y+3}, 3); AbstractButton b = (AbstractButton) c; Color saved = g.getColor(); if (b.isEnabled()) { g.setColor(low); g.drawRect(x, y, 10, 10); g.setColor(hi); g.drawRect(x+1, y+1, 10, 10); if (b.isSelected()) { g.setColor(sel); if (b.isSelected()) { g.drawLine(x+3, y+5, x+3, y+8); g.drawLine(x+4, y+5, x+4, y+8); g.drawLine(x+3, y+8, x+8, y+3); g.drawLine(x+4, y+8, x+8, y+3); } } } else { g.setColor(hi); g.drawRect(x, y, 10, 10); if (b.isSelected()) { g.drawLine(x+3, y+5, x+3, y+9); g.drawLine(x+3, y+9, x+8, y+3); } } g.setColor(saved); } } }; }
|
public static Icon getCheckBoxIcon() { return new Icon() { public int getIconHeight() { return 10; } public int getIconWidth() { return 10; } public void paintIcon(Component c, Graphics g, int x, int y) { if (c instanceof AbstractButton) { UIDefaults defaults; defaults = UIManager.getLookAndFeelDefaults(); Color hi = defaults.getColor("CheckBox.highlight"); Color low = defaults.getColor("CheckBox.darkShadow"); Color sel = defaults.getColor("CheckBox.foreground"); Color dim = defaults.getColor("CheckBox.shadow"); Polygon check = new Polygon(new int[] {x+3, x+3, x+8}, new int[] {y+5, y+9, y+3}, 3); AbstractButton b = (AbstractButton) c; Color saved = g.getColor(); if (b.isEnabled()) { g.setColor(low); g.drawRect(x, y, 10, 10); g.setColor(hi); g.drawRect(x+1, y+1, 10, 10); if (b.isSelected()) { g.setColor(sel); if (b.isSelected()) { g.drawLine(x+3, y+5, x+3, y+8); g.drawLine(x+4, y+5, x+4, y+8); g.drawLine(x+3, y+8, x+8, y+3); g.drawLine(x+4, y+8, x+8, y+3); } } } else { g.setColor(hi); g.drawRect(x, y, 10, 10); if (b.isSelected()) { g.drawLine(x+3, y+5, x+3, y+9); g.drawLine(x+3, y+9, x+8, y+3); } } g.setColor(saved); } } }; }
| 1,471
|
public static Icon getRadioButtonIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { UIDefaults defaults; defaults = UIManager.getLookAndFeelDefaults(); Color hi = defaults.getColor("RadioButton.highlight"); Color low = defaults.getColor("RadioButton.darkShadow"); Color sel = defaults.getColor("RadioButton.foreground"); Color dim = defaults.getColor("RadioButton.shadow"); if (c instanceof AbstractButton) { AbstractButton b = (AbstractButton) c; Color saved = g.getColor(); if (b.isEnabled()) { g.setColor(low); g.drawOval(x, y, 12, 12); g.setColor(hi); g.drawOval(x+1, y+1, 12, 12); if (b.isSelected()) { g.setColor(sel); g.fillOval(x+4, y+4, 6, 6); } } else { g.setColor(hi); g.drawOval(x, y, 12, 12); if (b.isSelected()) g.fillOval(x+4, y+4, 6, 6); } g.setColor(saved); } } }; }
|
public static Icon getRadioButtonIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { UIDefaults defaults; defaults = UIManager.getLookAndFeelDefaults(); Color hi = defaults.getColor("RadioButton.highlight"); Color low = defaults.getColor("RadioButton.darkShadow"); Color sel = defaults.getColor("RadioButton.foreground"); Color dim = defaults.getColor("RadioButton.shadow"); if (c instanceof AbstractButton) { AbstractButton b = (AbstractButton) c; Color saved = g.getColor(); if (b.isEnabled()) { g.setColor(low); g.drawOval(x, y, 12, 12); g.setColor(hi); g.drawOval(x+1, y+1, 12, 12); if (b.isSelected()) { g.setColor(sel); g.fillOval(x+4, y+4, 6, 6); } } else { g.setColor(hi); g.drawOval(x, y, 12, 12); if (b.isSelected()) g.fillOval(x+4, y+4, 6, 6); } g.setColor(saved); } } }; }
| 1,472
|
public static Icon getRadioButtonIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { UIDefaults defaults; defaults = UIManager.getLookAndFeelDefaults(); Color hi = defaults.getColor("RadioButton.highlight"); Color low = defaults.getColor("RadioButton.darkShadow"); Color sel = defaults.getColor("RadioButton.foreground"); Color dim = defaults.getColor("RadioButton.shadow"); if (c instanceof AbstractButton) { AbstractButton b = (AbstractButton) c; Color saved = g.getColor(); if (b.isEnabled()) { g.setColor(low); g.drawOval(x, y, 12, 12); g.setColor(hi); g.drawOval(x+1, y+1, 12, 12); if (b.isSelected()) { g.setColor(sel); g.fillOval(x+4, y+4, 6, 6); } } else { g.setColor(hi); g.drawOval(x, y, 12, 12); if (b.isSelected()) g.fillOval(x+4, y+4, 6, 6); } g.setColor(saved); } } }; }
|
public static Icon getRadioButtonIcon() { return new Icon() { public int getIconHeight() { return 12; } public int getIconWidth() { return 12; } public void paintIcon(Component c, Graphics g, int x, int y) { UIDefaults defaults; defaults = UIManager.getLookAndFeelDefaults(); Color hi = defaults.getColor("RadioButton.highlight"); Color low = defaults.getColor("RadioButton.darkShadow"); Color sel = defaults.getColor("RadioButton.foreground"); Color dim = defaults.getColor("RadioButton.shadow"); if (c instanceof AbstractButton) { AbstractButton b = (AbstractButton) c; Color saved = g.getColor(); if (b.isEnabled()) { g.setColor(low); g.drawOval(x, y, 12, 12); g.setColor(hi); g.drawOval(x+1, y+1, 12, 12); if (b.isSelected()) { g.setColor(sel); g.fillOval(x+4, y+4, 6, 6); } } else { g.setColor(hi); g.drawOval(x, y, 12, 12); if (b.isSelected()) g.fillOval(x+4, y+4, 6, 6); } g.setColor(saved); } } }; }
| 1,473
|
public FileSystem getFileSystem() { return null; }
|
public FileSystem getFileSystem() { return null; }
| 1,474
|
public boolean isValid() { return true; }
|
public boolean isValid() { return true; }
| 1,475
|
public Iterator iterator() throws IOException { return new Iterator() { int offset = 0; EntryRecord parent = ISO9660Directory.this.entry.getCDFSentry(); byte[] buffer = parent.getExtentData(); public boolean hasNext() { return buffer[offset] > 0; } public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); } public void remove() { throw new UnsupportedOperationException("Not yet implemented"); } }; }
|
public Iterator iterator() throws IOException { return new Iterator() { int offset = 0; EntryRecord parent = ISO9660Directory.this.entry.getCDFSentry(); byte[] buffer = parent.getExtentData(); public boolean hasNext() { return buffer[offset] > 0; } public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); } public void remove() { throw new UnsupportedOperationException("Not yet implemented"); } }; }
| 1,476
|
public Iterator iterator() throws IOException { return new Iterator() { int offset = 0; EntryRecord parent = ISO9660Directory.this.entry.getCDFSentry(); byte[] buffer = parent.getExtentData(); public boolean hasNext() { return buffer[offset] > 0; } public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); } public void remove() { throw new UnsupportedOperationException("Not yet implemented"); } }; }
|
public Iterator iterator() throws IOException { return new Iterator() { int offset = 0; EntryRecord parent = ISO9660Directory.this.entry.getCDFSentry(); byte[] buffer = parent.getExtentData(); public boolean hasNext() { return buffer[offset] > 0; } public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); } public void remove() { throw new UnsupportedOperationException("Not yet implemented"); } }; }
| 1,477
|
public Iterator iterator() throws IOException { return new Iterator() { int offset = 0; EntryRecord parent = ISO9660Directory.this.entry.getCDFSentry(); byte[] buffer = parent.getExtentData(); public boolean hasNext() { return buffer[offset] > 0; } public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); } public void remove() { throw new UnsupportedOperationException("Not yet implemented"); } }; }
|
public Iterator iterator() throws IOException { return new Iterator() { int offset = 0; EntryRecord parent = ISO9660Directory.this.entry.getCDFSentry(); byte[] buffer = parent.getExtentData(); public boolean hasNext() { return buffer[offset] > 0; } public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); } public void remove() { throw new UnsupportedOperationException("Not yet implemented"); } }; }
| 1,478
|
public boolean hasNext() { return buffer[offset] > 0; }
|
public boolean hasNext() { return buffer[offset] > 0; }
| 1,479
|
public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); }
|
public Object next() { EntryRecord fEntry = new EntryRecord(parent.getVolume(),buffer,offset); offset += fEntry.getLengthOfDirectoryEntry(); return new ISO9660Entry(fEntry); }
| 1,480
|
UTF_16 () { super ("UTF-16", null); }
|
UTF_16 () { super ("UTF-16", new String[] { "UTF16", "ISO-10646-UCS-2", "unicode", "csUnicode", "ucs-2" }); }
| 1,481
|
public Object read_abstract_interface() { boolean isValue = read_boolean(); if (isValue) return read_value(); else return read_Object(); }
|
public Object read_abstract_interface() { boolean isObject = read_boolean(); if (isValue) return read_value(); else return read_Object(); }
| 1,482
|
public Object read_abstract_interface() { boolean isValue = read_boolean(); if (isValue) return read_value(); else return read_Object(); }
|
public Object read_abstract_interface() { boolean isValue = read_boolean(); if (isValue) return read_value(); else return read_Object(); }
| 1,483
|
public Object read_abstract_interface() { boolean isValue = read_boolean(); if (isValue) return read_value(); else return read_Object(); }
|
public Object read_abstract_interface() { boolean isValue = read_boolean(); if (isValue) return read_value(); else return read_value(); }
| 1,484
|
public static Serializable read(InputStream input) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { // We may need to jump back if the value is read via value factory. input.mark(512); int value_tag = input.read_long(); checkTag(value_tag); String codebase = null; String[] ids = null; String id = null; // The existing implementing object. java.lang.Object ox = null; // Check for the agreed null value. if (value_tag == vt_NULL) return null; else if (value_tag == vt_INDIRECTION) // TODO FIXME Implement support for indirections. throw new NO_IMPLEMENT("Indirections unsupported"); else { // Read the value. if ((value_tag & vf_CODEBASE) != 0) { // The codebase is present. The codebase is a space // separated list of URLs from where the implementing // code can be downloaded. codebase = input.read_string(); } if ((value_tag & vf_MULTIPLE_IDS) != 0) { // Multiple supported repository ids are present. ids = StringSeqHelper.read(input); for (int i = 0; (i < ids.length) && (ox == null); i++) { ox = ObjectCreator.Idl2Object(ids [ i ]); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(ids [ i ]); if (f != null) { // Reset, as the value factory reads from beginning. input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } else if ((value_tag & vf_ID) != 0) { // Single supported repository id is present. id = input.read_string(); ox = ObjectCreator.Idl2Object(id); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(id); if (f != null) { input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } if (ox == null) throw new MARSHAL("Unable to instantiate the value type"); else { read_instance(input, ox, value_tag, null); return (Serializable) ox; } } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
|
public static Serializable read(InputStream input) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { // We may need to jump back if the value is read via value factory. input.mark(512); int value_tag = input.read_long(); checkTag(value_tag); String codebase = null; String[] ids = null; String id = null; // The existing implementing object. java.lang.Object ox = null; // Check for the agreed null value. if (value_tag == vt_NULL) return null; else if (value_tag == vt_INDIRECTION) // TODO FIXME Implement support for indirections. throw new NO_IMPLEMENT("Indirections unsupported"); else { // Read the value. if ((value_tag & vf_CODEBASE) != 0) { // The codebase is present. The codebase is a space // separated list of URLs from where the implementing // code can be downloaded. codebase = input.read_string(); } if ((value_tag & vf_MULTIPLE_IDS) != 0) { // Multiple supported repository ids are present. ids = StringSeqHelper.read(input); for (int i = 0; (i < ids.length) && (ox == null); i++) { ox = ObjectCreator.Idl2Object(ids [ i ]); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(ids [ i ]); if (f != null) { // Reset, as the value factory reads from beginning. input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } else if ((value_tag & vf_ID) != 0) { // Single supported repository id is present. id = input.read_string(); ox = ObjectCreator.Idl2Object(id); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(id); if (f != null) { input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } if (ox == null) throw new MARSHAL("Unable to instantiate the value type"); else { read_instance(input, ox, value_tag, null); return (Serializable) ox; } } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
| 1,485
|
public Image createImage(byte[] data) { return createImage(data, 0, data.length); }
|
public Image createImage(byte[] data) { return createImage(data, 0, data.length); }
| 1,486
|
public ICMPTimestampHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_TIMESTAMP) && (type != ICMP_TIMESTAMPREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.originateTimestamp = skbuf.get32(8); this.receiveTimestamp = skbuf.get32(12); this.transmitTimestamp = skbuf.get32(16); }
|
public ICMPTimestampHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_TIMESTAMP) && (type != ICMP_TIMESTAMPREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.originateTimestamp = skbuf.get32(8); this.receiveTimestamp = skbuf.get32(12); this.transmitTimestamp = skbuf.get32(16); }
| 1,487
|
public ICMPTimestampHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_TIMESTAMP) && (type != ICMP_TIMESTAMPREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.originateTimestamp = skbuf.get32(8); this.receiveTimestamp = skbuf.get32(12); this.transmitTimestamp = skbuf.get32(16); }
|
public ICMPTimestampHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_TIMESTAMP) && (type != ICMP_TIMESTAMPREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.originateTimestamp = skbuf.get32(8); this.receiveTimestamp = skbuf.get32(12); this.transmitTimestamp = skbuf.get32(16); }
| 1,488
|
public ICMPAddressMaskHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_ADDRESS) && (type != ICMP_ADDRESSREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.subnetMask = new IPv4Address(skbuf, 8); }
|
public ICMPAddressMaskHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_ADDRESS) && (type != ICMP_ADDRESSREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.subnetMask = new IPv4Address(skbuf, 8); }
| 1,489
|
public ICMPAddressMaskHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_ADDRESS) && (type != ICMP_ADDRESSREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.subnetMask = new IPv4Address(skbuf, 8); }
|
public ICMPAddressMaskHeader(SocketBuffer skbuf) { super(skbuf); final int type = getType(); if ((type != ICMP_ADDRESS) && (type != ICMP_ADDRESSREPLY)) { throw new IllegalArgumentException("Invalid type " + type); } this.subnetMask = subnetMask; }
| 1,490
|
public ICMPEchoHeader(SocketBuffer skbuf) { super(skbuf); }
|
public ICMPEchoHeader(SocketBuffer skbuf) { super(skbuf); }
| 1,491
|
private void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"axisUnits"); attribOrder.add(0,"axisDatatype"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("aligh", new XMLAttribute(null, Constants.STRING_TYPE)); //double check??? //set up the axisUnits attribute Units unitsObj = new Units(); attribHash.put("axisUnits", new XMLAttribute(unitsObj, Constants.OBJECT_TYPE)); unitsObj.setXDFNodeName("axisUnits"); attribHash.put("axisDatatype",new XMLAttribute(new StringDataFormat(), Constants.OBJECT_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
|
private void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"axisUnits"); attribOrder.add(0,"axisDatatype"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("aligh", new XMLAttribute(null, Constants.STRING_TYPE)); //double check??? //set up the axisUnits attribute Units unitsObj = new Units(); attribHash.put("axisUnits", new XMLAttribute(unitsObj, Constants.OBJECT_TYPE)); unitsObj.setXDFNodeName("axisUnits"); attribHash.put("axisDatatype",new XMLAttribute(new StringDataFormat(), Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
| 1,492
|
public Dimension minimumLayoutSize(Container parent) { JViewport vp = (JViewport)parent; Component view = vp.getView(); if (view != null) return view.getMinimumSize(); else return new Dimension(); }
|
public Dimension minimumLayoutSize(Container parent) { JViewport vp = (JViewport)parent; Component view = vp.getView(); if (view != null) return view.getMinimumSize(); else return new Dimension(); }
| 1,493
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
|
public void connect(InetAddress address, int port) { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
| 1,494
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
| 1,495
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
| 1,496
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
|
public void connect(SocketAddress address) throws SocketException { if (isClosed()) throw new SocketException("socket is closed"); if (! (address instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); InetSocketAddress tmp = (InetSocketAddress) address; connect(tmp.getAddress(), tmp.getPort()); }
| 1,497
|
public abstract int read(ByteBuffer dst) throws IOException;
|
public final long read(ByteBuffer[] dsts) throws IOException { long b = 0; for (int i = 0; i < dsts.length; i++) b += read(dsts[i]); return b; }
| 1,498
|
public DatagramPacket(byte[] buf, int length) { this(buf, 0, length); }
|
public DatagramPacket(byte[] buf, int length) { this(buf, 0, length); }
| 1,499
|
public abstract int write(ByteBuffer src) throws IOException;
|
public final long write(ByteBuffer[] srcs) throws IOException { long b = 0; for (int i = 0; i < srcs.length; i++) b += write(srcs[i]); return b; }
| 1,500
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: log.setLevel((Level)Level.OFF); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
| 1,501
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: log.setLevel((Level)Level.DEBUG); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
| 1,502
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: log.setLevel((Level)Level.INFO); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
| 1,503
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: log.setLevel((Level)Level.WARN); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
| 1,504
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.setLevel((Level)Level.ERROR); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
| 1,505
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.setLevel((Level)Level.FATAL); break; } }
| 1,506
|
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if ((mY % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
|
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
| 1,507
|
public int[] getSelectedIndices() { int lo, hi, n, i, j; if (selectionModel.isSelectionEmpty()) return new int[0]; lo = selectionModel.getMinSelectionIndex(); hi = selectionModel.getMaxSelectionIndex(); n = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) n++; int [] v = new int[n]; j = 0; for (i = lo; i < hi; ++i) if (selectionModel.isSelectedIndex(i)) v[j++] = i; return v; }
|
public int[] getSelectedIndices() { int lo, hi, n, i, j; if (selectionModel.isSelectionEmpty()) return new int[0]; lo = selectionModel.getMinSelectionIndex(); hi = selectionModel.getMaxSelectionIndex(); n = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) n++; int [] v = new int[n]; j = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) v[j++] = i; return v; }
| 1,508
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 1,509
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 1,510
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 1,511
|
private Rectangle getCellBounds(int x, int y, Object cell) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm .getHeight()); }
|
private Rectangle getCellBounds(int x, int y, Object cell) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm .getHeight()); }
| 1,515
|
public Dimension getMaximumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
|
public Dimension getMaximumSize(JComponent c) { // FIXME: not implemented return getPreferredSize(c); }
| 1,516
|
public Dimension getMinimumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
|
public Dimension getMinimumSize(JComponent c) { // FIXME: not implemented return getPreferredSize(c); }
| 1,517
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
| 1,518
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
| 1,519
|
public int getRowCount(JTree tree) { return treeState.getRowCount(); }
|
public int getRowCount(JTree tree) { DefaultMutableTreeNode node = ((DefaultMutableTreeNode) (tree.getModel()) .getRoot()); int count = 0; while (node != null) { count++; node = getNextVisibleNode(node); } return count; }
| 1,520
|
protected boolean isLeaf(int row) { return false; // FIXME: not implemented }
|
protected boolean isLeaf(int row) { TreePath pathForRow = getPathForRow(tree, row); if (pathForRow == null) return true; Object node = pathForRow.getLastPathComponent(); if (node instanceof TreeNode) return ((TreeNode) node).isLeaf(); else return true; // FIXME: not implemented }
| 1,521
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 1,522
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 1,523
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 1,524
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 1,525
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 1,526
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 1,527
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 1,528
|
public Point getLocationOnScreen() { final Point screen = new Point(location); final Component parent = component.getParent(); if (parent != null) { final Point parentScreen = parent.getLocationOnScreen(); screen.translate(parentScreen.x, parentScreen.y); } return screen; }
|
public Point getLocationOnScreen() { final Point screen = new Point(location); final Component parent = component.getParent(); if (parent != null) { final Point parentScreen = parent.getLocationOnScreen(); screen.translate(parentScreen.x, parentScreen.y); } return screen; }
| 1,529
|
public Image createImage(ImageProducer producer) { return new JNodeImage(producer); }
|
public Image createImage(ImageProducer producer) { return new JNodeImage(producer); }
| 1,530
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "[] value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
| 1,534
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "[en_US] value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
| 1,535
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
| 1,536
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr", "FR" ), "key3" ); assertEquals( "value1", s5 ); }
| 1,537
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: fr-FR", s5, "[fr] value3" ); String s6 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "Unable to retrieve localized properties for locale: default", "[] value1", s6 ); Locale old = Locale.getDefault(); Locale.setDefault(Locale.FRENCH); try { String s7 = i18n.getString( "org.codehaus.plexus.i18n.i18n", Locale.ENGLISH, "key1" ); assertEquals( "Not picking up new default locale: fr", "[fr] value1", s7 ); String s8 = i18n.getString( "org.codehaus.plexus.i18n.i18n", Locale.ITALIAN, "key1" ); assertEquals( "Unable to retrieve localized properties for locale: it", "[it] value1", s8 ); } finally { Locale.setDefault(old); } }
| 1,538
|
private void showPopupMenu(MouseEvent me) { JPopupMenu jpm = new JPopupMenu(); JMenuItem menuItem; Action action; final int row = spools.rowAtPoint(me.getPoint()); final int col = spools.convertColumnIndexToModel( spools.columnAtPoint(me.getPoint()));// System.out.println(" column clicked " + col);// System.out.println(" column clicked to model " + spools.convertColumnIndexToModel(col)); action = new AbstractAction(LangTool.getString("spool.optionView")) { public void actionPerformed(ActionEvent e) { System.out.println(row + " is selected "); spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater( new Runnable () { public void run() { displayViewer(getSpooledFile(row)); } } ); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionProps")) { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null,"Not Available yet","Not yet", JOptionPane.WARNING_MESSAGE); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionExport")) { public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); } }; jpm.add(action); jpm.addSeparator(); switch (col) { case 0: case 3: case 6: action = new AbstractAction(LangTool.getString("spool.labelFilter")) { public void actionPerformed(ActionEvent e) { setFilter(row,col); } }; jpm.add(action); jpm.addSeparator(); break; } action = new AbstractAction(LangTool.getString("spool.optionHold")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionRelease")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionDelete")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); GUIGraphicsUtils.positionPopup(spools,jpm,me.getX(),me.getY()); }
|
private void showPopupMenu(MouseEvent me) { JPopupMenu jpm = new JPopupMenu(); JMenuItem menuItem; Action action; final int row = spools.rowAtPoint(me.getPoint()); final int col = spools.convertColumnIndexToModel( spools.columnAtPoint(me.getPoint()));// System.out.println(" column clicked " + col);// System.out.println(" column clicked to model " + spools.convertColumnIndexToModel(col)); action = new AbstractAction(LangTool.getString("spool.optionView")) { public void actionPerformed(ActionEvent e) { System.out.println(row + " is selected "); spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater( new Runnable () { public void run() { displayViewer(getSpooledFile(row)); } } ); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionProps")) { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null,"Not Available yet","Not yet", JOptionPane.WARNING_MESSAGE); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionExport")) { public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.setVisible(true); } }; jpm.add(action); jpm.addSeparator(); switch (col) { case 0: case 3: case 6: action = new AbstractAction(LangTool.getString("spool.labelFilter")) { public void actionPerformed(ActionEvent e) { setFilter(row,col); } }; jpm.add(action); jpm.addSeparator(); break; } action = new AbstractAction(LangTool.getString("spool.optionHold")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionRelease")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionDelete")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); GUIGraphicsUtils.positionPopup(spools,jpm,me.getX(),me.getY()); }
| 1,539
|
public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); }
|
public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.setVisible(true); }
| 1,540
|
public NoSuchMethodException() { super(); }
|
public NoSuchMethodException() { super(); }
| 1,541
|
public NoSuchAlgorithmException(String msg) { super(msg); }
|
public NoSuchAlgorithmException() { super(msg); }
| 1,542
|
public NoSuchAlgorithmException(String msg) { super(msg); }
|
public NoSuchAlgorithmException(String msg) { }
| 1,543
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection inElements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
| 1,544
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = inElements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
| 1,545
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!this.elements.contains (o)) { elements.add (o); } } }
| 1,546
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { this.elements.add (o); } } }
| 1,547
|
public synchronized boolean contains (final Object element) { return elements.remove (element); }
|
public synchronized boolean contains (final Object element) { return elements.contains (element); }
| 1,548
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors y = y + getShift(); g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
| 1,549
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(MetalLookAndFeel.getPrimaryControl()); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
| 1,550
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y + 3, x, y + 12); g.drawLine(x, y + 12, x + 15, y + 12); g.drawLine(x + 15, y + 12, x + 15, y + 2); g.drawLine(x + 14, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 2, x + 1, y + 2); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 4, 7, 8); g.fillRect(x + 9, y + 5, 6, 7); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 9, y + 2, x + 14, y + 2); g.setColor(new Color(50, 50, 120)); g.drawLine(x + 9, y + 1, x + 15, y + 1); g.drawLine(x + 10, y, x + 15, y); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y + 3, x, y + 12); g.drawLine(x, y + 12, x + 15, y + 12); g.drawLine(x + 15, y + 12, x + 15, y + 2); g.drawLine(x + 14, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 2, x + 1, y + 2); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 4, 7, 8); g.fillRect(x + 9, y + 5, 6, 7); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 9, y + 2, x + 14, y + 2); g.setColor(new Color(50, 50, 120)); g.drawLine(x + 9, y + 1, x + 15, y + 1); g.drawLine(x + 10, y, x + 15, y); }
| 1,551
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 1,552
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 1,553
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(MetalLookAndFeel.getWhite()); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 1,554
|
public boolean equals(Object obj) { return (obj instanceof SmallAttributeSet) && this.isEqual((AttributeSet)obj); }
|
public boolean equals(Object obj) { return (obj instanceof AttributeSet) && this.isEqual((AttributeSet)obj); }
| 1,555
|
public final static void setMacro(String name, String keyStrokes) { int x = 0; while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; saveMacros(); }
|
public final static void setMacro(String name, String keyStrokes) { int x = 0; while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; saveMacros(); }
| 1,556
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
| 1,557
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len;
| 1,558
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems + 1); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
| 1,559
|
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
|
protected DatagramSocket(DatagramSocketImpl impl) { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
| 1,562
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.