rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
sesProps.put(SESSION_NAME,sessionName); | if(sessionName == null) sesProps.put(SESSION_TERM_NAME,sesProps.getProperty(SESSION_HOST)); else sesProps.put(SESSION_TERM_NAME,sessionName); | public Session openSession(Properties sesProps, String configurationResource , String sessionName) {// throws TN5250jException { sesProps.put(SESSION_NAME,sessionName); if (configurationResource == null) configurationResource = ""; sesProps.put(SESSION_CONFIG_RESOURCE ,configurationResource); Session newSession = new Session(me,sesProps,configurationResource,sessionName); sessions.addSession(newSession); return newSession; } |
public Session item (String sessionName) { | public Session item (int index) { | public Session item (String sessionName) { Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; } |
Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; | return (Session)sessions.get(index); | public Session item (String sessionName) { Session s = null; int x = 0; while (x < sessions.size()) { s = (Session)sessions.get(x); if (s.getSessionName().equals(sessionName)) return s; x++; } return null; } |
log.debug("Removing session: "+session.getSessionName()); | protected void removeSession(Session session) { if (session != null) { if (session.isConnected()) session.disconnect(); sessions.remove(session); --count; } } |
|
log.debug("adding Session: "+newSession.getSessionName()); | protected void addSession(Session newSession) { sessions.add(newSession); if (newSession.isSendKeepAlive() && heartBeater == null) { heartBeater = new Timer(15000,this);// heartBeater = new Timer(3000,this); heartBeater.start(); } ++count; } |
|
public PluginException(String message, Throwable cause) { super(message, cause); | public PluginException() { super(); | public PluginException(String message, Throwable cause) { super(message, cause); } |
public GetPropertyAction(String key, String defaultValue) { this.key = key; this.defaultValue = defaultValue; } | public GetPropertyAction() { } | public GetPropertyAction(String key, String defaultValue) { this.key = key; this.defaultValue = defaultValue; } |
return uiClassID; | return "MenuItemUI"; | public String getUIClassID() { return uiClassID; } |
return "JMenuItem"; | return super.paramString(); | protected String paramString() { return "JMenuItem"; } |
if (typeCode == null) typeCode = ORB.init().get_primitive_tc(TCKind.tk_objref); | public static TypeCode type() { return typeCode; } |
|
final void pushExitStack(VirtualStack vstack) { | final void pushExitStack(ItemFactory ifac, VirtualStack vstack) { | final void pushExitStack(VirtualStack vstack) { vstack.reset(); //vstack.pushAll(outerMethodStack); vstack.pushAll(exitStack); } |
vstack.pushAll(exitStack); | vstack.pushAll(ifac, exitStack); | final void pushExitStack(VirtualStack vstack) { vstack.reset(); //vstack.pushAll(outerMethodStack); vstack.pushAll(exitStack); } |
final void pushOuterMethodStack(VirtualStack vstack) { vstack.pushAll(outerMethodStack); | final void pushOuterMethodStack(ItemFactory ifac, VirtualStack vstack) { vstack.pushAll(ifac, outerMethodStack); | final void pushOuterMethodStack(VirtualStack vstack) { vstack.pushAll(outerMethodStack); } |
public static ItemListener add(ItemListener a, ItemListener b) | public static ComponentListener add(ComponentListener a, ComponentListener b) | public static ItemListener add(ItemListener a, ItemListener b) { return (ItemListener) addInternal(a, b); } |
return (ItemListener) addInternal(a, b); | return (ComponentListener) addInternal(a, b); | public static ItemListener add(ItemListener a, ItemListener b) { return (ItemListener) addInternal(a, b); } |
processEvent(e); } | { if (! Thread.holdsLock(e)) { switch (e.id) { case WindowEvent.WINDOW_GAINED_FOCUS: case WindowEvent.WINDOW_LOST_FOCUS: case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: case FocusEvent.FOCUS_GAINED: case FocusEvent.FOCUS_LOST: if (KeyboardFocusManager .getCurrentKeyboardFocusManager() .dispatchEvent(e)) return; } } processEvent (e); } } | void dispatchEventImpl(AWTEvent e) { if (eventTypeEnabled (e.id)) processEvent(e); } |
param.append(width).append("x").append(height).append("+").append(x) .append("+").append(y); | param.append(x).append(",").append(y).append(",").append(width) .append("x").append(height); | protected String paramString() { StringBuffer param = new StringBuffer(); String name = getName(); if (name != null) param.append(name).append(","); param.append(width).append("x").append(height).append("+").append(x) .append("+").append(y); if (! isValid()) param.append(",invalid"); if (! isVisible()) param.append(",invisible"); if (! isEnabled()) param.append(",disabled"); if (! isOpaque()) param.append(",translucent"); if (isDoubleBuffered()) param.append(",doublebuffered"); return param.toString(); } |
public static ItemListener remove(ItemListener l, ItemListener oldl) | protected EventListener remove(EventListener oldl) | public static ItemListener remove(ItemListener l, ItemListener oldl) { return (ItemListener) removeInternal(l, oldl); } |
return (ItemListener) removeInternal(l, oldl); | if (a == oldl) return b; if (b == oldl) return a; if (a instanceof AWTEventMulticaster) { EventListener newa = ((AWTEventMulticaster) a).remove(oldl); if (newa != a) return new AWTEventMulticaster(newa, b); } if (b instanceof AWTEventMulticaster) { EventListener newb = ((AWTEventMulticaster) b).remove(oldl); if (newb != b) return new AWTEventMulticaster(a, newb); } return this; | public static ItemListener remove(ItemListener l, ItemListener oldl) { return (ItemListener) removeInternal(l, oldl); } |
os.set32(fldOffset, 0); | switch (jnodeField.getTypeSize()) { case 1: os.set8(fldOffset, 0); break; case 2: os.set16(fldOffset, 0); break; case 4: os.set32(fldOffset, 0); break; default: throw new BuildException("Invalid typesize in: " + jnodeField); } | private void storeObject(int offset, Class<?> cls, Object obj, VmClassType<?> vmType) throws BuildException, ClassNotFoundException, JNodeClassNotFoundException { final Class< ? > sCls = cls.getSuperclass(); if (sCls != null) { final VmClassType< ? > vmSuperType = (VmClassType< ? >) loaderContext .loadClass(sCls.getName(), true); storeObject(offset, sCls, obj, vmSuperType); } try { final FieldInfo fieldInfo = getFieldInfo(cls); // final Field fields[] = cls.getDeclaredFields(); final Field[] fields = fieldInfo.getJdkInstanceFields(); final int len = fields.length; // AccessibleObject.setAccessible(fields, true); for (int i = 0; i < len; i++) { final VmField jnodeField = fieldInfo.getJNodeInstanceField(i); final Field jdkField = fields[i]; final int modifiers = jnodeField.getModifiers(); if ((modifiers & Modifier.STATIC) != 0) { throw new BuildException("Static field in instance list"); } final int fldOffset = offset + ((VmInstanceField) jnodeField).getOffset(); if ((jdkField == null) || ((modifiers & Modifier.TRANSIENT) != 0)) { if (jnodeField.isWide()) { os.set64(fldOffset, 0); } else if (!jnodeField.isPrimitive()) { os.setWord(fldOffset, 0); } else { os.set32(fldOffset, 0); } if (debugWriter != null) { debugWriter.println(jnodeField.getName() + " transient: 0"); } } else if (jnodeField.isPrimitive()) { final Class< ? > fType = jdkField.getType(); if (debugWriter != null) { debugWriter.println(jdkField.getName() + " " + jdkField.get(obj)); } if (fType == byte.class) { os.set8(fldOffset, jdkField.getByte(obj)); } else if (fType == boolean.class) { os.set8(fldOffset, (jdkField.getBoolean(obj)) ? 1 : 0); } else if (fType == char.class) { os.set16(fldOffset, jdkField.getChar(obj)); } else if (fType == short.class) { os.set16(fldOffset, jdkField.getShort(obj)); } else if (fType == int.class) { os.set32(fldOffset, jdkField.getInt(obj)); } else if (fType == float.class) { os.set32(fldOffset, Float.floatToIntBits(jdkField .getFloat(obj))); } else if (fType == long.class) { os.set64(fldOffset, jdkField.getLong(obj)); } else if (fType == double.class) { os.set64(fldOffset, Double.doubleToLongBits(jdkField .getDouble(obj))); } else { throw new BuildException("Unknown primitive class " + fType.getName()); } } else { Object value = jdkField.get(obj); try { testForValidEmit(value, cls.getName()); } catch (BuildException ex) { throw new BuildException("Cannot emit field " + jdkField.getName() + " of class " + cls.getName(), ex); } catch (JNodeClassNotFoundException ex) { BootLog .warn("JNode class not found " + ex.getMessage()); value = null; } bis.setObjectRef(fldOffset, value); } } } catch (IllegalAccessException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } catch (SecurityException ex) { throw new BuildException("emitting object: [" + obj + "]", ex); } } |
public static void warn(String msg) { log(WARN, System.out, msg, null); | public static void warn(String msg, Throwable ex) { log(WARN, System.out, msg, ex); | public static void warn(String msg) { log(WARN, System.out, msg, null); } |
setOpaque(true); | public JRootPane() { setLayout(createRootLayout()); getGlassPane(); getLayeredPane(); getContentPane(); updateUI(); } |
|
setLayout(null); | public JLayeredPane() { layers = new TreeMap (); componentToLayer = new Hashtable (); } |
|
if (!((JMenu)c).isTopLevelMenu()) { JMenuItem menuItem = new JMenuItem(((JMenu)c).getText(), ((JMenu)c).getIcon()); return menuItem.getMaximumSize(); } | public Dimension getMaximumSize(JComponent c) { return c.getPreferredSize(); } |
|
return super.clone(); | BaseMac result = (BaseMac) super.clone(); if (this.underlyingHash != null) result.underlyingHash = (IMessageDigest) this.underlyingHash.clone(); return result; | public Object clone() throws CloneNotSupportedException { return super.clone(); } |
public Number evaluate (Number value) { | public double evaluate (double value) { | public Number evaluate (Number value) { //NOT IMPLEMENTED YET return (Number) new Integer("0"); } |
return (Number) new Integer("0"); | return value; | public Number evaluate (Number value) { //NOT IMPLEMENTED YET return (Number) new Integer("0"); } |
resetAttributes(); | super.init(); | protected void init() { resetAttributes(); classXDFNodeName = "conversion"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,COMPONENTLIST_XML_ATTRIBUTE_NAME); attribHash.put(COMPONENTLIST_XML_ATTRIBUTE_NAME, new Attribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); } |
writeOut(outputstream, " encoding=" + attrib); | writeOut(outputstream, " encoding=\"" + attrib+"\""); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=" + attrib); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=" + attrib); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=" + attrib); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=" + attrib); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
writeOut(outputstream, " endian=" + attrib); | writeOut(outputstream, " endian=\"" + attrib + "\""); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=" + attrib); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=" + attrib); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=" + attrib); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=" + attrib); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
writeOut(outputstream, " readId=" + attrib); | writeOut(outputstream, " readId=\"" + attrib + "\""); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=" + attrib); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=" + attrib); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=" + attrib); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=" + attrib); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
writeOut(outputstream, " readIdRef=" + attrib); | writeOut(outputstream, " readIdRef=\"" + attrib + "\""); | public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + sPrettyXDFOutputIndentation; if (niceOutput) writeOut(outputstream, myIndent); //open the read block writeOut(outputstream, "<read"); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) writeOut(outputstream, " encoding=" + attrib); if ( (attrib=getEndian()) !=null) writeOut(outputstream, " endian=" + attrib); if ( (attrib=getReadId()) !=null) writeOut(outputstream, " readId=" + attrib); if ( (attrib=getReadIdRef()) !=null) writeOut(outputstream, " readIdRef=" + attrib); } writeOut(outputstream, ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputstream, moreIndent); //close the read block if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</read>"); if (niceOutput) { writeOut(outputstream,Constants.NEW_LINE); } } |
public GnuRSAPrivateKey(final BigInteger p, final BigInteger q, final BigInteger e, final BigInteger d) | public GnuRSAPrivateKey(BigInteger p, BigInteger q, BigInteger e, BigInteger d) | public GnuRSAPrivateKey(final BigInteger p, final BigInteger q, final BigInteger e, final BigInteger d) { // super(p.multiply(q)); super(p.multiply(q), e); this.p = p; this.q = q; // this.e = e; this.d = d; // the exponents dP and dQ are positive integers less than p and q // respectively satisfying // e * dP = 1 (mod p-1); // e * dQ = 1 (mod q-1), dP = e.modInverse(p.subtract(BigInteger.ONE)); dQ = e.modInverse(q.subtract(BigInteger.ONE)); // and the CRT coefficient qInv is a positive integer less than p // satisfying // q * qInv = 1 (mod p). qInv = q.modInverse(p); } |
super(p.multiply(q), e); this.p = p; this.q = q; this.d = d; dP = e.modInverse(p.subtract(BigInteger.ONE)); dQ = e.modInverse(q.subtract(BigInteger.ONE)); qInv = q.modInverse(p); | this(Registry.RAW_ENCODING_ID, p, q, e, d); | public GnuRSAPrivateKey(final BigInteger p, final BigInteger q, final BigInteger e, final BigInteger d) { // super(p.multiply(q)); super(p.multiply(q), e); this.p = p; this.q = q; // this.e = e; this.d = d; // the exponents dP and dQ are positive integers less than p and q // respectively satisfying // e * dP = 1 (mod p-1); // e * dQ = 1 (mod q-1), dP = e.modInverse(p.subtract(BigInteger.ONE)); dQ = e.modInverse(q.subtract(BigInteger.ONE)); // and the CRT coefficient qInv is a positive integer less than p // satisfying // q * qInv = 1 (mod p). qInv = q.modInverse(p); } |
public byte[] getEncoded(final int format) | public byte[] getEncoded(int format) | public byte[] getEncoded(final int format) { final byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new RSAKeyPairRawCodec().encodePrivateKey(this); break; default: throw new IllegalArgumentException("format"); } return result; } |
throw new IllegalArgumentException("format"); | throw new IllegalArgumentException("Unsupported encoding format: " + format); | public byte[] getEncoded(final int format) { final byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new RSAKeyPairRawCodec().encodePrivateKey(this); break; default: throw new IllegalArgumentException("format"); } return result; } |
final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPrivateKey) codec.decodePrivateKey(k); | return (GnuRSAPrivateKey) new RSAKeyPairRawCodec().decodePrivateKey(k); | public static GnuRSAPrivateKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } } |
else | catch (IllegalArgumentException ignored) | public static GnuRSAPrivateKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } } |
throw new IllegalArgumentException("magic"); | public static GnuRSAPrivateKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } } |
|
return (GnuRSAPrivateKey) new RSAKeyPairPKCS8Codec().decodePrivateKey(k); | public static GnuRSAPrivateKey valueOf(final byte[] k) { // check magic... // we should parse here enough bytes to know which codec to use, and // direct the byte array to the appropriate codec. since we only have one // codec, we could have immediately tried it; nevertheless since testing // one byte is cheaper than instatiating a codec that will fail we test // the first byte before we carry on. if (k[0] == Registry.MAGIC_RAW_RSA_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over final IKeyPairCodec codec = new RSAKeyPairRawCodec(); return (GnuRSAPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } } |
|
return "JCheckBoxMenuItem"; | return super.paramString(); | protected String paramString() { return "JCheckBoxMenuItem"; } |
Color colorBg, Session ses) { | Color colorBg, boolean toDefaultPrinter, Session ses) { | public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, Session ses) { setPriority(1); session = ses; screen = new ScreenChar[sc.length]; int len = sc.length; for (int x = 0; x < len; x++) { screen[x] = new ScreenChar(sc[x].s); screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace()); } numCols = cols; numRows = rows; this.colorBg = colorBg; this.font = font; } |
toDefault = toDefaultPrinter; | public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, Session ses) { setPriority(1); session = ses; screen = new ScreenChar[sc.length]; int len = sc.length; for (int x = 0; x < len; x++) { screen[x] = new ScreenChar(sc[x].s); screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace()); } numCols = cols; numRows = rows; this.colorBg = colorBg; this.font = font; } |
|
public IndexOutOfBoundsException(String s) { super(s); | public IndexOutOfBoundsException() { | public IndexOutOfBoundsException(String s) { super(s); } |
public NumberFormatException() { super(); | public NumberFormatException() { | public NumberFormatException() { super(); } |
super(); | public ArithmeticException() { super(); } |
|
verifyMonitor(); | public void visit_monitorenter() { inline(entryPoints.getMonitorEnterMethod()); } |
|
verifyMonitor(); | public void visit_monitorexit() { inline(entryPoints.getMonitorExitMethod()); } |
|
if (callee.isSynchronized()) { System.out.println("Method '" + currentMethod.getFullName() + "' calls synchronized method: " + callee.getFullName()); } | protected final void verifyInvoke(VmConstMethodRef methodRef) { if (currentKernelSpace) { // May only call methods with kernelspace pragma. methodRef.resolve(currentMethod.getDeclaringClass().getLoader()); final VmMethod callee = methodRef.getResolvedVmMethod(); if (!callee.hasKernelSpacePragma()) { //throw new ClassFormatError("Method '" + currentMethod + "' calls method outside KernelSpace: " + callee); System.out.println("Method '" + currentMethod.getFullName() + "' calls method outside KernelSpace: " + callee.getFullName()); } } } |
|
Log.errorln("EXPONENT WIDTH:"+wsize+" Precision:"+esize); | private void generateFormatPattern ( ) { StringBuffer leftpattern = new StringBuffer(); StringBuffer rightpattern = new StringBuffer(); StringBuffer etemplate = new StringBuffer(); // precision is the size of the exponent excluding 'E' int esize = getPrecision().intValue(); // width including 'E' and exponent int wsize = getWidth().intValue() - esize - 1;Log.errorln("EXPONENT WIDTH:"+wsize+" Precision:"+esize); if(wsize > 2) etemplate.append("#"); leftpattern.append("0."); while (wsize-- > 3) leftpattern.append("0"); rightpattern.append("E0"); while (esize-- > 1) rightpattern.append("0"); // finish building the template etemplate.append(leftpattern.toString()+rightpattern.toString()); etemplate.append(";-"+leftpattern.toString()+rightpattern.toString()); formatPattern = etemplate.toString(); } |
|
goto_XY(pos); isInField(lastPos); | if (gui.rubberband.isAreaSelected()) { gui.rubberband.reset(); gui.repaint(); } else { goto_XY(pos); isInField(lastPos); } | public void moveCursor (MouseEvent e) { if(!keyboardLocked) { int pos = getPosFromView(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 { goto_XY(pos); isInField(lastPos); } } gui.requestFocus(); } |
gui.rubberband.reset(); gui.repaint(); | protected final Vector sumThem(boolean which) { StringBuffer s = new StringBuffer(); getBoundingArea(workR); gui.rubberband.reset(); gui.repaint();// System.out.println("Summing"); // obtain the decimal format for parsing DecimalFormat df = (DecimalFormat)NumberFormat.getInstance() ; DecimalFormatSymbols dfs = df.getDecimalFormatSymbols(); if (which) { dfs.setDecimalSeparator('.'); dfs.setGroupingSeparator(','); } else { dfs.setDecimalSeparator(','); dfs.setGroupingSeparator('.'); } df.setDecimalFormatSymbols(dfs); Vector sumVector = new Vector(); // loop through all the screen characters to send them to the clip board int m = workR.x; int i = 0; int t = 0; double sum = 0.0; while (workR.height-- > 0) { t = workR.width; i = workR.y; while (t-- > 0) { // only copy printable numeric characters (in this case >= ' ') char c = screen[getPos(m - 1,i - 1)].getChar(); if (((c >= '0' && c <= '9') || c== '.' || c == ',' || c == '-') && !screen[getPos(m - 1,i - 1)].nonDisplay) { s.append(c); } i++; } if (s.length() > 0) { if (s.charAt(s.length()-1) == '-') { s.insert(0,'-'); s.deleteCharAt(s.length()-1); } try { Number n = df.parse(s.toString());// System.out.println(s + " " + n.doubleValue()); sumVector.add(new Double(n.doubleValue())); sum += n.doubleValue(); } catch (ParseException pe) { System.out.println(pe.getMessage() + " at " + pe.getErrorOffset()); } } s.setLength(0); m++; }// System.out.println(sum); return sumVector; } |
|
if (!fullRepaint) | if (!fullRepaint) { | protected synchronized void updateImage(int x, int y , int width, int height) { if (gg2d == null) { //System.out.println("was null"); gg2d = (Graphics2D)gui.getGraphics(); } // check for selected area and erase it before updating screen if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.erase(); } if (bi == null || gg2d == null) { if (bi == null) System.out.println("bi was null in update image"); if (gg2d == null) System.out.println("gg2d was null in update image"); return; } g2d.setClip(x,y,width,height); if (!cursorActive && x + width <= bi.getWidth(null) && y + height <= (bi.getHeight(null) - fmWidth)) {// if (!cursorActive) { paintComponent2(g2d); }// if (tileimage != null) {//// AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);// g2d.setComposite(ac);// g2d.drawImage(tileimage, null, null);// } // 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);// } if (gui.isVisible()) { if (height > 0 && width > 0) { // We now redraw the selected area rectangle. if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.draw(); } if (!fullRepaint) bi.drawImageBuffer(gg2d,x,y,width,height); else gui.repaint();// System.out.println(" something went right finally " + gui.isVisible() +// " height " + height + " width " + width); }// else { // bi.drawImageBuffer(gg2d);// System.out.println(" something is wrong here " + gui.isVisible() +// " height " + height + " width " + width);// } } } |
} | protected synchronized void updateImage(int x, int y , int width, int height) { if (gg2d == null) { //System.out.println("was null"); gg2d = (Graphics2D)gui.getGraphics(); } // check for selected area and erase it before updating screen if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.erase(); } if (bi == null || gg2d == null) { if (bi == null) System.out.println("bi was null in update image"); if (gg2d == null) System.out.println("gg2d was null in update image"); return; } g2d.setClip(x,y,width,height); if (!cursorActive && x + width <= bi.getWidth(null) && y + height <= (bi.getHeight(null) - fmWidth)) {// if (!cursorActive) { paintComponent2(g2d); }// if (tileimage != null) {//// AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);// g2d.setComposite(ac);// g2d.drawImage(tileimage, null, null);// } // 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);// } if (gui.isVisible()) { if (height > 0 && width > 0) { // We now redraw the selected area rectangle. if (gui.rubberband != null && gui.rubberband.isAreaSelected()) { gui.rubberband.draw(); } if (!fullRepaint) bi.drawImageBuffer(gg2d,x,y,width,height); else gui.repaint();// System.out.println(" something went right finally " + gui.isVisible() +// " height " + height + " width " + width); }// else { // bi.drawImageBuffer(gg2d);// System.out.println(" something is wrong here " + gui.isVisible() +// " height " + height + " width " + width);// } } } |
|
c.setOpaque(true); | protected void installDefaults(JLabel c) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); c.setForeground(defaults.getColor("Label.foreground")); c.setBackground(defaults.getColor("Label.background")); c.setFont(defaults.getFont("Label.font")); c.setBorder(defaults.getBorder("Label.border")); c.setOpaque(true); //XXX: There are properties we don't use called disabledForeground //and disabledShadow. } |
|
if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; | if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { bufferedKeys = ""; keysBuffered = false; } else { keysBuffered = true; if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } | public void sendKeys(String text) { if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; } } } |
isInField(lastPos,true); strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); | if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); | public void sendKeys(String text) { if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; } } } |
if (s != null) simulateMnemonic(getMnemonicValue(s)); else | strokenizer.setKeyStrokes(text); String s; boolean done = false; | public void sendKeys(String text) { if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; } } } |
System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; | while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; } } | public void sendKeys(String text) { if (keysBuffered) { text = bufferedKeys + text; keysBuffered = false; bufferedKeys = ""; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) simulateMnemonic(getMnemonicValue(s)); else System.out.println(" mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) keysBuffered = true; done = true; } } } |
public static final ResourceBundle getBundle(String baseName, Locale locale) | public static final ResourceBundle getBundle(String baseName) | public static final ResourceBundle getBundle(String baseName, Locale locale) { return getBundle(baseName, locale, security.getCallingClassLoader()); } |
return getBundle(baseName, locale, security.getCallingClassLoader()); | return getBundle(baseName, Locale.getDefault(), security.getCallingClassLoader()); | public static final ResourceBundle getBundle(String baseName, Locale locale) { return getBundle(baseName, locale, security.getCallingClassLoader()); } |
setSize(view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS)); | public HTMLRootView(JComponent c, View view, EditorKit kit, Document doc) { super(null); component = c; editorKit = kit; document = doc; setView(view); } |
|
public String toString() { return null; } | public String toString() { return this.getClass().toString() + "[ source=" + source.toString() + " firstIndex= " + firstIndex + " lastIndex= " + lastIndex + " isAdjusting= " + isAdjusting + " ]"; } | public String toString() { return null; // TODO } // toString() |
log.getLevel().toLevel(org.apache.log4j.Level.DEBUG_INT); | Level.toLevel(org.apache.log4j.Level.DEBUG_INT); | public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: log.getLevel().toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: log.getLevel().toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: log.getLevel().toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.getLevel().toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); break; } } |
log.getLevel().toLevel(org.apache.log4j.Level.INFO_INT); | Level.toLevel(org.apache.log4j.Level.INFO_INT); | public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: log.getLevel().toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: log.getLevel().toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: log.getLevel().toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.getLevel().toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); break; } } |
log.getLevel().toLevel(org.apache.log4j.Level.WARN_INT); | Level.toLevel(org.apache.log4j.Level.WARN_INT); | public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: log.getLevel().toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: log.getLevel().toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: log.getLevel().toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.getLevel().toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); break; } } |
log.getLevel().toLevel(org.apache.log4j.Level.ERROR_INT); | Level.toLevel(org.apache.log4j.Level.ERROR_INT); | public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: log.getLevel().toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: log.getLevel().toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: log.getLevel().toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.getLevel().toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); break; } } |
log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); | Level.toLevel(org.apache.log4j.Level.FATAL_INT); | public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: log.getLevel().toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: log.getLevel().toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: log.getLevel().toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.getLevel().toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); break; } } |
if (selectionMode == SINGLE_SELECTION) setSelectionInterval(index0, index1); | public void addSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) setSelectionInterval(index0, index1); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); fireDifference(sel, (BitSet) oldSel); } } |
|
} | public void addSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) setSelectionInterval(index0, index1); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); fireDifference(sel, (BitSet) oldSel); } } |
|
public void setAnchorSelectionIndex(int anchorIndex) | public void setAnchorSelectionIndex(int index) | public void setAnchorSelectionIndex(int anchorIndex) { anchorSelectionIndex = anchorIndex; } |
anchorSelectionIndex = anchorIndex; | if (anchorSelectionIndex != index) { int old = anchorSelectionIndex; anchorSelectionIndex = index; if (leadAnchorNotificationEnabled) fireValueChanged(index, old); } | public void setAnchorSelectionIndex(int anchorIndex) { anchorSelectionIndex = anchorIndex; } |
public void setSelectionInterval(int index0, int index1) | public void setSelectionInterval(int anchor, int lead) | public void setSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; BitSet oldSel = (BitSet) sel.clone(); sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); // update the anchorSelectionIndex and leadSelectionIndex variables setAnchorSelectionIndex(index0); leadSelectionIndex=index1; fireDifference(sel, oldSel); } |
if (index0 == -1 || index1 == -1) | if (anchor == -1 || lead == -1) | public void setSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; BitSet oldSel = (BitSet) sel.clone(); sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); // update the anchorSelectionIndex and leadSelectionIndex variables setAnchorSelectionIndex(index0); leadSelectionIndex=index1; fireDifference(sel, oldSel); } |
index0 = index1; | anchor = lead; | public void setSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; BitSet oldSel = (BitSet) sel.clone(); sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); // update the anchorSelectionIndex and leadSelectionIndex variables setAnchorSelectionIndex(index0); leadSelectionIndex=index1; fireDifference(sel, oldSel); } |
int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); | int lo = Math.min(anchor, lead); int hi = Math.max(anchor, lead); | public void setSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; BitSet oldSel = (BitSet) sel.clone(); sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); // update the anchorSelectionIndex and leadSelectionIndex variables setAnchorSelectionIndex(index0); leadSelectionIndex=index1; fireDifference(sel, oldSel); } |
setAnchorSelectionIndex(index0); leadSelectionIndex=index1; | setAnchorSelectionIndex(anchor); leadSelectionIndex = lead; | public void setSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; BitSet oldSel = (BitSet) sel.clone(); sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); // update the anchorSelectionIndex and leadSelectionIndex variables setAnchorSelectionIndex(index0); leadSelectionIndex=index1; fireDifference(sel, oldSel); } |
} | public void setSelectionInterval(int index0, int index1) { if (index0 == -1 || index1 == -1) return; BitSet oldSel = (BitSet) sel.clone(); sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); sel.set(lo, hi+1); // update the anchorSelectionIndex and leadSelectionIndex variables setAnchorSelectionIndex(index0); leadSelectionIndex=index1; fireDifference(sel, oldSel); } |
|
revalidate(); repaint(); | public void setText(String newText) { if (text != newText) { String oldText = text; text = newText; firePropertyChange("text", oldText, newText); if (text != null && text.length() <= displayedMnemonicIndex) setDisplayedMnemonicIndex(text.length() - 1); } } |
|
new GrayFilter(false, 100)))); | new GrayFilter(true, 0)))); | public static Image createDisabledImage(Image src) { return (Toolkit.getDefaultToolkit(). createImage(new FilteredImageSource(src.getSource(), new GrayFilter(false, 100)))); } |
Class c = Class.forName("org.tn5250j.transport.SSL.SSLImplementation"); | Class c = Class.forName("org.tn5250j.framework.transport.SSL.SSLImplementation"); | public Socket createSocket(String destination, int port) { try { if (sslType.equals(SSLConstants.SSL_TYPE_NONE)) { System.out.println("Creating Socket"); // for jdk 1.4// return SocketFactory.getDefault().createSocket(destination,port); return new Socket(destination,port); } //Using SSL Socket SSLInterface o = null; try { Class c = Class.forName("org.tn5250j.transport.SSL.SSLImplementation"); o = (SSLInterface)c.newInstance(); o.setSSLType(sslType); return o.createSSLSocket(destination,port); } catch (Exception e) { System.err.println(e); } } catch (Exception e) { System.err.println("SocketConnector: createSocket: " + e.getMessage()); } return null; } |
log.debug(" bound " + band.getEndPoint()); | public void areaBounded(RubberBand band, int x1, int y1, int x2, int y2) {// repaint(x1,y1,x2-1,y2-1); repaint();// System.out.println(" bound " + band.getEndPoint()); } |
|
catch (Exception exc) {} | catch (Exception exc) { log.warn(""+exc.getMessage()); } | private void doTransfer(java.io.File file) { try { Properties props = new Properties(); props.load(new java.io.FileInputStream(file)); org.tn5250j.tools.XTFRFile tfr = new org.tn5250j.tools.XTFRFile(null, vt, (Session)this,props); } catch (Exception exc) {} } |
log.debug("Initializing macros"); | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); screen = new Screen5250(this,sesConfig); this.addComponentListener(this); if (!sesConfig.isPropertyExists("width") || !sesConfig.isPropertyExists("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(sesConfig.getIntegerProperty("width"), sesConfig.getIntegerProperty("height")); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); scroller = new SessionScroller().getScrollerInstance((Session)this); if (!sesConfig.getStringProperty("mouseWheel").equals("Yes")) scroller.removeMouseWheelListener((Session)this); keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this); macros = new Macronizer(); Macronizer.init(); keyPad.addActionListener(this); if (sesConfig.getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); // check if double click sends enter if (sesConfig.getStringProperty("doubleClick").equals("Yes")) doubleClick = true; else doubleClick = false; DropTargetAdapter dta = new DropTargetAdapter() { public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } }; DropTarget dt = new DropTarget((JPanel)this,dta); setDropTarget(dt); } |
|
System.out.println("dtde drop it2 "); | log.debug("dtde drop it2 "); | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); screen = new Screen5250(this,sesConfig); this.addComponentListener(this); if (!sesConfig.isPropertyExists("width") || !sesConfig.isPropertyExists("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(sesConfig.getIntegerProperty("width"), sesConfig.getIntegerProperty("height")); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); scroller = new SessionScroller().getScrollerInstance((Session)this); if (!sesConfig.getStringProperty("mouseWheel").equals("Yes")) scroller.removeMouseWheelListener((Session)this); keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this); macros = new Macronizer(); Macronizer.init(); keyPad.addActionListener(this); if (sesConfig.getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); // check if double click sends enter if (sesConfig.getStringProperty("doubleClick").equals("Yes")) doubleClick = true; else doubleClick = false; DropTargetAdapter dta = new DropTargetAdapter() { public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } }; DropTarget dt = new DropTarget((JPanel)this,dta); setDropTarget(dt); } |
System.out.println("importData: unsupported data flavor"); | log.info("importData: unsupported data flavor"); | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); screen = new Screen5250(this,sesConfig); this.addComponentListener(this); if (!sesConfig.isPropertyExists("width") || !sesConfig.isPropertyExists("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(sesConfig.getIntegerProperty("width"), sesConfig.getIntegerProperty("height")); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); scroller = new SessionScroller().getScrollerInstance((Session)this); if (!sesConfig.getStringProperty("mouseWheel").equals("Yes")) scroller.removeMouseWheelListener((Session)this); keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this); macros = new Macronizer(); Macronizer.init(); keyPad.addActionListener(this); if (sesConfig.getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); // check if double click sends enter if (sesConfig.getStringProperty("doubleClick").equals("Yes")) doubleClick = true; else doubleClick = false; DropTargetAdapter dta = new DropTargetAdapter() { public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } }; DropTarget dt = new DropTarget((JPanel)this,dta); setDropTarget(dt); } |
System.out.println("importData: I/O exception"); | log.warn("importData: I/O exception"); | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); screen = new Screen5250(this,sesConfig); this.addComponentListener(this); if (!sesConfig.isPropertyExists("width") || !sesConfig.isPropertyExists("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(sesConfig.getIntegerProperty("width"), sesConfig.getIntegerProperty("height")); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); scroller = new SessionScroller().getScrollerInstance((Session)this); if (!sesConfig.getStringProperty("mouseWheel").equals("Yes")) scroller.removeMouseWheelListener((Session)this); keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this); macros = new Macronizer(); Macronizer.init(); keyPad.addActionListener(this); if (sesConfig.getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); // check if double click sends enter if (sesConfig.getStringProperty("doubleClick").equals("Yes")) doubleClick = true; else doubleClick = false; DropTargetAdapter dta = new DropTargetAdapter() { public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } }; DropTarget dt = new DropTarget((JPanel)this,dta); setDropTarget(dt); } |
System.out.println(ex.getMessage()); | log.warn(""+ex.getMessage()); | private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); screen = new Screen5250(this,sesConfig); this.addComponentListener(this); if (!sesConfig.isPropertyExists("width") || !sesConfig.isPropertyExists("height")) // set the initialize size this.setSize(screen.getPreferredSize()); else { this.setSize(sesConfig.getIntegerProperty("width"), sesConfig.getIntegerProperty("height")); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { doPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { screen.moveCursor(e); repaint(); getFocusForMe(); } } }); scroller = new SessionScroller().getScrollerInstance((Session)this); if (!sesConfig.getStringProperty("mouseWheel").equals("Yes")) scroller.removeMouseWheelListener((Session)this); keyHandler = KeyboardHandler.getKeyboardHandlerInstance((Session)this); macros = new Macronizer(); Macronizer.init(); keyPad.addActionListener(this); if (sesConfig.getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); setRubberBand(new TNRubberBand(this)); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); // check if double click sends enter if (sesConfig.getStringProperty("doubleClick").equals("Yes")) doubleClick = true; else doubleClick = false; DropTargetAdapter dta = new DropTargetAdapter() { public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } }; DropTarget dt = new DropTarget((JPanel)this,dta); setDropTarget(dt); } |
System.out.println("dtde drop it2 "); | log.debug("dtde drop it2 "); | public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } |
System.out.println("importData: unsupported data flavor"); | log.info("importData: unsupported data flavor"); | public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } |
System.out.println("importData: I/O exception"); | log.warn("importData: I/O exception"); | public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } |
System.out.println(ex.getMessage()); | log.warn(""+ex.getMessage()); | public void drop(DropTargetDropEvent dtde) { Transferable tr = dtde.getTransferable(); dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); DataFlavor[] dfs = dtde.getCurrentDataFlavors(); if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { try { System.out.println("dtde drop it2 "); java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor); // implementation for when we are able to process a list // of files.// Iterator iterator = fileList.iterator();// if (iterator.hasNext()) {// File file = (File)iterator.next();// } java.io.File file = (java.io.File)fileList.get(0); System.out.println(file.toString()); dtde.dropComplete(true); doTransfer(file); return; } catch (UnsupportedFlavorException ufe) { System.out.println("importData: unsupported data flavor"); } catch (java.io.IOException ieo) { System.out.println("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } } |
log.debug("paint from screen"); | protected void paintComponent(Graphics g) {// System.out.println("paint from screen"); screen.paintComponent3(g); if (rubberband.isAreaSelected() && !rubberband.isDragging()) { rubberband.erase(); rubberband.draw(); } keyPad.repaint(); } |
|
System.out.println(macName); | log.info(macName); | protected void startRecordingMe() { String macName = (String)JOptionPane.showInputDialog(null, LangTool.getString("macro.message"), LangTool.getString("macro.title"), JOptionPane.PLAIN_MESSAGE); if (macName != null) { macName = macName.trim(); if (macName.length() > 0) { System.out.println(macName); newMacName = macName; keyHandler.startRecording(); } } } |
System.out.println(keyHandler.getRecordBuffer()); | log.debug(keyHandler.getRecordBuffer()); | protected void stopRecordingMe() { if (keyHandler.getRecordBuffer().length() > 0) { Macronizer.setMacro(newMacName,keyHandler.getRecordBuffer()); System.out.println(keyHandler.getRecordBuffer()); } keyHandler.stopRecording(); } |
System.out.println(exc.getMessage()); | log.warn(exc.getMessage()); | public void toggleDebug() { vt.toggleDebug(); try { vt.sendHeartBeat(); } catch (Exception exc) { System.out.println(exc.getMessage()); } } |
log.debug("paint from gui"); | public void update(Graphics g) {// System.out.println("paint from gui"); paint(g); } |
|
session.doConnections(); | session.startNewSession(); | public SessionPopup(Session ses, MouseEvent me) { JMenuItem menuItem; Action action; JPopupMenu popup = new JPopupMenu(); session = ses; vt = session.getVT();// final Gui5250 g = session; screen = session.getScreen(); JMenuItem mi; final int pos = screen.getPosFromView(me.getX(),me.getY()); if (!session.rubberband.isAreaSelected() && screen.isInField(pos,false) ) { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyField(pos); session.getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(false); session.getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); session.getFocusForMe(); } }; popup.add(action); popup.addSeparator(); } else { action = new AbstractAction(LangTool.getString("popup.copy")) { public void actionPerformed(ActionEvent e) { screen.copyMe(); session.getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_COPY)); action = new AbstractAction(LangTool.getString("popup.paste")) { public void actionPerformed(ActionEvent e) { screen.sendKeys(MNEMONIC_PASTE); session.getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PASTE)); action = new AbstractAction(LangTool.getString("popup.pasteSpecial")) { public void actionPerformed(ActionEvent e) { screen.pasteMe(true); session.getFocusForMe(); } }; popup.add(action); Rectangle workR = new Rectangle(); if (session.rubberband.isAreaSelected()) { // get the bounded area of the selection screen.getBoundingArea(workR); popup.addSeparator(); menuItem = new JMenuItem(LangTool.getString("popup.selectedColumns") + " " + workR.width); menuItem.setArmed(false); popup.add(menuItem); menuItem = new JMenuItem(LangTool.getString("popup.selectedRows") + " " + workR.height); menuItem.setArmed(false); popup.add(menuItem); JMenu sumMenu = new JMenu(LangTool.getString("popup.calc")); popup.add(sumMenu); action = new AbstractAction(LangTool.getString("popup.calcGroupCD")) { public void actionPerformed(ActionEvent e) { sumArea(true); } }; sumMenu.add(action); action = new AbstractAction(LangTool.getString("popup.calcGroupDC")) { public void actionPerformed(ActionEvent e) { sumArea(false); } }; sumMenu.add(action); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.printScreen")) { public void actionPerformed(ActionEvent e) { screen.printMe(); session.getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_PRINT_SCREEN)); popup.addSeparator(); JMenu kbMenu = new JMenu(LangTool.getString("popup.keyboard")); popup.add(kbMenu); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); } }; kbMenu.add(action); kbMenu.addSeparator(); createKeyboardItem(kbMenu,MNEMONIC_ATTN); createKeyboardItem(kbMenu,MNEMONIC_RESET); createKeyboardItem(kbMenu,MNEMONIC_SYSREQ); if (screen.isMessageWait() && OptionAccessFactory.getInstance().isValidOption(MNEMONIC_DISP_MESSAGES)) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; kbMenu.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } kbMenu.addSeparator(); createKeyboardItem(kbMenu,MNEMONIC_DUP_FIELD); createKeyboardItem(kbMenu,MNEMONIC_HELP); createKeyboardItem(kbMenu,MNEMONIC_ERASE_EOF); createKeyboardItem(kbMenu,MNEMONIC_FIELD_PLUS); createKeyboardItem(kbMenu,MNEMONIC_FIELD_MINUS); createKeyboardItem(kbMenu,MNEMONIC_NEW_LINE); if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_PRINT)) { action = new AbstractAction(LangTool.getString("popup.hostPrint")) { public void actionPerformed(ActionEvent e) { vt.hostPrint(1); } }; kbMenu.add(createMenuItem(action,MNEMONIC_PRINT)); } createShortCutItems(kbMenu); if (screen.isMessageWait() && OptionAccessFactory.getInstance().isValidOption(MNEMONIC_DISP_MESSAGES)) { action = new AbstractAction(LangTool.getString("popup.displayMessages")) { public void actionPerformed(ActionEvent e) { vt.systemRequest('4'); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_MESSAGES)); } popup.addSeparator(); action = new AbstractAction(LangTool.getString("popup.hexMap")) { public void actionPerformed(ActionEvent e) { showHexMap(); session.getFocusForMe(); } }; popup.add(createMenuItem(action,"")); action = new AbstractAction(LangTool.getString("popup.mapKeys")) { public void actionPerformed(ActionEvent e) { mapMeKeys(); session.getFocusForMe(); } }; popup.add(createMenuItem(action,"")); if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_DISP_ATTRIBUTES)) { action = new AbstractAction(LangTool.getString("popup.settings")) { public void actionPerformed(ActionEvent e) { session.doAttributes(); session.getFocusForMe(); } }; popup.add(createMenuItem(action,MNEMONIC_DISP_ATTRIBUTES)); } popup.addSeparator(); if (session.isMacroRunning()) { action = new AbstractAction(LangTool.getString("popup.stopScript")) { public void actionPerformed(ActionEvent e) { session.setStopMacroRequested(); } }; popup.add(action); } else { JMenu macMenu = new JMenu(LangTool.getString("popup.macros")); if (session.isSessionRecording()) { action = new AbstractAction(LangTool.getString("popup.stop")) { public void actionPerformed(ActionEvent e) { session.stopRecordingMe(); session.getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.record")) { public void actionPerformed(ActionEvent e) { session.startRecordingMe(); session.getFocusForMe(); } }; } macMenu.add(action); if (Macronizer.isMacrosExist()) { // this will add a sorted list of the macros to the macro menu addMacros(macMenu); } popup.add(macMenu); } popup.addSeparator(); JMenu xtfrMenu = new JMenu(LangTool.getString("popup.export")); if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_FILE_TRANSFER)) { action = new AbstractAction(LangTool.getString("popup.xtfrFile")) { public void actionPerformed(ActionEvent e) { doMeTransfer(); session.getFocusForMe(); } }; xtfrMenu.add(createMenuItem(action,MNEMONIC_FILE_TRANSFER)); } if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_SPOOL_FILE)) { action = new AbstractAction(LangTool.getString("popup.xtfrSpool")) { public void actionPerformed(ActionEvent e) { doMeSpool(); session.getFocusForMe(); } }; xtfrMenu.add(action); } popup.add(xtfrMenu); JMenu sendMenu = new JMenu(LangTool.getString("popup.send")); popup.add(sendMenu); if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_QUICK_MAIL)) { action = new AbstractAction(LangTool.getString("popup.quickmail")) { public void actionPerformed(ActionEvent e) { sendQuickEMail(); session.getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_QUICK_MAIL)); } if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_E_MAIL)) { action = new AbstractAction(LangTool.getString("popup.email")) { public void actionPerformed(ActionEvent e) { sendScreenEMail(); session.getFocusForMe(); } }; sendMenu.add(createMenuItem(action,MNEMONIC_E_MAIL)); } action = new AbstractAction(LangTool.getString("popup.file")) { public void actionPerformed(ActionEvent e) { sendMeToFile(); } }; sendMenu.add(action); action = new AbstractAction(LangTool.getString("popup.toImage")) { public void actionPerformed(ActionEvent e) { sendMeToImageFile(); } }; sendMenu.add(action); popup.addSeparator(); } if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_OPEN_NEW)) { action = new AbstractAction(LangTool.getString("popup.connections")) { public void actionPerformed(ActionEvent e) { session.doConnections(); } }; popup.add(createMenuItem(action,MNEMONIC_OPEN_NEW)); } popup.addSeparator(); if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_TOGGLE_CONNECTION)) { if (vt.isConnected()) { action = new AbstractAction(LangTool.getString("popup.disconnect")) { public void actionPerformed(ActionEvent e) { changeConnection(); session.getFocusForMe(); } }; } else { action = new AbstractAction(LangTool.getString("popup.connect")) { public void actionPerformed(ActionEvent e) { changeConnection(); session.getFocusForMe(); } }; } popup.add(createMenuItem(action,MNEMONIC_TOGGLE_CONNECTION)); } if (OptionAccessFactory.getInstance().isValidOption(MNEMONIC_CLOSE)) { action = new AbstractAction(LangTool.getString("popup.close")) { public void actionPerformed(ActionEvent e) { session.closeSession(); } }; popup.add(createMenuItem(action,MNEMONIC_CLOSE)); } GUIGraphicsUtils.positionPopup(me.getComponent(),popup, me.getX(),me.getY()); } |
public DropTarget (Component c, DropTargetListener dtl) | public DropTarget () | public DropTarget (Component c, DropTargetListener dtl) { this (c, 0, dtl, true, null); } |
this (c, 0, dtl, true, null); | this (null, 0, null, true, null); | public DropTarget (Component c, DropTargetListener dtl) { this (c, 0, dtl, true, null); } |
Subsets and Splits