bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
getSelectedCheckbox(){ return(selectedCheckbox);}
getSelectedCheckbox(){ return getCurrent ();}
5,122
setCurrent(Checkbox selectedCheckbox){ setSelectedCheckbox(selectedCheckbox);}
setCurrent(Checkbox selectedCheckbox){ if (this.selectedCheckbox != null) { if (this.selectedCheckbox.getCheckboxGroup() != this) return; this.selectedCheckbox.setState(false); } this.selectedCheckbox = selectedCheckbox; if (selectedCheckbox != null) selectedCheckbox.setState(true);}
5,123
setSelectedCheckbox(Checkbox selectedCheckbox){ if (this.selectedCheckbox != null) { if (this.selectedCheckbox.getCheckboxGroup() != this) return; this.selectedCheckbox.setState(false); } this.selectedCheckbox = selectedCheckbox; if (selectedCheckbox != null) selectedCheckbox.setState(true);}
setSelectedCheckbox(Checkbox selectedCheckbox){ if (this.selectedCheckbox != null) { if (this.selectedCheckbox.getCheckboxGroup() != this) return; this.selectedCheckbox.setState(false); } this.selectedCheckbox = selectedCheckbox; if (selectedCheckbox != null) selectedCheckbox.setState(true);}
5,124
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); setText(s); setOpaque(true); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); // Use focusCellHighlightBorder when renderer has focus and // noFocusBorder otherwise if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder); return this; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); FontMetrics fm = getToolkit().getFontMetrics(list.getFont()); int strWidth = SwingUtilities.computeStringWidth(fm, s); int cbWidth = getSize().width; if (cbWidth != 0 && strWidth > cbWidth) { char[] str = s.toCharArray(); int currWidth = 0; int i = 0; String postStr = "... "; cbWidth -= SwingUtilities.computeStringWidth(fm, postStr); while (i < str.length && currWidth < cbWidth) { ++i; currWidth = SwingUtilities.computeStringWidth(fm, new String(str, 0, i)); } setText(new String(str, 0, i) + postStr); } else setText(s); setOpaque(true); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); // Use focusCellHighlightBorder when renderer has focus and // noFocusBorder otherwise if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder); return this; }
5,125
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); setText(s); setOpaque(true); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); // Use focusCellHighlightBorder when renderer has focus and // noFocusBorder otherwise if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder); return this; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); setText(s); setOpaque(true); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); // Use focusCellHighlightBorder when renderer has focus and // noFocusBorder otherwise if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder); return this; }
5,126
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); setText(s); setOpaque(true); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); // Use focusCellHighlightBorder when renderer has focus and // noFocusBorder otherwise if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder); return this; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String s = value.toString(); setText(s); setOpaque(true); UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setEnabled(list.isEnabled()); setFont(list.getFont()); // Use focusCellHighlightBorder when renderer has focus and // noFocusBorder otherwise if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder); return this; }
5,127
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address frame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
5,129
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
5,130
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (sfEnum.isValid() && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
5,131
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; sfEnum.next(); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); sfEnum.next(); } return stack; }
5,132
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
5,133
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address sfEnum.reset(frame, ip); int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; sfEnum.reset(frame, ip); for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
5,134
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); // Subtract 1, because the return address is directly after // the location where the previous frame was executing. ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f); } return stack; }
5,135
public void flush() throws IOException { //TODO: perhaps nothing todo (always readOnly ?) }
public void flush() throws IOException { //TODO: perhaps nothing todo (always readOnly ?) if (isReadOnly()) { } else { } }
5,136
public FSEntry getRootEntry() throws IOException { return new ISO9660Entry(volume.getVolumeDescriptor().getRootDirectoryEntry()); }
public FSEntry getRootEntry() throws IOException { return new ISO9660Entry(volume.getVolumeDescriptor().getRootDirectoryEntry()); }
5,137
private Raster createCompatibleRaster(Raster raster) { //todo fix gif images (index color model?), optimize final ColorModel dst_model = surface.getColorModel(); final int[] samples = new int[4]; final int w = raster.getWidth(); final int h = raster.getHeight(); final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { raster.getPixel(x, y, samples); dst_raster.setPixel(x, y, samples); } } return dst_raster; }
private Raster createCompatibleRaster(Raster raster, ColorModel model) { //todo fix gif images (index color model?), optimize final ColorModel dst_model = surface.getColorModel(); final int[] samples = new int[4]; final int w = raster.getWidth(); final int h = raster.getHeight(); final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { raster.getPixel(x, y, samples); dst_raster.setPixel(x, y, samples); } } return dst_raster; }
5,138
private Raster createCompatibleRaster(Raster raster) { //todo fix gif images (index color model?), optimize final ColorModel dst_model = surface.getColorModel(); final int[] samples = new int[4]; final int w = raster.getWidth(); final int h = raster.getHeight(); final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { raster.getPixel(x, y, samples); dst_raster.setPixel(x, y, samples); } } return dst_raster; }
private Raster createCompatibleRaster(Raster raster) { //todo fix gif images (index color model?), optimize final ColorModel dst_model = surface.getColorModel(); final int[] samples = new int[4]; final int w = raster.getWidth(); final int h = raster.getHeight(); final WritableRaster dst_raster = dst_model.createCompatibleWritableRaster(w, h); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { raster.getPixel(x, y, samples); dst_raster.setPixel(x, y, samples); } } return dst_raster; }
5,139
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final BufferedImage b_image = (BufferedImage) image; final Raster raster = b_image.getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
5,140
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster, b_image.getColorModel()); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster, b_image.getColorModel()); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
5,141
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else if (image instanceof RenderedImage) { // We have a direct raster final RenderedImage r_image = (RenderedImage) image; final Raster raster = r_image.getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
5,142
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
private Raster getCompatibleRaster(Image image) throws InterruptedException { final ColorModel dstModel = surface.getColorModel(); if (image instanceof BufferedImage) { // We have a direct raster final Raster raster = ((BufferedImage) image).getRaster(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster, r_image.getColorModel()); } } else if (image instanceof RenderedImage) { // We have a direct raster final Raster raster = ((RenderedImage) image).getData(); if (dstModel.isCompatibleRaster(raster)) { // Raster is compatible, return without changes return raster; } else { // Convert it into a compatible raster return createCompatibleRaster(raster, r_image.getColorModel()); } } else { // Convert it to a raster final PixelGrabber grabber = new PixelGrabber(image, 0, 0, -1, -1, true); if (grabber.grabPixels()) { final int w = grabber.getWidth(); final int h = grabber.getHeight(); final WritableRaster raster = dstModel.createCompatibleWritableRaster(w, h); final int[] pixels = (int[]) grabber.getPixels(); Object dataElems = null; for (int y = 0; y < h; y++) { final int ofsY = y * w; for (int x = 0; x < w; x++) { final int rgb = pixels[ofsY + x]; dataElems = dstModel.getDataElements(rgb, dataElems); raster.setDataElements(x, y, dataElems); } } return raster; } else { throw new IllegalArgumentException("Cannot grab pixels"); } } }
5,143
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList methods = new ArrayList(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] table = new int[ count * 3]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { table[ i + 0] = methods.indexOf(p.method); table[ i + 1] = p.pc; table[ i + 2] = p.offset; if (p.offset < lastOffset) { throw new VirtualMachineError( "unordered offset found"); } lastOffset = p.offset; i += 3; p = p.next; } this.table = table; this.list = null; }
final void lock() { AddressPcEntry p = list; int count = 0; final ArrayList methods = new ArrayList(); while (p != null) { count++; final VmMethod m = p.method; if (!methods.contains(m)) { methods.add(m); } p = p.next; } final int[] table = new int[ count * 3]; this.methodTable = (VmMethod[]) methods.toArray(new VmMethod[ methods .size()]); p = list; int i = 0; int lastOffset = -1; while (p != null) { table[ i + 0] = methods.indexOf(p.method); table[ i + 1] = p.pc; table[ i + 2] = p.offset; if (p.offset < lastOffset) { throw new InternalError( "unordered offset found"); } lastOffset = p.offset; i += 3; p = p.next; } this.table = table; this.list = null; }
5,144
protected final void copyMe() { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); StringBuffer s = new StringBuffer(); if (!gui.rubberband.isAreaSelected()) workR.setBounds(0,0,numCols,numRows); else { // lets get the bounding area using a rectangle that we have already // allocated gui.rubberband.getBoundingArea(workR); // get starting row and column int sPos = getRowColFromPoint(workR.x , workR.y ); // get the width and height int ePos = getRowColFromPoint(workR.width , workR.height ); int r = getRow(sPos); int c = getCol(sPos); workR.setBounds(r,c,getCol(ePos),getRow(ePos)); gui.rubberband.reset(); gui.repaint(); } System.out.println("Copying"); System.out.println(workR); // loop through all the screen characters to send them to the clip board int m = workR.x; int i = 0; int t = 0; while (workR.height-- > 0) { t = workR.width; i = workR.y; while (t-- > 0) { // only copy printable characters (in this case >= ' ') char c = screen[getPos(m,i)].getChar(); if (c >= ' ' && !screen[getPos(m,i)].nonDisplay) s.append(c); else s.append(' '); i++; } s.append('\n'); m++; } StringSelection contents = new StringSelection(s.toString()); cb.setContents(contents, null); }
protected final void copyMe() { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); StringBuffer s = new StringBuffer(); if (!gui.rubberband.isAreaSelected()) workR.setBounds(0,0,numCols,numRows); else { // lets get the bounding area using a rectangle that we have already // allocated gui.rubberband.getBoundingArea(workR); // get starting row and column int sPos = getRowColFromPoint(workR.x , workR.y ); // get the width and height int ePos = getRowColFromPoint(workR.width , workR.height ); int r = getRow(sPos); int c = getCol(sPos); workR.setBounds(r,c,c2,r2); gui.rubberband.reset(); gui.repaint(); } System.out.println("Copying"); System.out.println(workR); // loop through all the screen characters to send them to the clip board int m = workR.x; int i = 0; int t = 0; while (workR.height-- > 0) { t = workR.width; i = workR.y; while (t-- > 0) { // only copy printable characters (in this case >= ' ') char c = screen[getPos(m,i)].getChar(); if (c >= ' ' && !screen[getPos(m,i)].nonDisplay) s.append(c); else s.append(' '); i++; } s.append('\n'); m++; } StringSelection contents = new StringSelection(s.toString()); cb.setContents(contents, null); }
5,146
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } return 0; }
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom // int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } return 0; }
5,147
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } return 0; }
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } return 0; }
5,148
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } return 0; }
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); if (x > tArea.getMaxX()) x = (int)tArea.getMaxX() - 1; if (y > tArea.getMaxY()) y = (int)tArea.getMaxY() - 1; if (x < tArea.getMinX()) x = 0; if (y < tArea.getMinY()) y = 0; return 0; if (x > tArea.getMaxX()) x = (int)tArea.getMaxX() - 1; if (y > tArea.getMaxY()) y = (int)tArea.getMaxY() - 1; if (x < tArea.getMinX()) x = 0; if (y < tArea.getMinY()) y = 0;
5,149
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } return 0; }
public int getRowColFromPoint (int x, int y) { // is x,y in the drawing area // x is left to right and y is top to bottom if (tArea.contains(x,y)) {// int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));// System.out.println(cols); return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) ); } int s = fmWidth * numCols; int t = s - x; int u = t / fmWidth; int v = numCols - u; int s0 = y / fmHeight; int s1 = x / fmWidth; return getPos(s0, s1 ); }
5,150
public void moveCursor (MouseEvent e) { if(!keyboardLocked) { int pos = getRowColFromPoint(e.getX(),e.getY());// System.out.println((getRow(pos)) + "," + (getCol(pos)));// System.out.println(e.getX() + "," + e.getY()+ "," + fmWidth+ "," + fmHeight); if (pos == 0) return ; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 pos -= (numCols + 1); int g = screen[pos].getWhichGUI(); // lets check for hot spots if (g >= ScreenChar.BUTTON_LEFT && g <= ScreenChar.BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case ScreenChar.BUTTON_RIGHT: case ScreenChar.BUTTON_MIDDLE: while (screen[--pos].getWhichGUI() != ScreenChar.BUTTON_LEFT) { } case ScreenChar.BUTTON_LEFT: if (screen[pos].getChar() == 'F') { pos++; } else aidFlag=false; if (screen[pos+1].getChar() != '=' && screen[pos+1].getChar() != '.' && screen[pos+1].getChar() != '/' ) {// System.out.println(" Hotspot clicked!!! we will send characters " +// screen[pos].getChar() +// screen[pos+1].getChar()); aid.append(screen[pos].getChar()); aid.append(screen[pos + 1].getChar()); } else {// System.out.println(" Hotspot clicked!!! we will send character " +// screen[pos].getChar());// aid.append(screen[pos].getChar()); } break; } if (aidFlag) { switch (g) { case ScreenChar.BUTTON_LEFT_UP: case ScreenChar.BUTTON_MIDDLE_UP: case ScreenChar.BUTTON_RIGHT_UP: case ScreenChar.BUTTON_ONE_UP: case ScreenChar.BUTTON_SB_UP: case ScreenChar.BUTTON_SB_GUIDE: gui.sendAidKey(tnvt.AID_ROLL_UP); break; case ScreenChar.BUTTON_LEFT_DN: case ScreenChar.BUTTON_MIDDLE_DN: case ScreenChar.BUTTON_RIGHT_DN: case ScreenChar.BUTTON_ONE_DN: case ScreenChar.BUTTON_SB_DN: case ScreenChar.BUTTON_SB_THUMB: gui.sendAidKey(tnvt.AID_ROLL_DOWN); break; case ScreenChar.BUTTON_LEFT_EB: case ScreenChar.BUTTON_MIDDLE_EB: case ScreenChar.BUTTON_RIGHT_EB: System.out.println("Send to external Browser"); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) gui.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) gui.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) {// System.out.println(sr + "," + (sc + x) + " " + aid.charAt(x)); screen[xPos + x].setChar(aid.charAt(x)); }// System.out.println(aid); screenFields.setCurrentFieldMDT(); gui.sendAidKey(tnvt.AID_ENTER); } } } else { if (gui.rubberband.isAreaSelected()) { gui.rubberband.reset(); gui.repaint(); } goto_XY(pos); isInField(lastPos); } } gui.requestFocus(); }
public void moveCursor (MouseEvent e) { if(!keyboardLocked) { int pos = getRowColFromPoint(e.getX(),e.getY());// System.out.println((getRow(pos)) + "," + (getCol(pos)));// System.out.println(e.getX() + "," + e.getY()+ "," + fmWidth+ "," + fmHeight); if (pos == 0) return ; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 int g = screen[pos].getWhichGUI(); // lets check for hot spots if (g >= ScreenChar.BUTTON_LEFT && g <= ScreenChar.BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case ScreenChar.BUTTON_RIGHT: case ScreenChar.BUTTON_MIDDLE: while (screen[--pos].getWhichGUI() != ScreenChar.BUTTON_LEFT) { } case ScreenChar.BUTTON_LEFT: if (screen[pos].getChar() == 'F') { pos++; } else aidFlag=false; if (screen[pos+1].getChar() != '=' && screen[pos+1].getChar() != '.' && screen[pos+1].getChar() != '/' ) {// System.out.println(" Hotspot clicked!!! we will send characters " +// screen[pos].getChar() +// screen[pos+1].getChar()); aid.append(screen[pos].getChar()); aid.append(screen[pos + 1].getChar()); } else {// System.out.println(" Hotspot clicked!!! we will send character " +// screen[pos].getChar());// aid.append(screen[pos].getChar()); } break; } if (aidFlag) { switch (g) { case ScreenChar.BUTTON_LEFT_UP: case ScreenChar.BUTTON_MIDDLE_UP: case ScreenChar.BUTTON_RIGHT_UP: case ScreenChar.BUTTON_ONE_UP: case ScreenChar.BUTTON_SB_UP: case ScreenChar.BUTTON_SB_GUIDE: gui.sendAidKey(tnvt.AID_ROLL_UP); break; case ScreenChar.BUTTON_LEFT_DN: case ScreenChar.BUTTON_MIDDLE_DN: case ScreenChar.BUTTON_RIGHT_DN: case ScreenChar.BUTTON_ONE_DN: case ScreenChar.BUTTON_SB_DN: case ScreenChar.BUTTON_SB_THUMB: gui.sendAidKey(tnvt.AID_ROLL_DOWN); break; case ScreenChar.BUTTON_LEFT_EB: case ScreenChar.BUTTON_MIDDLE_EB: case ScreenChar.BUTTON_RIGHT_EB: System.out.println("Send to external Browser"); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) gui.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) gui.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) {// System.out.println(sr + "," + (sc + x) + " " + aid.charAt(x)); screen[xPos + x].setChar(aid.charAt(x)); }// System.out.println(aid); screenFields.setCurrentFieldMDT(); gui.sendAidKey(tnvt.AID_ENTER); } } } else { if (gui.rubberband.isAreaSelected()) { gui.rubberband.reset(); gui.repaint(); } goto_XY(pos); isInField(lastPos); } } gui.requestFocus(); }
5,151
protected synchronized void paintComponent2(Graphics2D g2) { Rectangle r = g2.getClipBounds(); g2.setColor(colorBg);// System.out.println("PaintComponent " + r); g2.fillRect(r.x,r.y,r.width,r.height); int sPos = getRowColFromPoint(r.x, r.y); // fix me here int er = (numRows - ((((fmHeight * (numRows + 1)) - ((r.y + r.height) + fmHeight)) / fmHeight))); int ec = (numCols - ((((fmWidth * (numCols + 1)) - ((r.x + r.width) + fmWidth)) / fmWidth))); int sr = getRow(sPos); int c = getCol(sPos); er--; ec--;// System.out.println(sr + "," + c + "," + er + "," + ec); workR.setBounds(sr,c,ec,er); int rows = er - sr; int cols = 0; int lr = workR.x; int lc = 0; lr = sPos; while (rows-- >= 0) { cols = ec - c; lc = lr; while (cols-- >= 0) { screen[lc++].drawChar(g2); } lr += numCols; } }
protected void paintComponent2(Graphics2D g2) { Rectangle r = g2.getClipBounds(); g2.setColor(colorBg);// System.out.println("PaintComponent " + r); g2.fillRect(r.x,r.y,r.width,r.height); int sPos = getRowColFromPoint(r.x, r.y); // fix me here int er = (numRows - ((((fmHeight * (numRows + 1)) - ((r.y + r.height) + fmHeight)) / fmHeight))); int ec = (numCols - ((((fmWidth * (numCols + 1)) - ((r.x + r.width) + fmWidth)) / fmWidth))); int sr = getRow(sPos); int c = getCol(sPos); er--; ec--;// System.out.println(sr + "," + c + "," + er + "," + ec); workR.setBounds(sr,c,ec,er); int rows = er - sr; int cols = 0; int lr = workR.x; int lc = 0; lr = sPos; while (rows-- >= 0) { cols = ec - c; lc = lr; while (cols-- >= 0) { screen[lc++].drawChar(g2); } lr += numCols; } }
5,152
protected synchronized void paintComponent2(Graphics2D g2) { Rectangle r = g2.getClipBounds(); g2.setColor(colorBg);// System.out.println("PaintComponent " + r); g2.fillRect(r.x,r.y,r.width,r.height); int sPos = getRowColFromPoint(r.x, r.y); // fix me here int er = (numRows - ((((fmHeight * (numRows + 1)) - ((r.y + r.height) + fmHeight)) / fmHeight))); int ec = (numCols - ((((fmWidth * (numCols + 1)) - ((r.x + r.width) + fmWidth)) / fmWidth))); int sr = getRow(sPos); int c = getCol(sPos); er--; ec--;// System.out.println(sr + "," + c + "," + er + "," + ec); workR.setBounds(sr,c,ec,er); int rows = er - sr; int cols = 0; int lr = workR.x; int lc = 0; lr = sPos; while (rows-- >= 0) { cols = ec - c; lc = lr; while (cols-- >= 0) { screen[lc++].drawChar(g2); } lr += numCols; } }
protected synchronized void paintComponent2(Graphics2D g2) { Rectangle r = g2.getClipBounds(); g2.setColor(colorBg);// System.out.println("PaintComponent " + r); g2.fillRect(r.x,r.y,r.width,r.height); int sPos = getRowColFromPoint(r.x, r.y); // fix me here int er = (numRows - ((((fmHeight * (numRows + 1)) - ((r.y + r.height) + fmHeight)) / fmHeight))); int ec = (numCols - ((((fmWidth * (numCols + 1)) - ((r.x + r.width) + fmWidth)) / fmWidth))); int sr = getRow(sPos); int c = getCol(sPos); er--; ec--;// System.out.println(sr + "," + c + "," + er + "," + ec); workR.setBounds(sr,c,ec,er); int rows = er - sr; int cols = 0; int lr = workR.x; int lc = 0; lr = sPos; while (rows-- >= 0) { cols = ec - c; lc = lr; while (cols-- >= 0) { if (lc >= 0 && lc < lenScreen) screen[lc++].drawChar(g2); } lr += numCols; } }
5,153
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError();// if (!cursorActive)// setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; }// if (text.length() == 0) { keysBuffered = false; setKBIndicatorOff();// } bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) {// setCursorOff2(); setCursorActive(false); simulateKeyStroke(text.charAt(0)); setCursorActive(true);// setCursorOn2();// System.out.println(" text one"); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false;// setCursorOff2(); setCursorActive(false); while (!done) {// while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked &&// !isStatusErrorCode() && !done) { if (strokenizer.hasMoreKeyStrokes()) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) {// setCursorOn();// if (!keysBuffered) {// System.out.println(" s two" + s);// setCursorOn();// }// try { new Thread().sleep(400);} catch (InterruptedException ie) {} simulateKeyStroke(s.charAt(0));// System.out.println(" s two " + s + " " + cursorActive);// if (cursorActive && !keysBuffered) {// System.out.println(" s two" + s);// setCursorOn();// } } else { if (s != null) { simulateMnemonic(getMnemonicValue(s));// if (!cursorActive && !keysBuffered) {// System.out.println(" m one");// setCursorOn();// } } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } else {// setCursorActive(true);// setCursorOn(); done = true; } } setCursorActive(true); } } }
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { setCursorActive(false); simulateMnemonic(getMnemonicValue("[reset]")); setCursorActive(true);// if (!cursorActive)// setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; }// if (text.length() == 0) { keysBuffered = false; setKBIndicatorOff();// } bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) {// setCursorOff2(); setCursorActive(false); simulateKeyStroke(text.charAt(0)); setCursorActive(true);// setCursorOn2();// System.out.println(" text one"); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false;// setCursorOff2(); setCursorActive(false); while (!done) {// while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked &&// !isStatusErrorCode() && !done) { if (strokenizer.hasMoreKeyStrokes()) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) {// setCursorOn();// if (!keysBuffered) {// System.out.println(" s two" + s);// setCursorOn();// }// try { new Thread().sleep(400);} catch (InterruptedException ie) {} simulateKeyStroke(s.charAt(0));// System.out.println(" s two " + s + " " + cursorActive);// if (cursorActive && !keysBuffered) {// System.out.println(" s two" + s);// setCursorOn();// } } else { if (s != null) { simulateMnemonic(getMnemonicValue(s));// if (!cursorActive && !keysBuffered) {// System.out.println(" m one");// setCursorOn();// } } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } else {// setCursorActive(true);// setCursorOn(); done = true; } } setCursorActive(true); } } }
5,154
public Point translateEnd(Point end) { // because getRowColFromPoint returns position offset as 1,1 we need // to translate as offset 0,0 int pos = getRowColFromPoint(end.x,end.y) - (numCols + 1); int x = screen[pos].x + fmWidth - 1; int y = screen[pos].y + fmHeight - 1;// System.out.println(" ex = " + x + " sx = " + rubberband.getStartPoint().x); end.setLocation(x,y); return end; }
public Point translateEnd(Point end) { // because getRowColFromPoint returns position offset as 1,1 we need // to translate as offset 0,0 int pos = getRowColFromPoint(end.x,end.y); int x = screen[pos].x + fmWidth - 1; int y = screen[pos].y + fmHeight - 1;// System.out.println(" ex = " + x + " sx = " + rubberband.getStartPoint().x); end.setLocation(x,y); return end; }
5,156
public Point translateStart(Point start) { // because getRowColFromPoint returns position offset as 1,1 we need // to translate as offset 0,0 int pos = getRowColFromPoint(start.x,start.y) - (numCols + 1); start.setLocation(screen[pos].x,screen[pos].y); return start; }
public Point translateStart(Point start) { // because getRowColFromPoint returns position offset as 1,1 we need // to translate as offset 0,0 int pos = getRowColFromPoint(start.x,start.y); start.setLocation(screen[pos].x,screen[pos].y); return start; }
5,157
protected synchronized void updateImage(int x, int y , int width, int height) { if (gg2d == null) { gg2d = (Graphics2D)gui.getGraphics();// System.out.println("was null"); } if (bi == null || gg2d == null) return; g2d.setClip(x,y,width,height); if (!cursorActive && x + width <= bi.getWidth(null) && y + height <= (bi.getHeight(null) - fmWidth)) { paintComponent2(g2d); } // fix for jdk1.4 - found this while testing under jdk1.4 // if the height and or the width are equal to zero we skip the // the updating of the image. if (gui.isVisible() && height > 0 && width > 0) { bi.drawImageBuffer(gg2d,x,y,width,height); } }
protected synchronized void updateImage(int x, int y , int width, int height) { if (gg2d == null) { gg2d = (Graphics2D)gui.getGraphics();// System.out.println("was null"); } if (bi == null || gg2d == null) return; g2d.setClip(x,y,width,height); if (!cursorActive && x + width <= bi.getWidth(null) && y + height <= (bi.getHeight(null) - fmWidth)) { paintComponent2(g2d); } // fix for jdk1.4 - found this while testing under jdk1.4 // if the height and or the width are equal to zero we skip the // the updating of the image. if (gui.isVisible() && height > 0 && width > 0) { bi.drawImageBuffer(gg2d,x,y,width,height); } }
5,158
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
5,159
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
5,160
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
5,161
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
5,162
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); mainPanel.add(configPanel, BorderLayout.NORTH); optionsPanel.add(optDone); optionsPanel.add(optCancel); mainPanel.add(optionsPanel, BorderLayout.SOUTH); setProperties(); } centerMe(); }
5,163
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { getContentPane().add(mainPanel); } centerMe(); }
5,164
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); if (loadConfig(null)) { if (loadConfig(null)) {); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); if (loadConfig(null)) { if (loadConfig(null)) {); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); if (loadConfig(null)) { centerMe(); if (loadConfig(null)) {
5,165
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } setProperties(); }
5,166
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); }
void jbInit() throws Exception { setTitle(LangTool.getString("em.configTitle")); mainPanel.setLayout(borderLayout1); labelHost.setText(LangTool.getString("em.labelHost")); fieldHost.setColumns(20); labelPort.setText(LangTool.getString("em.labelPort")); fieldPort.setColumns(5); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } centerMe(); } } centerMe(); }); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } centerMe(); } } centerMe(); }); labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel); mainPanel.add(configPanel, BorderLayout.CENTER); configPanel.add(labelHost, null); mainPanel.add(optionsPanel, BorderLayout.SOUTH); configPanel.add(fieldHost, null); configPanel.add(labelPort, null); configPanel.add(fieldPort, null); configPanel.add(labelFrom, null); configPanel.add(fieldFrom, null); configPanel.add(labelFileName, null); configPanel.add(fieldFileName, null); configPanel.setLayout(alignLayout); if (loadConfig(null)) { setProperties(); } centerMe(); } centerMe(); } centerMe(); }
5,167
void optDone_actionPerformed(ActionEvent e) { SMTPProperties.setProperty("mail.smtp.host",fieldHost.getText()); SMTPProperties.setProperty("mail.smtp.port",fieldPort.getText()); SMTPProperties.setProperty("mail.smtp.from",fieldFrom.getText()); // file name SMTPProperties.setProperty("fileName",fieldFileName.getText()); for (Enumeration x = SMTPProperties.propertyNames();x.hasMoreElements();) System.out.println(SMTPProperties.get(x.nextElement())); ConfigureFactory.getInstance().saveSettings("smtp", smtpFileName, "------ SMTP Defaults --------"); this.setVisible(false); }
void optDone_actionPerformed(ActionEvent e) { SMTPProperties.setProperty("mail.smtp.host",fieldHost.getText()); SMTPProperties.setProperty("mail.smtp.port",fieldPort.getText()); SMTPProperties.setProperty("mail.smtp.from",fieldFrom.getText()); // file name SMTPProperties.setProperty("fileName",fieldFileName.getText()); for (Enumeration x = SMTPProperties.propertyNames();x.hasMoreElements();) System.out.println(SMTPProperties.get(x.nextElement())); ConfigureFactory.getInstance().saveSettings("smtp", smtpFileName, "------ SMTP Defaults --------"); this.setVisible(false); }
5,168
private void setProperties() { // mail.smtp.host= Fill in the host name or ip address of your SMTP // mail server. // // mail.smtp.port= Fill in the port to use to connect // // mail.smtp.from= This is the e-mail address from. For example I would // place kjpou@hotmail.com here as follows: // // mail.smtp.from=kjpou@hotmail.com fieldHost.setText(SMTPProperties.getProperty("mail.smtp.host")); fieldPort.setText(SMTPProperties.getProperty("mail.smtp.port")); fieldFrom.setText(SMTPProperties.getProperty("mail.smtp.from")); // file name fieldFileName.setText(SMTPProperties.getProperty("fileName")); }
private void setProperties() { // mail.smtp.host= Fill in the host name or ip address of your SMTP // mail server. // // mail.smtp.port= Fill in the port to use to connect // // mail.smtp.from= This is the e-mail address from. For example I would // place kjpou@hotmail.com here as follows: // // mail.smtp.from=kjpou@hotmail.com fieldHost.setText(SMTPProperties.getProperty("mail.smtp.host")); fieldPort.setText(SMTPProperties.getProperty("mail.smtp.port")); fieldFrom.setText(SMTPProperties.getProperty("mail.smtp.from")); // file name fieldFileName.setText(SMTPProperties.getProperty("fileName")); }
5,169
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) { super(); setPrompt(prompt); setMessageType(messageType); setOptionType(optionType, defaultOption); this.defaultOption = defaultOption; }
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) { super(); setPrompt(prompt); setMessageType(messageType); setOptionType(optionType, defaultOption); this.defaultOption = defaultOption; }
5,172
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) { super(); setPrompt(prompt); setMessageType(messageType); setOptionType(optionType, defaultOption); this.defaultOption = defaultOption; }
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) { super(); setMessageType(messageType); setOptionType(optionType, defaultOption); this.defaultOption = defaultOption; }
5,173
public Object get() { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. Object value = valueMap.get(currentThread); if (value == null) { value = initialValue(); valueMap.put(currentThread, value == null ? NULL : value); } return value == NULL ? null : value; }
public Object get() { Map map = Thread.getThreadLocals(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. Object value = valueMap.get(currentThread); if (value == null) { value = initialValue(); valueMap.put(currentThread, value == null ? NULL : value); } return value == NULL ? null : value; }
5,174
public Object get() { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. Object value = valueMap.get(currentThread); if (value == null) { value = initialValue(); valueMap.put(currentThread, value == null ? NULL : value); } return value == NULL ? null : value; }
public Object get() { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. Object value = map.get(key); if (value == null) { value = initialValue(); valueMap.put(currentThread, value == null ? NULL : value); } return value == NULL ? null : value; }
5,175
public Object get() { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. Object value = valueMap.get(currentThread); if (value == null) { value = initialValue(); valueMap.put(currentThread, value == null ? NULL : value); } return value == NULL ? null : value; }
public Object get() { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. Object value = valueMap.get(currentThread); if (value == null) { value = initialValue(); map.put(key, value == null ? NULL : value); } return value == NULL ? null : value; }
5,176
public void set(Object value) { // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. valueMap.put(Thread.currentThread(), value == null ? NULL : value); }
public void set(Object value) { // Note that we don't have to synchronize, as only this thread will // ever modify the returned value and valueMap is a synchronizedMap. map.put(key, value == null ? NULL : value); }
5,177
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); }
5,178
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; }
5,179
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); }
5,181
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; }
5,182
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 + ">"); } }
5,183
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();// } } }
5,184
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();// } } }
5,185
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(); } }
5,186
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("Missing static initializer in class " + vmClass.getName(), Project.MSG_WARN); /* * os.writeMOV(X86Constants.rEAX, clInit); */ } } } os.writeRET(); // RET os.align(4096); initCallerObject.markEnd(); }
5,188
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("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); } }
5,189
static int nativeLoad(String filename) { return 0; }
static int nativeLoad(String filename, ClassLoader loader) { return 0; }
5,190
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 }; }
5,194
public String toString() { return getAddress() + ": return " + operand; }
public String toString() { return getAddress() + ": return " + refs[0]; }
5,195
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); }
5,196
public static boolean compileClass(Class oneClass) { // Never succeed. return false; }
public static boolean compileClass(Class oneClass) { // Never succeed. return VMCompiler.compileClass(oneClass); }
5,197
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); }
5,198
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; }
5,201
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 (); }
5,202
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 (); }
5,203
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; }
5,204
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; }
5,205
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; }
5,206
public Object clone() throws CloneNotSupportedException { return super.clone(); }
public Object clone() throws CloneNotSupportedException { return new MacAdapter((IMac) mac.clone(), new HashMap(attributes)); }
5,207
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); }
5,208
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); }
5,210
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; }
5,211
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; }
5,212
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()); } }
5,213
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; }
5,214
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; }
5,215
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; }
5,216
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; }
5,217
public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
public String getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
5,218
public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
public DataFormat getDatatype() { return (String) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); }
5,219
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; }
5,220
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); }
5,221
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; }
5,222
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(); }
5,223
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(); }
5,224
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; }
5,225
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; }
5,226
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; }
5,227
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"); }
5,228
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(); }
5,229
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(); }
5,230
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"); }
5,231
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; }
5,232
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); } }
5,234
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; }
5,235