bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
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 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); } }
1,328
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 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); } }
1,329
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 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); } }
1,330
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 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); } }
1,331
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 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); }
1,332
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 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); }
1,333
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; }
public byte[] getEncoded(int format) { final byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new RSAKeyPairRawCodec().encodePrivateKey(this); break; default: throw new IllegalArgumentException("format"); } return result; }
1,334
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; }
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("Unsupported encoding format: " + format); } return result; }
1,335
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"); } }
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"); } }
1,336
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"); } }
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); } catch (IllegalArgumentException ignored) { throw new IllegalArgumentException("magic"); } }
1,337
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"); } }
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 { } }
1,338
protected String paramString() { return "JCheckBoxMenuItem"; }
protected String paramString() { return super.paramString(); }
1,340
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 PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, boolean toDefaultPrinter, 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; }
1,341
public IndexOutOfBoundsException(String s) { super(s); }
public IndexOutOfBoundsException(String s) { super(s); }
1,343
public NumberFormatException() { super(); }
public NumberFormatException() { super(); }
1,344
public ArithmeticException() { super(); }
public ArithmeticException() { }
1,345
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(); }
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; 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(); }
1,349
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(); }
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(); }
1,350
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; }
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; }
1,351
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);// } } }
1,352
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. }
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")); //XXX: There are properties we don't use called disabledForeground //and disabledShadow. }
1,354
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 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; } } }
1,355
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 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; } } }
1,356
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 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; } } }
1,357
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 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; } } }
1,358
public static final ResourceBundle getBundle(String baseName, Locale locale) { return getBundle(baseName, locale, security.getCallingClassLoader()); }
public static final ResourceBundle getBundle(String baseName, Locale locale) { return getBundle(baseName, locale, security.getCallingClassLoader()); }
1,359
public static final ResourceBundle getBundle(String baseName, Locale locale) { return getBundle(baseName, locale, security.getCallingClassLoader()); }
public static final ResourceBundle getBundle(String baseName, Locale locale) { return getBundle(baseName, Locale.getDefault(), security.getCallingClassLoader()); }
1,360
public String toString() { return null; // TODO } // toString()
public String toString() { return null; // TODO } // toString()
1,362
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; } }
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.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; } }
1,363
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; } }
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: Level.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; } }
1,364
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; } }
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: Level.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; } }
1,365
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; } }
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: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.getLevel().toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
1,366
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; } }
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: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
1,367
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); } }
1,368
public void setAnchorSelectionIndex(int anchorIndex) { anchorSelectionIndex = anchorIndex; }
public void setAnchorSelectionIndex(int index) { anchorSelectionIndex = anchorIndex; }
1,370
public void setAnchorSelectionIndex(int anchorIndex) { anchorSelectionIndex = anchorIndex; }
public void setAnchorSelectionIndex(int anchorIndex) { if (anchorSelectionIndex != index) { int old = anchorSelectionIndex; anchorSelectionIndex = index; if (leadAnchorNotificationEnabled) fireValueChanged(index, old); } }
1,371
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 anchor, int lead) { 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); }
1,372
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 (anchor == -1 || lead == -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); }
1,373
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) anchor = lead; 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); }
1,374
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); }
1,375
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); }
1,376
public static Image createDisabledImage(Image src) { return (Toolkit.getDefaultToolkit(). createImage(new FilteredImageSource(src.getSource(), new GrayFilter(false, 100)))); }
public static Image createDisabledImage(Image src) { return (Toolkit.getDefaultToolkit(). createImage(new FilteredImageSource(src.getSource(), new GrayFilter(true, 0)))); }
1,379
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; }
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.framework.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; }
1,380
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) {} }
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.warn(""+exc.getMessage()); } }
1,382
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); }
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 { log.debug("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); }
1,384
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); }
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) { log.info("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); }
1,385
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); }
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) { log.warn("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); }
1,386
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); }
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) { log.warn(""+ex.getMessage()); } finally { dtde.dropComplete(false); } } } }; DropTarget dt = new DropTarget((JPanel)this,dta); setDropTarget(dt); }
1,387
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); } } }
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 { log.debug("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); } } }
1,388
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); } } }
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) { log.info("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); } } }
1,389
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); } } }
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) { log.warn("importData: I/O exception"); } catch (Exception ex) { System.out.println(ex.getMessage()); } finally { dtde.dropComplete(false); } } }
1,390
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); } } }
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) { log.warn(""+ex.getMessage()); } finally { dtde.dropComplete(false); } } }
1,391
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(); } } }
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) { log.info(macName); newMacName = macName; keyHandler.startRecording(); } } }
1,393
protected void stopRecordingMe() { if (keyHandler.getRecordBuffer().length() > 0) { Macronizer.setMacro(newMacName,keyHandler.getRecordBuffer()); System.out.println(keyHandler.getRecordBuffer()); } keyHandler.stopRecording(); }
protected void stopRecordingMe() { if (keyHandler.getRecordBuffer().length() > 0) { Macronizer.setMacro(newMacName,keyHandler.getRecordBuffer()); log.debug(keyHandler.getRecordBuffer()); } keyHandler.stopRecording(); }
1,394
public void toggleDebug() { vt.toggleDebug(); try { vt.sendHeartBeat(); } catch (Exception exc) { System.out.println(exc.getMessage()); } }
public void toggleDebug() { vt.toggleDebug(); try { vt.sendHeartBeat(); } catch (Exception exc) { log.warn(exc.getMessage()); } }
1,395
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 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.startNewSession(); } }; 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()); }
1,397
public DropTarget (Component c, DropTargetListener dtl) { this (c, 0, dtl, true, null); }
public DropTarget () { this (c, 0, dtl, true, null); }
1,398
public DropTarget (Component c, DropTargetListener dtl) { this (c, 0, dtl, true, null); }
public DropTarget (Component c, DropTargetListener dtl) { this (null, 0, null, true, null); }
1,399
protected void closeConnection() throws IOException { if (socket != null) { try { socket.close(); } finally { socket = null; } } }
protected synchronized void closeConnection() throws IOException { if (socket != null) { try { socket.close(); } finally { socket = null; } } }
1,400
protected InputStream getInputStream() throws IOException { if (socket == null) { getSocket(); } return in; }
protected synchronized InputStream getInputStream() throws IOException { if (socket == null) { getSocket(); } return in; }
1,401
protected OutputStream getOutputStream() throws IOException { if (socket == null) { getSocket(); } return out; }
protected synchronized OutputStream getOutputStream() throws IOException { if (socket == null) { getSocket(); } return out; }
1,402
protected Socket getSocket() throws IOException { if (socket == null) { String connectHostname = hostname; int connectPort = port; if (isUsingProxy()) { connectHostname = proxyHostname; connectPort = proxyPort; } socket = new Socket(); InetSocketAddress address = new InetSocketAddress(connectHostname, connectPort); if (connectionTimeout > 0) { socket.connect(address, connectionTimeout); } else { socket.connect(address); } if (timeout > 0) { socket.setSoTimeout(timeout); } if (secure) { try { SSLSocketFactory factory = getSSLSocketFactory(); SSLSocket ss = (SSLSocket) factory.createSocket(socket, connectHostname, connectPort, true); String[] protocols = { "TLSv1", "SSLv3" }; ss.setEnabledProtocols(protocols); ss.setUseClientMode(true); synchronized (handshakeCompletedListeners) { if (!handshakeCompletedListeners.isEmpty()) { for (Iterator i = handshakeCompletedListeners.iterator(); i.hasNext(); ) { HandshakeCompletedListener l = (HandshakeCompletedListener) i.next(); ss.addHandshakeCompletedListener(l); } } } ss.startHandshake(); socket = ss; } catch (GeneralSecurityException e) { throw new IOException(e.getMessage()); } } in = socket.getInputStream(); in = new BufferedInputStream(in); out = socket.getOutputStream(); out = new BufferedOutputStream(out); } return socket; }
protected synchronized Socket getSocket() throws IOException { if (socket == null) { String connectHostname = hostname; int connectPort = port; if (isUsingProxy()) { connectHostname = proxyHostname; connectPort = proxyPort; } socket = new Socket(); InetSocketAddress address = new InetSocketAddress(connectHostname, connectPort); if (connectionTimeout > 0) { socket.connect(address, connectionTimeout); } else { socket.connect(address); } if (timeout > 0) { socket.setSoTimeout(timeout); } if (secure) { try { SSLSocketFactory factory = getSSLSocketFactory(); SSLSocket ss = (SSLSocket) factory.createSocket(socket, connectHostname, connectPort, true); String[] protocols = { "TLSv1", "SSLv3" }; ss.setEnabledProtocols(protocols); ss.setUseClientMode(true); synchronized (handshakeCompletedListeners) { if (!handshakeCompletedListeners.isEmpty()) { for (Iterator i = handshakeCompletedListeners.iterator(); i.hasNext(); ) { HandshakeCompletedListener l = (HandshakeCompletedListener) i.next(); ss.addHandshakeCompletedListener(l); } } } ss.startHandshake(); socket = ss; } catch (GeneralSecurityException e) { throw new IOException(e.getMessage()); } } in = socket.getInputStream(); in = new BufferedInputStream(in); out = socket.getOutputStream(); out = new BufferedOutputStream(out); } return socket; }
1,403
public void connect(SocketAddress endpoint, int timeout) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); if (! (endpoint instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); // The Sun spec says that if we have an associated channel and // it is in non-blocking mode, we throw an IllegalBlockingModeException. // However, in our implementation if the channel itself initiated this // operation, then we must honor it regardless of its blocking mode. if (getChannel() != null && ! getChannel().isBlocking() && ! ((PlainSocketImpl) getImpl()).isInChannelOperation()) throw new IllegalBlockingModeException(); if (! isBound()) bind(null); try { getImpl().connect(endpoint, timeout); } catch (IOException exception) { close(); throw exception; } catch (RuntimeException exception) { close(); throw exception; } catch (Error error) { close(); throw error; } }
public void connect(SocketAddress endpoint, int timeout) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); if (! (endpoint instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); // The Sun spec says that if we have an associated channel and // it is in non-blocking mode, we throw an IllegalBlockingModeException. // However, in our implementation if the channel itself initiated this // operation, then we must honor it regardless of its blocking mode. if (getChannel() != null && ! getChannel().isBlocking() && ! ((PlainSocketImpl) getImpl()).isInChannelOperation()) throw new IllegalBlockingModeException(); if (! isBound()) bind(null); try { getImpl().connect(endpoint, timeout); } catch (IOException exception) { close(); throw exception; } catch (RuntimeException exception) { close(); throw exception; } catch (Error error) { close(); throw error; } }
1,404
public void connect(SocketAddress endpoint, int timeout) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); if (! (endpoint instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); // The Sun spec says that if we have an associated channel and // it is in non-blocking mode, we throw an IllegalBlockingModeException. // However, in our implementation if the channel itself initiated this // operation, then we must honor it regardless of its blocking mode. if (getChannel() != null && ! getChannel().isBlocking() && ! ((PlainSocketImpl) getImpl()).isInChannelOperation()) throw new IllegalBlockingModeException(); if (! isBound()) bind(null); try { getImpl().connect(endpoint, timeout); } catch (IOException exception) { close(); throw exception; } catch (RuntimeException exception) { close(); throw exception; } catch (Error error) { close(); throw error; } }
public void connect(SocketAddress endpoint, int timeout) throws IOException { if (isClosed()) throw new SocketException("socket is closed"); if (! (endpoint instanceof InetSocketAddress)) throw new IllegalArgumentException("unsupported address type"); // The Sun spec says that if we have an associated channel and // it is in non-blocking mode, we throw an IllegalBlockingModeException. // However, in our implementation if the channel itself initiated this // operation, then we must honor it regardless of its blocking mode. if (getChannel() != null && ! getChannel().isBlocking() && ! ((PlainSocketImpl) getImpl()).isInChannelOperation()) throw new IllegalBlockingModeException(); if (! isBound()) bind(null); try { getImpl().connect(endpoint, timeout); } catch (IOException exception) { close(); throw exception; } catch (RuntimeException exception) { close(); throw exception; } catch (Error error) { close(); throw error; } }
1,405
public Axis addAxis(Axis axis) { if (!canAddAxisObjToArray(axis)) //check if the axis can be added return null; getDataCube().incrementDimension(axis ); //increment the DataCube dimension by 1 getAxisList().add(axis); //update the locators that is related to this Array object int stop = locators.size(); for (int i = 0; i < stop; i++) { ((Locator) locators.get(i)).addAxis(axis); } updateNotesLocationOrder(); // reset to the current order of the axes return axis; }
public Axis addAxis(Axis axis) { if (!canAddAxisObjToArray(axis)) //check if the axis can be added return null; getDataCube().incrementDimension(axis ); //increment the DataCube dimension by 1 getAxisList().add(axis); //update the locators that is related to this Array object int stop = locators.size(); for (int i = 0; i < stop; i++) { ((Locator) locators.get(i)).addAxis(axis); } updateNotesLocationOrder(); // reset to the current order of the axes return axis; }
1,406
public FieldAxis addFieldAxis(FieldAxis fieldAxis) { if (!canAddAxisObjToArray(fieldAxis)) return null; if (getFieldAxis() !=null) { List axisList = getAxisList(); axisList.remove(0); axisList.add(0, fieldAxis); //replace the old fieldAxis with the new one } else { //add fieldAxis and increment dimension getAxisList().add(0, fieldAxis); getDataCube().incrementDimension(fieldAxis); } hasFieldAxis = true; //update the locators that are related to this Array object int stop = locators.size(); for (int i = 0; i < stop; i++) { ((Locator) locators.get(i)).addAxis(fieldAxis); } //array doenst hold a dataformat anymore //each field along the fieldAxis should have dataformat setDataFormat(null); return fieldAxis; }
public FieldAxis addFieldAxis(FieldAxis fieldAxis) { if (!canAddAxisObjToArray(fieldAxis)) return null; if (getFieldAxis() !=null) { List axisList = getAxisList(); axisList.remove(0); axisList.add(0, fieldAxis); //replace the old fieldAxis with the new one } else { //add fieldAxis and increment dimension getAxisList().add(0, fieldAxis); getDataCube().incrementDimension(fieldAxis); } hasFieldAxis = true; //update the locators that are related to this Array object int stop = locators.size(); for (int i = 0; i < stop; i++) { ((Locator) locators.get(i)).addAxis(fieldAxis); } //array doenst hold a dataformat anymore //each field along the fieldAxis should have dataformat setDataFormat(null); return fieldAxis; }
1,407
public Object clone() throws CloneNotSupportedException { Array cloneObj = (Array) super.clone(); //deep clone for DataCube cloneObj.setDataCube((DataCube) this.getDataCube().clone()); //there are no locators that are related to the cloned Array object cloneObj.locators = new Vector(); //set the parentArray correctly for child object cloneObj.getDataCube().setParentArray(cloneObj); cloneObj.getXMLDataIOStyle().setParentArray(cloneObj); synchronized (this.paramGroupOwnedHash) { synchronized(cloneObj.paramGroupOwnedHash) { cloneObj.paramGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.paramGroupOwnedHash.size())); Iterator iter = this.paramGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.paramGroupOwnedHash.add(((Group) iter.next()).clone()); } } } return cloneObj; } //end of clone
public Object clone() throws CloneNotSupportedException { Array cloneObj = (Array) super.clone(); //deep clone for DataCube cloneObj.setDataCube((DataCube) this.getDataCube().clone()); //there are no locators that are related to the cloned Array object cloneObj.locatorList = new Vector(); //set the parentArray correctly for child object cloneObj.getDataCube().setParentArray(cloneObj); cloneObj.getXMLDataIOStyle().setParentArray(cloneObj); synchronized (this.paramGroupOwnedHash) { synchronized(cloneObj.paramGroupOwnedHash) { cloneObj.paramGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.paramGroupOwnedHash.size())); Iterator iter = this.paramGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.paramGroupOwnedHash.add(((Group) iter.next()).clone()); } } } return cloneObj; } //end of clone
1,408
public Locator createLocator() { Locator locatorObj = new Locator(this); //add this locator to the list of locators this Array object monitors locators.add(locatorObj); return locatorObj; }
public Locator createLocator() { Locator locatorObj = new Locator(this); //add this locator to the list of locators this Array object monitors locatorList.add(locatorObj); return locatorObj; }
1,409
public boolean removeAxis(Axis what) { boolean isRemoveSuccess = removeFromList(what, getAxisList(), "axisList"); if (isRemoveSuccess) //remove successful getDataCube().decrementDimension(); //decrease the dimension by 1 return isRemoveSuccess; }
public boolean removeAxis(Axis what) { boolean isRemoveSuccess = removeFromList(what, getAxisList(), "axisList"); if (isRemoveSuccess) //remove successful getDataCube().decrementDimension(); //decrease the dimension by 1 return isRemoveSuccess; }
1,410
public Note addNote (Note note ) { if (note == null) { Log.warn("in Notes.addNote(), the Note passed in is null"); return null; } getNoteList().add(note); return note; }
public Note addNote (Note note ) { if (note == null) { Log.warn("in Notes.addNote(), the Note passed in is null"); return null; } getNoteList().add(note); return note; }
1,412
public Unit addUnit(Unit unit) { if (unit == null) { Log.warn("in Units.addUnit(), the Unit passed in is null"); return null; } getUnitList().add(unit); return unit; }
public Unit addUnit(Unit unit) { if (unit == null) { Log.warn("in Units.addUnit(), the Unit passed in is null"); return null; } getUnitList().add(unit); return unit; }
1,413
public int decrementDimension() { if (dimension == 0) { Log.error(" in DataCube, incrementDimentsion, the dimension is 0"); return 0; } else return dimension--;}
public int decrementDimension() { if (dimension == 0) { Log.error(" in DataCube, incrementDimentsion, the dimension is 0"); return 0; } else return dimension--;}
1,414
public void startInstruction(int address) { if (debug) { BootLog.debug("#" + address + "\t" + vstack); } if (log) { os.log("#" + address); } this.curAddress = address; this.curInstrLabel = helper.getInstrLabel(address); if (startOfBB || setCurInstrLabel) { os.setObjectRef(curInstrLabel); startOfBB = false; setCurInstrLabel = false; } final int offset = os.getLength() - startOffset; cm.add(currentMethod, address, offset); }
public void startInstruction(int address) { if (debug) { BootLog.debug("#" + address + "\t" + vstack); } if (log) { if (debug) { os.log("#" + address + " VStack: " + vstack.toString()); } else { os.log("#" + address); } } this.curAddress = address; this.curInstrLabel = helper.getInstrLabel(address); if (startOfBB || setCurInstrLabel) { os.setObjectRef(curInstrLabel); startOfBB = false; setCurInstrLabel = false; } final int offset = os.getLength() - startOffset; cm.add(currentMethod, address, offset); }
1,415
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,416
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,417
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,418
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,419
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,420
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,421
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
public final void visit_dup2_x2() { final Item v1 = vstack.pop(); final Item v2 = vstack.pop(); final int c1 = v1.getCategory(); final int c2 = v2.getCategory(); v1.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); v2.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); // cope with brain-dead definition from Sun (look-like somebody there // was to eager to optimize this and it landed in the compiler... if (c2 == 2) { // form 4 assertCondition(c1 == 2, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v2); vstack.push(v1); } else { final Item v3 = vstack.pop(); v3.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); int c3 = v3.getCategory(); if (c1 == 2) { // form 2 assertCondition(c3 == 1, "category mismatch"); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else if (c3 == 2) { // form 3 vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v3); vstack.push(v2); vstack.push(v1); } else { // form 1 final Item v4 = vstack.pop(); v4.loadIf(eContext, Item.Kind.STACK | Item.Kind.FPUSTACK); vstack.push(v2.clone(eContext)); vstack.push(v1.clone(eContext)); vstack.push(v4); vstack.push(v3); vstack.push(v2); vstack.push(v1); } } }
1,422
final void loadTo(EmitterContext ec, Register lsb, Register msb) { final AbstractX86Stream os = ec.getStream(); final X86RegisterPool pool = ec.getPool(); final VirtualStack stack = ec.getVStack(); //os.log("LongItem.log called "+Integer.toString(kind)); assertCondition(lsb != msb, "lsb != msb"); assertCondition(lsb != null, "lsb != null"); assertCondition(msb != null, "msb != null"); switch (kind) { case Kind.REGISTER: // invariant: (msb != lsb) && (this.msb != this.lsb) if (msb != this.lsb) { // generic case; avoid only if msb is lsb' (value overwriting) // invariant: (msb != this.lsb) && (msb != lsb) && (this.msb != // this.lsb) // msb <- msb' // lsb <- lsb' if (msb != this.msb) { os.writeMOV(INTSIZE, msb, this.msb); if (lsb != this.msb) { pool.release(this.msb); } } if (lsb != this.lsb) { // invariant: (msb != this.lsb) && (lsb != this.lsb) && (msb // != lsb) && (this.msb != this.lsb) os.writeMOV(INTSIZE, lsb, this.lsb); //if (msb != this.lsb) { <- enforced by first if() pool.release(this.lsb); //} } } else if (lsb != this.msb) { // generic case, assignment sequence inverted; avoid only if lsb // is msb' (overwriting) // invariant: (msb == this.lsb) && (lsb != this.msb) // lsb <- lsb' // msb <- msb' // if (lsb != this.lsb) { <- always true, because msb == // this.lsb os.writeMOV(INTSIZE, lsb, this.lsb); // if (msb != this.lsb) { <- always false, because of invariant // pool.release(this.lsb); // } // } // if (msb != this.msb) { <- always true, because of invariant os.writeMOV(INTSIZE, msb, this.msb); // if (lsb != this.msb) { <- always true, because of invariant pool.release(this.msb); // } // } } else { // invariant: (msb == this.lsb) && (lsb == this.msb) // swap registers os.writeXCHG(this.lsb, this.msb); } break; case Kind.LOCAL: os.writeMOV(INTSIZE, lsb, FP, offsetToFP); os.writeMOV(INTSIZE, msb, FP, offsetToFP + 4); break; case Kind.CONSTANT: loadToConstant(ec, os, lsb, msb); break; case Kind.FPUSTACK: // Make sure this item is on top of the FPU stack stack.fpuStack.pop(this); // Convert & move to new space on normal stack os.writeLEA(SP, SP, 8); popFromFPU(os, SP, 0); os.writePOP(lsb); os.writePOP(msb); break; case Kind.STACK: if (VirtualStack.checkOperandStack) { stack.operandStack.pop(this); } os.writePOP(lsb); os.writePOP(msb); break; } kind = Kind.REGISTER; this.lsb = lsb; this.msb = msb; }
final void loadTo(EmitterContext ec, Register lsb, Register msb) { final AbstractX86Stream os = ec.getStream(); final X86RegisterPool pool = ec.getPool(); final VirtualStack stack = ec.getVStack(); //os.log("LongItem.log called "+Integer.toString(kind)); assertCondition(lsb != msb, "lsb != msb"); assertCondition(lsb != null, "lsb != null"); assertCondition(msb != null, "msb != null"); switch (kind) { case Kind.REGISTER: // invariant: (msb != lsb) && (this.msb != this.lsb) if (msb != this.lsb) { // generic case; avoid only if msb is lsb' (value overwriting) // invariant: (msb != this.lsb) && (msb != lsb) && (this.msb != // this.lsb) // msb <- msb' // lsb <- lsb' if (msb != this.msb) { os.writeMOV(INTSIZE, msb, this.msb); if (lsb != this.msb) { pool.release(this.msb); } } if (lsb != this.lsb) { // invariant: (msb != this.lsb) && (lsb != this.lsb) && (msb // != lsb) && (this.msb != this.lsb) os.writeMOV(INTSIZE, lsb, this.lsb); //if (msb != this.lsb) { <- enforced by first if() pool.release(this.lsb); //} } } else if (lsb != this.msb) { // generic case, assignment sequence inverted; avoid only if lsb // is msb' (overwriting) // invariant: (msb == this.lsb) && (lsb != this.msb) // lsb <- lsb' // msb <- msb' // if (lsb != this.lsb) { <- always true, because msb == // this.lsb os.writeMOV(INTSIZE, lsb, this.lsb); // if (msb != this.lsb) { <- always false, because of invariant // pool.release(this.lsb); // } // } // if (msb != this.msb) { <- always true, because of invariant os.writeMOV(INTSIZE, msb, this.msb); // if (lsb != this.msb) { <- always true, because of invariant pool.release(this.msb); // } // } } else { // invariant: (msb == this.lsb) && (lsb == this.msb) // swap registers os.writeXCHG(this.lsb, this.msb); } break; case Kind.LOCAL: os.writeMOV(INTSIZE, lsb, FP, offsetToFP); os.writeMOV(INTSIZE, msb, FP, offsetToFP + 4); break; case Kind.CONSTANT: loadToConstant(ec, os, lsb, msb); break; case Kind.FPUSTACK: // Make sure this item is on top of the FPU stack stack.fpuStack.pop(this); // Convert & move to new space on normal stack os.writeLEA(SP, SP, -8); popFromFPU(os, SP, 0); os.writePOP(lsb); os.writePOP(msb); break; case Kind.STACK: if (VirtualStack.checkOperandStack) { stack.operandStack.pop(this); } os.writePOP(lsb); os.writePOP(msb); break; } kind = Kind.REGISTER; this.lsb = lsb; this.msb = msb; }
1,423
public final void writeClassInitialize(Label curInstrLabel, Register classReg, VmType cls) { if (!cls.isInitialized()) { // Test declaringClass.modifiers os.writeTEST(classReg, context.getVmTypeState().getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(curInstrLabel + "$$after-classinit-ex"); os.writeJCC(afterInit, X86Constants.JNZ); os.writePUSHA(); // Call cls.initialize os.writePUSH(classReg); invokeJavaMethod(context.getVmTypeInitialize()); os.writePOPA(); // Set label os.setObjectRef(afterInit); } }
public final void writeClassInitialize(Label curInstrLabel, Register classReg, VmType cls) { if (!cls.isInitialized()) { // Test declaringClass.modifiers os.writeTEST(classReg, context.getVmTypeState().getOffset(), VmTypeState.ST_INITIALIZED); final Label afterInit = new Label(curInstrLabel + "$$after-classinit-ex"); os.writeJCC(afterInit, X86Constants.JNZ); os.writePUSHA(); // Call cls.initialize os.writePUSH(classReg); invokeJavaMethod(context.getVmTypeInitialize()); os.writePOPA(); // Set label os.setObjectRef(afterInit); } }
1,424
final static void rem(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 / fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); // We need reg to be ST1, if not swap fxchST1(os, fpuStack, reg); // Pop the fpuStack.tos fpuStack.pop(); // Calculate os.writeFPREM(); os.writeFSTP(Register.ST1); // Push result vstack.push(fpuStack.tos()); } }
final static void rem(AbstractX86Stream os, EmitterContext ec, VirtualStack vstack, int type) { final Item v2 = vstack.pop(type); final Item v1 = vstack.pop(type); if (v1.isConstant() && v2.isConstant()) { final double fpv1 = getFPValue(v1); final double fpv2 = getFPValue(v2); vstack.push(createConst(type, fpv1 % fpv2)); } else { // Prepare stack final FPUStack fpuStack = vstack.fpuStack; final Register reg; reg = prepareForOperation(os, ec, vstack, fpuStack, v2, v1, false); // We need reg to be ST1, if not swap fxchST1(os, fpuStack, reg); // Pop the fpuStack.tos fpuStack.pop(); // Calculate os.writeFPREM(); os.writeFSTP(Register.ST1); // Push result vstack.push(fpuStack.tos()); } }
1,426
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
1,428
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature[ofs++]; switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
1,429
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature[ofs] == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
1,430
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature[ofs] == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
1,431
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature[ofs] != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature[ofs] != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
1,432
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
public static final int getArgSlotCount(String signature) { /*int ofs = 0; final int len = signature.length(); if (signature.charAt(ofs++) != '(') return 0; int count = 0; while (ofs < len) { char ch = signature.charAt(ofs++); switch (ch) { case ')' : return count; case 'B' : // Byte case 'Z' : // Boolean case 'C' : // Char case 'S' : // Short case 'I' : // Int case 'F' : // Float count++; break; case 'D' : // Double case 'J' : // Long count += 2; break; case '[' : // Array { count++; while (signature.charAt(ofs) == '[') ofs++; if (signature.charAt(ofs) == 'L') { ofs++; while (signature.charAt(ofs) != ';') ofs++; } ofs++; } break; case 'L' : // Object { count++; while (signature.charAt(ofs) != ';') ofs++; ofs++; } break; } } throw new RuntimeException( "Invalid signature in getArgSlotCount: " + signature);*/ return getArgSlotCount(signature.toCharArray()); }
1,433
private void parseIncoming() { boolean controlChars = false; byte control0; byte control1; boolean done = false; boolean error = false; try { while (bk.hasNext() && !done) { byte b = bk.getNextByte(); switch (b) { case 0: case 1: break; case CMD_SAVE_SCREEN: // 0x02 2 Save Screen case 3: // 0x03 3 Save Partial Screen// System.out.println("save screen partial"); saveScreen(); break; case ESC: // ESCAPE break; case 7: // audible bell Toolkit.getDefaultToolkit().beep(); bk.getNextByte(); bk.getNextByte(); break; case CMD_WRITE_TO_DISPLAY: // 0x11 17 write to display error = writeToDisplay(true); break; case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen case 13: // 0x13 19 Restore Partial Screen System.out.println("restore screen partial"); restoreScreen(); break; case CMD_CLEAR_UNIT_ALTERNATE: // 0x20 32 clear unit alternate int param = bk.getNextByte(); if (param != 0) {// System.out.println(" clear unit alternate error " + Integer.toHexString(param)); sendNegResponse(NR_REQUEST_ERROR,03,01,05, " clear unit alternate not supported"); done = true; } else { if (screen52.getRows() != 27) screen52.setRowsCols(27,132); screen52.clearAll(); } break; case CMD_WRITE_ERROR_CODE: // 0x21 33 Write Error Code writeErrorCode(); error = writeToDisplay(false); break; case CMD_WRITE_ERROR_CODE_TO_WINDOW: // 0x22 34 // Write Error Code to window writeErrorCodeToWindow(); error = writeToDisplay(false); break; case CMD_READ_SCREEN_IMMEDIATE: // 0x62 98 case CMD_READ_SCREEN_TO_PRINT: // 0x66 102 read screen to print readScreen(); break; case CMD_CLEAR_UNIT: // 64 0x40 clear unit if (screen52.getRows() != 24) screen52.setRowsCols(24,80); screen52.clearAll(); break; case CMD_CLEAR_FORMAT_TABLE: // 80 0x50 Clear format table screen52.clearTable(); break; case CMD_READ_INPUT_FIELDS: //0x42 66 read input fields case CMD_READ_MDT_FIELDS: // 0x52 82 read MDT Fields bk.getNextByte(); bk.getNextByte(); readType = b; screen52.goHome();// screen52.setCursorOn(); waitingForInput = true; pendingUnlock = true;// screen52.setKeyboardLocked(false); break; case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83 readType = b;// screen52.goHome();// waitingForInput = true;// screen52.setKeyboardLocked(false); readImmediate(readType); break; case CMD_WRITE_STRUCTURED_FIELD: // 243 0xF3 -13 Write structured field writeStructuredField(); break; default: done = true; sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming"); break; } if (error) done = true; } } catch (Exception exc) {System.out.println("incoming " + exc.getMessage());}; }
private void parseIncoming() { boolean controlChars = false; byte control0; byte control1; boolean done = false; boolean error = false; try { while (bk.hasNext() && !done) { byte b = bk.getNextByte(); switch (b) { case 0: case 1: break; case CMD_SAVE_SCREEN: // 0x02 2 Save Screen case 3: // 0x03 3 Save Partial Screen// System.out.println("save screen partial"); saveScreen(); break; case ESC: // ESCAPE break; case 7: // audible bell Toolkit.getDefaultToolkit().beep(); bk.getNextByte(); bk.getNextByte(); break; case CMD_WRITE_TO_DISPLAY: // 0x11 17 write to display error = writeToDisplay(true); break; case CMD_RESTORE_SCREEN: // 0x12 18 Restore Screen case 13: // 0x13 19 Restore Partial Screen restoreScreen(); break; case CMD_CLEAR_UNIT_ALTERNATE: // 0x20 32 clear unit alternate int param = bk.getNextByte(); if (param != 0) {// System.out.println(" clear unit alternate error " + Integer.toHexString(param)); sendNegResponse(NR_REQUEST_ERROR,03,01,05, " clear unit alternate not supported"); done = true; } else { if (screen52.getRows() != 27) screen52.setRowsCols(27,132); screen52.clearAll(); } break; case CMD_WRITE_ERROR_CODE: // 0x21 33 Write Error Code writeErrorCode(); error = writeToDisplay(false); break; case CMD_WRITE_ERROR_CODE_TO_WINDOW: // 0x22 34 // Write Error Code to window writeErrorCodeToWindow(); error = writeToDisplay(false); break; case CMD_READ_SCREEN_IMMEDIATE: // 0x62 98 case CMD_READ_SCREEN_TO_PRINT: // 0x66 102 read screen to print readScreen(); break; case CMD_CLEAR_UNIT: // 64 0x40 clear unit if (screen52.getRows() != 24) screen52.setRowsCols(24,80); screen52.clearAll(); break; case CMD_CLEAR_FORMAT_TABLE: // 80 0x50 Clear format table screen52.clearTable(); break; case CMD_READ_INPUT_FIELDS: //0x42 66 read input fields case CMD_READ_MDT_FIELDS: // 0x52 82 read MDT Fields bk.getNextByte(); bk.getNextByte(); readType = b; screen52.goHome();// screen52.setCursorOn(); waitingForInput = true; pendingUnlock = true;// screen52.setKeyboardLocked(false); break; case CMD_READ_MDT_IMMEDIATE_ALT: // 0x53 83 readType = b;// screen52.goHome();// waitingForInput = true;// screen52.setKeyboardLocked(false); readImmediate(readType); break; case CMD_WRITE_STRUCTURED_FIELD: // 243 0xF3 -13 Write structured field writeStructuredField(); break; default: done = true; sendNegResponse(NR_REQUEST_ERROR,03,01,01,"parseIncoming"); break; } if (error) done = true; } } catch (Exception exc) {System.out.println("incoming " + exc.getMessage());}; }
1,435
public byte uni2ebcdic (char index) { if (convert) { if (codePage.equals("1141")) { byte b = 0x0; try { b = Character.toString(index).getBytes("Cp1141")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } if (codePage.equals("1140")) { byte b = 0x0; try { b = Character.toString(index).getBytes("Cp1140")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } int ind = index; int len = unicode.length; if (index > '\u007F') for (int x = 0x80; x < len; x++) { if (unicode[x] == index) {// System.out.println("conversion found " + (char)index + " " + unicode[x]); ind = x; break; } }// System.out.println("using conversion"); return (byte)ascii[ind & 0xff]; } else return (byte)ascii[index & 0xff]; }
public byte uni2ebcdic (char index) { if (convert) { if (codePage.equals("1141")) { byte b = 0x0; try { b = characterToString(index).getBytes("Cp1141")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } if (codePage.equals("1140")) { byte b = 0x0; try { b = Character.toString(index).getBytes("Cp1140")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } int ind = index; int len = unicode.length; if (index > '\u007F') for (int x = 0x80; x < len; x++) { if (unicode[x] == index) {// System.out.println("conversion found " + (char)index + " " + unicode[x]); ind = x; break; } }// System.out.println("using conversion"); return (byte)ascii[ind & 0xff]; } else return (byte)ascii[index & 0xff]; }
1,437
public byte uni2ebcdic (char index) { if (convert) { if (codePage.equals("1141")) { byte b = 0x0; try { b = Character.toString(index).getBytes("Cp1141")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } if (codePage.equals("1140")) { byte b = 0x0; try { b = Character.toString(index).getBytes("Cp1140")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } int ind = index; int len = unicode.length; if (index > '\u007F') for (int x = 0x80; x < len; x++) { if (unicode[x] == index) {// System.out.println("conversion found " + (char)index + " " + unicode[x]); ind = x; break; } }// System.out.println("using conversion"); return (byte)ascii[ind & 0xff]; } else return (byte)ascii[index & 0xff]; }
public byte uni2ebcdic (char index) { if (convert) { if (codePage.equals("1141")) { byte b = 0x0; try { b = Character.toString(index).getBytes("Cp1141")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } if (codePage.equals("1140")) { byte b = 0x0; try { b = characterToString(index).getBytes("Cp1140")[0]; } catch (java.io.UnsupportedEncodingException uee) { uee.printStackTrace(); } return b; } int ind = index; int len = unicode.length; if (index > '\u007F') for (int x = 0x80; x < len; x++) { if (unicode[x] == index) {// System.out.println("conversion found " + (char)index + " " + unicode[x]); ind = x; break; } }// System.out.println("using conversion"); return (byte)ascii[ind & 0xff]; } else return (byte)ascii[index & 0xff]; }
1,438
protected void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag; }
protected void setPendingInsert(boolean flag, int icX, int icY) { if (homePos != -1) pendingInsert = flag; }
1,439
protected void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag; }
protected void setPendingInsert(boolean flag) { pendingInsert = flag; pendingInsert = flag; }
1,440
protected void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag; }
protected void setPendingInsert(boolean flag) { if (homePos != -1) if (pendingInsert) { homePos = getPos(icX, icY); } if (!isStatusErrorCode()) { setCursor(icX, icY); } }
1,441
public static Object[] getStackTrace(VmThread current) { if (current.inException) { Unsafe.debug("Exception in getStackTrace"); Unsafe.die("getStackTrace"); return null; } else { current.inException = true; } if (Vm.getVm().getHeapManager().isLowOnMemory()) { return null; } final VmProcessor proc = Unsafe.getCurrentProcessor(); final VmStackReader reader = proc.getArchitecture().getStackReader(); final VmStackFrame[] mt; //Address lastIP = null; if (current == proc.getCurrentThread()) { final Address curFrame = Unsafe.getCurrentFrame(); mt = reader.getVmStackTrace(reader.getPrevious(curFrame), reader .getReturnAddress(curFrame), STACKTRACE_LIMIT); } else { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getStackFrame(), current .getInstructionPointer(), STACKTRACE_LIMIT); //lastIP = current.getInstructionPointer(); } finally { proc.enableReschedule(); } } final int cnt = (mt == null) ? 0 : mt.length; VmType lastClass = null; int i = 0; while (i < cnt) { final VmStackFrame f = mt[ i]; if (f == null) { break; } final VmMethod method = f.getMethod(); if (method == null) { break; } final VmType vmClass = method.getDeclaringClass(); if (vmClass == null) { break; } final VmType sClass = vmClass.getSuperClass(); if ((lastClass != null) && (sClass != lastClass) && (vmClass != lastClass)) { break; } final String mname = method.getName(); if (mname == null) { break; } if (!("<init>".equals(mname) || "fillInStackTrace".equals(mname) || "getStackTrace" .equals(mname))) { break; } lastClass = vmClass; i++; } final VmStackFrame[] st = new VmStackFrame[ cnt - i]; int j = 0; for (; i < cnt; i++) { st[ j++] = mt[ i]; } current.inException = false; return st; }
public static Object[] getStackTrace(VmThread current) { if (current.inException) { Unsafe.debug("Exception in getStackTrace"); Unsafe.die("getStackTrace"); return null; } else { current.inException = true; } if (Vm.getVm().getHeapManager().isLowOnMemory()) { return null; } final VmProcessor proc = Unsafe.getCurrentProcessor(); final VmStackReader reader = proc.getArchitecture().getStackReader(); final VmStackFrame[] mt; //Address lastIP = null; if (current.isInSystemException()) { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getExceptionStackFrame(), current.getExceptionInstructionPointer(), STACKTRACE_LIMIT); } finally { proc.enableReschedule(); } } else if (current == proc.getCurrentThread()) { final Address curFrame = Unsafe.getCurrentFrame(); mt = reader.getVmStackTrace(reader.getPrevious(curFrame), reader .getReturnAddress(curFrame), STACKTRACE_LIMIT); } else { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getStackFrame(), current .getInstructionPointer(), STACKTRACE_LIMIT); //lastIP = current.getInstructionPointer(); } finally { proc.enableReschedule(); } } final int cnt = (mt == null) ? 0 : mt.length; VmType lastClass = null; int i = 0; while (i < cnt) { final VmStackFrame f = mt[ i]; if (f == null) { break; } final VmMethod method = f.getMethod(); if (method == null) { break; } final VmType vmClass = method.getDeclaringClass(); if (vmClass == null) { break; } final VmType sClass = vmClass.getSuperClass(); if ((lastClass != null) && (sClass != lastClass) && (vmClass != lastClass)) { break; } final String mname = method.getName(); if (mname == null) { break; } if (!("<init>".equals(mname) || "fillInStackTrace".equals(mname) || "getStackTrace" .equals(mname))) { break; } lastClass = vmClass; i++; } final VmStackFrame[] st = new VmStackFrame[ cnt - i]; int j = 0; for (; i < cnt; i++) { st[ j++] = mt[ i]; } current.inException = false; return st; }
1,442
public NoClassDefFoundError() { super(); }
public NoClassDefFoundError() { }
1,443
public ArrayStoreException(String s) { super(s); }
public ArrayStoreException(String s) { super(s); }
1,444
public boolean isResolved() { return resolved; }
public boolean isResolved() { return true; }
1,445
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.debug(getMagic(f)); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); ip = stack[i].getReturnAddress(); f = getPrevious(f); } return stack; }
final VmStackFrame[] getVmStackTrace(Address argFrame, Address ip, int limit) { final Address frame = argFrame; Address f = frame; int count = 0; while (isValid(f) && (count < limit)) { count++; f = getPrevious(f); } if ((f != null) && !isStackBottom(f) && (count < limit)) { Unsafe.debug("Corrupted stack!, st.length="); Unsafe.debug(count); Unsafe.debug(" f.magic="); Unsafe.debug(getMagic(f)); //Unsafe.die(); } final VmStackFrame[] stack = new VmStackFrame[count]; f = frame; for (int i = 0; i < count; i++) { stack[i] = new VmStackFrame(f, this, ip); ip = Address.add(stack[i].getReturnAddress(), -1); f = getPrevious(f); } return stack; }
1,446