rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
editorComponent = textfield; clickCountToStart = 2;
public DefaultCellEditor(JTextField textfield) { // TODO } // DefaultCellEditor()
delegate.cancelCellEditing();
public void cancelCellEditing() { // TODO } // cancelCellEditing()
return null;
return delegate.getCellEditorValue();
public Object getCellEditorValue() { return null; // TODO } // getCellEditorValue()
return 0;
return clickCountToStart;
public int getClickCountToStart() { return 0; // TODO } // getClickCountToStart()
return null;
return editorComponent;
public Component getComponent() { return null; // TODO } // getComponent()
public Component getTableCellEditorComponent(JTable tree, Object value,
public Component getTableCellEditorComponent(JTable table, Object value,
public Component getTableCellEditorComponent(JTable tree, Object value, boolean isSelected, int row, int column) { return null; // TODO } // getTableCellEditorComponent()
return null;
if (editorComponent instanceof JTextField) { ((JTextField)editorComponent).setText(value.toString()); delegate = new EditorDelegate(); ((JTextField)editorComponent).addActionListener(delegate); } else { } return editorComponent;
public Component getTableCellEditorComponent(JTable tree, Object value, boolean isSelected, int row, int column) { return null; // TODO } // getTableCellEditorComponent()
return false;
return delegate.isCellEditable(event);
public boolean isCellEditable(EventObject event) { return false; // TODO } // isCellEditable()
clickCountToStart = count;
public void setClickCountToStart(int count) { // TODO } // setClickCountToStart()
return false;
return delegate.shouldSelectCell(event);
public boolean shouldSelectCell(EventObject event) { return false; // TODO } // shouldSelectCell()
return false;
return delegate.stopCellEditing();
public boolean stopCellEditing() { return false; // TODO } // stopCellEditing()
attribHash.put("fieldList", new XMLAttribute(Collections.synchronizedList(new ArrayList(super.sDefaultDataArraySize)), Constants.LIST_TYPE));
attribHash.put("fieldList", new XMLAttribute(Collections.synchronizedList(new ArrayList(Specification.getInstance().getDefaultDataArraySize())), Constants.LIST_TYPE));
private void init() { classXDFNodeName = "fieldAxis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"fieldList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? 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("fieldList", 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("align", new XMLAttribute(null, Constants.STRING_TYPE)); //double check?? attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); length = 0; }
if (e.getKeyCode() == KeyEvent.VK_TAB) setPopupVisible(false); else if (keySelectionManager != null) { int i = keySelectionManager.selectionForKey(e.getKeyChar(), getModel()); if (i >= 0) setSelectedIndex(i); else super.processKeyEvent(e); } else super.processKeyEvent(e);
public void processKeyEvent(KeyEvent e) { }
if (newSelection != null)
protected void selectedItemChanged() { // Fire ItemEvent to indicated that previously selected item is now // deselected if (selectedItemReminder != null) fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, selectedItemReminder, ItemEvent.DESELECTED)); // Fire ItemEvent to indicate that new item is selected Object newSelection = getSelectedItem(); fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, newSelection, ItemEvent.SELECTED)); // Fire Action Event to JComboBox's registered listeners fireActionEvent(); selectedItemReminder = newSelection; }
keySelectionManager = aManager;
public void setKeySelectionManager(KeySelectionManager aManager) { }
selectedItemReminder = newDataModel.getSelectedItem();
public void setModel(ComboBoxModel newDataModel) { // dataModel is null if it this method is called from inside the constructors. if (dataModel != null) { // Prevents unneccessary updates. if (dataModel == newDataModel) return; // Removes itself (as DataListener) from the to-be-replaced model. dataModel.removeListDataListener(this); } /* Adds itself as a DataListener to the new model. * It is intentioned that this operation will fail with a NullPointerException if the * caller delivered a null argument. */ newDataModel.addListDataListener(this); // Stores old data model for event notification. ComboBoxModel oldDataModel = dataModel; dataModel = newDataModel; // Notifies the listeners of the model change. firePropertyChange("model", oldDataModel, dataModel); }
public void checkAccess(ThreadGroup g)
public void checkAccess(Thread thread)
public void checkAccess(ThreadGroup g) { if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
if (thread.getThreadGroup() != null && thread.getThreadGroup().getParent() != null) checkPermission(new RuntimePermission("modifyThread")); }
public void checkAccess(ThreadGroup g) { if (g.getParent() != null) checkPermission(new RuntimePermission("modifyThreadGroup")); }
screen.setVT(vt);
public Session5250 (Properties props, String configurationResource, String sessionName, SessionConfig config) { propFileName = config.getConfigurationResource(); sesConfig = config; this.configurationResource = configurationResource; this.sessionName = sessionName; sesProps = props; sce = new SessionChangeEvent(this); if (sesProps.containsKey(SESSION_HEART_BEAT)) heartBeat = true; screen = new Screen5250(); screen.setVT(vt); }
return vt.isConnected();
if (vt == null) return false; else return vt.isConnected();
public boolean isConnected() { return vt.isConnected(); }
throws NotImplementedException
public String getSystemDisplayName(File f) throws NotImplementedException { // FIXME: Implement; return null; }
return null;
String name = null; if (f != null) { if (isRoot(f)) name = f.getAbsolutePath(); else { try { String path = f.getCanonicalPath(); name = path.substring(path.lastIndexOf(File.separator) + 1); } catch (IOException e) { name = f.getName(); } } } return name;
public String getSystemDisplayName(File f) throws NotImplementedException { // FIXME: Implement; return null; }
return(selectedCheckbox);
return getCurrent ();
getSelectedCheckbox(){ return(selectedCheckbox);}
setSelectedCheckbox(selectedCheckbox);
if (this.selectedCheckbox != null) { if (this.selectedCheckbox.getCheckboxGroup() != this) return; this.selectedCheckbox.setState(false); } this.selectedCheckbox = selectedCheckbox; if (selectedCheckbox != null) selectedCheckbox.setState(true);
setCurrent(Checkbox selectedCheckbox){ setSelectedCheckbox(selectedCheckbox);}
if (this.selectedCheckbox != null) { if (this.selectedCheckbox.getCheckboxGroup() != this) return; this.selectedCheckbox.setState(false); } this.selectedCheckbox = selectedCheckbox; if (selectedCheckbox != null) selectedCheckbox.setState(true);
setCurrent (selectedCheckbox);
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);}
setText(s);
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);
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; }
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (isSelected)
if (isSelected || cellHasFocus)
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; }
if (cellHasFocus) setBorder(UIManager.getBorder("List.focusCellHighlightBorder")); else setBorder(noFocusBorder);
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 void setup(Map attributes) { // find out the modulus length Integer l = (Integer) attributes.get(MODULUS_LENGTH); L = (l == null ? DEFAULT_MODULUS_LENGTH : l.intValue()); if ((L % 64) != 0 || L < 512 || L > 1024) throw new IllegalArgumentException(MODULUS_LENGTH); // should we use the default pre-computed params? Boolean useDefaults = (Boolean) attributes.get(USE_DEFAULTS); if (useDefaults == null) { useDefaults = Boolean.TRUE; } // are we given a set of DSA params or we shall use/generate our own? DSAParameterSpec params = (DSAParameterSpec) attributes.get(DSS_PARAMETERS); if (params != null) { p = params.getP(); q = params.getQ(); g = params.getG(); } else if (useDefaults.equals(Boolean.TRUE)) { switch (L) { case 512: p = KEY_PARAMS_512.getP(); q = KEY_PARAMS_512.getQ(); g = KEY_PARAMS_512.getG(); break; case 768: p = KEY_PARAMS_768.getP(); q = KEY_PARAMS_768.getQ(); g = KEY_PARAMS_768.getG(); break; case 1024: p = KEY_PARAMS_1024.getP(); q = KEY_PARAMS_1024.getQ(); g = KEY_PARAMS_1024.getG(); break; default: p = null; q = null; g = null; } } else { p = null; q = null; g = null; } // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // set the seed-key byte[] kb = new byte[20]; // we need 160 bits of randomness nextRandomBytes(kb); XKEY = new BigInteger(1, kb).setBit(159).setBit(0); }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) {
final VmStackFrame[] getVmStackTrace(Address frame, Address ip, int limit) {
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 Address frame = argFrame; Address f = frame;
final VmStackFrameEnumerator sfEnum = new VmStackFrameEnumerator(this, frame, ip);
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; }
while (isValid(f) && (count < limit)) {
while (sfEnum.isValid() && (count < limit)) {
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; }
f = getPrevious(f);
sfEnum.next();
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; }
if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); }
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; }
f = frame;
sfEnum.reset(frame, ip);
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; }
stack[i] = new VmStackFrame(f, this, ip); ip = stack[i].getReturnAddress().add(-1); f = getPrevious(f);
stack[i] = new VmStackFrame(sfEnum.getMethod(), sfEnum.getProgramCounter()); sfEnum.next();
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; }
}
if (isReadOnly()) { } else { } }
public void flush() throws IOException { //TODO: perhaps nothing todo (always readOnly ?) }
public FSEntry getRootEntry() throws IOException { return new ISO9660Entry(volume.getVolumeDescriptor().getRootDirectoryEntry()); }
public FSEntry getRootEntry() throws IOException { return new ISO9660Entry(this, volume.getVolumeDescriptor() .getRootDirectoryEntry()); }
public FSEntry getRootEntry() throws IOException { return new ISO9660Entry(volume.getVolumeDescriptor().getRootDirectoryEntry()); }
private Raster createCompatibleRaster(Raster raster) {
private Raster createCompatibleRaster(Raster raster, ColorModel model) {
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; }
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);
if(dst_model instanceof DirectColorModel) if(model instanceof ComponentColorModel){ for (int y = 0; y < h; y++) for (int x = 0; x < w; x++) dst_raster.setPixel(x, y, raster.getPixel(x, y, samples)); } else if(model instanceof IndexColorModel){ final IndexColorModel icm = (IndexColorModel) model; for (int y = 0; y < h; y++) for (int x = 0; x < w; x++){ int sample = raster.getSample(x, y, 0); samples[0] = icm.getRed(sample); samples[1] = icm.getGreen(sample); samples[2] = icm.getBlue(sample); samples[3] = icm.getAlpha(sample); dst_raster.setPixel(x, y, samples); } } else { log.error("Unimplemented raster conversion"); return 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; }
final Raster raster = ((BufferedImage) image).getRaster();
final BufferedImage b_image = (BufferedImage) image; final Raster raster = b_image.getRaster();
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"); } } }
return createCompatibleRaster(raster);
return createCompatibleRaster(raster, b_image.getColorModel());
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"); } } }
final Raster raster = ((RenderedImage) image).getData();
final RenderedImage r_image = (RenderedImage) image; final Raster raster = r_image.getData();
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"); } } }
return createCompatibleRaster(raster);
return createCompatibleRaster(raster, r_image.getColorModel());
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"); } } }
if (p.offset < lastOffset) { throw new VirtualMachineError(
if (p.offset < lastOffset) { throw new InternalError(
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; }
if (lowerBound < 1) throw new IllegalArgumentException("lowerBound may not be less than 1");
public JobMediaSheetsSupported(int lowerBound, int upperBound) { super(lowerBound, upperBound); }
workR.setBounds(r,c,getCol(ePos),getRow(ePos));
workR.setBounds(r,c,c2,r2);
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); }
if (tArea.contains(x,y)) {
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; }
return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))), (numCols - ((((fmWidth * (numCols)) - x) / fmWidth))) );
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; }
}
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;
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; }
return 0;
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 );
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; }
pos -= (numCols + 1);
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(); }
protected synchronized void paintComponent2(Graphics2D g2) {
protected void paintComponent2(Graphics2D g2) {
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; } }
screen[lc++].drawChar(g2);
if (lc >= 0 && lc < lenScreen) screen[lc++].drawChar(g2);
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; } }
resetError();
setCursorActive(false); simulateMnemonic(getMnemonicValue("[reset]")); setCursorActive(true);
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); } } }
setCursorActive(true);
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); } } }
int pos = getRowColFromPoint(end.x,end.y) - (numCols + 1);
int pos = getRowColFromPoint(end.x,end.y);
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; }
int pos = getRowColFromPoint(start.x,start.y) - (numCols + 1);
int pos = getRowColFromPoint(start.x,start.y);
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; }
if (gui.isVisible() && height > 0 && width > 0) { bi.drawImageBuffer(gg2d,x,y,width,height);
if (gui.isVisible()) { if (height > 0 && width > 0) { bi.drawImageBuffer(gg2d,x,y,width,height); } else { }
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); } }
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); } });
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(3); labelDefault.setText(LangTool.getString("em.labelDefault")); labelName.setText(LangTool.getString("em.labelName")); fieldName.setColumns(20); labelFrom.setText(LangTool.getString("em.labelFrom")); fieldFrom.setColumns(20); optDone.setPreferredSize(new Dimension(100, 27)); optDone.setText(LangTool.getString("em.optDone")); optDone.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optDone_actionPerformed(e); } });
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(); }
optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } });
optCancel.setPreferredSize(new Dimension(100, 27)); optCancel.setText(LangTool.getString("em.optCancelLabel")); optCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { optCancel_actionPerformed(e); } });
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(); }
labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20); optionsPanel.add(optDone, null); optionsPanel.add(optCancel, null); getContentPane().add(mainPanel);
labelFileName.setText(LangTool.getString("em.labelFileName")); fieldFileName.setText("tn5250j.txt"); fieldFileName.setColumns(20);
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(); }
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);
gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.insets = new Insets(10, 10, 5, 5); gbc.anchor = GridBagConstraints.WEST; configPanel.add(labelHost, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 2; gbc.insets = new Insets(10, 5, 5, 10); gbc.anchor = GridBagConstraints.WEST; configPanel.add(fieldHost, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.insets = new Insets(5, 10, 5, 5); gbc.anchor = GridBagConstraints.WEST; configPanel.add(labelPort, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.insets = new Insets(5, 5, 5, 5); gbc.anchor = GridBagConstraints.WEST; configPanel.add(fieldPort, gbc); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 1; gbc.insets = new Insets(5, 15, 5, 10); gbc.anchor = GridBagConstraints.WEST; configPanel.add(labelDefault, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.insets = new Insets(5, 10, 5, 5); gbc.anchor = GridBagConstraints.WEST; configPanel.add(labelName, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.gridwidth = 2; gbc.insets = new Insets(5, 5, 5, 10); gbc.anchor = GridBagConstraints.WEST; configPanel.add(fieldName, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.insets = new Insets(5, 10, 5, 5); gbc.anchor = GridBagConstraints.WEST; configPanel.add(labelFrom, gbc); gbc.gridx = 1; gbc.gridy = 3; gbc.gridwidth = 2; gbc.insets = new Insets(5, 5, 5, 10); gbc.anchor = GridBagConstraints.WEST; configPanel.add(fieldFrom, gbc); gbc.gridx = 0; gbc.gridy = 4; gbc.gridwidth = 1; gbc.insets = new Insets(5, 10, 0, 5); gbc.anchor = GridBagConstraints.WEST; configPanel.add(labelFileName, gbc); gbc.gridx = 1; gbc.gridy = 4; gbc.gridwidth = 2; gbc.insets = new Insets(5, 5, 0, 10); gbc.anchor = GridBagConstraints.WEST; configPanel.add(fieldFileName, gbc);
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(); }
if (loadConfig(null)) {
mainPanel.add(configPanel, BorderLayout.NORTH); optionsPanel.add(optDone); optionsPanel.add(optCancel); mainPanel.add(optionsPanel, BorderLayout.SOUTH);
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(); }
setProperties();
getContentPane().add(mainPanel);
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(); }
}
if (loadConfig(null)) {
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(); }
centerMe();
setProperties();
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(); }
}
} 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(); }
SMTPProperties.setProperty("mail.smtp.host",fieldHost.getText()); SMTPProperties.setProperty("mail.smtp.port",fieldPort.getText()); SMTPProperties.setProperty("mail.smtp.from",fieldFrom.getText());
SMTPProperties.setProperty("mail.smtp.host", fieldHost.getText()); SMTPProperties.setProperty("mail.smtp.port", fieldPort.getText()); SMTPProperties.setProperty("mail.smtp.from", fieldFrom.getText()); SMTPProperties.setProperty("mail.smtp.realname", fieldName.getText());
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); }
fieldHost.setText(SMTPProperties.getProperty("mail.smtp.host")); fieldPort.setText(SMTPProperties.getProperty("mail.smtp.port")); fieldFrom.setText(SMTPProperties.getProperty("mail.smtp.from"));
fieldHost.setText(SMTPProperties.getProperty("mail.smtp.host")); fieldPort.setText(SMTPProperties.getProperty("mail.smtp.port")); fieldFrom.setText(SMTPProperties.getProperty("mail.smtp.from")); fieldName.setText(SMTPProperties.getProperty("mail.smtp.realname"));
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 [email protected] here as follows: // // [email protected] 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")); }
bad.minor = Minor.Any;
public static DynAny[] extract(Any any) { try { return ((DynAnySeqHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("DynAnySeq expected"); bad.initCause(cex); throw bad; } }
addPropertyChangeListener(new ValuePropertyHandler(dialog));
public JDialog createDialog(Component parentComponent, String title) { Frame toUse = getFrameForComponent(parentComponent); if (toUse == null) toUse = getRootFrame(); JDialog dialog = new JDialog(toUse, title); inputValue = UNINITIALIZED_VALUE; value = UNINITIALIZED_VALUE; dialog.getContentPane().add(this); dialog.setModal(true); dialog.setResizable(false); dialog.pack(); dialog.setLocationRelativeTo(parentComponent); return dialog; }
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption)
public ConfirmationCallback(int messageType, int optionType, int defaultOption) throws IllegalArgumentException
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) { super(); setPrompt(prompt); setMessageType(messageType); setOptionType(optionType, defaultOption); this.defaultOption = defaultOption; }
setPrompt(prompt);
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) { super(); setPrompt(prompt); setMessageType(messageType); setOptionType(optionType, defaultOption); this.defaultOption = defaultOption; }
Thread currentThread = Thread.currentThread();
Map map = Thread.getThreadLocals();
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; }
Object value = valueMap.get(currentThread);
Object value = map.get(key);
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; }
valueMap.put(currentThread, value == null ? NULL : value);
map.put(key, 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(); valueMap.put(currentThread, value == null ? NULL : value); } return value == NULL ? null : value; }
valueMap.put(Thread.currentThread(), value == null ? NULL : value);
map.put(key, 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. valueMap.put(Thread.currentThread(), value == null ? NULL : value); }
y1 = yPoints[1] + 1; x2 = xPoints[2] - 1;
y1 = yPoints[1]; x2 = xPoints[2];
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); }
catch (IllegalAccessException ex) {} catch (InstantiationException ex) {} catch (ClassNotFoundException ex) {}
catch (Exception ex) {}
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; }
if (config.getStringProperty("print.font").length() > 0) { font = new Font(config.getStringProperty("print.font"), Font.PLAIN, 8); }
public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); // will have to remember this for the next time. // Always set a page format before call setPrintable to // set the orientation. PageFormat pf = printJob.defaultPage(); if (numCols == 132) pf.setOrientation(PageFormat.LANDSCAPE); else pf.setOrientation(PageFormat.PORTRAIT); if (numCols != 132) { if (config.getStringProperty("print.portWidth").length() != 0 && config.getStringProperty("print.portHeight").length() != 0 && config.getStringProperty("print.portImageWidth").length() != 0 && config.getStringProperty("print.portImageHeight").length() != 0 && config.getStringProperty("print.portImage.X").length() != 0 && config.getStringProperty("print.portImage.Y").length() != 0) { Paper paper = pf.getPaper(); paper.setSize( Double.parseDouble(config.getStringProperty("print.portWidth")), Double.parseDouble(config.getStringProperty("print.portHeight"))); paper.setImageableArea( Double.parseDouble(config.getStringProperty("print.portImage.X")), Double.parseDouble(config.getStringProperty("print.portImage.Y")), Double.parseDouble(config.getStringProperty("print.portImageWidth")), Double.parseDouble(config.getStringProperty("print.portImageHeight"))); pf.setPaper(paper); } } else { if (config.getStringProperty("print.landWidth").length() != 0 && config.getStringProperty("print.landHeight").length() != 0 && config.getStringProperty("print.landImageWidth").length() != 0 && config.getStringProperty("print.landImageHeight").length() != 0 && config.getStringProperty("print.landImage.X").length() != 0 && config.getStringProperty("print.landImage.Y").length() != 0) { Paper paper = pf.getPaper(); paper.setSize( Double.parseDouble(config.getStringProperty("print.landWidth")), Double.parseDouble(config.getStringProperty("print.landHeight"))); paper.setImageableArea( Double.parseDouble(config.getStringProperty("print.landImage.X")), Double.parseDouble(config.getStringProperty("print.landImage.Y")), Double.parseDouble(config.getStringProperty("print.landImageWidth")), Double.parseDouble(config.getStringProperty("print.landImageHeight"))); } } //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this,pf); // set the cursor back session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; }
g.setColor(Color.BLACK);
if (c.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled());
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); }
if ((fcw1 & 0x88) == 0x88)
if (fcw1 == 0x88)
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; }
int stop = formatCommandList.size(); for (int i = 0; i < stop; i++) {
int stop2 = formatCommandList.size(); for (int i = 0; i < stop2; i++) {
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 + ">"); } }
if (isLinux && keyCode == e.VK_ALT_GRAPH) {
if (isLinux && keyCode == KeyEvent.VK_ALT_GRAPH) {
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();// } } }
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
if (keyCode == KeyEvent.VK_UNDEFINED || keyCode == KeyEvent.VK_CAPS_LOCK || keyCode == KeyEvent.VK_SHIFT || keyCode == KeyEvent.VK_ALT || keyCode == KeyEvent.VK_ALT_GRAPH || keyCode == KeyEvent.VK_CONTROL
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();// } } }
if (isLinux && e.getKeyCode() == e.VK_ALT_GRAPH) {
if (isLinux && e.getKeyCode() == KeyEvent.VK_ALT_GRAPH) {
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(); } }
if (b.isSelected()) sel = b.getModel();
public void add(AbstractButton b) { b.getModel().setGroup(this); buttons.addElement(b); }
log.warn("Missing static initializer in class " + vmClass.getName());
log("Missing static initializer in class " + vmClass.getName(), Project.MSG_WARN);
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(); }
log.info("Creating image");
log("Creating image");
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); } }
static int nativeLoad(String filename) {
static int nativeLoad(String filename, ClassLoader loader) {
static int nativeLoad(String filename) { return 0; }
if (Internet.version.since_inclusive(1, 1))
public void _read_no_endian(cdrInput c) throws IOException, BAD_PARAM { Id = c.read_string(); int n_profiles = c.read_long(); for (int i = 0; i < n_profiles; i++) { int tag = c.read_long(); cdrBufInput profile = c.read_encapsulation(); if (tag == Internet_profile.TAG_INTERNET_IOP) { Internet = new Internet_profile(); Internet.version = Version.read_version(profile); Internet.host = profile.read_string(); Internet.port = profile.gnu_read_ushort(); int lk = profile.read_long(); key = new byte[ lk ]; profile.read(key); // Read tagged components. int n_components = 0; try { n_components = profile.read_long(); for (int t = 0; t < n_components; t++) { int ctag = profile.read_long(); if (ctag == CodeSets_profile.TAG_CODE_SETS) { CodeSets.read(profile); } } } catch (Unexpected ex) { ex.printStackTrace(); } } } }
if (!Big_Endian) b.append(" (Little endian) ");
public String toString() { StringBuffer b = new StringBuffer(); b.append(Id); b.append(" at "); b.append(Internet); b.append(" Key "); for (int i = 0; i < key.length; i++) { b.append(Integer.toHexString(key [ i ] & 0xFF)); } b.append(" "); b.append(CodeSets); return b.toString(); }
*/ return new JNodeGraphics(this);
public Graphics getGraphics() { final Component parent = targetComponent.getParent(); if (parent != null) { final int x = peerComponent.getX(); final int y = peerComponent.getY(); final int width = peerComponent.getWidth(); final int height = peerComponent.getHeight(); return parent.getGraphics().create(x, y, width, height); } else { throw new Error(); } }
this.operand = getOperand(varIndex); refs = new Operand[] { operand };
refs = new Operand[] { getOperand(varIndex) };
public VarReturnQuad(int address, IRBasicBlock block, int varIndex) { super(address, block); this.operand = getOperand(varIndex); refs = new Operand[] { operand }; }
return getAddress() + ": return " + operand;
return getAddress() + ": return " + refs[0];
public String toString() { return getAddress() + ": return " + operand; }
return null;
return VMCompiler.command(arg);
public static Object command(Object arg) { // Our implementation defines this to a no-op. return null; }
return false;
return VMCompiler.compileClass(oneClass);
public static boolean compileClass(Class oneClass) { // Never succeed. return false; }
return false;
return VMCompiler.compileClasses(classNames);
public static boolean compileClasses(String classNames) { // Note the incredibly lame interface. Always fail. return false; }
VMCompiler.disable();
public static void disable() { }