bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
---|---|---|
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
|
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues, boolean writeCDATAStatement ) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
| 545 |
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
|
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; if(writeCDATAStatement) writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
| 546 |
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
|
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); if (writeCDATAStatement) writeOut(outputstream, "]]>"); }
| 547 |
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); }
|
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues, boolean writeCDATAStatement ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); }
| 548 |
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); }
|
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement if (writeCDATAStatement) writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); }
| 549 |
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement writeOut(outputstream, "]]>"); }
|
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues ) { // print opening CDATA statement writeOut(outputstream, "<![CDATA["); // print out the data as appropriate for the format // QUESTION: don't we need to syncronize on readObj too? synchronized (data) { List commands = readObj.getCommands(); // returns expanded list (no repeat cmds) int nrofCommands = commands.size(); int currentCommand = 0; DataFormat dataFormats[] = parentArray.getDataFormatList(); int nrofDataFormats = dataFormats.length; int currentDataFormat = 0; // loop thru all of the dataCube until finished with all data and commands boolean atEndOfDataCube = false; boolean backToStartOfDataCube = false; while (!backToStartOfDataCube) { FormattedIOCmd command = (FormattedIOCmd) commands.get(currentCommand); if(atEndOfDataCube && locator.getAxisLocation(fastestAxis) == 0) backToStartOfDataCube = true; if (command instanceof ReadCellFormattedIOCmd) { if (backToStartOfDataCube) break; // dont bother, we'd be re-printing data try { doReadCellFormattedIOCmdOutput( outputstream, dataFormats[currentDataFormat], locator ); } catch (NoDataException e) { // no data here, hurm. Print the noDataValue. // Is this always appropriate, seems questionable? -b.t. String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) writeOut(outputstream, noData); else Log.errorln("Cant print out null data: noDataValue NOT defined."); } // advance the data location locator.next(); // advance the DataFormat to be used if(nrofDataFormats > 1) { currentDataFormat++; if ( currentDataFormat == nrofDataFormats) currentDataFormat = 0; } } else if (command instanceof SkipCharFormattedIOCmd) { doSkipCharFormattedIOCmdOutput ( outputstream, (SkipCharFormattedIOCmd) command); } else { Log.errorln("DataCube cannot write out, unimplemented format command:"+ command.toString()); System.exit(-1); } if(nrofCommands > 1) { currentCommand++; if ( currentCommand == nrofCommands) { currentCommand = 0; } } if(!atEndOfDataCube && !locator.hasNext()) atEndOfDataCube = true; } // end of while loop } // end of sync loop // print closing CDATA statement if (writeCDATAStatement) writeOut(outputstream, "]]>"); }
| 550 |
public DecimalFormat (String pattern) { this (pattern, new DecimalFormatSymbols ()); }
|
public DecimalFormat () { this (pattern, new DecimalFormatSymbols ()); }
| 551 |
public DecimalFormat (String pattern) { this (pattern, new DecimalFormatSymbols ()); }
|
public DecimalFormat (String pattern) { this ("#,##0.###"); }
| 552 |
protected void writeOut ( OutputStream outputstream, String msg ) { if (msg == null) { return ; } try { outputstream.write(msg.getBytes()); } catch (IOException e) { Log.error("Error: couldnt open OutputStream for writing"); } }
|
protected void writeOut ( OutputStream outputstream, String msg ) { if (msg == null) { return ; } try { outputstream.write(msg.getBytes()); } catch (IOException e) { Log.error("Error: couldnt open OutputStream for writing"); } }
| 553 |
public int getAxisLocation (Axis axisObj) { if ((!parentArray.getAxisList().contains(axisObj)) ) { Log.error("axisObj is not an Axis ref contained in Locator's parentArray"); Log.error("regnore request"); return -1; } Integer loc = (Integer) locations.get(axisObj); if (loc !=null) return loc.intValue(); else { Log.error("error, parentArray constains the axisObj, but Location doens't"); return -1; } }
|
public int getAxisLocation (AxisInterface axisObj) { if ((!parentArray.getAxisList().contains(axisObj)) ) { Log.error("axisObj is not an Axis ref contained in Locator's parentArray"); Log.error("regnore request"); return -1; } Integer loc = (Integer) locations.get(axisObj); if (loc !=null) return loc.intValue(); else { Log.error("error, parentArray constains the axisObj, but Location doens't"); return -1; } }
| 554 |
public OptionArgument(String name, String description, Option o1) { this(name, description, new Option[] { o1}, SINGLE); }
|
public OptionArgument(String name, String description, Option o1) { this(name, description, new Option[] { o1}, SINGLE); }
| 555 |
public DeviceArgument(String name, String description) { super(name, description); }
|
public DeviceArgument(String name, String description) { super(name, description); }
| 556 |
public IntegerArgument(String name, String description) { super(name, description); }
|
public IntegerArgument(String name, String description) { super(name, description); }
| 557 |
public Parameter(Argument argument, boolean optional) { this(ANONYMOUS, NO_DESCRIPTION, argument, optional); }
|
public Parameter(Argument argument, boolean optional) { this(ANONYMOUS, NO_DESCRIPTION, argument, optional); }
| 558 |
public Syntax(String description, Parameter p1) { this(description, new Parameter[] { p1}); }
|
public Syntax(String description, Parameter p1) { this(description, new Parameter[] { p1}); }
| 559 |
protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); }
|
protected void crossHair() { setCursorActive(false); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); }
| 560 |
protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); }
|
protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorActive(true); }
| 561 |
protected final int getIntProperty(String prop) { return Integer.parseInt((String)appProps.get(prop)); }
|
protected final int getIntProperty(String prop) { if (appProps.containsKey(prop)) { try { int i = Integer.parseInt((String)appProps.get(prop)); return i; } catch (NumberFormatException ne) { return 0; } } else return 0; }
| 562 |
private void gotoNextWord() { int pos = lastPos; setCursorOff(); if (screen[lastPos].getChar() > ' ') { advancePos(); // get the next space character while (screen[lastPos].getChar() > ' ' && pos != lastPos ) { advancePos(); } } else advancePos(); // now that we are positioned on the next space character get the // next none space character while (screen[lastPos].getChar() <= ' ' && pos != lastPos) { advancePos(); } setCursorOn(); }
|
private void gotoNextWord() { int pos = lastPos; if (screen[lastPos].getChar() > ' ') { advancePos(); // get the next space character while (screen[lastPos].getChar() > ' ' && pos != lastPos ) { advancePos(); } } else advancePos(); // now that we are positioned on the next space character get the // next none space character while (screen[lastPos].getChar() <= ' ' && pos != lastPos) { advancePos(); } setCursorOn(); }
| 563 |
private void gotoNextWord() { int pos = lastPos; setCursorOff(); if (screen[lastPos].getChar() > ' ') { advancePos(); // get the next space character while (screen[lastPos].getChar() > ' ' && pos != lastPos ) { advancePos(); } } else advancePos(); // now that we are positioned on the next space character get the // next none space character while (screen[lastPos].getChar() <= ' ' && pos != lastPos) { advancePos(); } setCursorOn(); }
|
private void gotoNextWord() { int pos = lastPos; setCursorOff(); if (screen[lastPos].getChar() > ' ') { advancePos(); // get the next space character while (screen[lastPos].getChar() > ' ' && pos != lastPos ) { advancePos(); } } else advancePos(); // now that we are positioned on the next space character get the // next none space character while (screen[lastPos].getChar() <= ' ' && pos != lastPos) { advancePos(); } }
| 564 |
private void gotoPrevWord() { int pos = lastPos; setCursorOff(); changePos(-1); // position previous white space character while (screen[lastPos].getChar() <= ' ') { changePos(-1); if (pos == lastPos) break; } changePos(-1); // get the previous space character while (screen[lastPos].getChar() > ' ' && pos != lastPos) { changePos(-1); } // and position one position more should give us the beginning of word advancePos(); setCursorOn(); }
|
private void gotoPrevWord() { int pos = lastPos; changePos(-1); // position previous white space character while (screen[lastPos].getChar() <= ' ') { changePos(-1); if (pos == lastPos) break; } changePos(-1); // get the previous space character while (screen[lastPos].getChar() > ' ' && pos != lastPos) { changePos(-1); } // and position one position more should give us the beginning of word advancePos(); setCursorOn(); }
| 565 |
private void gotoPrevWord() { int pos = lastPos; setCursorOff(); changePos(-1); // position previous white space character while (screen[lastPos].getChar() <= ' ') { changePos(-1); if (pos == lastPos) break; } changePos(-1); // get the previous space character while (screen[lastPos].getChar() > ' ' && pos != lastPos) { changePos(-1); } // and position one position more should give us the beginning of word advancePos(); setCursorOn(); }
|
private void gotoPrevWord() { int pos = lastPos; setCursorOff(); changePos(-1); // position previous white space character while (screen[lastPos].getChar() <= ' ') { changePos(-1); if (pos == lastPos) break; } changePos(-1); // get the previous space character while (screen[lastPos].getChar() > ' ' && pos != lastPos) { changePos(-1); } // and position one position more should give us the beginning of word advancePos(); }
| 566 |
protected final void pasteMe(boolean special) { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); Transferable content = cb.getContents(this); setCursorOff(); try { StringBuffer sb = new StringBuffer((String)content.getTransferData(DataFlavor.stringFlavor)); StringBuffer pd = new StringBuffer(); int r = getRow(lastPos); int nextChar = 0; int nChars = sb.length(); boolean omitLF = false; boolean done = false; screenFields.saveCurrentField(); int lr = getRow(lastPos); int lc = getCol(lastPos); resetDirty(lastPos); while (!done) { if (nextChar >= nChars) { /* EOF */ done = true; break; } pd.setLength(0); boolean eol = false; char c = 0; int i; /* Skip a leftover '\n', if necessary */ if (omitLF && (sb.charAt(nextChar) == '\n')) nextChar++; boolean skipLF = false; omitLF = false; charLoop: for (i = nextChar; i < nChars; i++) { c = sb.charAt(i); if ((c == '\n') || (c == '\r')) { eol = true; break charLoop; } } int startChar = nextChar; nextChar = i; pd.append(sb.substring(startChar, startChar + (i - startChar))); if (eol) { nextChar++; if (c == '\r') { skipLF = true; } } System.out.println("pasted >" + pd + "<"); int col = getCol(lastPos); int t = numCols - col; if (t > pd.length()) t = pd.length(); int p = 0; char pc; boolean setIt; while (t-- > 0) { pc = pd.charAt(p); setIt = true; if (special && (!Character.isLetter(pc) && !Character.isDigit(pc))) setIt = false; if (isInField(r,col) && setIt) { screen[getPos(r,col)].setChar(pc); setDirty(r,col); screenFields.setCurrentFieldMDT(); } p++; if (setIt) col++; } r++; } screenFields.restoreCurrentField(); updateDirty(); goto_XY(lr+1,lc+1); } catch (Throwable exc) { System.err.println(exc); } setCursorOn(); }
|
protected final void pasteMe(boolean special) { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); Transferable content = cb.getContents(this); try { StringBuffer sb = new StringBuffer((String)content.getTransferData(DataFlavor.stringFlavor)); StringBuffer pd = new StringBuffer(); int r = getRow(lastPos); int nextChar = 0; int nChars = sb.length(); boolean omitLF = false; boolean done = false; screenFields.saveCurrentField(); int lr = getRow(lastPos); int lc = getCol(lastPos); resetDirty(lastPos); while (!done) { if (nextChar >= nChars) { /* EOF */ done = true; break; } pd.setLength(0); boolean eol = false; char c = 0; int i; /* Skip a leftover '\n', if necessary */ if (omitLF && (sb.charAt(nextChar) == '\n')) nextChar++; boolean skipLF = false; omitLF = false; charLoop: for (i = nextChar; i < nChars; i++) { c = sb.charAt(i); if ((c == '\n') || (c == '\r')) { eol = true; break charLoop; } } int startChar = nextChar; nextChar = i; pd.append(sb.substring(startChar, startChar + (i - startChar))); if (eol) { nextChar++; if (c == '\r') { skipLF = true; } } System.out.println("pasted >" + pd + "<"); int col = getCol(lastPos); int t = numCols - col; if (t > pd.length()) t = pd.length(); int p = 0; char pc; boolean setIt; while (t-- > 0) { pc = pd.charAt(p); setIt = true; if (special && (!Character.isLetter(pc) && !Character.isDigit(pc))) setIt = false; if (isInField(r,col) && setIt) { screen[getPos(r,col)].setChar(pc); setDirty(r,col); screenFields.setCurrentFieldMDT(); } p++; if (setIt) col++; } r++; } screenFields.restoreCurrentField(); updateDirty(); goto_XY(lr+1,lc+1); } catch (Throwable exc) { System.err.println(exc); } setCursorOn(); }
| 568 |
protected final void pasteMe(boolean special) { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); Transferable content = cb.getContents(this); setCursorOff(); try { StringBuffer sb = new StringBuffer((String)content.getTransferData(DataFlavor.stringFlavor)); StringBuffer pd = new StringBuffer(); int r = getRow(lastPos); int nextChar = 0; int nChars = sb.length(); boolean omitLF = false; boolean done = false; screenFields.saveCurrentField(); int lr = getRow(lastPos); int lc = getCol(lastPos); resetDirty(lastPos); while (!done) { if (nextChar >= nChars) { /* EOF */ done = true; break; } pd.setLength(0); boolean eol = false; char c = 0; int i; /* Skip a leftover '\n', if necessary */ if (omitLF && (sb.charAt(nextChar) == '\n')) nextChar++; boolean skipLF = false; omitLF = false; charLoop: for (i = nextChar; i < nChars; i++) { c = sb.charAt(i); if ((c == '\n') || (c == '\r')) { eol = true; break charLoop; } } int startChar = nextChar; nextChar = i; pd.append(sb.substring(startChar, startChar + (i - startChar))); if (eol) { nextChar++; if (c == '\r') { skipLF = true; } } System.out.println("pasted >" + pd + "<"); int col = getCol(lastPos); int t = numCols - col; if (t > pd.length()) t = pd.length(); int p = 0; char pc; boolean setIt; while (t-- > 0) { pc = pd.charAt(p); setIt = true; if (special && (!Character.isLetter(pc) && !Character.isDigit(pc))) setIt = false; if (isInField(r,col) && setIt) { screen[getPos(r,col)].setChar(pc); setDirty(r,col); screenFields.setCurrentFieldMDT(); } p++; if (setIt) col++; } r++; } screenFields.restoreCurrentField(); updateDirty(); goto_XY(lr+1,lc+1); } catch (Throwable exc) { System.err.println(exc); } setCursorOn(); }
|
protected final void pasteMe(boolean special) { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); Transferable content = cb.getContents(this); setCursorOff(); try { StringBuffer sb = new StringBuffer((String)content.getTransferData(DataFlavor.stringFlavor)); StringBuffer pd = new StringBuffer(); int r = getRow(lastPos); int nextChar = 0; int nChars = sb.length(); boolean omitLF = false; boolean done = false; screenFields.saveCurrentField(); int lr = getRow(lastPos); int lc = getCol(lastPos); resetDirty(lastPos); while (!done) { if (nextChar >= nChars) { /* EOF */ done = true; break; } pd.setLength(0); boolean eol = false; char c = 0; int i; /* Skip a leftover '\n', if necessary */ if (omitLF && (sb.charAt(nextChar) == '\n')) nextChar++; boolean skipLF = false; omitLF = false; charLoop: for (i = nextChar; i < nChars; i++) { c = sb.charAt(i); if ((c == '\n') || (c == '\r')) { eol = true; break charLoop; } } int startChar = nextChar; nextChar = i; pd.append(sb.substring(startChar, startChar + (i - startChar))); if (eol) { nextChar++; if (c == '\r') { skipLF = true; } } System.out.println("pasted >" + pd + "<"); int col = getCol(lastPos); int t = numCols - col; if (t > pd.length()) t = pd.length(); int p = 0; char pc; boolean setIt; while (t-- > 0) { pc = pd.charAt(p); setIt = true; if (special && (!Character.isLetter(pc) && !Character.isDigit(pc))) setIt = false; if (isInField(r,col) && setIt) { screen[getPos(r,col)].setChar(pc); setDirty(r,col); screenFields.setCurrentFieldMDT(); } p++; if (setIt) col++; } r++; } screenFields.restoreCurrentField(); updateDirty(); goto_XY(lr+1,lc+1); } catch (Throwable exc) { System.err.println(exc); } }
| 569 |
public void propertyChange(PropertyChangeEvent pce) { String pn = pce.getPropertyName(); boolean resetAttr = false; if (pn.equals("colorBg")) { colorBg = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorBlue")) { colorBlue = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorTurq")) { colorTurq = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorRed")) { colorRed = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorWhite")) { colorWhite = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorYellow")) { colorYellow = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGreen")) { colorGreen = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorPink")) { colorPink = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGUIField")) { colorGUIField = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorCursor")) { colorCursor = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorSep")) { colorSep = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorHexAttr")) { colorHexAttr = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("cursorSize")) { if (pce.getNewValue().equals("Full")) cursorSize = 2; if (pce.getNewValue().equals("Half")) cursorSize = 1; if (pce.getNewValue().equals("Line")) cursorSize = 0; } if (pn.equals("crossHair")) { if (pce.getNewValue().equals("None")) crossHair = 0; if (pce.getNewValue().equals("Horz")) crossHair = 1; if (pce.getNewValue().equals("Vert")) crossHair = 2; if (pce.getNewValue().equals("Both")) crossHair = 3; } if (pn.equals("colSeparator")) { if (pce.getNewValue().equals("Line")) colSepLine = 0; if (pce.getNewValue().equals("ShortLine")) colSepLine = 1; if (pce.getNewValue().equals("Dot")) colSepLine = 2; } if (pn.equals("showAttr")) { if (pce.getNewValue().equals("Hex")) showHex = true; else showHex= false; } if (pn.equals("guiInterface")) { if (pce.getNewValue().equals("Yes")) guiInterface = true; else guiInterface = false; } if (pn.equals("guiShowUnderline")) { if (pce.getNewValue().equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (pn.equals("hotspots")) { if (pce.getNewValue().equals("Yes")) hotSpots = true; else hotSpots = false; } if (pn.equals("hsMore")) { hsMore.setLength(0); hsMore.append((String)pce.getNewValue()); } if (pn.equals("hsBottom")) { hsBottom.setLength(0); hsBottom.append((String)pce.getNewValue()); } if (pn.equals("font")) { font = new Font((String)pce.getNewValue(),Font.PLAIN,14); updateFont = true; } if (pn.equals("fontScaleHeight")) {// try { sfh = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontScaleWidth")) {// try { sfw = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontPointSize")) {// try { ps132 = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (updateFont) { Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width,r.height); updateFont = false; } if (resetAttr) { for (int y = 0;y < lenScreen; y++) { screen[y].setAttribute(screen[y].getCharAttr()); } bi.drawOIA(fmWidth,fmHeight,numRows,numCols,font,colorBg,colorBlue); } gui.repaint(); gui.revalidate(); }
|
public void propertyChange(PropertyChangeEvent pce) { String pn = pce.getPropertyName(); boolean resetAttr = false; if (pn.equals("colorBg")) { colorBg = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorBlue")) { colorBlue = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorTurq")) { colorTurq = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorRed")) { colorRed = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorWhite")) { colorWhite = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorYellow")) { colorYellow = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGreen")) { colorGreen = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorPink")) { colorPink = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGUIField")) { colorGUIField = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorCursor")) { colorCursor = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorSep")) { colorSep = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorHexAttr")) { colorHexAttr = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("cursorSize")) { if (pce.getNewValue().equals("Full")) cursorSize = 2; if (pce.getNewValue().equals("Half")) cursorSize = 1; if (pce.getNewValue().equals("Line")) cursorSize = 0; } if (pn.equals("crossHair")) { if (pce.getNewValue().equals("None")) crossHair = 0; if (pce.getNewValue().equals("Horz")) crossHair = 1; if (pce.getNewValue().equals("Vert")) crossHair = 2; if (pce.getNewValue().equals("Both")) crossHair = 3; } if (pn.equals("colSeparator")) { if (pce.getNewValue().equals("Line")) colSepLine = 0; if (pce.getNewValue().equals("ShortLine")) colSepLine = 1; if (pce.getNewValue().equals("Dot")) colSepLine = 2; } if (pn.equals("showAttr")) { if (pce.getNewValue().equals("Hex")) showHex = true; else showHex= false; } if (pn.equals("guiInterface")) { if (pce.getNewValue().equals("Yes")) guiInterface = true; else guiInterface = false; } if (pn.equals("guiShowUnderline")) { if (pce.getNewValue().equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (pn.equals("hotspots")) { if (pce.getNewValue().equals("Yes")) hotSpots = true; else hotSpots = false; } if (pn.equals("hsMore")) { hsMore.setLength(0); hsMore.append((String)pce.getNewValue()); } if (pn.equals("hsBottom")) { hsBottom.setLength(0); hsBottom.append((String)pce.getNewValue()); } if (pn.equals("font")) { font = new Font((String)pce.getNewValue(),Font.PLAIN,14); updateFont = true; } if (pn.equals("fontScaleHeight")) {// try { sfh = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontScaleWidth")) {// try { sfw = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontPointSize")) {// try { ps132 = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (updateFont) { Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width,r.height); updateFont = false; } if (resetAttr) { for (int y = 0;y < lenScreen; y++) { screen[y].setAttribute(screen[y].getCharAttr()); } bi.drawOIA(fmWidth,fmHeight,numRows,numCols,font,colorBg,colorBlue); } gui.repaint(); }
| 570 |
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); setCursorOn(); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
|
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); setCursorOn(); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
| 571 |
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); setCursorOn(); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
|
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); setCursorOn(); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
| 572 |
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); setCursorOn(); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
|
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } keysBuffered = false; setKBIndicatorOff(); bufferedKeys = null; } // check to see if position is in a field and if it is then change // current field to that field isInField(lastPos,true); if (text.length() == 1 && !text.equals("[") && !text.equals("]")) { simulateKeyStroke(text.charAt(0)); } else { strokenizer.setKeyStrokes(text); String s; boolean done = false; while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) { s = strokenizer.nextKeyStroke(); if (s.length() == 1) { simulateKeyStroke(s.charAt(0)); } else { if (s != null) { simulateMnemonic(getMnemonicValue(s)); } else System.out.println(" send keys mnemonic " + s); } if (keyboardLocked) { bufferedKeys = strokenizer.getUnprocessedKeyStroked(); if (bufferedKeys != null) { keysBuffered = true; setKBIndicatorOn(); } done = true; } } } } }
| 573 |
public final void setBounds(int width, int height) { resizeScreenArea(width,height); dirty.setBounds(tArea.getBounds()); if (gui.getGraphics() != null) { // do not forget to null out gg2d before update or else there will // be a very hard to trace screen resize problem gg2d = null; updateDirty(); setCursorOn(); } // restore statuses that were on the screen before resize if (isStatusErrorCode()) setStatus(STATUS_ERROR_CODE,STATUS_VALUE_ON,statusString); if (isXSystem()) setStatus(STATUS_SYSTEM,STATUS_VALUE_ON,statusString); if (isMessageWait()) setMessageLightOn(); }
|
public final void setBounds(int width, int height) { resizeScreenArea(width,height); dirty.setBounds(tArea.getBounds()); if (gui.getGraphics() != null) { // do not forget to null out gg2d before update or else there will // be a very hard to trace screen resize problem gg2d = null; updateDirty(); } // restore statuses that were on the screen before resize if (isStatusErrorCode()) setStatus(STATUS_ERROR_CODE,STATUS_VALUE_ON,statusString); if (isXSystem()) setStatus(STATUS_SYSTEM,STATUS_VALUE_ON,statusString); if (isMessageWait()) setMessageLightOn(); }
| 575 |
public void setCursorOff() { updateCursorLoc(); updateCursorLoc = false; }
|
public void setCursorOff() { updateCursorLoc(); updateCursorLoc = false; }
| 577 |
public void setCursorOn() { updateCursorLoc = true;// System.out.println("cursor on"); if (!keysBuffered) updateCursorLoc(); }
|
public void setCursorOn() { updateCursorLoc = true;// System.out.println("cursor on"); if (!keysBuffered) updateCursorLoc(); }
| 578 |
protected boolean simulateKeyStroke(char c){// if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) {// if (resetRequired)// return false;// else// resetError();// } boolean updateField = false; boolean numericError = false; boolean updatePos = false; boolean autoEnter = false; if (!Character.isISOControl(c)) { if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { switch (screenFields.getCurrentFieldShift()) { case 0: // Alpha shift case 2: // Numeric Shift case 4: // Kakana Shift updateField = true; break; case 1: // Alpha Only if(Character.isLetter(c) || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; break; case 3: // Numeric only if(Character.isDigit(c) || c == '+' || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; else numericError = true; break; case 5: // Digits only if(Character.isDigit(c)) updateField = true; else displayError(ERR_NUMERIC_09); break; case 7: // Signed numeric if(Character.isDigit(c) || c == '+' || c == '-') if (lastPos == screenFields.getCurrentField().endPos() && (c != '+' && c != '-')) displayError(ERR_INVALID_SIGN); else updateField = true; else displayError(ERR_NUMERIC_09); break; } if (updateField) { if (screenFields.isCurrentFieldToUpper()) c = Character.toUpperCase(c); setCursorOff(); updatePos = true; resetDirty(lastPos); if (insertMode) { if (endOfField(false) != screenFields.getCurrentField().endPos()) shiftRight(lastPos); else { displayError(ERR_NO_ROOM_INSERT); updatePos = false; } } if (updatePos) { screenFields.getCurrentField().getKeyPos(getRow(lastPos),getCol(lastPos)); screenFields.getCurrentField().changePos(1); screen[lastPos].setChar(c); screenFields.setCurrentFieldMDT(); // if we have gone passed the end of the field then goto the next field if (!screenFields.withinCurrentField(screenFields.getCurrentFieldPos())) { if (screenFields.isCurrentFieldAutoEnter()) { autoEnter = true; } else if (!screenFields.isCurrentFieldFER()) gotoFieldNext(); } else goto_XY(screenFields.getCurrentField().getCursorRow() + 1,screenFields.getCurrentField().getCursorCol() + 1); } updateImage(dirty); setCursorOn(); if (autoEnter) sendAid(AID_ENTER); } else { if (numericError) { displayError(ERR_NUMERIC_ONLY); } } } else { displayError(ERR_CURSOR_PROTECTED); } } return updatePos; }
|
protected boolean simulateKeyStroke(char c){// if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) {// if (resetRequired)// return false;// else// resetError();// } boolean updateField = false; boolean numericError = false; boolean updatePos = false; boolean autoEnter = false; if (!Character.isISOControl(c)) { if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { switch (screenFields.getCurrentFieldShift()) { case 0: // Alpha shift case 2: // Numeric Shift case 4: // Kakana Shift updateField = true; break; case 1: // Alpha Only if(Character.isLetter(c) || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; break; case 3: // Numeric only if(Character.isDigit(c) || c == '+' || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; else numericError = true; break; case 5: // Digits only if(Character.isDigit(c)) updateField = true; else displayError(ERR_NUMERIC_09); break; case 7: // Signed numeric if(Character.isDigit(c) || c == '+' || c == '-') if (lastPos == screenFields.getCurrentField().endPos() && (c != '+' && c != '-')) displayError(ERR_INVALID_SIGN); else updateField = true; else displayError(ERR_NUMERIC_09); break; } if (updateField) { if (screenFields.isCurrentFieldToUpper()) c = Character.toUpperCase(c); updatePos = true; resetDirty(lastPos); if (insertMode) { if (endOfField(false) != screenFields.getCurrentField().endPos()) shiftRight(lastPos); else { displayError(ERR_NO_ROOM_INSERT); updatePos = false; } } if (updatePos) { screenFields.getCurrentField().getKeyPos(getRow(lastPos),getCol(lastPos)); screenFields.getCurrentField().changePos(1); screen[lastPos].setChar(c); screenFields.setCurrentFieldMDT(); // if we have gone passed the end of the field then goto the next field if (!screenFields.withinCurrentField(screenFields.getCurrentFieldPos())) { if (screenFields.isCurrentFieldAutoEnter()) { autoEnter = true; } else if (!screenFields.isCurrentFieldFER()) gotoFieldNext(); } else goto_XY(screenFields.getCurrentField().getCursorRow() + 1,screenFields.getCurrentField().getCursorCol() + 1); } updateImage(dirty); setCursorOn(); if (autoEnter) sendAid(AID_ENTER); } else { if (numericError) { displayError(ERR_NUMERIC_ONLY); } } } else { displayError(ERR_CURSOR_PROTECTED); } } return updatePos; }
| 579 |
protected boolean simulateKeyStroke(char c){// if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) {// if (resetRequired)// return false;// else// resetError();// } boolean updateField = false; boolean numericError = false; boolean updatePos = false; boolean autoEnter = false; if (!Character.isISOControl(c)) { if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { switch (screenFields.getCurrentFieldShift()) { case 0: // Alpha shift case 2: // Numeric Shift case 4: // Kakana Shift updateField = true; break; case 1: // Alpha Only if(Character.isLetter(c) || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; break; case 3: // Numeric only if(Character.isDigit(c) || c == '+' || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; else numericError = true; break; case 5: // Digits only if(Character.isDigit(c)) updateField = true; else displayError(ERR_NUMERIC_09); break; case 7: // Signed numeric if(Character.isDigit(c) || c == '+' || c == '-') if (lastPos == screenFields.getCurrentField().endPos() && (c != '+' && c != '-')) displayError(ERR_INVALID_SIGN); else updateField = true; else displayError(ERR_NUMERIC_09); break; } if (updateField) { if (screenFields.isCurrentFieldToUpper()) c = Character.toUpperCase(c); setCursorOff(); updatePos = true; resetDirty(lastPos); if (insertMode) { if (endOfField(false) != screenFields.getCurrentField().endPos()) shiftRight(lastPos); else { displayError(ERR_NO_ROOM_INSERT); updatePos = false; } } if (updatePos) { screenFields.getCurrentField().getKeyPos(getRow(lastPos),getCol(lastPos)); screenFields.getCurrentField().changePos(1); screen[lastPos].setChar(c); screenFields.setCurrentFieldMDT(); // if we have gone passed the end of the field then goto the next field if (!screenFields.withinCurrentField(screenFields.getCurrentFieldPos())) { if (screenFields.isCurrentFieldAutoEnter()) { autoEnter = true; } else if (!screenFields.isCurrentFieldFER()) gotoFieldNext(); } else goto_XY(screenFields.getCurrentField().getCursorRow() + 1,screenFields.getCurrentField().getCursorCol() + 1); } updateImage(dirty); setCursorOn(); if (autoEnter) sendAid(AID_ENTER); } else { if (numericError) { displayError(ERR_NUMERIC_ONLY); } } } else { displayError(ERR_CURSOR_PROTECTED); } } return updatePos; }
|
protected boolean simulateKeyStroke(char c){// if (isStatusErrorCode() && !Character.isISOControl(c) && !keyProcessed) {// if (resetRequired)// return false;// else// resetError();// } boolean updateField = false; boolean numericError = false; boolean updatePos = false; boolean autoEnter = false; if (!Character.isISOControl(c)) { if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { switch (screenFields.getCurrentFieldShift()) { case 0: // Alpha shift case 2: // Numeric Shift case 4: // Kakana Shift updateField = true; break; case 1: // Alpha Only if(Character.isLetter(c) || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; break; case 3: // Numeric only if(Character.isDigit(c) || c == '+' || c == ',' || c == '-' || c == '.' || c == ' ') updateField = true; else numericError = true; break; case 5: // Digits only if(Character.isDigit(c)) updateField = true; else displayError(ERR_NUMERIC_09); break; case 7: // Signed numeric if(Character.isDigit(c) || c == '+' || c == '-') if (lastPos == screenFields.getCurrentField().endPos() && (c != '+' && c != '-')) displayError(ERR_INVALID_SIGN); else updateField = true; else displayError(ERR_NUMERIC_09); break; } if (updateField) { if (screenFields.isCurrentFieldToUpper()) c = Character.toUpperCase(c); setCursorOff(); updatePos = true; resetDirty(lastPos); if (insertMode) { if (endOfField(false) != screenFields.getCurrentField().endPos()) shiftRight(lastPos); else { displayError(ERR_NO_ROOM_INSERT); updatePos = false; } } if (updatePos) { screenFields.getCurrentField().getKeyPos(getRow(lastPos),getCol(lastPos)); screenFields.getCurrentField().changePos(1); screen[lastPos].setChar(c); screenFields.setCurrentFieldMDT(); // if we have gone passed the end of the field then goto the next field if (!screenFields.withinCurrentField(screenFields.getCurrentFieldPos())) { if (screenFields.isCurrentFieldAutoEnter()) { autoEnter = true; } else if (!screenFields.isCurrentFieldFER()) gotoFieldNext(); } else goto_XY(screenFields.getCurrentField().getCursorRow() + 1,screenFields.getCurrentField().getCursorCol() + 1); } updateImage(dirty); if (autoEnter) sendAid(AID_ENTER); } else { if (numericError) { displayError(ERR_NUMERIC_ONLY); } } } else { displayError(ERR_CURSOR_PROTECTED); } } return updatePos; }
| 580 |
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { setCursorOff(); screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); setCursorOn(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : setCursorOff(); // we toggle it insertMode = insertMode ? false : true; setCursorOn(); break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { setCursorOff(); screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : if (isStatusErrorCode()) { resetError(); isInField(lastPos); updateDirty(); setCursorOn(); } else { setPrehelpState(false,isKeyboardLocked(),false); } simulated = true; break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; case DUP_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.isCurrentFieldDupEnabled()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().setFieldChar(lastPos,(char)0x1C); screenFields.setCurrentFieldMDT(); gotoFieldNext(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_DUP_KEY_NOT_ALLOWED); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case NEW_LINE : if (screenFields.getSize() > 0) { int startRow = getRow(lastPos) + 1; int startPos = lastPos; boolean isthere = false; setCursorOff(); if (startRow == getRows()) startRow = 0; goto_XY(++startRow,1); if (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { while (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { // lets keep going advancePos(); // Have we looped the screen? if (lastPos == startPos) { // if so then go back to starting point goto_XY(startPos); break; } } } setCursorOn(); } simulated = true; break; case JUMP_NEXT_SESS : gui.nextSession(); simulated = true; break; case JUMP_PREV_SESS : gui.prevSession(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
|
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); setCursorOn(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : // we toggle it insertMode = insertMode ? false : true; setCursorOn(); break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : if (isStatusErrorCode()) { resetError(); isInField(lastPos); updateDirty(); setCursorOn(); } else { setPrehelpState(false,isKeyboardLocked(),false); } simulated = true; break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; case DUP_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.isCurrentFieldDupEnabled()) { resetDirty(lastPos); screenFields.getCurrentField().setFieldChar(lastPos,(char)0x1C); screenFields.setCurrentFieldMDT(); gotoFieldNext(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_DUP_KEY_NOT_ALLOWED); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case NEW_LINE : if (screenFields.getSize() > 0) { int startRow = getRow(lastPos) + 1; int startPos = lastPos; boolean isthere = false; if (startRow == getRows()) startRow = 0; goto_XY(++startRow,1); if (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { while (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { // lets keep going advancePos(); // Have we looped the screen? if (lastPos == startPos) { // if so then go back to starting point goto_XY(startPos); break; } } } setCursorOn(); } simulated = true; break; case JUMP_NEXT_SESS : gui.nextSession(); simulated = true; break; case JUMP_PREV_SESS : gui.prevSession(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
| 581 |
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { setCursorOff(); screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); setCursorOn(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); setCursorOn(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : setCursorOff(); // we toggle it insertMode = insertMode ? false : true; setCursorOn(); break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { setCursorOff(); screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); setCursorOn(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : if (isStatusErrorCode()) { resetError(); isInField(lastPos); updateDirty(); setCursorOn(); } else { setPrehelpState(false,isKeyboardLocked(),false); } simulated = true; break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; case DUP_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.isCurrentFieldDupEnabled()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().setFieldChar(lastPos,(char)0x1C); screenFields.setCurrentFieldMDT(); gotoFieldNext(); updateDirty(); setCursorOn(); simulated = true; } else { displayError(ERR_DUP_KEY_NOT_ALLOWED); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case NEW_LINE : if (screenFields.getSize() > 0) { int startRow = getRow(lastPos) + 1; int startPos = lastPos; boolean isthere = false; setCursorOff(); if (startRow == getRows()) startRow = 0; goto_XY(++startRow,1); if (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { while (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { // lets keep going advancePos(); // Have we looped the screen? if (lastPos == startPos) { // if so then go back to starting point goto_XY(startPos); break; } } } setCursorOn(); } simulated = true; break; case JUMP_NEXT_SESS : gui.nextSession(); simulated = true; break; case JUMP_PREV_SESS : gui.prevSession(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
|
protected boolean simulateMnemonic(int mnem){ boolean simulated = false; switch (mnem) { case AID_CLEAR : case AID_ENTER : case AID_PF1 : case AID_PF2 : case AID_PF3 : case AID_PF4 : case AID_PF5 : case AID_PF6 : case AID_PF7 : case AID_PF8 : case AID_PF9 : case AID_PF10 : case AID_PF11 : case AID_PF12 : case AID_PF13 : case AID_PF14 : case AID_PF15 : case AID_PF16 : case AID_PF17 : case AID_PF18 : case AID_PF19 : case AID_PF20 : case AID_PF21 : case AID_PF22 : case AID_PF23 : case AID_PF24 : case AID_ROLL_DOWN : case AID_ROLL_UP : case AID_ROLL_LEFT : case AID_ROLL_RIGHT : sendAid(mnem); simulated = true; break; case AID_HELP : sessionVT.sendHelpRequest(); simulated = true; break; case AID_PRINT : sessionVT.hostPrint(1); simulated = true; break; case BACK_SPACE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.getCurrentField().startPos() == lastPos) displayError(ERR_CURSOR_PROTECTED); else { setCursorOff(); screenFields.getCurrentField().getKeyPos(lastPos); screenFields.getCurrentField().changePos(-1); resetDirty(screenFields.getCurrentField().getCurrentPos()); shiftLeft(screenFields.getCurrentField().getCurrentPos()); updateDirty(); screenFields.setCurrentFieldMDT(); simulated = true; } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BACK_TAB : if (screenFields.getCurrentField() != null && screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldPrev(); updateDirty(); } else gotoFieldPrev(); if (screenFields.isCurrentFieldContinued()) { do { gotoFieldPrev(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } isInField(lastPos); simulated = true; break; case UP : case MARK_UP : process_XY(lastPos - numCols); simulated = true; break; case DOWN : case MARK_DOWN : process_XY(lastPos + numCols); simulated = true; break; case LEFT : case MARK_LEFT : process_XY(lastPos - 1); simulated = true; break; case RIGHT : case MARK_RIGHT : process_XY(lastPos + 1); simulated = true; break; case NEXTWORD : gotoNextWord(); simulated = true; break; case PREVWORD : gotoPrevWord(); simulated = true; break; case DELETE : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().getKeyPos(lastPos); shiftLeft(screenFields.getCurrentFieldPos()); screenFields.setCurrentFieldMDT(); updateDirty(); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case TAB : if (screenFields.getCurrentField() != null && !screenFields.isCurrentFieldContinued()) { if (screenFields.isCurrentFieldHighlightedEntry()) { resetDirty(screenFields.getCurrentField().startPos); gotoFieldNext(); updateDirty(); } else gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.getCurrentField() != null && (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast())); } isInField(lastPos); simulated = true; break; case EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = endOfField(screenFields.getCurrentField().startPos(),true); if (where > 0) { goto_XY((where / numCols) + 1,(where % numCols) + 1); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case ERASE_EOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case ERASE_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); int where = lastPos; lastPos = screenFields.getCurrentField().startPos(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); goto_XY(where); simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } break; case INSERT : setCursorOff(); // we toggle it insertMode = insertMode ? false : true; break; case HOME : // position to the home position set if (lastPos + numCols + 1 != homePos) { goto_XY(homePos - numCols - 1); // now check if we are in a field isInField(lastPos); } else gotoField(1); break; case KEYPAD_0 : simulated = simulateKeyStroke('0'); break; case KEYPAD_1 : simulated = simulateKeyStroke('1'); break; case KEYPAD_2 : simulated = simulateKeyStroke('2'); break; case KEYPAD_3 : simulated = simulateKeyStroke('3'); break; case KEYPAD_4 : simulated = simulateKeyStroke('4'); break; case KEYPAD_5 : simulated = simulateKeyStroke('5'); break; case KEYPAD_6 : simulated = simulateKeyStroke('6'); break; case KEYPAD_7 : simulated = simulateKeyStroke('7'); break; case KEYPAD_8 : simulated = simulateKeyStroke('8'); break; case KEYPAD_9 : simulated = simulateKeyStroke('9'); break; case KEYPAD_PERIOD : simulated = simulateKeyStroke('.'); break; case KEYPAD_COMMA : simulated = simulateKeyStroke(','); break; case KEYPAD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } simulated = true; updateDirty(); if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_EXIT : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); if (screenFields.isCurrentFieldContinued()) fieldExit(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_PLUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { setCursorOff(); resetDirty(lastPos); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_CURSOR_PROTECTED); } break; case FIELD_MINUS : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int s = screenFields.getCurrentField().getFieldShift(); if (s == 3 || s == 5 || s == 7) { setCursorOff(); screen[lastPos].setChar('-'); resetDirty(lastPos); advancePos(); if (fieldExit()) { screenFields.setCurrentFieldMDT(); if (!screenFields.isCurrentFieldContinued()) { gotoFieldNext(); } else { do { gotoFieldNext(); } while (screenFields.isCurrentFieldContinuedMiddle() || screenFields.isCurrentFieldContinuedLast()); } } updateDirty(); simulated = true; if (screenFields.isCurrentFieldAutoEnter()) sendAid(AID_ENTER); } else { displayError(ERR_FIELD_MINUS); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case BOF : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { int where = screenFields.getCurrentField().startPos(); if (where > 0) { goto_XY(where); } simulated = true; } else { displayError(ERR_CURSOR_PROTECTED); } resetDirty(lastPos); break; case SYSREQ : sessionVT.systemRequest(); simulated = true; break; case RESET : if (isStatusErrorCode()) { resetError(); isInField(lastPos); updateDirty(); } else { setPrehelpState(false,isKeyboardLocked(),false); } simulated = true; break; case COPY : copyMe(); break; case PASTE : pasteMe(false); break; case ATTN : sessionVT.sendAttentionKey(); simulated = true; break; case DUP_FIELD : if (screenFields.getCurrentField() != null && screenFields.withinCurrentField(lastPos) && !screenFields.isCurrentFieldBypassField()) { if (screenFields.isCurrentFieldDupEnabled()) { setCursorOff(); resetDirty(lastPos); screenFields.getCurrentField().setFieldChar(lastPos,(char)0x1C); screenFields.setCurrentFieldMDT(); gotoFieldNext(); updateDirty(); simulated = true; } else { displayError(ERR_DUP_KEY_NOT_ALLOWED); } } else { displayError(ERR_CURSOR_PROTECTED); } break; case NEW_LINE : if (screenFields.getSize() > 0) { int startRow = getRow(lastPos) + 1; int startPos = lastPos; boolean isthere = false; setCursorOff(); if (startRow == getRows()) startRow = 0; goto_XY(++startRow,1); if (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { while (!isInField() && screenFields.getCurrentField() != null && !screenFields.isCurrentFieldBypassField()) { // lets keep going advancePos(); // Have we looped the screen? if (lastPos == startPos) { // if so then go back to starting point goto_XY(startPos); break; } } } } simulated = true; break; case JUMP_NEXT_SESS : gui.nextSession(); simulated = true; break; case JUMP_PREV_SESS : gui.prevSession(); simulated = true; break; default : System.out.println(" Mnemonic not supported " + mnem); break; } return simulated; }
| 582 |
private void updateCursorLoc() { if (updateCursorLoc) { cursorActive = cursorActive ? false:true; int row = getRow(lastPos); int col = getCol(lastPos); bi.drawCursor(this,row,col, fmWidth,fmHeight, insertMode, crossHair, cursorSize,colorCursor, colorBg,colorWhite, font); cursorActive = false; } }
|
private void updateCursorLoc() { if (updateCursorLoc) { cursorActive = cursorActive ? false:true; int row = getRow(lastPos); int col = getCol(lastPos); bi.drawCursor(this,row,col, fmWidth,fmHeight, insertMode, crossHair, cursorSize,colorCursor, colorBg,colorWhite, font); cursorActive = false; } }
| 583 |
private void updateCursorLoc() { if (updateCursorLoc) { cursorActive = cursorActive ? false:true; int row = getRow(lastPos); int col = getCol(lastPos); bi.drawCursor(this,row,col, fmWidth,fmHeight, insertMode, crossHair, cursorSize,colorCursor, colorBg,colorWhite, font); cursorActive = false; } }
|
private void updateCursorLoc() { if (updateCursorLoc) { cursorActive = cursorActive ? false:true; int row = getRow(lastPos); int col = getCol(lastPos); bi.drawCursor(this,row,col, fmWidth,fmHeight, insertMode, crossHair, cursorSize,colorCursor, colorBg,colorWhite, font,cursorBottOffset); cursorActive = false; } }
| 584 |
private void updateCursorLoc() { if (updateCursorLoc) { cursorActive = cursorActive ? false:true; int row = getRow(lastPos); int col = getCol(lastPos); bi.drawCursor(this,row,col, fmWidth,fmHeight, insertMode, crossHair, cursorSize,colorCursor, colorBg,colorWhite, font); cursorActive = false; } }
|
private void updateCursorLoc() { if (updateCursorLoc) { cursorActive = cursorActive ? false:true; int row = getRow(lastPos); int col = getCol(lastPos); bi.drawCursor(this,row,col, fmWidth,fmHeight, insertMode, crossHair, cursorSize,colorCursor, colorBg,colorWhite, font); } }
| 585 |
protected void getBoundingArea(Rectangle r) { if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getStartPoint().x,getStartPoint().y,getEndPoint().x-getStartPoint().x,getEndPoint().y-getStartPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getEndPoint().x,getEndPoint().y,getStartPoint().x-getEndPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getStartPoint().x,getEndPoint().y,getEndPoint().x-getStartPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getEndPoint().x,getStartPoint().y,getStartPoint().x-getEndPoint().x,getEndPoint().y-getStartPoint().y); }// return r; }
|
protected Rectangle getBoundingArea() { if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getStartPoint().x,getStartPoint().y,getEndPoint().x-getStartPoint().x,getEndPoint().y-getStartPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getEndPoint().x,getEndPoint().y,getStartPoint().x-getEndPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getStartPoint().x,getEndPoint().y,getEndPoint().x-getStartPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getEndPoint().x,getStartPoint().y,getStartPoint().x-getEndPoint().x,getEndPoint().y-getStartPoint().y); }// return r; }
| 587 |
protected void getBoundingArea(Rectangle r) { if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getStartPoint().x,getStartPoint().y,getEndPoint().x-getStartPoint().x,getEndPoint().y-getStartPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getEndPoint().x,getEndPoint().y,getStartPoint().x-getEndPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getStartPoint().x,getEndPoint().y,getEndPoint().x-getStartPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getEndPoint().x,getStartPoint().y,getStartPoint().x-getEndPoint().x,getEndPoint().y-getStartPoint().y); }// return r; }
|
protected void getBoundingArea(Rectangle r) { if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getStartPoint().x,getStartPoint().y,getEndPoint().x-getStartPoint().x,getEndPoint().y-getStartPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getEndPoint().x,getEndPoint().y,getStartPoint().x-getEndPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x > getStartPoint().x) && (getEndPoint().y < getStartPoint().y)) { r.setBounds(getStartPoint().x,getEndPoint().y,getEndPoint().x-getStartPoint().x,getStartPoint().y-getEndPoint().y); } else if((getEndPoint().x < getStartPoint().x) && (getEndPoint().y > getStartPoint().y)) { r.setBounds(getEndPoint().x,getStartPoint().y,getStartPoint().x-getEndPoint().x,getEndPoint().y-getStartPoint().y); }// return r; }
| 588 |
public int getKeyPos(int pos) { int y = pos - startPos(); cursorPos = pos; return y; }
|
public int getKeyPos(int row1, int col1) { int y = pos - startPos(); cursorPos = pos; return y; }
| 589 |
public int getKeyPos(int pos) { int y = pos - startPos(); cursorPos = pos; return y; }
|
public int getKeyPos(int pos) { int y = pos - startPos(); cursorPos = pos; return y; }
| 590 |
public boolean isInField(int pos, boolean chgToField) { ScreenField sf; for (int x = 0;x < sizeFields; x++) { sf = screenFields[x]; if (sf.withinField(pos)) { if (chgToField) { currentField = sf; } return true; } } return false; }
|
public boolean isInField(int pos, boolean chgToField) { ScreenField sf; for (int x = 0;x < sizeFields; x++) { sf = screenFields[x]; if (sf.withinField(pos)) { if (chgToField) { currentField = sf; } return true; } } return false; }
| 591 |
public synchronized void drawImageBuffer(Graphics2D gg2d) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi,null,0,0); // tell waiting threads to wake up lock.notifyAll(); } }
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi,null,0,0); // tell waiting threads to wake up lock.notifyAll(); } }
| 592 |
public synchronized void drawImageBuffer(Graphics2D gg2d) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi,null,0,0); // tell waiting threads to wake up lock.notifyAll(); } }
|
public synchronized void drawImageBuffer(Graphics2D gg2d) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x + offLeft,y+ offTop); // tell waiting threads to wake up lock.notifyAll(); } }
| 593 |
public String nextKeyStroke() { String s = ""; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index + " len " + length ); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :3 " + "at position " + index); sb.append(c); index++; } else { c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was incomplete beginning not found :4 " + "at position " + index); } } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = ""; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { log.warn(" mnemonic key was incomplete :1 " + "at position " + index + " len " + length ); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :3 " + "at position " + index); sb.append(c); index++; } else { c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was incomplete beginning not found :4 " + "at position " + index); } } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb); } }// System.out.println("next "+ keyStrokes); return s; }
| 596 |
public String nextKeyStroke() { String s = ""; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { System.out.println(" mnemonic key was incomplete :1 " + "at position " + index + " len " + length ); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { System.out.println( " mnemonic key was incomplete ending not found :3 " + "at position " + index); sb.append(c); index++; } else { c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { System.out.println( " mnemonic key was incomplete beginning not found :4 " + "at position " + index); } } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb); } }// System.out.println("next "+ keyStrokes); return s; }
|
public String nextKeyStroke() { String s = ""; boolean gotOne = false; int start = index; if(length > index) { sb.setLength(0); char c = keyStrokes.charAt(index); switch(c) { case '[': sb.append(c); index++; // we need to throw an error here if(index >= length) { log.warn(" mnemonic key was incomplete :1 " + "at position " + index + " len " + length ); } else { c = keyStrokes.charAt(index); if(c == '[') index++; else { while(!gotOne) { if(c == ']') { // did we find an ending sb.append(c); index++; gotOne = true; } else { sb.append(c); index++; // we need to throw an error here because we did not // find an ending for the potential mnemonic if(index >= length) { log.warn( " mnemonic key was incomplete ending not found :2 " + "at position " + index); } c = keyStrokes.charAt(index); } } } } break; case ']': index++; if(index >= length) { log.warn( " mnemonic key was incomplete ending not found :3 " + "at position " + index); sb.append(c); index++; } else { c = keyStrokes.charAt(index); if(c == ']') { sb.append(c); index++; } else { log.warn( " mnemonic key was incomplete beginning not found :4 " + "at position " + index); } } break; default: sb.append(c); index++; break; } if(sb != null) { s = new String(sb); } }// log.warn("next "+ keyStrokes); return s; }
| 597 |
public synchronized StringBuffer insert(int offset, char ch) { if (offset < 0 || offset > count) throw new StringIndexOutOfBoundsException(offset); ensureCapacity_unsynchronized(count + 1); VMSystem.arraycopy(value, offset, value, offset + 1, count - offset); value[offset] = ch; count++; return this; }
|
public synchronized StringBuffer insert(int offset, char[] str, int str_offset, int len) { if (offset < 0 || offset > count) throw new StringIndexOutOfBoundsException(offset); ensureCapacity_unsynchronized(count + 1); VMSystem.arraycopy(value, offset, value, offset + 1, count - offset); value[offset] = ch; count++; return this; }
| 599 |
public synchronized StringBuffer insert(int offset, char ch) { if (offset < 0 || offset > count) throw new StringIndexOutOfBoundsException(offset); ensureCapacity_unsynchronized(count + 1); VMSystem.arraycopy(value, offset, value, offset + 1, count - offset); value[offset] = ch; count++; return this; }
|
public synchronized StringBuffer insert(int offset, char ch) { if (offset < 0 || offset > count) throw new StringIndexOutOfBoundsException(offset); ensureCapacity_unsynchronized(count + 1); VMSystem.arraycopy(value, offset, value, offset + 1, count - offset); value[offset] = ch; count++; return this; }
| 600 |
public int getHeight(ImageObserver io) { synchronized (lock) { // tell waiting threads to wake up lock.notifyAll(); return bi.getHeight(io); } }
|
public int getHeight() { synchronized (lock) { // tell waiting threads to wake up lock.notifyAll(); return bi.getHeight(io); } }
| 601 |
public int getHeight(ImageObserver io) { synchronized (lock) { // tell waiting threads to wake up lock.notifyAll(); return bi.getHeight(io); } }
|
public int getHeight(ImageObserver io) { synchronized (lock) { // tell waiting threads to wake up lock.notifyAll(); return bi.getHeight(); } }
| 602 |
public TTFFileInput(RandomAccessFile file) throws IOException { this(file, 0, file.length()); }
|
public TTFFileInput(RandomAccessFile file) throws IOException { this(file, 0, file.length()); }
| 603 |
public GrubBootSector(byte[] src) { super(src); }
|
public GrubBootSector(byte[] src) { super(src); }
| 604 |
public void actionPerformed(ActionEvent event) { showTip(); if (insideTimer != null) insideTimer.start(); }
|
public void actionPerformed(ActionEvent event) { showTip(); if (insideTimer != null) insideTimer.start(); }
| 605 |
void hideTip() { if (currentTip == null || ! currentTip.isVisible() || ! enabled) return; currentTip.setVisible(false); if (containerPanel != null) { Container parent = containerPanel.getParent(); if (parent == null) return; parent.remove(containerPanel); parent.invalidate(); parent.validate(); parent.repaint(); parent = currentTip.getParent(); if (parent == null) return; parent.remove(currentTip); containerPanel = null; } if (tooltipWindow != null) { tooltipWindow.hide(); tooltipWindow.dispose(); tooltipWindow = null; } }
|
void hideTip() { if (currentTip == null || ! currentTip.isVisible() || ! enabled) return; currentTip.setVisible(false); if (containerPanel != null) { Container parent = containerPanel.getParent(); if (parent == null) return; parent.remove(containerPanel); parent.invalidate(); parent.validate(); parent.repaint(); parent = currentTip.getParent(); if (parent == null) return; parent.remove(currentTip); containerPanel = null; } if (tooltipWindow != null) { tooltipWindow.hide(); tooltipWindow.dispose(); tooltipWindow = null; } }
| 606 |
public void mouseEntered(MouseEvent event) { if (currentComponent != null && getContentPaneDeepestComponent(event) == currentComponent) return; currentPoint = event.getPoint(); currentComponent = (Component) event.getSource(); if (exitTimer.isRunning()) { exitTimer.stop(); showTip(); insideTimer.start(); return; } // This should always be stopped unless we have just fake-exited. if (! enterTimer.isRunning()) enterTimer.start(); }
|
public void mouseEntered(MouseEvent event) { if (currentComponent != null && getContentPaneDeepestComponent(event) == currentComponent) return; currentPoint = event.getPoint(); currentComponent = (Component) event.getSource(); if (exitTimer.isRunning()) { exitTimer.stop(); insideTimer.start(); return; } // This should always be stopped unless we have just fake-exited. if (! enterTimer.isRunning()) enterTimer.start(); }
| 607 |
public void mouseMoved(MouseEvent event) { currentPoint = event.getPoint(); if (currentTip != null) { if (currentComponent == null) currentComponent = (Component) event.getSource(); String text = ((JComponent) currentComponent).getToolTipText(event); currentTip.setTipText(text); } if (enterTimer.isRunning()) enterTimer.restart(); }
|
public void mouseMoved(MouseEvent event) { currentPoint = event.getPoint(); if (currentTip != null) { if (currentComponent == null) currentComponent = (Component) event.getSource(); String text = ((JComponent) currentComponent).getToolTipText(event); currentTip.setTipText(text); } if (enterTimer.isRunning()) enterTimer.restart(); }
| 608 |
public void mousePressed(MouseEvent event) { currentPoint = event.getPoint(); if (enterTimer.isRunning()) enterTimer.restart(); else if (insideTimer.isRunning()) { insideTimer.stop(); hideTip(); } if (currentComponent == null) currentComponent = (Component) event.getSource(); currentComponent.invalidate(); currentComponent.validate(); currentComponent.repaint(); }
|
public void mousePressed(MouseEvent event) { currentPoint = event.getPoint(); if (enterTimer.isRunning()) enterTimer.restart(); else if (insideTimer.isRunning()) { insideTimer.stop(); hideTip(); } if (currentComponent == null) currentComponent = (Component) event.getSource(); currentComponent.invalidate(); currentComponent.validate(); currentComponent.repaint(); }
| 609 |
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
|
void showTip() { if (!enabled || currentComponent == null || !currentComponent.isEnabled() || (currentTip != null && currentTip.isVisible())) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
| 610 |
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
|
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (parent instanceof JPopupMenu) setLightWeightPopupEnabled(((JPopupMenu) parent).isLightWeightPopupEnabled()); else setLightWeightPopupEnabled(true); if (isLightWeightPopupEnabled()) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
| 611 |
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
|
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
| 612 |
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
|
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
| 613 |
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
|
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
| 614 |
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
|
void showTip() { if (! enabled || currentComponent == null) return; if (currentTip == null || currentTip.getComponent() != currentComponent && currentComponent instanceof JComponent) currentTip = ((JComponent) currentComponent).createToolTip(); Point p = currentPoint; Dimension dims = currentTip.getPreferredSize(); if (canToolTipFit(currentTip)) { JLayeredPane pane = ((JRootPane) SwingUtilities.getAncestorOfClass(JRootPane.class, currentComponent)) .getLayeredPane(); // This should never happen, but just in case. if (pane == null) return; if (containerPanel != null) hideTip(); if (isLightWeightPopupEnabled()) { containerPanel = new Panel(); JRootPane root = new JRootPane(); root.getContentPane().add(currentTip); containerPanel.add(root); } else { containerPanel = new JPanel(); containerPanel.add(currentTip); } LayoutManager lm = containerPanel.getLayout(); if (lm instanceof FlowLayout) { FlowLayout fm = (FlowLayout) lm; fm.setVgap(0); fm.setHgap(0); } p = getGoodPoint(p, pane, currentTip, dims); pane.add(containerPanel); containerPanel.setBounds(p.x, p.y, dims.width, dims.height); currentTip.setBounds(0, 0, dims.width, dims.height); pane.revalidate(); pane.repaint(); } else { SwingUtilities.convertPointToScreen(p, currentComponent); tooltipWindow = new JWindow(); tooltipWindow.getContentPane().add(currentTip); tooltipWindow.setFocusable(false); tooltipWindow.pack(); tooltipWindow.setBounds(p.x, p.y, dims.width, dims.height); tooltipWindow.show(); } currentTip.setVisible(true); }
| 615 |
private void loadConfigurationResource() { sesProps = new Properties(); try { FileInputStream in = new FileInputStream(getConfigurationResource()); sesProps.load(in); if (sesProps.size() == 0) loadDefaults(); } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + getConfigurationResource()); loadDefaults(); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
|
private void loadConfigurationResource() { sesProps = new Properties(); try { FileInputStream in = new FileInputStream(settingsDirectory() + getConfigurationResource()); sesProps.load(in); if (sesProps.size() == 0) loadDefaults(); } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + getConfigurationResource()); loadDefaults(); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
| 617 |
abstract public void saveSettings(String regKey, String fileName, String header);
|
abstract public void saveSettings();
| 618 |
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } else { Log.warn("Warning: XMLDeclAttribs NOT currently supported."); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.error("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) writeOut(outputstream, pcdata); // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } else { Log.warn("Warning: XMLDeclAttribs NOT currently supported."); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.error("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 620 |
public void toXDFOutputStream (OutputStream outputstream, String indent) { // prepare XMLDeclaration Hashtable XMLDeclAttribs = new Hashtable(); XMLDeclAttribs.put("standalone", new String("no")); XMLDeclAttribs.put("version", (String) sXMLSpecVersion); toXDFOutputStream(outputstream, XMLDeclAttribs, indent); }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { // prepare XMLDeclaration Hashtable XMLDeclAttribs = new Hashtable(); XMLDeclAttribs.put("standalone", new String("no")); XMLDeclAttribs.put("version", (String) sXMLSpecVersion); toXDFOutputStream(outputstream, XMLDeclAttribs, indent); }
| 621 |
public void toXDFOutputStream (OutputStream outputstream, String indent) { // prepare XMLDeclaration Hashtable XMLDeclAttribs = new Hashtable(); XMLDeclAttribs.put("standalone", new String("no")); XMLDeclAttribs.put("version", (String) sXMLSpecVersion); toXDFOutputStream(outputstream, XMLDeclAttribs, indent); }
|
public void toXDFOutputStream (OutputStream outputstream, String indent) { // prepare XMLDeclaration Hashtable XMLDeclAttribs = new Hashtable(); XMLDeclAttribs.put("standalone", new String("no")); XMLDeclAttribs.put("version", (String) sXMLSpecVersion); toXDFOutputStream(outputstream, XMLDeclAttribs, indent); }
| 622 |
public DSSPrivateKey(BigInteger p, BigInteger q, BigInteger g, BigInteger x) { super(p, q, g); this.x = x; }
|
public DSSPrivateKey(BigInteger p, BigInteger q, BigInteger g, BigInteger x) { super(p, q, g); this.x = x; }
| 623 |
public byte[] getEncoded(int format) { byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new DSSKeyPairRawCodec().encodePrivateKey(this); break; default: throw new IllegalArgumentException("format"); } return result; }
|
public byte[] getEncoded(int format) { byte[] result; switch (format) { case IKeyPairCodec.RAW_FORMAT: result = new DSSKeyPairRawCodec().encodePrivateKey(this); break; default: throw new IllegalArgumentException("Unsupported encoding format: " + format); } return result; }
| 624 |
public static DSSPrivateKey valueOf(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_DSS_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } }
|
public static DSSPrivateKey valueOf(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_DSS_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } }
| 625 |
public static DSSPrivateKey valueOf(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_DSS_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } }
|
public static DSSPrivateKey valueOf(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_DSS_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPrivateKey) codec.decodePrivateKey(k); } catch (IllegalArgumentException ignored) { throw new IllegalArgumentException("magic"); } }
| 626 |
public static DSSPrivateKey valueOf(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_DSS_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPrivateKey) codec.decodePrivateKey(k); } else { throw new IllegalArgumentException("magic"); } }
|
public static DSSPrivateKey valueOf(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_DSS_PRIVATE_KEY[0]) { // it's likely to be in raw format. get a raw codec and hand it over IKeyPairCodec codec = new DSSKeyPairRawCodec(); return (DSSPrivateKey) codec.decodePrivateKey(k); } else { } }
| 627 |
public boolean equals(Object obj) { if (! (obj instanceof BigInteger)) return false; return equals(this, (BigInteger) obj); }
|
private static boolean equals(BigInteger x, BigInteger y) { if (! (obj instanceof BigInteger)) return false; return equals(this, (BigInteger) obj); }
| 629 |
public boolean equals(Object obj) { if (! (obj instanceof BigInteger)) return false; return equals(this, (BigInteger) obj); }
|
public boolean equals(Object obj) { if (x.words == null && y.words == null) return x.ival == y.ival; if (x.words == null || y.words == null || x.ival != y.ival) return false; return equals(this, (BigInteger) obj); }
| 630 |
public boolean equals(Object obj) { if (! (obj instanceof BigInteger)) return false; return equals(this, (BigInteger) obj); }
|
public boolean equals(Object obj) { if (! (obj instanceof BigInteger)) return false; for (int i = x.ival; --i >= 0; ) { if (x.words[i] != y.words[i]) return false; } return true; }
| 631 |
public static void error(String msg, Throwable ex) { log(ERROR, System.err, msg, ex); /*try { Thread.sleep(2500); } catch (InterruptedException ex2) { // Ignore }*/ }
|
public static void error(String msg, Throwable ex) { log(ERROR, System.err, msg, ex); /*try { Thread.sleep(2500); } catch (InterruptedException ex2) { // Ignore }*/ }
| 632 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * EPSILON; if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
| 633 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 -= small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
| 634 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 -= small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
| 635 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, EPSILON, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
| 636 |
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, 0.0, 0.0, distance)) nCrossings++; } return (nCrossings); }
|
private int getAxisIntersections(double x, double y, boolean useYaxis, double distance) { int nCrossings = 0; double a0; double a1; double a2; double b0; double b1; double b2; double[] r = new double[3]; int nRoots; a0 = a2 = 0.0; if (useYaxis) { a0 = getY1() - y; a1 = getCtrlY() - y; a2 = getY2() - y; b0 = getX1() - x; b1 = getCtrlX() - x; b2 = getX2() - x; } else { a0 = getX1() - x; a1 = getCtrlX() - x; a2 = getX2() - x; b0 = getY1() - y; b1 = getCtrlY() - y; b2 = getY2() - y; } /* If the axis intersects a start/endpoint, shift it up by some small amount to guarantee the line is 'inside' If this is not done,bad behaviour may result for points on that axis. */ if (a0 == 0.0 || a2 == 0.0) { double small = getFlatness() * (1E-10); if (a0 == 0.0) a0 += small; if (a2 == 0.0) a2 += small; } r[0] = a0; r[1] = 2 * (a1 - a0); r[2] = (a2 - 2 * a1 + a0); nRoots = solveQuadratic(r); for (int i = 0; i < nRoots; i++) { double t = r[i]; if (t >= 0.0 && t <= 1.0) { double crossing = t * t * (b2 - 2 * b1 + b0) + 2 * t * (b1 - b0) + b0; /* single root is always doubly degenerate in quads */ if (crossing > 0 && crossing < distance) nCrossings += (nRoots == 1) ? 2 : 1; } } if (useYaxis) { if (Line2D.linesIntersect(b0, a0, b2, a2, 0.0, 0.0, distance, 0.0)) nCrossings++; } else { if (Line2D.linesIntersect(a0, b0, a2, b2, 0.0, EPSILON, 0.0, distance)) nCrossings++; } return (nCrossings); }
| 637 |
public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); if (beta < 0.0 || beta > 1.0) return false; double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3); return alpha >= 0.0 && alpha <= 1.0; }
|
public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); if (beta < 0.0 || beta > 1.0) return false; double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3); return alpha >= 0.0 && alpha <= 1.0; }
| 638 |
public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); if (beta < 0.0 || beta > 1.0) return false; double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3); return alpha >= 0.0 && alpha <= 1.0; }
|
public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { double beta = (((y1 - y3) * (x4 - x3) + (x1 - x3) * (y4 - y3)) / ((y2 - y1) * (x4 - x3) + (x2 - x1) * (y4 - y3))); if (beta < 0.0 || beta > 1.0) return false; double alpha = (x1 + beta * (x2 - x1) - x3) / (x4 - x3); return alpha >= 0.0 && alpha <= 1.0; }
| 639 |
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num) { if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPts = f; } while (--num >= 0) { float x = srcPts[srcOff++]; float y = srcPts[srcOff++]; dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12); } }
|
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num) { if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPts = f; } while (--num >= 0) { float x = srcPts[srcOff++]; float y = srcPts[srcOff++]; dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12); } }
| 640 |
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num) { if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPts = f; } while (--num >= 0) { float x = srcPts[srcOff++]; float y = srcPts[srcOff++]; dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12); } }
|
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int num) { if (srcPts == dstPts && dstOff > srcOff && num > 1 && srcOff + 2 * num > dstOff) { float[] f = new float[2 * num]; System.arraycopy(srcPts, srcOff, f, 0, 2 * num); srcPts = f; } while (--num >= 0) { float x = srcPts[srcOff++]; float y = srcPts[srcOff++]; dstPts[dstOff++] = (float) (m00 * x + m01 * y + m02); dstPts[dstOff++] = (float) (m10 * x + m11 * y + m12); } }
| 641 |
public static double abs(double d) { return (d <= 0) ? 0 - d : d; }
|
public static double abs(double d) { return (d <= 0) ? 0 - d : d; }
| 642 |
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions, ClassLoader classloader, Principal[] principals) { this(codesource, permissions, classloader, principals, false); }
|
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions, ClassLoader classloader, Principal[] principals) { this(codesource, permissions, classloader, principals, false); }
| 643 |
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions, ClassLoader classloader, Principal[] principals) { this(codesource, permissions, classloader, principals, false); }
|
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions, ClassLoader classloader, Principal[] principals) { this(codesource, permissions, null, null, true); }
| 644 |
public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer("ProtectionDomain (").append(linesep); if (code_source == null) sb.append("CodeSource:null"); else sb.append(code_source); sb.append(linesep); if (classloader == null) sb.append("ClassLoader:null"); else sb.append(classloader); sb.append(linesep); sb.append("Principals:"); if (principals != null && principals.length > 0) { sb.append("["); Principal pal; for (int i = 0; i < principals.length; i++) { pal = principals[i]; sb.append("'").append(pal.getName()) .append("' of type ").append(pal.getClass().getName()); if (i < principals.length-1) sb.append(", "); } sb.append("]"); } else sb.append("none"); sb.append(linesep); if (!staticBinding) // include all but dont force loading Policy.currentPolicy if (Policy.isLoaded()) sb.append(Policy.getCurrentPolicy().getPermissions(this)); else // fallback on this one's permissions sb.append(perms); else sb.append(perms); return sb.append(linesep).append(")").append(linesep).toString(); }
|
public String toString() { String linesep = SystemProperties.getProperty("line.separator"); StringBuffer sb = new StringBuffer("ProtectionDomain (").append(linesep); if (code_source == null) sb.append("CodeSource:null"); else sb.append(code_source); sb.append(linesep); if (classloader == null) sb.append("ClassLoader:null"); else sb.append(classloader); sb.append(linesep); sb.append("Principals:"); if (principals != null && principals.length > 0) { sb.append("["); Principal pal; for (int i = 0; i < principals.length; i++) { pal = principals[i]; sb.append("'").append(pal.getName()) .append("' of type ").append(pal.getClass().getName()); if (i < principals.length-1) sb.append(", "); } sb.append("]"); } else sb.append("none"); sb.append(linesep); if (!staticBinding) // include all but dont force loading Policy.currentPolicy if (Policy.isLoaded()) sb.append(Policy.getCurrentPolicy().getPermissions(this)); else // fallback on this one's permissions sb.append(perms); else sb.append(perms); return sb.append(linesep).append(")").append(linesep).toString(); }
| 645 |
public static IdAssignmentPolicyValue from_int(int code) { try { return enume [ code ]; } catch (ArrayIndexOutOfBoundsException ex) { throw new BAD_OPERATION("Invalid enumeration code " + code); } }
|
public static IdAssignmentPolicyValue from_int(int code) { try { return enume [ code ]; } catch (ArrayIndexOutOfBoundsException ex) { BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); bad.minor = Minor.PolicyType; throw bad; } }
| 646 |
public void canceled(WizardEvent e) {// System.out.println("It is canceled!"); if (workingThread != null) workingThread.interrupt(); this.hide(); this.dispose(); }
|
public void canceled(WizardEvent e) {// System.out.println("It is canceled!"); if (workingThread != null) { workingThread.interrupt(); this.hide(); this.dispose(); }
| 647 |
public JFileChooser(String currentDirectoryPath) { setup(null); setCurrentDirectory(fsv.createFileObject(currentDirectoryPath)); }
|
public JFileChooser() { setup(null); setCurrentDirectory(fsv.createFileObject(currentDirectoryPath)); }
| 649 |
public JFileChooser(String currentDirectoryPath) { setup(null); setCurrentDirectory(fsv.createFileObject(currentDirectoryPath)); }
|
public JFileChooser(String currentDirectoryPath) { setup(null); setCurrentDirectory(null); }
| 650 |
public Process exec(String[] cmd) throws IOException { return exec(cmd, null, null); }
|
public Process exec(String cmdline) throws IOException { return exec(cmd, null, null); }
| 651 |
public Process exec(String[] cmd) throws IOException { return exec(cmd, null, null); }
|
public Process exec(String[] cmd) throws IOException { return exec(cmd, null, null); }
| 652 |
setIconImage(Image icon){ this.icon = icon; if (peer != null) ((FramePeer) peer).setIconImage(icon);}
|
setIconImage(Image icon){ this.icon = icon; if (peer != null) ((FramePeer) peer).setIconImage(icon);}
| 653 |
public WizardPage(int button_flags) { // set layout as a vertical column setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));// setLayout(new BorderLayout()); Box pageBox = Box.createVerticalBox(); contentPane = new JPanel(); // add the pages contentpane to our wizard page add(contentPane); // lets add some glue here but it still does not stop the separator from // moving up and down. add(Box.createGlue()); // create the separator between the panels JSeparator js = new JSeparator(); js.setAlignmentY(Component.BOTTOM_ALIGNMENT); add(js); add(Box.createRigidArea(new Dimension(10,10))); // create the box for the buttons with an x-axis buttonPanel = new JPanel(); buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.X_AXIS)); buttonPanel.setName("buttonPanel"); buttonPanel.add(Box.createHorizontalGlue()); add(buttonPanel); if (button_flags == 0) { // no buttons to add :-( return; } if ((button_flags & PREVIOUS) != 0) { previousAction = new AbstractAction(LangTool.getString("wiz.previous")) { public void actionPerformed(ActionEvent e) { } }; previousButton = new JButton(previousAction); buttonPanel.add(Box.createRigidArea(new Dimension(GROUP_SPACING,0))); buttonPanel.add(previousButton); } if ((button_flags & NEXT) != 0) { nextAction = new AbstractAction(LangTool.getString("wiz.next")) { public void actionPerformed(ActionEvent e) { } }; nextButton = new JButton(nextAction); buttonPanel.add(Box.createRigidArea(new Dimension(BUTTON_SPACING,0))); buttonPanel.add(nextButton); } if ((button_flags & FINISH) != 0) { finishAction = new AbstractAction(LangTool.getString("wiz.finish")) { public void actionPerformed(ActionEvent e) { } }; finishButton = new JButton(finishAction); buttonPanel.add(Box.createRigidArea(new Dimension(BUTTON_SPACING,0))); buttonPanel.add(finishButton); } if ((button_flags & CANCEL) != 0) { cancelAction = new AbstractAction(LangTool.getString("wiz.cancel")) { public void actionPerformed(ActionEvent e) { } }; cancelButton = new JButton(cancelAction); buttonPanel.add(Box.createRigidArea(new Dimension(GROUP_SPACING,0))); buttonPanel.add(cancelButton); buttonPanel.add(Box.createRigidArea(new Dimension(MARGIN,0))); } if ((button_flags & HELP) != 0) { helpAction = new AbstractAction(LangTool.getString("wiz.help")) { public void actionPerformed(ActionEvent e) { } }; helpButton = new JButton(helpAction); } }
|
public WizardPage(int button_flags) { // set layout as a vertical column setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));// setLayout(new BorderLayout()); Box pageBox = Box.createVerticalBox(); contentPane = new JPanel(); // add the pages contentpane to our wizard page add(contentPane); // lets add some glue here but it still does not stop the separator from // moving up and down. add(Box.createGlue()); // create the separator between the panels JSeparator js = new JSeparator(); js.setAlignmentY(Component.BOTTOM_ALIGNMENT); add(js); add(Box.createRigidArea(new Dimension(10,10))); // create the box for the buttons with an x-axis buttonPanel = new JPanel(); buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.X_AXIS)); buttonPanel.setName("buttonPanel"); buttonPanel.add(Box.createHorizontalGlue()); add(buttonPanel); if (button_flags == 0) { // no buttons to add :-( return; } if ((button_flags & PREVIOUS) != 0) { previousAction = new AbstractAction(LangTool.getString("wiz.previous")) { public void actionPerformed(ActionEvent e) { } }; previousButton = new JButton(previousAction); buttonPanel.add(Box.createRigidArea(new Dimension(GROUP_SPACING,0))); buttonPanel.add(previousButton); } if ((button_flags & NEXT) != 0) { nextAction = new AbstractAction(LangTool.getString("wiz.next")) { public void actionPerformed(ActionEvent e) { } }; nextButton = new JButton(nextAction); buttonPanel.add(Box.createRigidArea(new Dimension(BUTTON_SPACING,0))); buttonPanel.add(nextButton); } if ((button_flags & FINISH) != 0) { finishAction = new AbstractAction(LangTool.getString("wiz.finish")) { public void actionPerformed(ActionEvent e) { } }; finishButton = new JButton(finishAction); buttonPanel.add(Box.createRigidArea(new Dimension(BUTTON_SPACING,0))); buttonPanel.add(finishButton); } if ((button_flags & CANCEL) != 0) { cancelAction = new AbstractAction(LangTool.getString("wiz.cancel")) { public void actionPerformed(ActionEvent e) { } }; cancelButton = new JButton(cancelAction); buttonPanel.add(Box.createRigidArea(new Dimension(GROUP_SPACING,0))); buttonPanel.add(cancelButton); buttonPanel.add(Box.createRigidArea(new Dimension(MARGIN,0))); } if ((button_flags & HELP) != 0) { helpAction = new AbstractAction(LangTool.getString("wiz.help")) { public void actionPerformed(ActionEvent e) { } }; helpButton = new JButton(helpAction); } }
| 654 |
setTitle(String title){ this.title = title; if (peer != null) ((FramePeer) peer).setTitle(title);}
|
setTitle(String title){ this.title = title; if (peer != null) ((FramePeer) peer).setTitle(title);}
| 655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.