bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
match(DataFlavor dataFlavor){ // XXX - How is this different from equals? return(equals(dataFlavor));}
|
match(DataFlavor dataFlavor){ // XXX - How is this different from equals? return(equals(dataFlavor));}
| 3,688
|
normalizeMimeType(String type){ return(type);}
|
normalizeMimeType(String type){ return(type);}
| 3,689
|
normalizeMimeTypeParameter(String name, String value){ return(name + "=" + value);}
|
normalizeMimeTypeParameter(String name, String value){ return(name + "=" + value);}
| 3,690
|
readExternal(ObjectInput stream) throws IOException, ClassNotFoundException{ // FIXME: Implement me}
|
readExternal(ObjectInput stream) throws IOException, ClassNotFoundException{ // FIXME: Implement me}
| 3,691
|
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; } // A InputStream is good if the mime primary type is "text" if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { // Try to construct a dummy reader with the found encoding r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncodingException uee) { /* ignore */ } if (r != null) return df; } } // Nothing found return(null);}
|
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; } // A InputStream is good if the mime primary type is "text" if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { // Try to construct a dummy reader with the found encoding r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncodingException uee) { /* ignore */ } if (r != null) return df; } } // Nothing found return(null);}
| 3,692
|
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; } // A InputStream is good if the mime primary type is "text" if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { // Try to construct a dummy reader with the found encoding r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncodingException uee) { /* ignore */ } if (r != null) return df; } } // Nothing found return(null);}
|
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; } // A InputStream is good if the mime primary type is "text" if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { // Try to construct a dummy reader with the found encoding r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncodingException uee) { /* ignore */ } if (r != null) return df; } } // Nothing found return(null);}
| 3,693
|
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; } // A InputStream is good if the mime primary type is "text" if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { // Try to construct a dummy reader with the found encoding r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncodingException uee) { /* ignore */ } if (r != null) return df; } } // Nothing found return(null);}
|
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; } // A InputStream is good if the mime primary type is "text" if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { // Try to construct a dummy reader with the found encoding r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncodingException uee) { /* ignore */ } if (r != null) return df; } } // Nothing found return(null);}
| 3,694
|
setHumanPresentableName(String humanPresentableName){ this.humanPresentableName = humanPresentableName;}
|
setHumanPresentableName(String humanPresentableName){ this.humanPresentableName = humanPresentableName;}
| 3,695
|
toString(){ return(getClass().getName() + "[representationClass=" + getRepresentationClass().getName() + ",mimeType=" + getMimeType() + ",humanPresentableName=" + getHumanPresentableName() + "]");}
|
toString(){ return(getClass().getName() + "[representationClass=" + getRepresentationClass().getName() + ",mimeType=" + getMimeType() + ",humanPresentableName=" + getHumanPresentableName() + "]");}
| 3,696
|
tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException{ try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className);}
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException{ try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className);}
| 3,697
|
writeExternal(ObjectOutput stream) throws IOException{ // FIXME: Implement me}
|
writeExternal(ObjectOutput stream) throws IOException{ // FIXME: Implement me}
| 3,698
|
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; } } }
|
public final void drawChar(Graphics2D g) { if (attributePlace && s.isShowHex()) { 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; } } }
| 3,699
|
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; } } }
|
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) if (sChar[0] == 0x1C) g.drawChars(dupChar, 0, 1, x+1, cy -2); else 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; } } }
| 3,700
|
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; } } }
|
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 if (sChar[0] == 0x1C) g.drawChars(dupChar, 0, 1, x, 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; } } }
| 3,701
|
protected void setPrehelpState(boolean setErrorCode) { statusErrorCode = setErrorCode; setKeyboardLocked(setErrorCode); bufferedKeys = null; keysBuffered = false; setKBIndicatorOff(); }
|
protected void setPrehelpState(boolean setErrorCode, boolean lockKeyboard, boolean unlockIfLocked) { statusErrorCode = setErrorCode; setKeyboardLocked(setErrorCode); bufferedKeys = null; keysBuffered = false; setKBIndicatorOff(); }
| 3,702
|
protected void setPrehelpState(boolean setErrorCode) { statusErrorCode = setErrorCode; setKeyboardLocked(setErrorCode); bufferedKeys = null; keysBuffered = false; setKBIndicatorOff(); }
|
protected void setPrehelpState(boolean setErrorCode) { statusErrorCode = setErrorCode; if (isKeyboardLocked() && unlockIfLocked) setKeyboardLocked(false); else setKeyboardLocked(lockKeyboard); bufferedKeys = null; keysBuffered = false; setKBIndicatorOff(); }
| 3,703
|
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()); }
|
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,true,false); Toolkit.getDefaultToolkit().beep(); } else { setPrehelpState(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); }
| 3,704
|
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()); }
|
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,true,true); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); }
| 3,705
|
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; }
|
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; }
| 3,706
|
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); } }
|
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); } }
| 3,709
|
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); } }
|
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); } }
| 3,710
|
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; }
|
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. setRootPaneCheckingEnabled(true); }
| 3,711
|
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); }
| 3,712
|
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); }
| 3,713
|
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);
| 3,714
|
protected int getAvailableSize(Dimension containerSize, Insets insets) { return containerSize.width - insets.left - insets.right; }
|
protected int getAvailableSize(Dimension containerSize, Insets insets) { int size; if (axis == SwingConstants.HORIZONTAL) size = containerSize.width - insets.left - insets.right; else size = containerSize.height - insets.top - insets.bottom; return size; }
| 3,717
|
protected int getInitialLocation(Insets insets) { if (insets != null) return insets.left; return 0; }
|
protected int getInitialLocation(Insets insets) { if (insets != null) return insets.left; return 0; }
| 3,718
|
protected int getPreferredSizeOfComponent(Component c) { Dimension dims = c.getPreferredSize(); if (dims != null) return dims.width; return 0; }
|
protected int getPreferredSizeOfComponent(Component c) { Dimension dims = c.getPreferredSize(); if (dims != null) return dims.width; return 0; }
| 3,719
|
protected int getSizeOfComponent(Component c) { return c.getWidth(); }
|
protected int getSizeOfComponent(Component c) { int size; if (axis == SwingConstants.HORIZONTAL) size = c.getHeight(); else size = c.getWidth(); return size; }
| 3,720
|
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; }
|
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; }
| 3,721
|
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; }
|
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; }
| 3,722
|
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; }
|
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; }
| 3,723
|
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; }
|
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); } } 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); } return null; }
| 3,724
|
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; }
|
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 dim; }
| 3,725
|
int minimumSizeOfComponent(int index) { Dimension dims = components[index].getMinimumSize(); if (dims != null) return dims.width; else return 0; }
|
int minimumSizeOfComponent(int index) { Dimension dims = components[index].getMinimumSize(); if (dims != null) if (axis == SwingConstants.HORIZONTAL) size = dims.width; else return 0; }
| 3,726
|
int minimumSizeOfComponent(int index) { Dimension dims = components[index].getMinimumSize(); if (dims != null) return dims.width; else return 0; }
|
int minimumSizeOfComponent(int index) { Dimension dims = components[index].getMinimumSize(); if (dims != null) return dims.width; else size = dims.height; return size; }
| 3,727
|
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; }
|
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; }
| 3,728
|
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; }
|
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; }
| 3,729
|
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; }
|
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; }
| 3,730
|
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; }
|
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); } } 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); } return null; }
| 3,731
|
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; }
|
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 dim; }
| 3,732
|
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); }
|
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); }
| 3,733
|
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); }
|
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; }
| 3,734
|
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); }
|
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 dividerSize = UIManager.getInt("SplitPane.dividerSize"); splitPane.setDividerSize(dividerSize); divider.setDividerSize(dividerSize); splitPane.setOpaque(true); }
| 3,735
|
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()); }
|
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()); }
| 3,736
|
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()); }
|
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(getSessionAt(selectedIndex).getAllocDeviceName()); if (sequence - 1 > 0) setTitle(getTitle() + " - tn5250j <" + sequence + "> - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); else setTitle(getTitle() + " - tn5250j - " + tn5250jRelease + tn5250jVersion + tn5250jSubVer); }
| 3,737
|
public void connect(Stub self, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for StubDelegate"); }
|
public void connect(Stub self, ORB orb) throws RemoteException { throw new Error("Not implemented for StubDelegate"); }
| 3,739
|
public void connect(Stub self, javax.rmi.ORB orb) throws RemoteException { throw new Error("Not implemented for StubDelegate"); }
|
public void connect(Stub self, javax.rmi.ORB orb) throws RemoteException { connect(self, orb, null); }
| 3,740
|
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(); }
|
public boolean equals(Stub self, java.lang.Object obj) { if(self == null || obj == null) return self == obj; if(!(obj instanceof Stub)) return false; return self.hashCode() == ((Stub)obj).hashCode(); }
| 3,741
|
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(); }
|
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(); }
| 3,742
|
public int hashCode(Stub self) { //FIX ME return hashCode; }
|
public int hashCode(Stub self) { //FIX ME Delegate d = self._get_delegate(); return d==null?0:d.hashCode(); }
| 3,743
|
public void readObject(Stub self, ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("Not implemented for StubDelegate"); }
|
public void readObject(Stub self, ObjectInputStream input) throws IOException, ClassNotFoundException { throw new Error("Not implemented for StubDelegate"); }
| 3,744
|
public void readObject(Stub self, ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("Not implemented for StubDelegate"); }
|
public void readObject(Stub self, ObjectInputStream s) throws IOException, ClassNotFoundException { readObject(self, input, null); }
| 3,745
|
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 String toString(Stub self) { try { return self._orb().object_to_string(self); } // XXX javax.rmi.BAD_OPERATION -> org.omg.CORBA.BAD_OPERATION catch (Exception ex) { return null; } }
| 3,746
|
public void writeObject(Stub self, ObjectOutputStream s) throws IOException { throw new Error("Not implemented for StubDelegate"); }
|
public void writeObject(Stub self, ObjectOutputStream output) throws IOException { throw new Error("Not implemented for StubDelegate"); }
| 3,747
|
public void writeObject(Stub self, ObjectOutputStream s) throws IOException { throw new Error("Not implemented for StubDelegate"); }
|
public void writeObject(Stub self, ObjectOutputStream s) throws IOException { writeObject(self, output, null); }
| 3,748
|
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; }
|
public MetalSplitPaneDivider(MetalSplitPaneUI ui, Color light, Color dark) { super(ui); this.splitPane = super.splitPane; this.orientation = super.orientation; this.light = light; this.dark = dark; }
| 3,749
|
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 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); 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, light, dark); if (splitPane.isOneTouchExpandable()) { ((BasicArrowButton) rightButton).paint(g); ((BasicArrowButton) leftButton).paint(g); } }
| 3,750
|
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 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); } }
| 3,751
|
public SortingFocusTraversalPolicy(Comparator comparator) { this.comparator = comparator; }
|
protected SortingFocusTraversalPolicy() { this.comparator = comparator; }
| 3,752
|
public SortingFocusTraversalPolicy(Comparator comparator) { this.comparator = comparator; }
|
public SortingFocusTraversalPolicy(Comparator comparator) { }
| 3,753
|
public Object clone() { return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), P2.getX(), P2.getY()); }
|
public Object clone() { return new CubicSegment(P1.getX(), P1.getY(), cp1.getX(), cp1.getY(), cp2.getX(), cp2.getY(), P2.getX(), P2.getY()); }
| 3,754
|
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); } } }
|
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); } } }
| 3,756
|
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); } } }
|
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); } } }
| 3,757
|
public BasicSplitPaneDivider(BasicSplitPaneUI ui) { setLayout(new DividerLayout()); setBasicSplitPaneUI(ui); setDividerSize(splitPane.getDividerSize()); setBorder(tmpBorder); }
|
public BasicSplitPaneDivider(BasicSplitPaneUI ui) { setLayout(new DividerLayout()); setBasicSplitPaneUI(ui); setDividerSize(splitPane.getDividerSize()); }
| 3,758
|
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(); } }
|
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(); } }
| 3,759
|
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(); } }
|
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(); } }
| 3,760
|
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 }
|
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(COMMAND_TIMEOUT); } 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 }
| 3,761
|
public boolean equals(Object obj) { return (obj != null) && (obj instanceof SimpleAttributeSet) && ((SimpleAttributeSet)obj).tab.equals(this.tab); }
|
public boolean equals(Object obj) { return (obj != null) && (obj instanceof SimpleAttributeSet) && ((SimpleAttributeSet)obj).tab.equals(this.tab); }
| 3,763
|
public boolean isEqual(AttributeSet attr) { return this.equals(attr); }
|
public boolean isEqual(AttributeSet attr) { return attr != null && attr.containsAttributes(this) && this.containsAttributes(attr); }
| 3,764
|
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); } }
|
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(protocol)) loader = new FileURLLoader(this, newUrl); else loader = new RemoteURLLoader(this, newUrl); // Cache it. urlloaders.put(newUrl, loader); } urls.add(newUrl); urlinfos.add(loader); } }
| 3,765
|
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); } }
| 3,766
|
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 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) { flush(); } activeCount++; return irqRes; } catch (ResourceNotFreeException ex) { throw new DriverException("Cannot claim necessairy resources: ", ex); } }
| 3,769
|
final int getMode() throws DeviceException { writeController(CCMD_READ_MODE); return readData(); }
|
final int getMode() throws DeviceException { writeController(CCMD_READ_MODE); return readData(); }
| 3,770
|
public synchronized final void handleInterrupt(int irq) { if (irqReadQueue) { processQueues(); } }
|
public synchronized final void handleInterrupt(int irq) { if (irqReadQueue) { processQueues(); } }
| 3,771
|
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('>'); }
|
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('>'); }
| 3,772
|
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 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(); } }
| 3,775
|
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 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(); } }
| 3,776
|
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 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 { processQueues(); } }
| 3,777
|
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 boolean writeMouseCommands(int[] cmds) throws DeviceException { boolean ok = true; for (int i = 0; i < cmds.length; i++) { ok &= writeMouseCommand(cmds[i]); } return ok; }
| 3,778
|
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); }
|
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 (true || !(g instanceof Graphics2D)) { /* 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); }
| 3,779
|
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()); }
|
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()); }
| 3,780
|
public MetalLookAndFeel() { createDefaultTheme(); }
|
public MetalLookAndFeel() { }
| 3,781
|
protected void createDefaultTheme() { if (theme == null) setCurrentTheme(new OceanTheme()); }
|
protected void createDefaultTheme() { if (theme == null) setCurrentTheme(new OceanTheme()); }
| 3,782
|
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; } }
|
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 (getMouseListeners().length == 0 && getMouseMotionListeners().length == 0) return null; return this; } }
| 3,786
|
public float getAlignmentX() { return super.getAlignmentX(); }
|
public float 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; }
| 3,787
|
public float getAlignmentY() { return super.getAlignmentY(); }
|
public float 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; }
| 3,788
|
public void paintComponents(Graphics g) { super.paint(g); visitChildren(g, GfxPaintAllVisitor.INSTANCE, true); }
|
public void paintComponents(Graphics g) { paint(g); visitChildren(g, GfxPaintAllVisitor.INSTANCE, true); }
| 3,789
|
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; }
|
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; }
| 3,791
|
public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
|
public void list() { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
| 3,795
|
public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
|
public void list(PrintStream out, int indent) { for (int i = 0; i < indent; ++i) out.print(' '); out.println(toString()); }
| 3,796
|
public void read(InputStream in, Object desc) throws IOException { }
|
public void read(InputStream in, Object desc) throws IOException { }
| 3,797
|
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; } } }
|
private synchronized final 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; } } }
| 3,799
|
public final void initialize() { if (!isInitialized()) { linkAndInitialize(); } }
|
public final void initialize() { if (!isInitialized() && !isInitializing()) { linkAndInitialize(); } }
| 3,800
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("[loadFromBootClassArray:"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
| 3,801
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug('\n'); }
|
protected static void loadFromBootClassArray(VmType[] bootClasses) { Unsafe.debug("loadFromBootClassArray"); final int count = bootClasses.length; for (int i = 0; i < count; i++) { final VmType<?> vmClass = bootClasses[i]; final String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else if (name.equals("byte")) { ByteClass = (VmNormalClass) vmClass; } else if (name.equals("char")) { CharClass = (VmNormalClass) vmClass; } else if (name.equals("short")) { ShortClass = (VmNormalClass) vmClass; } else if (name.equals("int")) { IntClass = (VmNormalClass) vmClass; } else if (name.equals("float")) { FloatClass = (VmNormalClass) vmClass; } else if (name.equals("long")) { LongClass = (VmNormalClass) vmClass; } else if (name.equals("double")) { DoubleClass = (VmNormalClass) vmClass; } else if (name.equals("void")) { VoidClass = (VmNormalClass) vmClass; } } else if (vmClass.isArray()) { if (name.equals("[Z")) { BooleanArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[B")) { ByteArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[C")) { CharArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[S")) { ShortArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[I")) { IntArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[F")) { FloatArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[J")) { LongArrayClass = (VmArrayClass) vmClass; } else if (name.equals("[D")) { DoubleArrayClass = (VmArrayClass) vmClass; } } else { if (name.equals("java.lang.Object")) { ObjectClass = (VmNormalClass) vmClass; } else if (name.equals("java.lang.Cloneable")) { CloneableClass = (VmInterfaceClass) vmClass; } else if (name.equals("java.io.Serializable")) { SerializableClass = (VmInterfaceClass) vmClass; } } } Unsafe.debug("]\n"); }
| 3,802
|
public LinkageError(String s) { super(s); }
|
public LinkageError(String s) { super(s); }
| 3,803
|
public ExceptionInInitializerError(String s) { super(s); exception = null; }
|
public ExceptionInInitializerError(String s) { super(s); exception = null; }
| 3,804
|
public Object getAny(int index) { return get(index); }
|
public final Object getAny(int index) { return get(index); }
| 3,805
|
public float getLayoutAlignmentX(Container parent) { return(parent.getAlignmentX()); }
|
public float getLayoutAlignmentX(Container parent) { return 0.5F; }
| 3,806
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.