rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
g.drawChars(sChar, 0, 1, x+1, cy -2); | if (sChar[0] == 0x1C) g.drawChars(dupChar, 0, 1, x+1, cy -2); else g.drawChars(sChar, 0, 1, x+1, cy -2); | public final void drawChar(Graphics2D g) { if (attributePlace && s.getShowHex()) { Font f = g.getFont(); Font k = f.deriveFont(f.getSize2D()/2); g.setFont(k); g.setColor(s.colorHexAttr); char[] a = Integer.toHexString(attr).toCharArray(); g.drawChars(a, 0, 1, x, y + (int)(s.fmHeight /2)); g.drawChars(a, 1, 1, x+(int)(s.fmWidth/2), (int)(y + s.fmHeight - (s.lm.getDescent() + s.lm.getLeading())-2)); g.setFont(f); } if(!nonDisplay && !attributePlace) { if (!useGui) { g.setColor(bg); g.fill(cArea); } else { if (bg == s.colorBg && whichGui >= FIELD_LEFT && whichGui <= FIELD_ONE) g.setColor(s.colorGUIField); else g.setColor(bg); g.fill(cArea); } if (useGui && (whichGui < FIELD_LEFT)) { int w = 0; g.setColor(fg); switch (whichGui) { case UPPER_LEFT: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpperLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinUpperLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case UPPER: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpper(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinUpper(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case UPPER_RIGHT: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpperRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinUpperRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case LEFT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); g.drawLine(x + s.fmWidth / 2, y, x + s.fmWidth / 2, y + s.fmHeight); } } break; case RIGHT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case LOWER_LEFT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLowerLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinLowerLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case BOTTOM: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinBottom(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinBottom(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case LOWER_RIGHT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLowerRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinLowerRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; } } else { if (sChar[0] != 0x0) { // use this until we define colors for gui stuff if ((useGui && whichGui < BUTTON_LEFT) && (fg == s.colorGUIField)) g.setColor(Color.black); else g.setColor(fg); try { if (useGui) g.drawChars(sChar, 0, 1, x+1, cy -2); else g.drawChars(sChar, 0, 1, x, cy -2); } catch (IllegalArgumentException iae) { System.out.println(" ScreenChar iae " + iae.getMessage()); } } if(underLine ) { if (!useGui || s.guiShowUnderline) { g.setColor(fg);// g.drawLine(x, cy -2, (int)(x + s.fmWidth), cy -2); g.drawLine(x, (int)(y + (s.fmHeight - s.lm.getLeading()-5)), (int)(x + s.fmWidth), (int)(y + (s.fmHeight - s.lm.getLeading())-5)); } } if(colSep) { g.setColor(s.colorSep); switch (s.getColSepLine()) { case 1: g.drawLine(x, y + s.fmHeight - (int)s.lm.getLeading()-4, x, y + s.fmHeight); g.drawLine(x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-4, x + s.fmWidth - 1, y + s.fmHeight); break; case 2: g.drawLine(x, y + s.fmHeight - (int)s.lm.getLeading()-3, x, y + s.fmHeight - (int)s.lm.getLeading()-4); g.drawLine(x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-3, x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-4); break; default: g.setColor(fg); g.drawLine(x, y, x, y + s.fmHeight - 1); g.drawLine(x + s.fmWidth - 1, y, x + s.fmWidth - 1, y + s.fmHeight); break; } } } } if (useGui & (whichGui >= FIELD_LEFT)) { int w = 0; switch (whichGui) { case FIELD_LEFT: GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case FIELD_MIDDLE: GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case FIELD_RIGHT: GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case FIELD_ONE: GUIGraphicsUtils.draw3DOne(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case BUTTON_LEFT: case BUTTON_LEFT_UP: case BUTTON_LEFT_DN: case BUTTON_LEFT_EB: GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.RAISED, x,y, s.fmWidth,s.fmHeight); break; case BUTTON_MIDDLE: case BUTTON_MIDDLE_UP: case BUTTON_MIDDLE_DN: case BUTTON_MIDDLE_EB: GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.RAISED, x,y, s.fmWidth,s.fmHeight); break; case BUTTON_RIGHT: case BUTTON_RIGHT_UP: case BUTTON_RIGHT_DN: case BUTTON_RIGHT_EB: GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.RAISED, x,y, s.fmWidth,s.fmHeight); break; // scroll bar case BUTTON_SB_UP: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 1, x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_DN: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 2, x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_GUIDE: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 0,x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_THUMB: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 3,x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; } } } |
g.drawChars(sChar, 0, 1, x, cy -2); | if (sChar[0] == 0x1C) g.drawChars(dupChar, 0, 1, x, cy -2); else g.drawChars(sChar, 0, 1, x, cy -2); | public final void drawChar(Graphics2D g) { if (attributePlace && s.getShowHex()) { Font f = g.getFont(); Font k = f.deriveFont(f.getSize2D()/2); g.setFont(k); g.setColor(s.colorHexAttr); char[] a = Integer.toHexString(attr).toCharArray(); g.drawChars(a, 0, 1, x, y + (int)(s.fmHeight /2)); g.drawChars(a, 1, 1, x+(int)(s.fmWidth/2), (int)(y + s.fmHeight - (s.lm.getDescent() + s.lm.getLeading())-2)); g.setFont(f); } if(!nonDisplay && !attributePlace) { if (!useGui) { g.setColor(bg); g.fill(cArea); } else { if (bg == s.colorBg && whichGui >= FIELD_LEFT && whichGui <= FIELD_ONE) g.setColor(s.colorGUIField); else g.setColor(bg); g.fill(cArea); } if (useGui && (whichGui < FIELD_LEFT)) { int w = 0; g.setColor(fg); switch (whichGui) { case UPPER_LEFT: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpperLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinUpperLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case UPPER: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpper(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinUpper(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case UPPER_RIGHT: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpperRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinUpperRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case LEFT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); g.drawLine(x + s.fmWidth / 2, y, x + s.fmWidth / 2, y + s.fmHeight); } } break; case RIGHT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case LOWER_LEFT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLowerLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinLowerLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case BOTTOM: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinBottom(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinBottom(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; case LOWER_RIGHT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLowerRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,s.fmWidth,s.fmHeight); } else { GUIGraphicsUtils.drawWinLowerRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,s.fmWidth,s.fmHeight); } } break; } } else { if (sChar[0] != 0x0) { // use this until we define colors for gui stuff if ((useGui && whichGui < BUTTON_LEFT) && (fg == s.colorGUIField)) g.setColor(Color.black); else g.setColor(fg); try { if (useGui) g.drawChars(sChar, 0, 1, x+1, cy -2); else g.drawChars(sChar, 0, 1, x, cy -2); } catch (IllegalArgumentException iae) { System.out.println(" ScreenChar iae " + iae.getMessage()); } } if(underLine ) { if (!useGui || s.guiShowUnderline) { g.setColor(fg);// g.drawLine(x, cy -2, (int)(x + s.fmWidth), cy -2); g.drawLine(x, (int)(y + (s.fmHeight - s.lm.getLeading()-5)), (int)(x + s.fmWidth), (int)(y + (s.fmHeight - s.lm.getLeading())-5)); } } if(colSep) { g.setColor(s.colorSep); switch (s.getColSepLine()) { case 1: g.drawLine(x, y + s.fmHeight - (int)s.lm.getLeading()-4, x, y + s.fmHeight); g.drawLine(x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-4, x + s.fmWidth - 1, y + s.fmHeight); break; case 2: g.drawLine(x, y + s.fmHeight - (int)s.lm.getLeading()-3, x, y + s.fmHeight - (int)s.lm.getLeading()-4); g.drawLine(x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-3, x + s.fmWidth - 1, y + s.fmHeight - (int)s.lm.getLeading()-4); break; default: g.setColor(fg); g.drawLine(x, y, x, y + s.fmHeight - 1); g.drawLine(x + s.fmWidth - 1, y, x + s.fmWidth - 1, y + s.fmHeight); break; } } } } if (useGui & (whichGui >= FIELD_LEFT)) { int w = 0; switch (whichGui) { case FIELD_LEFT: GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case FIELD_MIDDLE: GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case FIELD_RIGHT: GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case FIELD_ONE: GUIGraphicsUtils.draw3DOne(g, GUIGraphicsUtils.INSET, x,y, s.fmWidth,s.fmHeight); break; case BUTTON_LEFT: case BUTTON_LEFT_UP: case BUTTON_LEFT_DN: case BUTTON_LEFT_EB: GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.RAISED, x,y, s.fmWidth,s.fmHeight); break; case BUTTON_MIDDLE: case BUTTON_MIDDLE_UP: case BUTTON_MIDDLE_DN: case BUTTON_MIDDLE_EB: GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.RAISED, x,y, s.fmWidth,s.fmHeight); break; case BUTTON_RIGHT: case BUTTON_RIGHT_UP: case BUTTON_RIGHT_DN: case BUTTON_RIGHT_EB: GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.RAISED, x,y, s.fmWidth,s.fmHeight); break; // scroll bar case BUTTON_SB_UP: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 1, x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_DN: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 2, x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_GUIDE: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 0,x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_THUMB: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 3,x,y, s.fmWidth,s.fmHeight, s.colorWhite,s.colorBg); break; } } } |
protected void setPrehelpState(boolean setErrorCode) { | protected void setPrehelpState(boolean setErrorCode, boolean lockKeyboard, boolean unlockIfLocked) { | protected void setPrehelpState(boolean setErrorCode) { statusErrorCode = setErrorCode; setKeyboardLocked(setErrorCode); bufferedKeys = null; keysBuffered = false; setKBIndicatorOff(); } |
setKeyboardLocked(setErrorCode); | if (isKeyboardLocked() && unlockIfLocked) setKeyboardLocked(false); else setKeyboardLocked(lockKeyboard); | protected void setPrehelpState(boolean setErrorCode) { statusErrorCode = setErrorCode; setKeyboardLocked(setErrorCode); bufferedKeys = null; keysBuffered = false; setKBIndicatorOff(); } |
setPrehelpState(true); | setPrehelpState(true,true,false); | public void setStatus(byte attr,byte value,String s) { statusString = s; // draw the status information bi.setStatus(attr,value,s, fmWidth, fmHeight, lm, font, colorBg, colorRed, colorWhite); // set environment variables switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { setPrehelpState(true); Toolkit.getDefaultToolkit().beep(); } else { setPrehelpState(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); } |
setPrehelpState(false); | setPrehelpState(false,true,true); | public void setStatus(byte attr,byte value,String s) { statusString = s; // draw the status information bi.setStatus(attr,value,s, fmWidth, fmHeight, lm, font, colorBg, colorRed, colorWhite); // set environment variables switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { setPrehelpState(true); Toolkit.getDefaultToolkit().beep(); } else { setPrehelpState(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); } |
} setKBIndicatorOff(); | setCursorOn(); } else { setPrehelpState(false,isKeyboardLocked(),false); } | 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 : if (isStatusErrorCode()) { restoreErrorLine(); setStatus(STATUS_ERROR_CODE,STATUS_VALUE_OFF,""); isInField(lastPos); updateDirty(); } setKBIndicatorOff(); simulated = true; break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; case DUP_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.isCurrentFieldDupEnabled()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().setFieldChar(lastPos,(char)0x1C); screenFields.setCurrentFieldMDT(); gotoFieldNext(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_DUP_KEY_NOT_ALLOWED); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case NEW_LINE : if (screenFields.getSize() > 0) { int startRow = getRow(lastPos) + 1; int startPos = lastPos; boolean isthere = false; setCursorOff(); if (startRow == getRows()) startRow = 0; goto_XY(++startRow,1); if (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { while (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { // lets keep going advancePos(); // Have we looped the screen? if (lastPos == startPos) { // if so then go back to starting point goto_XY(startPos); break; } } } setCursorOn(); } simulated = true; break; case JUMP_NEXT_SESS : gui.nextSession(); simulated = true; break; case JUMP_PREV_SESS : gui.prevSession(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; } |
if (delegate == null) throw new IllegalArgumentException("Null 'delegate' argument."); | public IconUIResource(Icon delegate) { this.delegate = delegate; } |
|
else { if (sess.getCount() == 0) System.exit(0); } | void startNewSession() { int result = 2; String sel = ""; if (sessionArgs != null && !sessionArgs[0].startsWith("-")) sel = sessionArgs[0]; else { sel = getDefaultSession(); } Sessions sess = manager.getSessions(); if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)){ sessionArgs = new String[NUM_PARMS]; parseArgs((String)sessions.getProperty(sel), sessionArgs); } if (sessionArgs == null || sess.getCount() > 0) { sel = getConnectSession(); if (sel != null) { String selArgs = sessions.getProperty(sel); sessionArgs = new String[NUM_PARMS]; parseArgs(selArgs, sessionArgs); if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } } else { if (!frame.isVisible()) frame.setVisible(true); newSession(sel,sessionArgs); } } |
|
if (!initStageDone) super.addImpl(comp, constraints, index); | if (isRootPaneCheckingEnabled()) getContentPane().add(comp,constraints,index); | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components " + "disallowed."); getContentPane().add(comp,constraints,index); } } |
{ if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components " + "disallowed."); getContentPane().add(comp,constraints,index); } | super.addImpl(comp, constraints, index); | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding in the initialization stage use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("rootPaneChecking is enabled - adding components " + "disallowed."); getContentPane().add(comp,constraints,index); } } |
initStageDone = true; | setRootPaneCheckingEnabled(true); | protected void frameInit() { super.setLayout(new BorderLayout(1, 1)); enableEvents(AWTEvent.WINDOW_EVENT_MASK); getRootPane(); // will do set/create // We're now done the init stage. initStageDone = true; } |
if (initStageDone) { | public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); } |
|
throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); | public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); } |
|
} | public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); } |
|
hostFile.setText(ftpProtocol.getFullFileName(hostFile.getText())); | public void fileInfoReceived(FTPStatusEvent statusevent) { if (allFields.isSelected()) { doTransfer(); } else { selectFields(); } } |
|
this(SwingConstants.HORIZONTAL); | BasicHorizontalLayoutManager() { // Nothing to do here. } |
|
return containerSize.width - insets.left - insets.right; | int size; if (axis == SwingConstants.HORIZONTAL) size = containerSize.width - insets.left - insets.right; else size = containerSize.height - insets.top - insets.bottom; return size; | protected int getAvailableSize(Dimension containerSize, Insets insets) { return containerSize.width - insets.left - insets.right; } |
return insets.left; return 0; | { if (axis == SwingConstants.HORIZONTAL) loc = insets.left; else loc = insets.top; } return loc; | protected int getInitialLocation(Insets insets) { if (insets != null) return insets.left; return 0; } |
return dims.width; return 0; | size = dims.height; } return size; | protected int getPreferredSizeOfComponent(Component c) { Dimension dims = c.getPreferredSize(); if (dims != null) return dims.width; return 0; } |
return c.getWidth(); | int size; if (axis == SwingConstants.HORIZONTAL) size = c.getHeight(); else size = c.getWidth(); return size; | protected int getSizeOfComponent(Component c) { return c.getWidth(); } |
Insets insets = target.getInsets(); int height = 0; int width = 0; | int primary = 0; int secondary = 0; | public Dimension minimumLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getMinimumSize(); if (dims != null) { width += dims.width; height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
if (components[i] == null) continue; Dimension dims = components[i].getMinimumSize(); if (dims != null) | if (components[i] != null) | public Dimension minimumLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getMinimumSize(); if (dims != null) { width += dims.width; height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
width += dims.width; height = Math.max(height, dims.height); | Dimension dims = components[i].getMinimumSize(); primary += axis == SwingConstants.HORIZONTAL ? dims.width : dims.height; int sec = axis == SwingConstants.HORIZONTAL ? dims.height : dims.width; secondary = Math.max(sec, secondary); | public Dimension minimumLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getMinimumSize(); if (dims != null) { width += dims.width; height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
return new Dimension(width, height); | int width = axis == SwingConstants.HORIZONTAL ? primary : secondary; int height = axis == SwingConstants.VERTICAL ? secondary : primary; Insets i = splitPane.getInsets(); dim.setSize(width + i.left + i.right, height + i.top + i.bottom); | public Dimension minimumLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getMinimumSize(); if (dims != null) { width += dims.width; height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
return null; | return dim; | public Dimension minimumLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getMinimumSize(); if (dims != null) { width += dims.width; height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
return dims.width; | if (axis == SwingConstants.HORIZONTAL) size = dims.width; | int minimumSizeOfComponent(int index) { Dimension dims = components[index].getMinimumSize(); if (dims != null) return dims.width; else return 0; } |
return 0; | size = dims.height; return size; | int minimumSizeOfComponent(int index) { Dimension dims = components[index].getMinimumSize(); if (dims != null) return dims.width; else return 0; } |
Insets insets = target.getInsets(); int height = 0; int width = 0; | int primary = 0; int secondary = 0; | public Dimension preferredLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getPreferredSize(); if (dims != null) { width += dims.width; if (!(components[i] instanceof BasicSplitPaneDivider)) height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
if (components[i] == null) continue; Dimension dims = components[i].getPreferredSize(); if (dims != null) | if (components[i] != null) | public Dimension preferredLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getPreferredSize(); if (dims != null) { width += dims.width; if (!(components[i] instanceof BasicSplitPaneDivider)) height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
width += dims.width; if (!(components[i] instanceof BasicSplitPaneDivider)) height = Math.max(height, dims.height); | Dimension dims = components[i].getPreferredSize(); primary += axis == SwingConstants.HORIZONTAL ? dims.width : dims.height; int sec = axis == SwingConstants.HORIZONTAL ? dims.height : dims.width; secondary = Math.max(sec, secondary); | public Dimension preferredLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getPreferredSize(); if (dims != null) { width += dims.width; if (!(components[i] instanceof BasicSplitPaneDivider)) height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
return new Dimension(width, height); | int width = axis == SwingConstants.HORIZONTAL ? primary : secondary; int height = axis == SwingConstants.VERTICAL ? secondary : primary; Insets i = splitPane.getInsets(); dim.setSize(width + i.left + i.right, height + i.top + i.bottom); | public Dimension preferredLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getPreferredSize(); if (dims != null) { width += dims.width; if (!(components[i] instanceof BasicSplitPaneDivider)) height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
return null; | return dim; | public Dimension preferredLayoutSize(Container target) { if (target instanceof JSplitPane) { JSplitPane split = (JSplitPane) target; Insets insets = target.getInsets(); int height = 0; int width = 0; for (int i = 0; i < components.length; i++) { if (components[i] == null) continue; Dimension dims = components[i].getPreferredSize(); if (dims != null) { width += dims.width; if (!(components[i] instanceof BasicSplitPaneDivider)) height = Math.max(height, dims.height); } } return new Dimension(width, height); } return null; } |
int w = size; int h = containerSize.height - insets.top - insets.bottom; int x = location; int y = insets.top; c.setBounds(x, y, w, h); | if (insets != null) { if (axis == SwingConstants.HORIZONTAL) c.setBounds(location, insets.top, size, containerSize.height - insets.top - insets.bottom); else c.setBounds(insets.left, location, containerSize.width - insets.left - insets.right, size); } else { if (axis == SwingConstants.HORIZONTAL) c.setBounds(location, 0, size, containerSize.height); else c.setBounds(0, location, containerSize.width, size); } | protected void setComponentToSize(Component c, int size, int location, Insets insets, Dimension containerSize) { int w = size; int h = containerSize.height - insets.top - insets.bottom; int x = location; int y = insets.top; c.setBounds(x, y, w, h); } |
resetSizeAt(2); | protected void updateComponents() { Component left = splitPane.getLeftComponent(); Component right = splitPane.getRightComponent(); if (left != null) { components[0] = left; resetSizeAt(0); } if (right != null) { components[1] = right; resetSizeAt(1); } components[2] = divider; resetSizeAt(2); } |
|
splitPane.setDividerSize(UIManager.getInt("SplitPane.dividerSize")); | dividerSize = UIManager.getInt("SplitPane.dividerSize"); splitPane.setDividerSize(dividerSize); divider.setDividerSize(dividerSize); | protected void installDefaults() { LookAndFeel.installColors(splitPane, "SplitPane.background", "SplitPane.foreground"); LookAndFeel.installBorder(splitPane, "SplitPane.border"); divider = createDefaultDivider(); divider.setBorder(UIManager.getBorder("SplitPaneDivider.border")); resetLayoutManager(); nonContinuousLayoutDivider = createDefaultNonContinuousLayoutDivider(); splitPane.add(divider, JSplitPane.DIVIDER); // There is no need to add the nonContinuousLayoutDivider splitPane.setDividerSize(UIManager.getInt("SplitPane.dividerSize")); splitPane.setOpaque(true); } |
if (sequence - 1 > 0) setTitle("tn5250j <" + sequence + "> - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); | private void setTitle() { if (sequence - 1 > 0) setTitle("tn5250j <" + sequence + "> - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (getSessionAt(selectedIndex) != null && getSessionAt(selectedIndex).getAllocDeviceName() != null) setTitle(getTitle() + " - " + getSessionAt(selectedIndex).getAllocDeviceName()); } |
|
setTitle(getTitle() + " - " + getSessionAt(selectedIndex).getAllocDeviceName()); | setTitle(getSessionAt(selectedIndex).getAllocDeviceName()); if (sequence - 1 > 0) setTitle(getTitle() + " - tn5250j <" + sequence + "> - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle(getTitle() + " - tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); | private void setTitle() { if (sequence - 1 > 0) setTitle("tn5250j <" + sequence + "> - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle("tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); if (getSessionAt(selectedIndex) != null && getSessionAt(selectedIndex).getAllocDeviceName() != null) setTitle(getTitle() + " - " + getSessionAt(selectedIndex).getAllocDeviceName()); } |
setTitle(); | public void stateChanged(ChangeEvent e) { JTabbedPane p = (JTabbedPane)e.getSource(); p.setForegroundAt(selectedIndex,Color.black); p.setIconAt(selectedIndex,unfocused); Session sg = (Session)p.getComponentAt(selectedIndex); sg.setVisible(false); sg = (Session)p.getSelectedComponent(); if (sg == null) return; sg.setVisible(true); sg.grabFocus(); selectedIndex = p.getSelectedIndex(); p.setForegroundAt(selectedIndex,Color.blue); p.setIconAt(selectedIndex,focused); } |
|
public void connect(Stub self, javax.rmi.ORB orb) | public void connect(Stub self, ORB orb) | public void connect(Stub self, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for StubDelegate"); } |
throw new Error("Not implemented for StubDelegate"); | connect(self, orb, null); | public void connect(Stub self, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for StubDelegate"); } |
public boolean equals(Stub self, Object obj) | public boolean equals(Stub self, java.lang.Object obj) | public boolean equals(Stub self, Object obj) { if(self == null || obj == null) return self == obj; if(!(obj instanceof Stub)) return false; return self.hashCode() == ((Stub)obj).hashCode(); } |
if(self == null || obj == null) return self == obj; if(!(obj instanceof Stub)) return false; return self.hashCode() == ((Stub)obj).hashCode(); | if (obj instanceof ObjectImpl) { ObjectImpl other = (ObjectImpl) obj; Delegate d1 = other._get_delegate(); Delegate d2 = self._get_delegate(); if (d1 == null || d2 == null) return d1 == d2; else return d1.equals(d2); } else return false; | public boolean equals(Stub self, Object obj) { if(self == null || obj == null) return self == obj; if(!(obj instanceof Stub)) return false; return self.hashCode() == ((Stub)obj).hashCode(); } |
return hashCode; | Delegate d = self._get_delegate(); return d==null?0:d.hashCode(); | public int hashCode(Stub self) { //FIX ME return hashCode; } |
public void readObject(Stub self, ObjectInputStream s) | public void readObject(Stub self, ObjectInputStream input) | public void readObject(Stub self, ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("Not implemented for StubDelegate"); } |
throw new Error("Not implemented for StubDelegate"); | readObject(self, input, null); | public void readObject(Stub self, ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("Not implemented for StubDelegate"); } |
catch(javax.rmi.BAD_OPERATION bad_operation) | catch (Exception ex) | public String toString(Stub self) { try { return self._orb().object_to_string(self); } // XXX javax.rmi.BAD_OPERATION -> org.omg.CORBA.BAD_OPERATION catch(javax.rmi.BAD_OPERATION bad_operation) { return null; } } |
public void writeObject(Stub self, ObjectOutputStream s) | public void writeObject(Stub self, ObjectOutputStream output) | public void writeObject(Stub self, ObjectOutputStream s) throws IOException { throw new Error("Not implemented for StubDelegate"); } |
throw new Error("Not implemented for StubDelegate"); | writeObject(self, output, null); | public void writeObject(Stub self, ObjectOutputStream s) throws IOException { throw new Error("Not implemented for StubDelegate"); } |
setLayout(new MetalDividerLayout()); | public MetalSplitPaneDivider(MetalSplitPaneUI ui, Color light, Color dark) { super(ui); setLayout(new MetalDividerLayout()); this.splitPane = super.splitPane; this.orientation = super.orientation; this.light = light; this.dark = dark; } |
|
MetalUtils.fillMetalPattern(splitPane, g, 2, 2, s.width - 4, s.height - 4, | Insets i = getInsets(); MetalUtils.fillMetalPattern(splitPane, g, i.left + 2, i.top + 2, s.width - i.left - i.right - 4, s.height - i.top - i.bottom - 4, | public void paint(Graphics g) { Dimension s = getSize(); if (splitPane.hasFocus()) { g.setColor(UIManager.getColor("SplitPane.dividerFocusColor")); g.fillRect(0, 0, s.width, s.height); } // Paint border if one exists. Border border = getBorder(); if (border != null) border.paintBorder(this, g, 0, 0, s.width, s.height); MetalUtils.fillMetalPattern(splitPane, g, 2, 2, s.width - 4, s.height - 4, light, dark); if (splitPane.isOneTouchExpandable()) { ((BasicArrowButton) rightButton).paint(g); ((BasicArrowButton) leftButton).paint(g); } } |
if (splitPane.isOneTouchExpandable()) { ((BasicArrowButton) rightButton).paint(g); ((BasicArrowButton) leftButton).paint(g); } | super.paint(g); | public void paint(Graphics g) { Dimension s = getSize(); if (splitPane.hasFocus()) { g.setColor(UIManager.getColor("SplitPane.dividerFocusColor")); g.fillRect(0, 0, s.width, s.height); } // Paint border if one exists. Border border = getBorder(); if (border != null) border.paintBorder(this, g, 0, 0, s.width, s.height); MetalUtils.fillMetalPattern(splitPane, g, 2, 2, s.width - 4, s.height - 4, light, dark); if (splitPane.isOneTouchExpandable()) { ((BasicArrowButton) rightButton).paint(g); ((BasicArrowButton) leftButton).paint(g); } } |
public SortingFocusTraversalPolicy(Comparator comparator) | protected SortingFocusTraversalPolicy() | public SortingFocusTraversalPolicy(Comparator comparator) { this.comparator = comparator; } |
this.comparator = comparator; | public SortingFocusTraversalPolicy(Comparator comparator) { this.comparator = comparator; } |
|
return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), P2.getX(), P2.getY()); | CubicSegment segment = null; try { segment = (CubicSegment) super.clone(); segment.P1 = (Point2D) P1.clone(); segment.P2 = (Point2D) P2.clone(); segment.cp1 = (Point2D) cp1.clone(); segment.cp2 = (Point2D) cp2.clone(); } catch (CloneNotSupportedException cnse) { InternalError ie = new InternalError(); ie.initCause(cnse); throw ie; } return segment; | public Object clone() { return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), P2.getX(), P2.getY()); } |
first = this; | public Segment() { P1 = P2 = null; next = null; last = this; } |
|
int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); | int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); | protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } } } |
((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } | } while(numberOfAxes-- > 0) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); indent = indent.substring(0,indent.length() - Specification.getInstance().getPrettyXDFOutputIndentation().length()); writeOut(outputstream, indent); } writeOut(outputstream, "</for>"); | protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } } } |
setBorder(tmpBorder); | public BasicSplitPaneDivider(BasicSplitPaneUI ui) { setLayout(new DividerLayout()); setBasicSplitPaneUI(ui); setDividerSize(splitPane.getDividerSize()); setBorder(tmpBorder); } |
|
splitPane.removeMouseListener(mouseHandler); splitPane.removeMouseMotionListener(mouseHandler); | public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) { /* Remove the connection to the existing JSplitPane. */ if (splitPane != null) { splitPane.removePropertyChangeListener(this); splitPane.removeMouseListener(mouseHandler); splitPane.removeMouseMotionListener(mouseHandler); removeMouseListener(mouseHandler); removeMouseMotionListener(mouseHandler); splitPane = null; hiddenDivider = null; } /* Establish the connection to the new JSplitPane. */ splitPaneUI = newUI; if (splitPaneUI != null) splitPane = newUI.getSplitPane(); if (splitPane != null) { splitPane.addPropertyChangeListener(this); splitPane.addMouseListener(mouseHandler); splitPane.addMouseMotionListener(mouseHandler); addMouseListener(mouseHandler); addMouseMotionListener(mouseHandler); hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider(); orientation = splitPane.getOrientation(); oneTouchExpandableChanged(); } } |
|
splitPane.addMouseListener(mouseHandler); splitPane.addMouseMotionListener(mouseHandler); | public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) { /* Remove the connection to the existing JSplitPane. */ if (splitPane != null) { splitPane.removePropertyChangeListener(this); splitPane.removeMouseListener(mouseHandler); splitPane.removeMouseMotionListener(mouseHandler); removeMouseListener(mouseHandler); removeMouseMotionListener(mouseHandler); splitPane = null; hiddenDivider = null; } /* Establish the connection to the new JSplitPane. */ splitPaneUI = newUI; if (splitPaneUI != null) splitPane = newUI.getSplitPane(); if (splitPane != null) { splitPane.addPropertyChangeListener(this); splitPane.addMouseListener(mouseHandler); splitPane.addMouseMotionListener(mouseHandler); addMouseListener(mouseHandler); addMouseMotionListener(mouseHandler); hiddenDivider = splitPaneUI.getNonContinuousLayoutDivider(); orientation = splitPane.getOrientation(); oneTouchExpandableChanged(); } } |
|
data = mouseChannel.read(50); | data = mouseChannel.read(COMMAND_TIMEOUT); | final boolean writeMouseCommand(int cmd) throws DeviceException { // First clear the mouse channel, otherwise we might read // old data back mouseChannel.clear(); // Transmit the command writeController(CCMD_WRITE_MOUSE); writeData(cmd); int data; try { data = mouseChannel.read(50); } catch (IOException ex) { log.debug("IOException in readMouse", ex); return false; } catch (TimeoutException ex) { log.debug("Timeout in readMouse"); return false; } catch (InterruptedException ex) { log.debug("Interrupted in readMouse"); return false; } if (data == REPLY_ACK) { return true; // command acknowledged } else if (data == REPLY_RESEND) { log.debug("Mouse replied with RESEND"); } else { log.debug("Invalid reply 0x" + Integer.toHexString(data)); } return false; // on error } |
} | public UIDefaults getDefaults() { if (LAF_defaults == null) LAF_defaults = super.getDefaults(); // add custom theme entries to the table theme.addCustomEntriesToTable(LAF_defaults); // Returns the default values for this look and feel. return LAF_defaults; } |
|
return (obj != null) && (obj instanceof SimpleAttributeSet) && ((SimpleAttributeSet)obj).tab.equals(this.tab); | return (obj instanceof AttributeSet) && this.isEqual((AttributeSet) obj); | public boolean equals(Object obj) { return (obj != null) && (obj instanceof SimpleAttributeSet) && ((SimpleAttributeSet)obj).tab.equals(this.tab); } |
return this.equals(attr); | return attr != null && attr.containsAttributes(this) && this.containsAttributes(attr); | public boolean isEqual(AttributeSet attr) { return this.equals(attr); } |
else if ("file".equals(newUrl.getProtocol())) | else if ("file".equals(protocol)) | private void addURLImpl(URL newUrl) { synchronized (urlloaders) { if (newUrl == null) return; // Silently ignore... // Check global cache to see if there're already url loader // for this url. URLLoader loader = (URLLoader) urlloaders.get(newUrl); if (loader == null) { String file = newUrl.getFile(); // Check that it is not a directory if (! (file.endsWith("/") || file.endsWith(File.separator))) loader = new JarURLLoader(this, newUrl); else if ("file".equals(newUrl.getProtocol())) loader = new FileURLLoader(this, newUrl); else loader = new RemoteURLLoader(this, newUrl); // Cache it. urlloaders.put(newUrl, loader); } urls.add(newUrl); urlinfos.add(loader); } } |
return (Class) AccessController.doPrivileged(new PrivilegedAction() | { return (Class)AccessController.doPrivileged (new PrivilegedAction() | protected Class findClass(final String className) throws ClassNotFoundException { // Just try to find the resource by the (almost) same name String resourceName = className.replace('.', '/') + ".class"; Resource resource = findURLResource(resourceName); if (resource == null) throw new ClassNotFoundException(className + " not found in " + urls); // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) try { byte[] data; InputStream in = resource.getInputStream(); try { int length = resource.getLength(); if (length != -1) { // We know the length of the data. // Just try to read it in all at once data = new byte[length]; int pos = 0; while (length - pos > 0) { int len = in.read(data, pos, length - pos); if (len == -1) throw new EOFException("Not enough data reading from: " + in); pos += len; } } else { // We don't know the data length. // Have to read it in chunks. ByteArrayOutputStream out = new ByteArrayOutputStream(4096); byte[] b = new byte[4096]; int l = 0; while (l != -1) { l = in.read(b); if (l != -1) out.write(b, 0, l); } data = out.toByteArray(); } } finally { in.close(); } final byte[] classData = data; // Now get the CodeSource final CodeSource source = resource.getCodeSource(); // Find out package name String packageName = null; int lastDot = className.lastIndexOf('.'); if (lastDot != -1) packageName = className.substring(0, lastDot); if (packageName != null && getPackage(packageName) == null) { // define the package Manifest manifest = resource.loader.getManifest(); if (manifest == null) definePackage(packageName, null, null, null, null, null, null, null); else definePackage(packageName, manifest, resource.loader.baseURL); } // And finally construct the class! SecurityManager sm = System.getSecurityManager(); if (sm != null && securityContext != null) return (Class) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return defineClass(className, classData, 0, classData.length, source); } }, securityContext); else return defineClass(className, classData, 0, classData.length, source); } catch (IOException ioe) { throw new ClassNotFoundException(className, ioe); } } |
} | protected Class findClass(final String className) throws ClassNotFoundException { // Just try to find the resource by the (almost) same name String resourceName = className.replace('.', '/') + ".class"; Resource resource = findURLResource(resourceName); if (resource == null) throw new ClassNotFoundException(className + " not found in " + urls); // Try to read the class data, create the CodeSource, Package and // construct the class (and watch out for those nasty IOExceptions) try { byte[] data; InputStream in = resource.getInputStream(); try { int length = resource.getLength(); if (length != -1) { // We know the length of the data. // Just try to read it in all at once data = new byte[length]; int pos = 0; while (length - pos > 0) { int len = in.read(data, pos, length - pos); if (len == -1) throw new EOFException("Not enough data reading from: " + in); pos += len; } } else { // We don't know the data length. // Have to read it in chunks. ByteArrayOutputStream out = new ByteArrayOutputStream(4096); byte[] b = new byte[4096]; int l = 0; while (l != -1) { l = in.read(b); if (l != -1) out.write(b, 0, l); } data = out.toByteArray(); } } finally { in.close(); } final byte[] classData = data; // Now get the CodeSource final CodeSource source = resource.getCodeSource(); // Find out package name String packageName = null; int lastDot = className.lastIndexOf('.'); if (lastDot != -1) packageName = className.substring(0, lastDot); if (packageName != null && getPackage(packageName) == null) { // define the package Manifest manifest = resource.loader.getManifest(); if (manifest == null) definePackage(packageName, null, null, null, null, null, null, null); else definePackage(packageName, manifest, resource.loader.baseURL); } // And finally construct the class! SecurityManager sm = System.getSecurityManager(); if (sm != null && securityContext != null) return (Class) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return defineClass(className, classData, 0, classData.length, source); } }, securityContext); else return defineClass(className, classData, 0, classData.length, source); } catch (IOException ioe) { throw new ClassNotFoundException(className, ioe); } } |
|
} | protected PermissionCollection getPermissions(CodeSource source) { // XXX - This implementation does exactly as the Javadoc describes. // But maybe we should/could use URLConnection.getPermissions()? // First get the permissions that would normally be granted PermissionCollection permissions = super.getPermissions(source); // Now add any extra permissions depending on the URL location. URL url = source.getLocation(); String protocol = url.getProtocol(); if (protocol.equals("file")) { String file = url.getFile(); // If the file end in / it must be an directory. if (file.endsWith("/") || file.endsWith(File.separator)) // Grant permission to read everything in that directory and // all subdirectories. permissions.add(new FilePermission(file + "-", "read")); else // It is a 'normal' file. // Grant permission to access that file. permissions.add(new FilePermission(file, "read")); } else { // Grant permission to connect to and accept connections from host String host = url.getHost(); if (host != null) permissions.add(new SocketPermission(host, "connect,accept")); } return permissions; } |
|
processQueues(); | flush(); | final synchronized IRQResource claimResources(ResourceOwner owner, int irq) throws DriverException { try { final ResourceManager rm; try { rm = (ResourceManager) InitialNaming.lookup(ResourceManager.NAME); } catch (NameNotFoundException ex) { throw new DriverException("Cannot find ResourceManager: ", ex); } if (ioResData == null) { ioResData = claimPorts(rm, owner, PS2_DATA_PORT, 1); ioResCtrl = claimPorts(rm, owner, PS2_CTRL_PORT, 1); } final IRQResource irqRes = rm.claimIRQ(owner, irq, this, true); if (activeCount == 0) { processQueues(); } activeCount++; return irqRes; } catch (ResourceNotFreeException ex) { throw new DriverException("Cannot claim necessairy resources: ", ex); } } |
final int getMode() throws DeviceException { writeController(CCMD_READ_MODE); return readData(); | final synchronized int getMode() throws DeviceException { try { writeController(CCMD_READ_MODE); if (waitRead()) { return readData(); } else { throw new DeviceException("Not return data from READ_MODE"); } } finally { processQueues(); } | final int getMode() throws DeviceException { writeController(CCMD_READ_MODE); return readData(); } |
if (irqReadQueue) { processQueues(); } | processQueues(); | public synchronized final void handleInterrupt(int irq) { if (irqReadQueue) { processQueues(); } } |
final void processQueues() { int status; while (((status = readStatus()) & AUX_STAT_OBF) != 0) { | private final void processQueues() { int status; int loops = 0; while (((status = readStatus()) & STAT_OBF) != 0) { if (++loops > 1000) { log.error("A lot of PS2 data, probably wrong"); } | final void processQueues() { int status; //System.out.print('<'); while (((status = readStatus()) & AUX_STAT_OBF) != 0) { final int data = readData(); // determine which driver shall handle the scancode final PS2ByteChannel channel; if ((status & STAT_MOUSE_OBF) != 0) { channel = mouseChannel; } else { channel = kbChannel; } // if this driver is not registered, merely exit if (channel == null) { log.debug("Unhandled scancode 0x" + Integer.toHexString(data) + " status=0x" + Integer.toHexString(status)); } else { // let the driver handle the scancode channel.handleScancode(data); } } //System.out.print('>'); } |
int mode = getMode(); if (enable) { mode |= MODE_INT; } else { mode &= ~MODE_INT; } setMode(mode); | final void setKeyboardEnabled(boolean enable) throws DeviceException { writeController(enable ? CCMD_KB_ENABLE : CCMD_KB_DISABLE); } |
|
int mode = getMode(); if (enable) { mode |= MODE_MOUSE_INT; } else { mode &= ~MODE_MOUSE_INT; } setMode(mode); | final void setMouseEnabled(boolean enable) throws DeviceException { writeController(enable ? CCMD_MOUSE_ENABLE : CCMD_MOUSE_DISABLE); } |
|
final boolean testMouse() throws DeviceException { irqReadQueue = false; try { | final synchronized boolean testMouse() throws DeviceException { try { | final boolean testMouse() throws DeviceException { irqReadQueue = false; try { writeController(CCMD_TEST_MOUSE); final int status = readStatus(); final int rc = readData(); log.debug("testMouse rc=0x" + NumberUtils.hex(rc, 2) + ", status 0x" + NumberUtils.hex(status, 2)); return (rc != 0xFF); } finally { irqReadQueue = true; processQueues(); } } |
final int status = readStatus(); final int rc = readData(); log.debug("testMouse rc=0x" + NumberUtils.hex(rc, 2) + ", status 0x" + NumberUtils.hex(status, 2)); return (rc != 0xFF); | if (waitRead()) { final int status = readStatus(); final int rc = readData(); log.debug("testMouse rc=0x" + NumberUtils.hex(rc, 2) + ", status 0x" + NumberUtils.hex(status, 2)); return (rc != 0xFF); } else { log.debug("No return from TEST_MOUSE"); return false; } | final boolean testMouse() throws DeviceException { irqReadQueue = false; try { writeController(CCMD_TEST_MOUSE); final int status = readStatus(); final int rc = readData(); log.debug("testMouse rc=0x" + NumberUtils.hex(rc, 2) + ", status 0x" + NumberUtils.hex(status, 2)); return (rc != 0xFF); } finally { irqReadQueue = true; processQueues(); } } |
irqReadQueue = true; | final boolean testMouse() throws DeviceException { irqReadQueue = false; try { writeController(CCMD_TEST_MOUSE); final int status = readStatus(); final int rc = readData(); log.debug("testMouse rc=0x" + NumberUtils.hex(rc, 2) + ", status 0x" + NumberUtils.hex(status, 2)); return (rc != 0xFF); } finally { irqReadQueue = true; processQueues(); } } |
|
final boolean writeMouseCommands(int[] cmds) throws DeviceException { boolean ok = true; for (int i = 0; i < cmds.length; i++) { ok &= writeMouseCommand(cmds[i]); } return ok; | final synchronized boolean writeMouseCommands(int cmd, int[] params, int returnCnt) throws DeviceException { mouseChannel.clear(); if (params == null) { return sendMouseCommand(cmd, returnCnt); } else { if (!sendMouseCommand(cmd, 0)) { return false; } final int cnt = params.length; for (int i = 0; i < cnt - 1; i++) { if (!sendMouseCommand(params[i], 0)) { return false; } } return sendMouseCommand(params[cnt-1], returnCnt); } | final boolean writeMouseCommands(int[] cmds) throws DeviceException { boolean ok = true; for (int i = 0; i < cmds.length; i++) { ok &= writeMouseCommand(cmds[i]); } return ok; } |
if (!(g instanceof Graphics2D) || true) | if (true || !(g instanceof Graphics2D)) | public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y) { Graphics2D g2; Rectangle2D.Double underline; FontRenderContext frc; FontMetrics fmet; LineMetrics lineMetrics; Font font; TextLayout layout; double underlineX1, underlineX2; boolean drawUnderline; int textLength; textLength = text.length(); if (textLength == 0) return; drawUnderline = (underlinedIndex >= 0) && (underlinedIndex < textLength); // XXX - FIXME we now always use this fall-back since TextLayout is // almost completely not implemented. if (!(g instanceof Graphics2D) || true) { /* Fall-back. This is likely to produce garbage for any text * containing right-to-left (Hebrew or Arabic) characters, even * if the underlined character is left-to-right. */ g.drawString(text, x, y); if (drawUnderline) { fmet = g.getFontMetrics(); g.fillRect( /* x */ x + fmet.stringWidth(text.substring(0, underlinedIndex)), /* y */ y + fmet.getDescent() - 1, /* width */ fmet.charWidth(text.charAt(underlinedIndex)), /* height */ 1); } return; } g2 = (Graphics2D) g; font = g2.getFont(); frc = g2.getFontRenderContext(); lineMetrics = font.getLineMetrics(text, frc); layout = new TextLayout(text, font, frc); /* Draw the text. */ layout.draw(g2, x, y); if (!drawUnderline) return; underlineX1 = x + layout.getLogicalHighlightShape( underlinedIndex, underlinedIndex).getBounds2D().getX(); underlineX2 = x + layout.getLogicalHighlightShape( underlinedIndex + 1, underlinedIndex + 1).getBounds2D().getX(); underline = new Rectangle2D.Double(); if (underlineX1 < underlineX2) { underline.x = underlineX1; underline.width = underlineX2 - underlineX1; } else { underline.x = underlineX2; underline.width = underlineX1 - underlineX2; } underline.height = lineMetrics.getUnderlineThickness(); underline.y = lineMetrics.getUnderlineOffset(); if (underline.y == 0) { /* Some fonts do not specify an underline offset, although they * actually should do so. In that case, the result of calling * lineMetrics.getUnderlineOffset() will be zero. Since it would * look very ugly if the underline was be positioned immediately * below the baseline, we check for this and move the underline * below the descent, as shown in the following ASCII picture: * * ##### ##### # * # # # # * # # # # * # # # # * ##### ###### ---- baseline (0) * # * # * ------------------###----------- lineMetrics.getDescent() */ underline.y = lineMetrics.getDescent(); } underline.y += y; g2.fill(underline); } |
if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); g.setColor(textComponent.getBackground()); g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); } | } | protected void paintBackground(Graphics g) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); g.setColor(textComponent.getBackground()); g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); } |
createDefaultTheme(); | public MetalLookAndFeel() { createDefaultTheme(); } |
|
if (theme == null) setCurrentTheme(new OceanTheme()); | getCurrentTheme(); | protected void createDefaultTheme() { if (theme == null) setCurrentTheme(new OceanTheme()); } |
if (theme == null) { if ("steel".equals(SystemProperties.getProperty("swing.metalTheme"))) theme = new DefaultMetalTheme(); else theme = new OceanTheme(); } | public static MetalTheme getCurrentTheme() { return theme; } |
|
createDefaultTheme(); | public UIDefaults getDefaults() { if (LAF_defaults == null) { LAF_defaults = super.getDefaults(); // add custom theme entries to the table if (theme != null) theme.addCustomEntriesToTable(LAF_defaults); } // Returns the default values for this look and feel. return LAF_defaults; } |
|
"TitledBorder.border", new LineBorderUIResource(getPrimaryControl(), 1), | protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new InsetsUIResource(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", Boolean.TRUE, "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "DesktopIcon.border", MetalBorders.getDesktopIconBorder(), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "FileChooser.upFolderIcon", MetalIconFactory.getFileChooserUpFolderIcon(), "FileChooser.listViewIcon", MetalIconFactory.getFileChooserListViewIcon(), "FileChooser.newFolderIcon", MetalIconFactory.getFileChooserNewFolderIcon(), "FileChooser.homeFolderIcon", MetalIconFactory.getFileChooserHomeFolderIcon(), "FileChooser.detailsViewIcon", MetalIconFactory.getFileChooserDetailViewIcon(), "FileChooser.fileNameLabelMnemonic", new Integer(78), "FileChooser.filesOfTypeLabelMnemonic", new Integer(84), "FileChooser.lookInLabelMnemonic", new Integer(73), "FileView.computerIcon", MetalIconFactory.getTreeComputerIcon(), "FileView.directoryIcon", MetalIconFactory.getTreeFolderIcon(), "FileView.fileIcon", MetalIconFactory.getTreeLeafIcon(), "FileView.floppyDriveIcon", MetalIconFactory.getTreeFloppyDriveIcon(), "FileView.hardDriveIcon", MetalIconFactory.getTreeHardDriveIcon(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.closeSound", "sounds/FrameClose.wav", "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.maximizeSound", "sounds/FrameMaximize.wav", "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "InternalFrame.minimizeSound", "sounds/FrameMinimize.wav", "InternalFrame.paletteBorder", new MetalBorders.PaletteBorder(), "InternalFrame.paletteCloseIcon", new MetalIconFactory.PaletteCloseIcon(), "InternalFrame.paletteTitleHeight", new Integer(11), "InternalFrame.restoreDownSound", "sounds/FrameRestoreDown.wav", "InternalFrame.restoreUpSound", "sounds/FrameRestoreUp.wav", "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.font", getControlTextFont(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "List.focusCellHighlightBorder", new LineBorderUIResource(MetalLookAndFeel.getFocusColor()), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.arrowIcon", MetalIconFactory.getMenuArrowIcon(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "MenuItem.commandSound", "sounds/MenuItemCommand.wav", "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "Menu.submenuPopupOffsetX", new Integer(-4), "Menu.submenuPopupOffsetY", new Integer(-3), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorDelimiter", "-", "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.arrowIcon", MetalIconFactory.getMenuItemArrowIcon(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.borderPainted", Boolean.TRUE, "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorSound", "sounds/OptionPaneError.wav", "OptionPane.informationSound", "sounds/OptionPaneInformation.wav", "OptionPane.questionSound", "sounds/OptionPaneQuestion.wav", "OptionPane.warningSound", "sounds/OptionPaneWarning.wav", "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "PopupMenu.popupSound", "sounds/PopupMenuPopup.wav", "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.commandSound", "sounds/MenuItemCommand.wav", "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE, "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollBar.width", new Integer(17), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.arrowButtonInsets", new InsetsUIResource(0, 0, 0, 0), "Spinner.background", getControl(), "Spinner.border", MetalBorders.getTextFieldBorder(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.dividerSize", new Integer(10), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", new BorderUIResource.LineBorderUIResource(getFocusColor()), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0), "TableHeader.background", getControl(), "TableHeader.cellBorder", new MetalBorders.TableHeaderBorder(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getToggleButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", getFocusColor(), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolBar.border", new MetalBorders.ToolBarBorder(), "ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "ToolTip.hideAccelerator", Boolean.FALSE, "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(0), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); } |
|
if (this.getMouseListeners().length == 0) | if (getMouseListeners().length == 0 && getMouseMotionListeners().length == 0) | Component findComponentForMouseEventAt(int x, int y) { synchronized (getTreeLock()) { if (!contains(x, y)) return null; for (int i = 0; i < ncomponents; ++i) { // Ignore invisible children... if (!component[i].isVisible()) continue; int x2 = x - component[i].x; int y2 = y - component[i].y; // We don't do the contains() check right away because // findComponentAt would redundantly do it first thing. if (component[i] instanceof Container) { Container k = (Container) component[i]; Component r = k.findComponentForMouseEventAt(x2, y2); if (r != null) return r; } else if (component[i].contains(x2, y2)) return component[i]; } //don't return transparent components with no MouseListeners if (this.getMouseListeners().length == 0) return null; return this; } } |
return super.getAlignmentX(); | LayoutManager layout = getLayout(); float alignmentX = 0.0F; if (layout != null && layout instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layout; alignmentX = lm2.getLayoutAlignmentX(this); } else alignmentX = super.getAlignmentX(); return alignmentX; | public float getAlignmentX() { return super.getAlignmentX(); } |
return super.getAlignmentY(); | LayoutManager layout = getLayout(); float alignmentY = 0.0F; if (layout != null && layout instanceof LayoutManager2) { LayoutManager2 lm2 = (LayoutManager2) layout; alignmentY = lm2.getLayoutAlignmentY(this); } else alignmentY = super.getAlignmentY(); return alignmentY; | public float getAlignmentY() { return super.getAlignmentY(); } |
super.paint(g); | paint(g); | public void paintComponents(Graphics g) { super.paint(g); visitChildren(g, GfxPaintAllVisitor.INSTANCE, true); } |
if (r.isShowing()) | public void remove(int index) { synchronized (getTreeLock ()) { Component r = component[index]; ComponentListener[] list = r.getComponentListeners(); for (int j = 0; j < list.length; j++) r.removeComponentListener(list[j]); r.removeNotify(); System.arraycopy(component, index + 1, component, index, ncomponents - index - 1); component[--ncomponents] = null; invalidate(); if (layoutMgr != null) layoutMgr.removeLayoutComponent(r); r.parent = null; if (isShowing ()) { // Post event to notify of removing the component. ContainerEvent ce = new ContainerEvent(this, ContainerEvent.COMPONENT_REMOVED, r); getToolkit().getSystemEventQueue().postEvent(ce); // Repaint this container. repaint(); } } } |
|
if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 | if (me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 | Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; } |
pressCount = 0; } | Component acquireComponentForMouseEvent(MouseEvent me) { int x = me.getX (); int y = me.getY (); Component mouseEventTarget = null; // Find the candidate which should receive this event. Component parent = nativeContainer; Component candidate = null; Point p = me.getPoint(); while (candidate == null && parent != null) { candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y); if (candidate == null || (candidate.eventMask & me.getID()) == 0) { candidate = null; p = AWTUtilities.convertPoint(parent, p.x, p.y, parent.parent); parent = parent.parent; } } // If the only candidate we found was the native container itself, // don't dispatch any event at all. We only care about the lightweight // children here. if (candidate == nativeContainer) candidate = null; // If our candidate is new, inform the old target we're leaving. if (lastComponentEntered != null && lastComponentEntered.isShowing() && lastComponentEntered != candidate) { // Old candidate could have been removed from // the nativeContainer so we check first. if (AWTUtilities.isDescendingFrom(lastComponentEntered, nativeContainer)) { Point tp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent exited = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_EXITED, me.getWhen (), me.getModifiersEx (), tp.x, tp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (exited); } lastComponentEntered = null; } // If we have a candidate, maybe enter it. if (candidate != null) { mouseEventTarget = candidate; if (candidate.isLightweight() && candidate.isShowing() && candidate != nativeContainer && candidate != lastComponentEntered) { lastComponentEntered = mouseEventTarget; Point cp = AWTUtilities.convertPoint(nativeContainer, x, y, lastComponentEntered); MouseEvent entered = new MouseEvent (lastComponentEntered, MouseEvent.MOUSE_ENTERED, me.getWhen (), me.getModifiersEx (), cp.x, cp.y, me.getClickCount (), me.isPopupTrigger (), me.getButton ()); lastComponentEntered.dispatchEvent (entered); } } // Check which buttons where pressed except the last button that // changed state. int modifiers = me.getModifiersEx() & (MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK); switch(me.getButton()) { case MouseEvent.BUTTON1: modifiers &= ~MouseEvent.BUTTON1_DOWN_MASK; break; case MouseEvent.BUTTON2: modifiers &= ~MouseEvent.BUTTON2_DOWN_MASK; break; case MouseEvent.BUTTON3: modifiers &= ~MouseEvent.BUTTON3_DOWN_MASK; break; } if (me.getID() == MouseEvent.MOUSE_RELEASED || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0 || me.getID() == MouseEvent.MOUSE_DRAGGED) { // If any of the following events occur while a button is held down, // they should be dispatched to the same component to which the // original MOUSE_PRESSED event was dispatched: // - MOUSE_RELEASED // - MOUSE_PRESSED: another button pressed while the first is held // down // - MOUSE_DRAGGED if (AWTUtilities.isDescendingFrom(pressedComponent, nativeContainer)) mouseEventTarget = pressedComponent; } else if (me.getID() == MouseEvent.MOUSE_CLICKED) { // Don't dispatch CLICKED events whose target is not the same as the // target for the original PRESSED event. if (candidate != pressedComponent) mouseEventTarget = null; else if (pressCount == 0) pressedComponent = null; } return mouseEventTarget; } |
|
pressCount = 0; } | boolean handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; // Make the LightWeightDispatcher reentrant. This is necessary when // a lightweight component does its own modal event queue. Component mouseEventTarget = acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } MouseEvent newEvt = AWTUtilities.convertMouseEvent(nativeContainer, me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); if (newEvt.isConsumed()) e.consume(); } } return e.isConsumed(); } |
|
postEvent (e); | public void deliverEvent(Event e) { // XXX Add backward compatibility handling. } |
|
public void list(PrintStream out, int indent) | public void list() | public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); } |
for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); | list(System.out, 0); | public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); } |
public void read(InputStream in, Object desc) throws IOException | public void read(InputStream in, Object desc) throws IOException { EditorKit kit = getEditorKit(); if (kit instanceof HTMLEditorKit && desc instanceof HTMLDocument) { Document doc = (Document) desc; try { kit.read(in, doc, 0); } catch (BadLocationException ex) { assert false : "BadLocationException must not be thrown here."; } } else | public void read(InputStream in, Object desc) throws IOException { } |
Reader inRead = new InputStreamReader(in); super.read(inRead, desc); } | public void read(InputStream in, Object desc) throws IOException { } |
|
private synchronized void doInitialize() { | private synchronized final void doInitialize() { | private synchronized void doInitialize() { if (!isInitialized()) { if (!isInitializing()) { state |= VmTypeState.ST_INITIALIZING; /* * Screen.debug("initialize("); Screen.debug(name); */ final VmMethod initMethod = getInitializerMethod(); if (initMethod != null) { try { VmReflection.invokeStatic(initMethod); } catch (InvocationTargetException ex) { final Throwable targetEx = ex.getTargetException(); if (targetEx != null) { ex.getTargetException().printStackTrace(); //Unsafe.die("VmType.doInitialize"); throw new ExceptionInInitializerError(ex .getTargetException()); } else { throw new ExceptionInInitializerError( "targetEx == null"); } } } state |= VmTypeState.ST_INITIALIZED; } } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.