bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
8,411
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
8,412
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
8,413
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { Color saved = g.getColor(); AbstractButton b = (AbstractButton) c; if (b.getModel().isPressed()) { g.setColor(darkShadow); g.drawRect(x, y, x + w - 1, y + h - 1); } else { g.setColor(highlight); g.drawLine(x + 1, y + 1, x + w - 3, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + h - 2); g.setColor(shadow); g.drawLine(x + 1, y + h - 2, x + w - 1, y + h - 2); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x, y + h - 1, x + w - 1, y + h - 1); g.drawLine(x + w - 1, y, x + w - 1, y + h - 1); g.setColor(saved); } }
8,414
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1] + 1; x2 = xPoints[2] - 1; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) { Polygon arrow = null; switch (direction) { case NORTH: arrow = upIcon; break; case SOUTH: arrow = downIcon; break; case EAST: case RIGHT: arrow = rightIcon; break; case WEST: case LEFT: arrow = leftIcon; break; } int[] xPoints = arrow.xpoints; int[] yPoints = arrow.ypoints; int x1; int y1; int x2; int y2; x1 = y1 = x2 = y2 = 0; if (size != defaultSize) { float scale = size * 1f / defaultSize; for (int i = 0; i < 3; i++) { xPoints[i] *= scale; yPoints[i] *= scale; } } g.translate(x, y); switch (direction) { case NORTH: x1 = xPoints[0] + 2; y1 = yPoints[0]; y2 = y1; x2 = xPoints[2] - 1; break; case SOUTH: x1 = xPoints[1]; y1 = yPoints[1] + 1; x2 = xPoints[2] - 1; y2 = yPoints[2]; break; case LEFT: case WEST: x1 = xPoints[0] + 1; y1 = yPoints[0] + 1; x2 = x1; y2 = yPoints[2] + 1; break; case RIGHT: case EAST: x1 = xPoints[2]; y1 = yPoints[2] + 1; x2 = xPoints[1] - 1; y2 = yPoints[1] + 1; break; } Color saved = g.getColor(); if (isEnabled) { g.setColor(Color.DARK_GRAY); if (arrow != null) g.fillPolygon(xPoints, yPoints, 3); } else { g.setColor(Color.GRAY); g.fillPolygon(xPoints, yPoints, 3); g.setColor(Color.WHITE); g.drawLine(x1, y1, x2, y2); } g.setColor(saved); g.translate(-x, -y); }
8,415
private static ResourceBundle tryBundle(String localizedName, ClassLoader classloader) { ResourceBundle bundle = null; try { Class rbClass; if (classloader == null) rbClass = Class.forName(localizedName); else rbClass = classloader.loadClass(localizedName); // Note that we do the check up front instead of catching // ClassCastException. The reason for this is that some crazy // programs (Eclipse) have classes that do not extend // ResourceBundle but that have the same name as a property // bundle; in fact Eclipse relies on ResourceBundle not // instantiating these classes. if (ResourceBundle.class.isAssignableFrom(rbClass)) bundle = (ResourceBundle) rbClass.newInstance(); } catch (IllegalAccessException ex) {} catch (InstantiationException ex) {} catch (ClassNotFoundException ex) {} if (bundle == null) { try { InputStream is; String resourceName = localizedName.replace('.', '/') + ".properties"; if (classloader == null) is = ClassLoader.getSystemResourceAsStream(resourceName); else is = classloader.getResourceAsStream(resourceName); if (is != null) bundle = new PropertyResourceBundle(is); } catch (IOException ex) { MissingResourceException mre = new MissingResourceException ("Failed to load bundle: " + localizedName, localizedName, ""); mre.initCause(ex); throw mre; } } return bundle; }
private static ResourceBundle tryBundle(String localizedName, ClassLoader classloader) { ResourceBundle bundle = null; try { Class rbClass; if (classloader == null) rbClass = Class.forName(localizedName); else rbClass = classloader.loadClass(localizedName); // Note that we do the check up front instead of catching // ClassCastException. The reason for this is that some crazy // programs (Eclipse) have classes that do not extend // ResourceBundle but that have the same name as a property // bundle; in fact Eclipse relies on ResourceBundle not // instantiating these classes. if (ResourceBundle.class.isAssignableFrom(rbClass)) bundle = (ResourceBundle) rbClass.newInstance(); } catch (IllegalAccessException ex) {} catch (InstantiationException ex) {} catch (ClassNotFoundException ex) {} if (bundle == null) { try { InputStream is; String resourceName = localizedName.replace('.', '/') + ".properties"; if (classloader == null) is = ClassLoader.getSystemResourceAsStream(resourceName); else is = classloader.getResourceAsStream(resourceName); if (is != null) bundle = new PropertyResourceBundle(is); } catch (IOException ex) { MissingResourceException mre = new MissingResourceException ("Failed to load bundle: " + localizedName, localizedName, ""); mre.initCause(ex); throw mre; } } return bundle; }
8,416
protected void drawCheck(Component c, Graphics g, int x, int y) { g.setColor(Color.BLACK); g.drawLine(3 + x, 5 + y, 3 + x, 9 + y); g.drawLine(4 + x, 5 + y, 4 + x, 9 + y); g.drawLine(5 + x, 7 + y, 9 + x, 3 + y); g.drawLine(5 + x, 8 + y, 9 + x, 4 + y); }
protected void drawCheck(Component c, Graphics g, int x, int y) { if (c.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); g.drawLine(3 + x, 5 + y, 3 + x, 9 + y); g.drawLine(4 + x, 5 + y, 4 + x, 9 + y); g.drawLine(5 + x, 7 + y, 9 + x, 3 + y); g.drawLine(5 + x, 8 + y, 9 + x, 4 + y); }
8,418
public ScreenField setField(int attr, int row, int col, int len, int ffw1, int ffw2, int fcw1, int fcw2) { ScreenField sf = null; screenFields[nextField] = new ScreenField(screen); screenFields[nextField].setField(attr,row,col,len,ffw1,ffw2,fcw1,fcw2); sf = screenFields[nextField++]; sizeFields++; // set the field id if it is not a bypass field // this is used for cursor progression if (!sf.isBypassField()) sf.setFieldId(++fieldIds); // check if the cursor progression field flag should be set. if ((fcw1 & 0x88) == 0x88) cpfExists = true; if (currentField != null) { currentField.next = sf; sf.prev = currentField; } currentField = sf; // check if the Modified Data Tag was set while creating the field masterMDT = currentField.mdt; return currentField; }
public ScreenField setField(int attr, int row, int col, int len, int ffw1, int ffw2, int fcw1, int fcw2) { ScreenField sf = null; screenFields[nextField] = new ScreenField(screen); screenFields[nextField].setField(attr,row,col,len,ffw1,ffw2,fcw1,fcw2); sf = screenFields[nextField++]; sizeFields++; // set the field id if it is not a bypass field // this is used for cursor progression if (!sf.isBypassField()) sf.setFieldId(++fieldIds); // check if the cursor progression field flag should be set. if (fcw1 == 0x88) cpfExists = true; if (currentField != null) { currentField.next = sf; sf.prev = currentField; } currentField = sf; // check if the Modified Data Tag was set while creating the field masterMDT = currentField.mdt; return currentField; }
8,419
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i < stop; i++) { FormattedIOCmd command = (FormattedIOCmd) formatCommandList.get(i); command.toXMLOutputStream(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i < stop; i++) { FormattedIOCmd command = (FormattedIOCmd) formatCommandList.get(i); command.toXMLOutputStream(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
8,420
public boolean equals(Object obj) { if (obj instanceof ObjID && this.objNum == ((ObjID)obj).objNum) { return (true); } return (false);}
public boolean equals(Object obj) { if (obj instanceof ObjID && this.objNum == ((ObjID)obj).objNum) { return (true); } return (false);}
8,421
public boolean equals(Object obj) { if (obj instanceof ObjID && this.objNum == ((ObjID)obj).objNum) { return (true); } return (false);}
public boolean equals(Object obj) { if (obj instanceof ObjID && this.objNum == ((ObjID)obj).objNum) { return (true); } return (false);}
8,422
public int hashCode() { return ((int)objNum);}
public int hashCode() { return ((int)objNum);}
8,423
public String toString() { return ("[objNum: " + objNum + ", " + space + "]");}
public String toString() { return ("[objNum: " + objNum + ", " + space + "]");}
8,424
public String toString() { return ("[objNum: " + objNum + ", " + space + "]");}
public String toString() { return ("[objNum: " + objNum + ", " + space + "]");}
8,425
public String toString() { return ("[UID: " + unique + "," + time + "," + count + "]");}
public String toString() { return ("[UID: " + unique + "," + time + "," + count + "]");}
8,426
void processVTKeyPressed(KeyEvent e){ displayInfo(e); int keyCode = e.getKeyCode(); if (isLinux && keyCode == e.VK_ALT_GRAPH) { isAltGr = true; } // be careful with the control key if (keyCode == e.VK_UNDEFINED || keyCode == e.VK_CAPS_LOCK || keyCode == e.VK_SHIFT || keyCode == e.VK_ALT || keyCode == e.VK_ALT_GRAPH || keyCode == e.VK_CONTROL ) { return; } // be careful with the control key !!!!!! if (!e.isAltDown() || !e.isShiftDown() || !e.isControlDown() || keyCode != KeyEvent.VK_CONTROL && // be careful about removing this line !e.isActionKey()) {// if (keyCode == KeyEvent.VK_ESCAPE ||// keyCode == KeyEvent.VK_CONTROL ||// keyCode == KeyEvent.VK_BACK_SPACE) {// displayInfo(e,"Pressed added"); keyevent = e; dialog.setVisible(false); dialog.dispose();// } } }
void processVTKeyPressed(KeyEvent e){ displayInfo(e); int keyCode = e.getKeyCode(); if (isLinux && keyCode == KeyEvent.VK_ALT_GRAPH) { isAltGr = true; } // be careful with the control key if (keyCode == e.VK_UNDEFINED || keyCode == e.VK_CAPS_LOCK || keyCode == e.VK_SHIFT || keyCode == e.VK_ALT || keyCode == e.VK_ALT_GRAPH || keyCode == e.VK_CONTROL ) { return; } // be careful with the control key !!!!!! if (!e.isAltDown() || !e.isShiftDown() || !e.isControlDown() || keyCode != KeyEvent.VK_CONTROL && // be careful about removing this line !e.isActionKey()) {// if (keyCode == KeyEvent.VK_ESCAPE ||// keyCode == KeyEvent.VK_CONTROL ||// keyCode == KeyEvent.VK_BACK_SPACE) {// displayInfo(e,"Pressed added"); keyevent = e; dialog.setVisible(false); dialog.dispose();// } } }
8,427
void processVTKeyPressed(KeyEvent e){ displayInfo(e); int keyCode = e.getKeyCode(); if (isLinux && keyCode == e.VK_ALT_GRAPH) { isAltGr = true; } // be careful with the control key if (keyCode == e.VK_UNDEFINED || keyCode == e.VK_CAPS_LOCK || keyCode == e.VK_SHIFT || keyCode == e.VK_ALT || keyCode == e.VK_ALT_GRAPH || keyCode == e.VK_CONTROL ) { return; } // be careful with the control key !!!!!! if (!e.isAltDown() || !e.isShiftDown() || !e.isControlDown() || keyCode != KeyEvent.VK_CONTROL && // be careful about removing this line !e.isActionKey()) {// if (keyCode == KeyEvent.VK_ESCAPE ||// keyCode == KeyEvent.VK_CONTROL ||// keyCode == KeyEvent.VK_BACK_SPACE) {// displayInfo(e,"Pressed added"); keyevent = e; dialog.setVisible(false); dialog.dispose();// } } }
void processVTKeyPressed(KeyEvent e){ displayInfo(e); int keyCode = e.getKeyCode(); if (isLinux && keyCode == e.VK_ALT_GRAPH) { isAltGr = true; } // be careful with the control key if (keyCode == e.VK_UNDEFINED || keyCode == e.VK_CAPS_LOCK || keyCode == e.VK_SHIFT || keyCode == e.VK_ALT || keyCode == e.VK_ALT_GRAPH || keyCode == e.VK_CONTROL ) { return; } // be careful with the control key !!!!!! if (!e.isAltDown() || !e.isShiftDown() || !e.isControlDown() || keyCode != KeyEvent.VK_CONTROL && // be careful about removing this line !e.isActionKey()) {// if (keyCode == KeyEvent.VK_ESCAPE ||// keyCode == KeyEvent.VK_CONTROL ||// keyCode == KeyEvent.VK_BACK_SPACE) {// displayInfo(e,"Pressed added"); keyevent = e; dialog.setVisible(false); dialog.dispose();// } } }
8,428
void processVTKeyReleased(KeyEvent e){ displayInfo(e); if (isLinux && e.getKeyCode() == e.VK_ALT_GRAPH) { isAltGr = false; } int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e; dialog.setVisible(false); dialog.dispose(); } }
void processVTKeyReleased(KeyEvent e){ displayInfo(e); if (isLinux && e.getKeyCode() == KeyEvent.VK_ALT_GRAPH) { isAltGr = false; } int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e; dialog.setVisible(false); dialog.dispose(); } }
8,429
protected void emitStaticInitializerCalls(NativeStream nativeOs, VmType[] bootClasses, Object clInitCaller) throws ClassNotFoundException { final X86Stream os = (X86Stream) nativeOs; X86Stream.ObjectInfo initCallerObject = os.startObject(loadClass(VmMethodCode.class)); os.setObjectRef(clInitCaller); // Call VmClass.loadFromBootClassArray final VmType vmClassClass = loadClass(VmType.class); final VmMethod lfbcaMethod = vmClassClass.getMethod("loadFromBootClassArray", "([Lorg/jnode/vm/classmgr/VmType;)V"); final VmType vmMethodClass = loadClass(VmMethod.class); final VmInstanceField nativeCodeField = (VmInstanceField)vmMethodClass.getField("nativeCode"); os.writePUSH(bootClasses); os.writeMOV_Const(Register.EAX, lfbcaMethod); os.writeCALL(Register.EAX, nativeCodeField.getOffset()); // Now call all static initializers for (int i = 0;(i < bootClasses.length); i++) { VmType vmClass = bootClasses[i]; if ((vmClass instanceof VmClassType) && (((VmClassType) vmClass).getInstanceCount() > 0)) { VmMethod clInit = vmClass.getMethod("<clinit>", "()V"); if (clInit != null) { os.setObjectRef(clInitCaller + "$$" + vmClass.getName()); log.warn("Missing static initializer in class " + vmClass.getName()); /* * os.writeMOV(X86Constants.rEAX, clInit); */ } } } os.writeRET(); // RET os.align(4096); initCallerObject.markEnd(); }
protected void emitStaticInitializerCalls(NativeStream nativeOs, VmType[] bootClasses, Object clInitCaller) throws ClassNotFoundException { final X86Stream os = (X86Stream) nativeOs; X86Stream.ObjectInfo initCallerObject = os.startObject(loadClass(VmMethodCode.class)); os.setObjectRef(clInitCaller); // Call VmClass.loadFromBootClassArray final VmType vmClassClass = loadClass(VmType.class); final VmMethod lfbcaMethod = vmClassClass.getMethod("loadFromBootClassArray", "([Lorg/jnode/vm/classmgr/VmType;)V"); final VmType vmMethodClass = loadClass(VmMethod.class); final VmInstanceField nativeCodeField = (VmInstanceField)vmMethodClass.getField("nativeCode"); os.writePUSH(bootClasses); os.writeMOV_Const(Register.EAX, lfbcaMethod); os.writeCALL(Register.EAX, nativeCodeField.getOffset()); // Now call all static initializers for (int i = 0;(i < bootClasses.length); i++) { VmType vmClass = bootClasses[i]; if ((vmClass instanceof VmClassType) && (((VmClassType) vmClass).getInstanceCount() > 0)) { VmMethod clInit = vmClass.getMethod("<clinit>", "()V"); if (clInit != null) { os.setObjectRef(clInitCaller + "$$" + vmClass.getName()); log.warn("Missing static initializer in class " + vmClass.getName()); /* * os.writeMOV(X86Constants.rEAX, clInit); */ } } } os.writeRET(); // RET os.align(4096); initCallerObject.markEnd(); }
8,431
protected void storeImage(NativeStream os) throws BuildException { try { log.info("Creating image"); FileOutputStream fos = new FileOutputStream(getDestFile()); fos.write(os.getBytes(), 0, os.getLength()); fos.close(); /* * log.info("Creating ELF image"); final long start = System.currentTimeMillis(); final * Elf elf = ((X86Stream)os).toElf(); final long end = System.currentTimeMillis(); * log.info("... took " + (end-start) + "ms"); * elf.store(getDestFile().getAbsolutePath() + ".elf"); */ } catch (IOException ex) { throw new BuildException(ex); } }
protected void storeImage(NativeStream os) throws BuildException { try { log.info("Creating image"); FileOutputStream fos = new FileOutputStream(getDestFile()); fos.write(os.getBytes(), 0, os.getLength()); fos.close(); /* * log.info("Creating ELF image"); final long start = System.currentTimeMillis(); final * Elf elf = ((X86Stream)os).toElf(); final long end = System.currentTimeMillis(); * log.info("... took " + (end-start) + "ms"); * elf.store(getDestFile().getAbsolutePath() + ".elf"); */ } catch (IOException ex) { throw new BuildException(ex); } }
8,432
static int nativeLoad(String filename) { return 0; }
static int nativeLoad(String filename, ClassLoader loader) { return 0; }
8,433
public VarReturnQuad(int address, IRBasicBlock block, int varIndex) { super(address, block); this.operand = getOperand(varIndex); refs = new Operand[] { operand }; }
public VarReturnQuad(int address, IRBasicBlock block, int varIndex) { super(address, block); this.operand = getOperand(varIndex); refs = new Operand[] { operand }; }
8,437
public void doPass2(BootableHashMap liveVariables) { operand = operand.simplify(); if (operand instanceof Variable) { Variable v = (Variable) operand; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
public void doPass2(BootableHashMap liveVariables) { operand = operand.simplify(); if (operand instanceof Variable) { Variable v = (Variable) operand; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } }
8,438
public Operand getOperand() { return operand; }
public Operand getOperand() { return operand; }
8,439
public String toString() { return getAddress() + ": return " + operand; }
public String toString() { return getAddress() + ": return " + operand; }
8,440
public static Object command(Object arg) { // Our implementation defines this to a no-op. return null; }
public static Object command(Object arg) { // Our implementation defines this to a no-op. return VMCompiler.command(arg); }
8,441
public static boolean compileClass(Class oneClass) { // Never succeed. return false; }
public static boolean compileClass(Class oneClass) { // Never succeed. return VMCompiler.compileClass(oneClass); }
8,442
public static boolean compileClasses(String classNames) { // Note the incredibly lame interface. Always fail. return false; }
public static boolean compileClasses(String classNames) { // Note the incredibly lame interface. Always fail. return VMCompiler.compileClasses(classNames); }
8,443
public Object clone() throws CloneNotSupportedException { if (!(sigSpi instanceof Cloneable)) throw new CloneNotSupportedException(); Signature result = new DummySignature ((SignatureSpi) sigSpi.clone(), this.getAlgorithm()); result.provider = this.getProvider(); return result; }
public Object clone() throws CloneNotSupportedException { if (!(sigSpi instanceof Cloneable)) throw new CloneNotSupportedException(); Signature result = new DummySignature ((SignatureSpi) sigSpi.clone(), this.getAlgorithm()); result.provider = this.getProvider(); return result; }
8,446
public Object clone() throws CloneNotSupportedException { throw new CloneNotSupportedException(); }
public Object clone() throws CloneNotSupportedException { return super.clone(); }
8,447
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); int layerInt = layerNum.intValue(); if (layerInt == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
8,448
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); break; } else if (layerInt > layer.intValue()) { ret[1] = ret[0]; break; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
8,449
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration throw new IllegalArgumentException (); }
private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer) pair.getValue (); if (layerNum.intValue() == layer.intValue()) { ret[0] = ret[1] - layerSz.intValue (); return ret; } else { ret[1] -= layerSz.intValue (); } } // should have found the layer during iteration return ret; }
8,450
private void removeIt() { if (!macros && !special) { mapper.removeKeyStroke(mnemonicData[functions.getSelectedIndex()]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[functions.getSelectedIndex()])); } else { if (macros) { mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
private void removeIt() { if (!macros && !special) { mapper.removeKeyStroke(mnemonicData[functions.getSelectedIndex()]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[functions.getSelectedIndex()])); } else { if (macros) { mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
8,451
public Object stringToValue(String string) throws ParseException { Object value = string; Class valueClass = getValueClass(); if (valueClass == null) valueClass = getFormattedTextField().getValue().getClass(); if (valueClass != null) try { Constructor constr = valueClass.getConstructor (new Class[]{String.class}); value = constr.newInstance(new Object[]{ string }); } catch (NoSuchMethodException ex) { // leave value as string } catch (Exception ex) { throw new ParseException(string, 0); } return value; }
public Object stringToValue(String string) throws ParseException { Object value = string; Class valueClass = getValueClass(); if (valueClass == null) { JFormattedTextField jft = getFormattedTextField(); if (jft != null) valueClass = jft.getValue().getClass(); } if (valueClass != null) try { Constructor constr = valueClass.getConstructor (new Class[]{String.class}); value = constr.newInstance(new Object[]{ string }); } catch (NoSuchMethodException ex) { // leave value as string } catch (Exception ex) { throw new ParseException(string, 0); } return value; }
8,452
public Object clone() throws CloneNotSupportedException { return super.clone(); }
public Object clone() throws CloneNotSupportedException { return new MacAdapter((IMac) mac.clone(), new HashMap(attributes)); }
8,453
public int compare(Object one, Object two) { String s1 = one.toString(); String s2 = two.toString(); return s1.compareToIgnoreCase(s2); }
public int compare(Object one, Object two) { String s1 = one.toString(); String s2 = two.toString(); return s1.compareToIgnoreCase(s2); }
8,454
private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString("key."+mnemonicData[x]),x)); } Collections.sort(lk,new KeyDescriptionCompare()); for (int x = 0; x < mnemonicData.length; x++) {// lm.addElement(LangTool.getString("key."+mnemonicData[x])); lm.addElement(lk.get(x)); } macros = false; special = false; } else { if (which.equals(LangTool.getString("key.labelMacros"))) { if (macrosList != null) for (int x = 0; x < macrosList.length; x++) { lm.addElement(macrosList[x]); } macros = true; special = false; } else { // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; StringBuffer sb = new StringBuffer(); Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = codePage.ebcdic2uni(x); char ac = codePage.getASCIIChar(x); if (!Character.isISOControl(c)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c + " - " + getUnicodeString(c)); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); lm.addElement(keyc.getSourceString()); } macros = false; special = true; } } if (!lm.isEmpty()) functions.setSelectedIndex(0); }
privatevoidloadList(Stringwhich){lm.clear();lm.removeAllElements();if(which.equals(LangTool.getString("key.labelKeys"))){Vectorlk=newVector(mnemonicData.length);for(intx=0;x<mnemonicData.length;x++){lk.addElement(newKeyDescription(LangTool.getString("key."+mnemonicData[x]),x));}Collections.sort(lk,newKeyDescriptionCompare());for(intx=0;x<mnemonicData.length;x++){//lm.addElement(LangTool.getString("key."+mnemonicData[x]));lm.addElement(lk.get(x));}macros=false;special=false;}else{if(which.equals(LangTool.getString("key.labelMacros"))){if(macrosList!=null)for(intx=0;x<macrosList.length;x++){lm.addElement(macrosList[x]);}macros=true;special=false;}else{//wewilluseacollatorheresothatwecantakeadvantageofthelocalesCollatorcollator=Collator.getInstance();CollationKeykey=null;StringBuffersb=newStringBuffer();Setset=newTreeSet();for(intx=0;x<256;x++){charc=codePage.ebcdic2uni(x);charac=codePage.getASCIIChar(x);if(!Character.isISOControl(c)){sb.setLength(0);if(Integer.toHexString(ac).length()==1){sb.append("0x0"+Integer.toHexString(ac).toUpperCase());}else{sb.append("0x"+Integer.toHexString(ac).toUpperCase());}sb.append("-"+c+"-"+getUnicodeString(c));key=collator.getCollationKey(sb.toString());set.add(key);}}Iteratoriterator=set.iterator();while(iterator.hasNext()){CollationKeykeyc=(CollationKey)iterator.next();lm.addElement(keyc.getSourceString());}macros=false;special=true;}}if(!lm.isEmpty())functions.setSelectedIndex(0);}
8,455
private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString("key."+mnemonicData[x]),x)); } Collections.sort(lk,new KeyDescriptionCompare()); for (int x = 0; x < mnemonicData.length; x++) {// lm.addElement(LangTool.getString("key."+mnemonicData[x])); lm.addElement(lk.get(x)); } macros = false; special = false; } else { if (which.equals(LangTool.getString("key.labelMacros"))) { if (macrosList != null) for (int x = 0; x < macrosList.length; x++) { lm.addElement(macrosList[x]); } macros = true; special = false; } else { // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; StringBuffer sb = new StringBuffer(); Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = codePage.ebcdic2uni(x); char ac = codePage.getASCIIChar(x); if (!Character.isISOControl(c)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c + " - " + getUnicodeString(c)); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); lm.addElement(keyc.getSourceString()); } macros = false; special = true; } } if (!lm.isEmpty()) functions.setSelectedIndex(0); }
private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString("key."+mnemonicData[x]),x)); } Collections.sort(lk,new KeyDescriptionCompare()); for (int x = 0; x < mnemonicData.length; x++) {// lm.addElement(LangTool.getString("key."+mnemonicData[x])); lm.addElement(lk.get(x)); } macros = false; special = false; } else { if (which.equals(LangTool.getString("key.labelMacros"))) { if (macrosList != null) for (int x = 0; x < macrosList.length; x++) { macrosVector.add(macrosList[x]); } macros = true; special = false; } else { // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; StringBuffer sb = new StringBuffer(); Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = codePage.ebcdic2uni(x); char ac = codePage.getASCIIChar(x); if (!Character.isISOControl(c)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c + " - " + getUnicodeString(c)); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); lm.addElement(keyc.getSourceString()); } macros = false; special = true; } } if (!lm.isEmpty()) functions.setSelectedIndex(0); }
8,456
private void mapIt() { Object[] message = new Object[1]; JPanel kgp = new JPanel(); final KeyGetter kg = new KeyGetter(); kg.setForeground(Color.blue); message[0] = kgp; String function; if (functions.getSelectedValue() instanceof String) function = (String)functions.getSelectedValue(); else function = ((KeyDescription)functions.getSelectedValue()).toString(); kg.setText(LangTool.getString("key.labelMessage") + function); kgp.add(kg); String[] options = new String[1]; options[0] = LangTool.getString("key.labelClose"); JPanel kp = new JPanel(); JOptionPane opain = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, // option type null, options, options[0]); dialog = opain.createDialog(this, getTitle()); // add window listener to the dialog so that we can place focus on the // key getter label instead of default and set the new key value when // the window is closed. dialog.addWindowListener(new WindowAdapter() { boolean gotFocus = false; public void windowClosed(WindowEvent we) { setNewKeyStrokes(kg.keyevent); } public void windowActivated(WindowEvent we) { // Once window gets focus, set initial focus to our KeyGetter // component if (!gotFocus) { kg.grabFocus(); gotFocus = true; } } }); dialog.setVisible(true); }
private void mapIt() { Object[] message = new Object[1]; JPanel kgp = new JPanel(); final KeyGetter kg = new KeyGetter(); kg.setForeground(Color.blue); message[0] = kgp; String function; if (functions.getSelectedValue() instanceof String) function = (String)functions.getSelectedValue(); else if (functions.getSelectedValue() instanceof Macro) { function = ((Macro)functions.getSelectedValue()).toString(); } else function = ((KeyDescription)functions.getSelectedValue()).toString(); kg.setText(LangTool.getString("key.labelMessage") + function); kgp.add(kg); String[] options = new String[1]; options[0] = LangTool.getString("key.labelClose"); JPanel kp = new JPanel(); JOptionPane opain = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, // option type null, options, options[0]); dialog = opain.createDialog(this, getTitle()); // add window listener to the dialog so that we can place focus on the // key getter label instead of default and set the new key value when // the window is closed. dialog.addWindowListener(new WindowAdapter() { boolean gotFocus = false; public void windowClosed(WindowEvent we) { setNewKeyStrokes(kg.keyevent); } public void windowActivated(WindowEvent we) { // Once window gets focus, set initial focus to our KeyGetter // component if (!gotFocus) { kg.grabFocus(); gotFocus = true; } } }); dialog.setVisible(true); }
8,458
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
8,459
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } } mods = true; }
private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { mapper.removeKeyStroke((String)functions.getSelectedValue()); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } if (special) { String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); strokeDesc.setText(mapper.getKeyStrokeDesc( name)); } } mods = true; }
8,460
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); } else { if (macros) { System.out.println((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc((String)lm.getElementAt(index))); } if (special) { System.out.println((String)lm.getElementAt(index)); String k = ""; k += ((String)lm.getElementAt(index)).charAt(7); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); } else { if (macros) { System.out.println((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc((String)lm.getElementAt(index))); } if (special) { System.out.println((String)lm.getElementAt(index)); String k = ""; k += ((String)lm.getElementAt(index)).charAt(7); strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } } catch (ArrayIndexOutOfBoundsException ar) { System.out.println("ar at index " + index + " - " + ar.getMessage()); } }
8,461
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
8,462
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke(macro,ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
8,463
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke(macro,ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
8,464
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( (String)functions.getSelectedValue())); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { if (macros) { System.out.println((String)functions.getSelectedValue()); if (isLinux) mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); else mapper.setKeyStroke((String)functions.getSelectedValue(),ke); strokeDesc.setText(mapper.getKeyStrokeDesc( macro)); } if (special) { System.out.println((String)functions.getSelectedValue()); String k = ""; k += ((String)functions.getSelectedValue()).charAt(7); mapper.removeKeyStroke(k); if (isLinux) { mapper.setKeyStroke(k,ke,isAltGr); } else { mapper.setKeyStroke(k,ke); } strokeDesc.setText(mapper.getKeyStrokeDesc(k)); } } mods = true; }
8,465
public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
public String getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
8,467
public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
public DataFormat getDatatype() { return (String) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
8,468
private void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"axisUnits"); attribOrder.add(0,"axisDatatype"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("aligh", new XMLAttribute(null, Constants.STRING_TYPE)); //double check??? //set up the axisUnits attribute Units unitsObj = new Units(); attribHash.put("axisUnits", new XMLAttribute(unitsObj, Constants.OBJECT_TYPE)); unitsObj.setXDFNodeName("axisUnits"); attribHash.put("axisDatatype",new XMLAttribute(new StringDataFormat(), Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
private void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.add(0,"axisUnits"); attribOrder.add(0,"axisDatatype"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value //set the minimum array size(essentially the size of the axis) attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE)); attribHash.put("axisIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("axisId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("aligh", new XMLAttribute(null, Constants.STRING_TYPE)); //double check??? //set up the axisUnits attribute Units unitsObj = new Units(); attribHash.put("axisUnits", new XMLAttribute(unitsObj, Constants.OBJECT_TYPE)); unitsObj.setXDFNodeName("axisUnits"); attribHash.put("axisDatatype",new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
8,469
public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(datatype); }
public String setDatatype(String strDatatype) { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(datatype); }
8,470
public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(datatype); }
public DataFormat setDatatype(DataFormat datatype) { if (Utility.isValidDatatype(strDatatype)) return (String) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(strDatatype); else return null; }
8,471
public QName(String namespaceURI, String localPart, String prefix) { if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } this.namespaceURI = namespaceURI; this.localPart = localPart; this.prefix = prefix; StringBuffer buf = new StringBuffer(); if (namespaceURI != null && namespaceURI.length() > 0) { buf.append('{'); buf.append(namespaceURI); buf.append('}'); } if (prefix != null && prefix.length() > 0) { buf.append(prefix); buf.append(':'); } buf.append(localPart); qName = buf.toString(); }
public QName(String namespaceURI, String localPart) { if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } this.namespaceURI = namespaceURI; this.localPart = localPart; this.prefix = prefix; StringBuffer buf = new StringBuffer(); if (namespaceURI != null && namespaceURI.length() > 0) { buf.append('{'); buf.append(namespaceURI); buf.append('}'); } if (prefix != null && prefix.length() > 0) { buf.append(prefix); buf.append(':'); } buf.append(localPart); qName = buf.toString(); }
8,472
public QName(String namespaceURI, String localPart, String prefix) { if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } this.namespaceURI = namespaceURI; this.localPart = localPart; this.prefix = prefix; StringBuffer buf = new StringBuffer(); if (namespaceURI != null && namespaceURI.length() > 0) { buf.append('{'); buf.append(namespaceURI); buf.append('}'); } if (prefix != null && prefix.length() > 0) { buf.append(prefix); buf.append(':'); } buf.append(localPart); qName = buf.toString(); }
public QName(String namespaceURI, String localPart, String prefix) { if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } this.namespaceURI = namespaceURI; this.localPart = localPart; this.prefix = prefix; StringBuffer buf = new StringBuffer(); if (namespaceURI != null && namespaceURI.length() > 0) { buf.append('{'); buf.append(namespaceURI); buf.append('}'); } if (prefix != null && prefix.length() > 0) { buf.append(prefix); buf.append(':'); } buf.append(localPart); qName = buf.toString(); }
8,473
private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.mkdir()) { System.err.println(_fileDst.getParentFile().getAbsolutePath() + " cannot create "); return 0; } } for (int i = 0; i < subFile.length; i++) { final String name = subFile[ i].getName(); if (name.equals(".") || name.equals("..")) continue; File subDstDir = new File(dstDir.getAbsoluteFile() + File.separator + name); CpCommand cp = new CpCommand(subFile[ i], subDstDir, _mode, _recursive, _verbose); numberFileCopyed += cp.copy(); } return numberFileCopyed; }
private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopied = 0; if (!dstDir.exists()) { if (!dstDir.mkdir()) { System.err.println(_fileDst.getParentFile().getAbsolutePath() + " cannot create "); return 0; } } for (int i = 0; i < subFile.length; i++) { final String name = subFile[ i].getName(); if (name.equals(".") || name.equals("..")) continue; File subDstDir = new File(dstDir.getAbsoluteFile() + File.separator + name); CpCommand cp = new CpCommand(subFile[ i], subDstDir, _mode, _recursive, _verbose); numberFileCopyed += cp.copy(); } return numberFileCopyed; }
8,474
private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.mkdir()) { System.err.println(_fileDst.getParentFile().getAbsolutePath() + " cannot create "); return 0; } } for (int i = 0; i < subFile.length; i++) { final String name = subFile[ i].getName(); if (name.equals(".") || name.equals("..")) continue; File subDstDir = new File(dstDir.getAbsoluteFile() + File.separator + name); CpCommand cp = new CpCommand(subFile[ i], subDstDir, _mode, _recursive, _verbose); numberFileCopyed += cp.copy(); } return numberFileCopyed; }
private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.mkdir()) { System.err.println(_fileDst.getParentFile().getAbsolutePath() + " cannot create "); return 0; } } for (int i = 0; i < subFile.length; i++) { final String name = subFile[ i].getName(); if (name.equals(".") || name.equals("..")) continue; File subDstDir = new File(dstDir.getAbsoluteFile() + File.separator + name); CpCommand cp = new CpCommand(subFile[ i], subDstDir, _mode, _recursive, _verbose); numberFileCopied += cp.copy(); } return numberFileCopyed; }
8,475
private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.mkdir()) { System.err.println(_fileDst.getParentFile().getAbsolutePath() + " cannot create "); return 0; } } for (int i = 0; i < subFile.length; i++) { final String name = subFile[ i].getName(); if (name.equals(".") || name.equals("..")) continue; File subDstDir = new File(dstDir.getAbsoluteFile() + File.separator + name); CpCommand cp = new CpCommand(subFile[ i], subDstDir, _mode, _recursive, _verbose); numberFileCopyed += cp.copy(); } return numberFileCopyed; }
private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.mkdir()) { System.err.println(_fileDst.getParentFile().getAbsolutePath() + " cannot create "); return 0; } } for (int i = 0; i < subFile.length; i++) { final String name = subFile[ i].getName(); if (name.equals(".") || name.equals("..")) continue; File subDstDir = new File(dstDir.getAbsoluteFile() + File.separator + name); CpCommand cp = new CpCommand(subFile[ i], subDstDir, _mode, _recursive, _verbose); numberFileCopyed += cp.copy(); } return numberFileCopied; }
8,476
public static void main(String[] args) throws Exception { CpCommand cpCommand = new CpCommand(args); int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copied"); }
public static void main(String[] args) throws Exception { CpCommand cpCommand = new CpCommand(args); int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copied"); }
8,477
public static Enumeration getSaslClientFactories() { Vector result = new Vector(); HashSet names = new HashSet(); Provider[] providers = Security.getProviders(); Iterator it; if (providers == null) { Provider p; String key; for (int i = 0; i < providers.length; i++) { p = providers[i]; for (it = p.keySet().iterator(); it.hasNext(); ) { key = (String) it.next(); // add key's binding (a) it is a class of a client factory, // and (b) the key does not include blanks if (key.startsWith(CLIENT_FACTORY_SVC) && key.indexOf(" ") == -1) { names.add(p.getProperty(key)); break; } } } } // we have the factory class names in names; instantiate and enumerate String c; for (it = names.iterator(); it.hasNext(); ) { c = (String) it.next(); try { SaslClientFactory f = (SaslClientFactory) Class.forName(c).newInstance(); if (f != null) result.add(f); } catch (ClassCastException ignored) { // ignore instantiation exceptions } catch (ClassNotFoundException ignored) { } catch (InstantiationException ignored) { } catch (IllegalAccessException ignored) { } } return result.elements(); }
public static Enumeration getSaslClientFactories() { Vector result = new Vector(); HashSet names = new HashSet(); Provider[] providers = Security.getProviders(); Iterator it; if (providers != null) { Provider p; String key; for (int i = 0; i < providers.length; i++) { p = providers[i]; for (it = p.keySet().iterator(); it.hasNext(); ) { key = (String) it.next(); // add key's binding (a) it is a class of a client factory, // and (b) the key does not include blanks if (key.startsWith(CLIENT_FACTORY_SVC) && key.indexOf(" ") == -1) { names.add(p.getProperty(key)); break; } } } } // we have the factory class names in names; instantiate and enumerate String c; for (it = names.iterator(); it.hasNext(); ) { c = (String) it.next(); try { SaslClientFactory f = (SaslClientFactory) Class.forName(c).newInstance(); if (f != null) result.add(f); } catch (ClassCastException ignored) { // ignore instantiation exceptions } catch (ClassNotFoundException ignored) { } catch (InstantiationException ignored) { } catch (IllegalAccessException ignored) { } } return result.elements(); }
8,478
public static Enumeration getSaslServerFactories() { Vector result = new Vector(); HashSet names = new HashSet(); Provider[] providers = Security.getProviders(); Iterator it; if (providers == null) { Provider p; String key; for (int i = 0; i < providers.length; i++) { p = providers[i]; for (it = p.keySet().iterator(); it.hasNext(); ) { key = (String) it.next(); // add key's binding (a) it is a class of a server factory, // and (b) the key does not include blanks if (key.startsWith(SERVER_FACTORY_SVC) && key.indexOf(" ") == -1) { names.add(p.getProperty(key)); break; } } } } // we have the factory class names in names; instantiate and enumerate String c; for (it = names.iterator(); it.hasNext(); ) { c = (String) it.next(); try { SaslServerFactory f = (SaslServerFactory) Class.forName(c).newInstance(); if (f != null) result.add(f); } catch (ClassCastException ignored) // ignore instantiation exceptions { } catch (ClassNotFoundException ignored) { } catch (InstantiationException ignored) { } catch (IllegalAccessException ignored) { } } return result.elements(); }
public static Enumeration getSaslServerFactories() { Vector result = new Vector(); HashSet names = new HashSet(); Provider[] providers = Security.getProviders(); Iterator it; if (providers != null) { Provider p; String key; for (int i = 0; i < providers.length; i++) { p = providers[i]; for (it = p.keySet().iterator(); it.hasNext(); ) { key = (String) it.next(); // add key's binding (a) it is a class of a server factory, // and (b) the key does not include blanks if (key.startsWith(SERVER_FACTORY_SVC) && key.indexOf(" ") == -1) { names.add(p.getProperty(key)); break; } } } } // we have the factory class names in names; instantiate and enumerate String c; for (it = names.iterator(); it.hasNext(); ) { c = (String) it.next(); try { SaslServerFactory f = (SaslServerFactory) Class.forName(c).newInstance(); if (f != null) result.add(f); } catch (ClassCastException ignored) // ignore instantiation exceptions { } catch (ClassNotFoundException ignored) { } catch (InstantiationException ignored) { } catch (IllegalAccessException ignored) { } } return result.elements(); }
8,479
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[]) this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
8,480
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[]) this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
8,481
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[]) this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
8,482
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[])this.Ki.clone(); return result; }
public Object clone() throws CloneNotSupportedException { TMMH16 result = (TMMH16) super.clone(); if (this.keystream != null) result.keystream = (IRandom) this.keystream.clone(); if (this.prefix != null) result.prefix = (byte[])this.prefix.clone(); if (this.context != null) result.context = (int[])this.context.clone(); if (this.K0 != null) result.K0 = (int[])this.K0.clone(); if (this.Ki != null) result.Ki = (int[]) this.Ki.clone(); return result; }
8,483
public void connect(Remote remote, Remote remote1) throws RemoteException { throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); }
public void connect(Remote a_target, Remote a_source) throws RemoteException { throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); }
8,484
public void connect(Remote remote, Remote remote1) throws RemoteException { throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); }
public void connect(Remote remote, Remote remote1) throws RemoteException { ORB orb = null; POA poa = null; boolean ok = false; try { if (a_source instanceof Servant) { Servant s = (Servant) a_source; orb = s._orb(); poa = s._poa(); ok = true; }
8,485
public void exportObject(Remote obj) throws RemoteException { PortableServer.exportObject(obj); }
public void exportObject(Remote obj) throws RemoteException { if (obj instanceof Stub) Util.registerTarget(StubDelegateImpl.getTieFromStub((Stub) obj), obj); else if (obj instanceof Tie) { Tie t = (Tie) obj; Util.registerTarget(t, null); } }
8,487
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); else if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
8,488
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
8,489
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
8,490
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
8,491
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object ClassCastException cex = new ClassCastException("Cannot instantiate " + narrowTo.getName()); cex.initCause(e); throw cex; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { ClassCastException cex = new ClassCastException("Cannot instantiate " + narrowTo.getName()); cex.initCause(e); throw cex; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
8,492
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else { System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrace(); } System.exit(2); //throw new Error("We still haven't implement this case: narrow " // + narrowFrom + " of type " + fromClass + " to " // + narrowTo); /* ObjectImpl objimpl = (ObjectImpl)narrowFrom; if(objimpl._is_a(PortableServer.getTypeName(narrowTo))) result = PortableServer.getStubFromObjectImpl(objimpl, narrowTo); */ } } catch(Exception e) { result = null; } if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; }
8,493
public Remote toStub(Remote obj) throws NoSuchObjectException { return PortableServer.toStub(obj); }
public Remote toStub(Remote ObjImpl) throws NoSuchObjectException { return PortableServer.toStub(obj); }
8,494
public Remote toStub(Remote obj) throws NoSuchObjectException { return PortableServer.toStub(obj); }
public Remote toStub(Remote obj) throws NoSuchObjectException { String icn = ObjImpl.getClass().getName(); if (!icn.endsWith("Impl")) throw new BAD_PARAM("Invalid class name '" + icn + "', must end with 'Impl'"); String sn = "_" + icn.substring(0, icn.length() - "Impl".length()) + "_Stub"; Class stubClass; Object o_stub; try { stubClass = RMIClassLoader.loadClass(sn); o_stub = stubClass.newInstance(); } catch (Exception e) { NoSuchObjectException n = new NoSuchObjectException(sn); n.initCause(e); throw n; } if (!Remote.class.isAssignableFrom(stubClass)) throw new ClassCastException(stubClass.getName() + " exists but cannot be returned as it does not inherit from " + Remote.class.getName()); return (Remote) o_stub; }
8,495
public void unexportObject(Remote obj) throws NoSuchObjectException { PortableServer.unexportObject(obj); }
public void unexportObject(Remote obj) throws NoSuchObjectException { Util.unexportObject(obj); }
8,496
public void mouseWheelMoved(MouseWheelEvent e) { if (scrollpane.getViewport().getComponentCount() == 0) return; Component target = scrollpane.getViewport().getComponent(0); JScrollBar bar = scrollpane.getVerticalScrollBar(); Scrollable scrollable = (target instanceof Scrollable) ? (Scrollable) target : null; boolean tracksHeight = scrollable != null && scrollable.getScrollableTracksViewportHeight(); int wheel = e.getWheelRotation() * ROWS_PER_WHEEL_CLICK; int delta; // If possible, scroll vertically. if (bar != null && ! tracksHeight) { if (scrollable != null) { bounds(target); delta = scrollable.getScrollableUnitIncrement( rect, SwingConstants.VERTICAL, wheel); } else { // Scroll non scrollables. delta = wheel * SCROLL_NON_SCROLLABLES; } scroll(bar, delta); } // If not, try to scroll horizontally else { bar = scrollpane.getHorizontalScrollBar(); boolean tracksWidth = scrollable != null && scrollable.getScrollableTracksViewportWidth(); if (bar != null && ! tracksWidth) { if (scrollable != null) { bounds(target); delta = scrollable.getScrollableUnitIncrement( rect, SwingConstants.HORIZONTAL, wheel); } else { // Scroll non scrollables. delta = wheel * SCROLL_NON_SCROLLABLES; } scroll(bar, delta); } } }
public void mouseWheelMoved(MouseWheelEvent e) { if (scrollpane.getViewport().getComponentCount() == 0) return; Component target = scrollpane.getViewport().getComponent(0); JScrollBar bar = scrollpane.getVerticalScrollBar(); Scrollable scrollable = (target instanceof Scrollable) ? (Scrollable) target : null; boolean tracksHeight = scrollable != null && scrollable.getScrollableTracksViewportHeight(); int wheel = e.getWheelRotation() * ROWS_PER_WHEEL_CLICK; int delta; // If possible, scroll vertically. if (bar != null && ! tracksHeight) { if (scrollable != null) { bounds(target); delta = scrollable.getScrollableUnitIncrement( rect, SwingConstants.VERTICAL, wheel); } else { // Scroll non scrollables. delta = wheel * SCROLL_NON_SCROLLABLES; } scroll(bar, wheel > 0 ? delta : -delta); } // If not, try to scroll horizontally else { bar = scrollpane.getHorizontalScrollBar(); boolean tracksWidth = scrollable != null && scrollable.getScrollableTracksViewportWidth(); if (bar != null && ! tracksWidth) { if (scrollable != null) { bounds(target); delta = scrollable.getScrollableUnitIncrement( rect, SwingConstants.HORIZONTAL, wheel); } else { // Scroll non scrollables. delta = wheel * SCROLL_NON_SCROLLABLES; } scroll(bar, wheel > 0 ? delta : -delta); } } }
8,497
public void paint(Graphics g, JComponent c) { // do nothing; the normal painting-of-children algorithm, along with // ScrollPaneLayout, does all the relevant work. }
Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } public void paint(Graphics g, JComponent c)Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } {Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } // do nothing; the normal painting-of-children algorithm, along withBorder vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } // ScrollPaneLayout, does all the relevant work.Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } }
8,499
protected void uninstallDefaults(JScrollPane p) { p.setForeground(null); p.setBackground(null); p.setFont(null); p.setBorder(null); scrollpane = null; }
protected void uninstallDefaults(JScrollPane p) { p.setForeground(null); p.setBackground(null); p.setFont(null); p.setBorder(null); scrollpane = null; }
8,500
public void popupMenuWillBecomeInvisible(PopupMenuEvent event) { // remove listener that listens to component events fired // by the top - level window that this popup belongs to. Component invoker = popupMenu.getInvoker(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); rootContainer.removeComponentListener(topWindowListener); }
public void popupMenuWillBecomeInvisible(PopupMenuEvent event) { // remove listener that listens to component events fired // by the top - level window that this popup belongs to. Component invoker = popupMenu.getInvoker(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); rootContainer.removeComponentListener(topWindowListener); }
8,508
public void popupMenuWillBecomeVisible(PopupMenuEvent event) { // Adds topWindowListener to top-level window to listener to // ComponentEvents fired by it. We need to cancel this popup menu // if topWindow to which this popup belongs was resized or moved. Component invoker = popupMenu.getInvoker(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); rootContainer.addComponentListener(topWindowListener); // if this popup menu is a free floating popup menu, // then by default its first element should be always selected when // this popup menu becomes visible. MenuSelectionManager manager = MenuSelectionManager.defaultManager(); if (manager.getSelectedPath().length == 0) { // Set selected path to point to the first item in the popup menu MenuElement[] path = new MenuElement[2]; path[0] = popupMenu; Component[] comps = popupMenu.getComponents(); if (comps.length != 0 && comps[0] instanceof MenuElement) { path[1] = (MenuElement) comps[0]; manager.setSelectedPath(path); } } }
public void popupMenuWillBecomeVisible(PopupMenuEvent event) { // Adds topWindowListener to top-level window to listener to // ComponentEvents fired by it. We need to cancel this popup menu // if topWindow to which this popup belongs was resized or moved. Component invoker = popupMenu.getInvoker(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); rootContainer.addComponentListener(topWindowListener); // if this popup menu is a free floating popup menu, // then by default its first element should be always selected when // this popup menu becomes visible. MenuSelectionManager manager = MenuSelectionManager.defaultManager(); if (manager.getSelectedPath().length == 0) { // Set selected path to point to the first item in the popup menu MenuElement[] path = new MenuElement[2]; path[0] = popupMenu; Component[] comps = popupMenu.getComponents(); if (comps.length != 0 && comps[0] instanceof MenuElement) { path[1] = (MenuElement) comps[0]; manager.setSelectedPath(path); } } }
8,509
public BasicPopupMenuUI() { popupMenuListener = new PopupMenuHandler(); mouseInputListener = new MouseInputHandler(); topWindowListener = new TopWindowListener(); }
public BasicPopupMenuUI() { popupMenuListener = new PopupMenuHandler(); topWindowListener = new TopWindowListener(); }
8,510
protected void installListeners() { popupMenu.addMouseListener(mouseInputListener); popupMenu.addMouseMotionListener(mouseInputListener); popupMenu.addPopupMenuListener(popupMenuListener); }
protected void installListeners() { popupMenu.addMouseListener(mouseInputListener); popupMenu.addMouseMotionListener(mouseInputListener); popupMenu.addPopupMenuListener(popupMenuListener); }
8,511
protected void uninstallListeners() { popupMenu.removeMouseListener(mouseInputListener); popupMenu.removeMouseMotionListener(mouseInputListener); popupMenu.removePopupMenuListener(popupMenuListener); }
protected void uninstallListeners() { popupMenu.removeMouseListener(mouseInputListener); popupMenu.removeMouseMotionListener(mouseInputListener); popupMenu.removePopupMenuListener(popupMenuListener); }
8,512
public ChangeHandler(JMenu m, BasicMenuUI ui) { // Not used. }
menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; publicmenu = m; this.ui = ui; ChangeHandler(JMenumenu = m; this.ui = ui; m,menu = m; this.ui = ui; BasicMenuUImenu = m; this.ui = ui; ui)menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; {menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; //menu = m; this.ui = ui; Notmenu = m; this.ui = ui; used.menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; menu = m; this.ui = ui; }
8,513
public void menuDragMouseDragged(MenuDragMouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); }
public void menuDragMouseDragged(MenuDragMouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); }
8,514
public void menuDragMouseEntered(MenuDragMouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); }
public void menuDragMouseEntered(MenuDragMouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); }
8,515
public void menuDragMouseExited(MenuDragMouseEvent e) { // TODO: What should be done here, if anything? }
public void menuDragMouseExited(MenuDragMouseEvent e) { // TODO: What should be done here, if anything? }
8,516
public void menuDragMouseReleased(MenuDragMouseEvent e) { // TODO: What should be done here, if anything? }
public void menuDragMouseReleased(MenuDragMouseEvent e) { // TODO: What should be done here, if anything? }
8,517
public void menuKeyPressed(MenuKeyEvent e) { // TODO: What should be done here, if anything? }
public void menuKeyPressed(MenuKeyEvent e) { // TODO: What should be done here, if anything? }
8,518
public void menuKeyReleased(MenuKeyEvent e) { // TODO: What should be done here, if anything? }
public void menuKeyReleased(MenuKeyEvent e) { // TODO: What should be done here, if anything? }
8,519
public void mouseClicked(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.processMouseEvent(e); }
public void mouseClicked(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.processMouseEvent(e); }
8,521
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
8,522
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
8,523
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
8,524
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); manager.processMouseEvent(e); } }
public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. (If nothing was selected, menu should be pressed before it will be selected) */ JMenu menu = (JMenu) menuItem; // NOTE: the following if used to require !menu.isArmed but I could find // no reason for this and it was preventing some JDK-compatible behaviour. // Specifically, if a menu is selected but its popup menu not visible, // and then another menu is selected whose popup menu IS visible, when // the mouse is moved over the first menu, its popup menu should become // visible. if (! menu.isTopLevelMenu() || popupVisible()) { // set new selection and forward this event to MenuSelectionManager MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(getPath()); setupPostTimer(menu); } } } else { if(selectedPath.length > 0 && selectedPath[0] == menu.getParent()) { MenuElement[] newPath = new MenuElement[3]; newPath[0] = (MenuElement) menu.getParent(); newPath[1] = menu; newPath[2] = menu.getPopupMenu(); manager.setSelectedPath(newPath); } } } }
8,525
public void mouseMoved(MouseEvent e) { // TODO: What should be done here, if anything? }
public void mouseMoved(MouseEvent e) { // TODO: What should be done here, if anything? }
8,526
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; if (menu.isEnabled()) { // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
8,527
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
8,528
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()) { if (menu.getPopupMenu().isVisible()) // If menu is visible and menu button was pressed.. // then need to cancel the menu manager.clearSelectedPath(); else { // Display the menu int x = 0; int y = menu.getHeight(); manager.setSelectedPath(getPath()); JMenuBar mb = (JMenuBar) menu.getParent(); // set selectedIndex of the selectionModel of a menuBar mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } } }
8,529