rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public abstract void setShort(int memPtr, short value, int count);
public abstract void setShort(int memPtr, short value);
public abstract void setShort(int memPtr, short value, int count);
public IllegalStateException(String s)
public IllegalStateException()
public IllegalStateException(String s) { super(s); }
super(s);
public IllegalStateException(String s) { super(s); }
public IncompatibleClassChangeError(String s) { super(s);
public IncompatibleClassChangeError() {
public IncompatibleClassChangeError(String s) { super(s); }
public final VmMethod getMethod(String name, String signature) { return getMethod(name, signature, false, true, VmMember.calcHashCode( name, signature));
final VmMethod getMethod(String name, String signature, boolean onlyThisClass, boolean searchInterfaces, int hashCode) { final VmMethod[] mt = this.methodTable; if (mt != null) { final int count = mt.length; for (int i = 0; i < count; i++) { final VmMethod mts = mt[i]; int mtsHashCode = mts.getMemberHashCode(); if (mtsHashCode == hashCode) { if (mts.nameEquals(name) && mts.signatureEquals(signature)) { return mts; } } else if (mtsHashCode > hashCode) { break; } } } if (isAbstract()) { final VmMethod method = getSyntheticAbstractMethod(name, signature, hashCode); if (method != null) { return method; } } if ((superClass != null) && (!onlyThisClass)) { final VmMethod method = superClass.getMethod(name, signature, false, false, hashCode); if (method != null) { return method; } } if (isInterface() || searchInterfaces) { final VmInterfaceClass[] ait = allInterfaceTable; if (ait != null) { final int count = ait.length; for (int i = 0; i < count; i++) { final VmInterfaceClass intf = ait[i]; final VmMethod method = intf.getMethod(name, signature, true, false, hashCode); if (method != null) { return method; } } } } return null;
public final VmMethod getMethod(String name, String signature) { return getMethod(name, signature, false, true, VmMember.calcHashCode( name, signature)); }
public NoSuchMethodError(String s) { super(s);
public NoSuchMethodError() {
public NoSuchMethodError(String s) { super(s); }
public AbstractMethodError(String s) { super(s);
public AbstractMethodError() {
public AbstractMethodError(String s) { super(s); }
public NotResolvedYetException(String s) { super(s);
public NotResolvedYetException() { super();
public NotResolvedYetException(String s) { super(s); }
Item pop(int type) {
Item pop() {
Item pop(int type) { // if (tos == 0) { // // the item requested in not on the virtual stack // // but already on the operand stack (it was pushed // // outside the current basic block) // // thus create a new stack item // Item it = createStack(type); // if (checkOperandStack) { // // insert at the begin of stack // // even if the vstack is empty, there // // may still be items popped from vstack // // that are not popped from operand stack // prependToOperandStack(it); // } // return it; // // pushStack(type); // } tos--; Item i = stack[tos]; stack[tos] = null; if (i.getType() != type) throw new VerifyError("Expected:" + Integer.toString(type) + " Actual:" + Integer.toString(i.getType())); return i; }
if (i.getType() != type) throw new VerifyError("Expected:" + Integer.toString(type) + " Actual:" + Integer.toString(i.getType()));
Item pop(int type) { // if (tos == 0) { // // the item requested in not on the virtual stack // // but already on the operand stack (it was pushed // // outside the current basic block) // // thus create a new stack item // Item it = createStack(type); // if (checkOperandStack) { // // insert at the begin of stack // // even if the vstack is empty, there // // may still be items popped from vstack // // that are not popped from operand stack // prependToOperandStack(it); // } // return it; // // pushStack(type); // } tos--; Item i = stack[tos]; stack[tos] = null; if (i.getType() != type) throw new VerifyError("Expected:" + Integer.toString(type) + " Actual:" + Integer.toString(i.getType())); return i; }
public boolean request(Register register) { return request(register, null);
public Register request(int type, Object owner) { return request(type, owner, false);
public boolean request(Register register) { return request(register, null); }
public StackException(String s) { super(s);
public StackException() { super();
public StackException(String s) { super(s); }
os86.setObjectRef(new Label("$$jmp-introCode"));
protected void initImageHeader(NativeStream os, Label clInitCaller, Vm vm, PluginRegistry pluginRegistry) throws BuildException { try { int startLength = os.getLength(); VmType vmCodeClass = loadClass(VmMethodCode.class); final X86Stream.ObjectInfo initObject = os.startObject(vmCodeClass); final int offset = os.getLength() - startLength; if (offset != JUMP_MAIN_OFFSET) { throw new BuildException("JUMP_MAIN_OFFSET is incorrect [" + offset + "] (set to Object headersize)"); } final X86Stream os86 = (X86Stream) os; final Label introCode = new Label("$$introCode"); os86.writeJMP(introCode); initObject.markEnd(); // The loading of class can emit object in between, so first load // all required classes here. loadClass(Main.class); loadClass(MathSupport.class); loadClass(MonitorManager.class); loadClass(SoftByteCodes.class); loadClass(Vm.class); loadClass(VmMethod.class); loadClass(VmProcessor.class); loadClass(VmThread.class); loadClass(VmType.class); loadClass(VmSystem.class); loadClass(VmSystemObject.class); final X86Stream.ObjectInfo initCodeObject = os.startObject(vmCodeClass); os86.setObjectRef(introCode); initMain(os86, pluginRegistry); initVm(os86, vm); //initHeapManager(os86, vm); initVmThread(os86); os.setObjectRef(new Label("$$Initial call to clInitCaller")); os86.writeCALL(clInitCaller); initCallMain(os86); initCodeObject.markEnd(); } catch (ClassNotFoundException ex) { throw new BuildException(ex); } }
VmType mainClass = loadClass(Main.class); VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME);
final VmType mainClass = loadClass(Main.class); final VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME);
protected void initMain(X86Stream os, PluginRegistry registry) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Main")); VmType mainClass = loadClass(Main.class); VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME); // Setup STATICS register (EDI) os.writeMOV_Const(Register.EDI, statics.getTable()); /* Set Main.pluginRegistry */ os.writeMOV_Const(Register.EBX, registry); final int rfOffset = (VmArray.DATA_OFFSET + registryField.getStaticsIndex()) << 2; os.writeMOV(INTSIZE, Register.EDI, rfOffset, Register.EBX); }
System.out.println("rfOffset " + NumberUtils.hex(rfOffset));
protected void initMain(X86Stream os, PluginRegistry registry) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Main")); VmType mainClass = loadClass(Main.class); VmStaticField registryField = (VmStaticField) mainClass.getField(Main.REGISTRY_FIELD_NAME); // Setup STATICS register (EDI) os.writeMOV_Const(Register.EDI, statics.getTable()); /* Set Main.pluginRegistry */ os.writeMOV_Const(Register.EBX, registry); final int rfOffset = (VmArray.DATA_OFFSET + registryField.getStaticsIndex()) << 2; os.writeMOV(INTSIZE, Register.EDI, rfOffset, Register.EBX); }
System.out.println("vmOffset " + NumberUtils.hex(vmOffset));
protected void initVm(X86Stream os, Vm vm) throws BuildException, ClassNotFoundException { os.setObjectRef(new Label("$$Initialize Vm")); VmType vmClass = loadClass(Vm.class); VmStaticField vmField = (VmStaticField) vmClass.getField("instance"); // Setup STATICS register (EDI) os.writeMOV_Const(Register.EDI, statics.getTable()); /* Set Vm.instance */ os.writeMOV_Const(Register.EBX, vm); final int vmOffset = (VmArray.DATA_OFFSET + vmField.getStaticsIndex()) << 2; os.writeMOV(INTSIZE, Register.EDI, vmOffset, Register.EBX); }
public final VmField getField(String name) { return getField(name, null);
public final VmField getField(String name, String signature) { VmField f = getDeclaredField(name, signature); if (f != null) { return f; } if (superClass != null) { f = superClass.getField(name, signature); if (f != null) { return f; } } final int cnt = getNoInterfaces(); for (int i = 0; i < cnt; i++) { f = allInterfaceTable[i].getField(name, signature); if (f != null) { return f; } } return null;
public final VmField getField(String name) { return getField(name, null); }
public ServerSocket() throws IOException
ServerSocket(SocketImpl impl) throws IOException
public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); impl.create(true); }
if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl();
if (impl == null) throw new NullPointerException("impl may not be null");
public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); impl.create(true); }
impl.create(true);
this.impl = impl; this.impl.create(true);
public ServerSocket() throws IOException { if (factory != null) impl = factory.createSocketImpl(); else impl = new PlainSocketImpl(); impl.create(true); }
n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();
public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException { X86CpuID cpuId = X86CpuID.createID("p5"); TextX86Stream os = new TextX86Stream(new OutputStreamWriter(System.out), cpuId); X86CodeGenerator x86cg = new X86CodeGenerator(os); VmByteCode code = loadByteCode(args); IRControlFlowGraph cfg = new IRControlFlowGraph(code); IRGenerator irg = new IRGenerator(cfg); BytecodeParser.parse(code, irg); BootableArrayList quads = irg.getQuadList(); int n = quads.size(); BootableHashMap liveVariables = new BootableHashMap(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); quad.doPass2(liveVariables); } Collection lv = liveVariables.values(); n = lv.size(); LiveRange[] liveRanges = new LiveRange[n]; Iterator it = lv.iterator(); for (int i=0; i<n; i+=1) { Variable v = (Variable) it.next(); liveRanges[i] = new LiveRange(v); } Arrays.sort(liveRanges); LinearScanAllocator lsa = new LinearScanAllocator(liveRanges); lsa.allocate(); x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs()); x86cg.setSpilledVariables(lsa.getSpilledVariables()); x86cg.emitHeader(); n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();/* BytecodeViewer bv = new BytecodeViewer(); BytecodeParser.parse(code, bv); // System.out.println(cfg.toString()); // System.out.println(); boolean printDeadCode = false; boolean printDetail = false; IRBasicBlock currentBlock = null; for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (currentBlock != quad.getBasicBlock()) { currentBlock = quad.getBasicBlock(); System.out.println(); System.out.println(currentBlock); } if (printDeadCode && quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } if (!quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } } System.out.println(); System.out.println("Live ranges:"); n = lv.size(); for (int i=0; i<n; i+=1) { System.out.println(liveRanges[i]); }*/ }
n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();
public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException { X86CpuID cpuId = X86CpuID.createID("p5"); TextX86Stream os = new TextX86Stream(new OutputStreamWriter(System.out), cpuId); X86CodeGenerator x86cg = new X86CodeGenerator(os); VmByteCode code = loadByteCode(args); IRControlFlowGraph cfg = new IRControlFlowGraph(code); IRGenerator irg = new IRGenerator(cfg); BytecodeParser.parse(code, irg); BootableArrayList quads = irg.getQuadList(); int n = quads.size(); BootableHashMap liveVariables = new BootableHashMap(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); quad.doPass2(liveVariables); } Collection lv = liveVariables.values(); n = lv.size(); LiveRange[] liveRanges = new LiveRange[n]; Iterator it = lv.iterator(); for (int i=0; i<n; i+=1) { Variable v = (Variable) it.next(); liveRanges[i] = new LiveRange(v); } Arrays.sort(liveRanges); LinearScanAllocator lsa = new LinearScanAllocator(liveRanges); lsa.allocate(); x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs()); x86cg.setSpilledVariables(lsa.getSpilledVariables()); x86cg.emitHeader(); n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();/* BytecodeViewer bv = new BytecodeViewer(); BytecodeParser.parse(code, bv); // System.out.println(cfg.toString()); // System.out.println(); boolean printDeadCode = false; boolean printDetail = false; IRBasicBlock currentBlock = null; for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (currentBlock != quad.getBasicBlock()) { currentBlock = quad.getBasicBlock(); System.out.println(); System.out.println(currentBlock); } if (printDeadCode && quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } if (!quad.isDeadCode()) { if (printDetail) { printQuadDetail(quad); } System.out.println(quad); } } System.out.println(); System.out.println("Live ranges:"); n = lv.size(); for (int i=0; i<n; i+=1) { System.out.println(liveRanges[i]); }*/ }
return -10;
int l0 = a1; return -l0;
public static int simple(int a0, int a1) { return -10; }
session.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
public PrinterThread (ScreenChar[] sc, Font font, int cols, int rows, Color colorBg, boolean toDefaultPrinter, Session ses) { setPriority(1); session = ses; screen = new ScreenChar[sc.length]; toDefault = toDefaultPrinter; int len = sc.length; for (int x = 0; x < len; x++) { screen[x] = new ScreenChar(sc[x].s); screen[x].setCharAndAttr(sc[x].getChar(),sc[x].getCharAttr(),sc[x].isAttributePlace()); } numCols = cols; numRows = rows; this.colorBg = colorBg; this.font = font; }
session.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
public void run () {// Toolkit tk = Toolkit.getDefaultToolkit();//int [][] range = new int[][] {//new int[] { 1, 1 }//};// JobAttributes jobAttributes = new JobAttributes(1, JobAttributes.DefaultSelectionType.ALL, JobAttributes.DestinationType.PRINTER, JobAttributes.DialogType.NONE, "file", 1, 1, JobAttributes.MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES, range, "HP LaserJet", JobAttributes.SidesType.ONE_SIDED);//PrintJob job = tk.getPrintJob(null, "Print", jobAttributes, null);//if (job != null) { //--- Create a printerJob object PrinterJob printJob = PrinterJob.getPrinterJob (); printJob.setJobName("tn5250j"); //--- Set the printable class to this one since we //--- are implementing the Printable interface printJob.setPrintable (this); //--- Show a print dialog to the user. If the user //--- clicks the print button, then print, otherwise //--- cancel the print job if (printJob.printDialog()) { try { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); printJob.print(); } catch (Exception PrintException) { PrintException.printStackTrace(); } } else { // we do this because of loosing focus with jdk 1.4.0 session.requestFocus(); } session = null; int len = screen.length; for (int x = 0; x < len; x++) { screen[x] = null; } screen = null; }
public Font deriveFont (float size) { return peer.deriveFont (this, size); }
public Font deriveFont(int style, float size) { return peer.deriveFont(this, style, size); }
public Font deriveFont (float size){ return peer.deriveFont (this, size);}
public LineMetrics getLineMetrics(String str, FontRenderContext frc)
public LineMetrics getLineMetrics(String text, int begin, int limit, FontRenderContext rc)
public LineMetrics getLineMetrics(String str, FontRenderContext frc) { return getLineMetrics (str, 0, str.length () - 1, frc); }
return getLineMetrics (str, 0, str.length () - 1, frc); }
return peer.getLineMetrics(this, new StringCharacterIterator(text), begin, limit, rc); }
public LineMetrics getLineMetrics(String str, FontRenderContext frc) { return getLineMetrics (str, 0, str.length () - 1, frc); }
throws NotImplementedException
public void stateChanged(ChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? }
firePropertyChange(AccessibleContext.ACCESSIBLE_VISIBLE_DATA_PROPERTY, Boolean.FALSE, Boolean.TRUE); ButtonModel model = getModel(); if (model.isArmed()) { if (! armed) { armed = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.ARMED, null); } } else { if (armed) { armed = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.ARMED); } } if (model.isPressed()) { if (! pressed) { pressed = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.PRESSED, null); } } else { if (pressed) { pressed = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.PRESSED); } } if (model.isSelected()) { if (! selected) { selected = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.SELECTED, null); } } else { if (selected) { selected = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.SELECTED); } } if (isFocusOwner()) { if (! focusOwner) { focusOwner = true; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, AccessibleState.FOCUSED, null); } } else { if (focusOwner) { focusOwner = false; firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, null, AccessibleState.FOCUSED); } }
public void stateChanged(ChangeEvent event) throws NotImplementedException { // TODO: What should be done here, if anything? }
accessibleContext = new AccessibleJMenuItem();
{ AccessibleJMenuItem ctx = new AccessibleJMenuItem(); addChangeListener(ctx); accessibleContext = ctx; }
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJMenuItem(); return accessibleContext; }
public void setMnemonic(int mne)
public void setMnemonic(char mne)
public void setMnemonic(int mne) { int old = getModel().getMnemonic(); if (old != mne) { getModel().setMnemonic(mne); if (text != null && ! text.equals("")) { // Since lower case char = upper case char for // mnemonic, we will convert both text and mnemonic // to upper case before checking if mnemonic character occurs // in the menu item text. int upperCaseMne = Character.toUpperCase((char) mne); String upperCaseText = text.toUpperCase(); setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); revalidate(); repaint(); } }
int old = getModel().getMnemonic(); if (old != mne) { getModel().setMnemonic(mne); if (text != null && ! text.equals("")) { int upperCaseMne = Character.toUpperCase((char) mne); String upperCaseText = text.toUpperCase(); setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); revalidate(); repaint(); }
setMnemonic((int) mne);
public void setMnemonic(int mne) { int old = getModel().getMnemonic(); if (old != mne) { getModel().setMnemonic(mne); if (text != null && ! text.equals("")) { // Since lower case char = upper case char for // mnemonic, we will convert both text and mnemonic // to upper case before checking if mnemonic character occurs // in the menu item text. int upperCaseMne = Character.toUpperCase((char) mne); String upperCaseText = text.toUpperCase(); setDisplayedMnemonicIndex(upperCaseText.indexOf(upperCaseMne)); } firePropertyChange(MNEMONIC_CHANGED_PROPERTY, old, mne); revalidate(); repaint(); } }
public String getHref()
public Href getHref()
public String getHref() { return (String) ((XMLAttribute) attribHash.get("href")).getAttribValue(); }
return (String) ((XMLAttribute) attribHash.get("href")).getAttribValue();
return (Href) ((XMLAttribute) attribHash.get("href")).getAttribValue();
public String getHref() { return (String) ((XMLAttribute) attribHash.get("href")).getAttribValue(); }
attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE));
attribHash.put("href", new XMLAttribute(null, Constants.OBJECT_TYPE));
private void init() { classXDFNodeName = "data"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"compression"); attribOrder.add(0, "encoding"); attribOrder.add(0,"checksum"); attribOrder.add(0,"href"); //set up the attribute hashtable key with the default initial value attribHash.put("compression", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("encoding", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("checksum", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("href", new XMLAttribute(null, Constants.STRING_TYPE)); };
public void setHref (String strHref)
public void setHref (Href hrefObj)
public void setHref (String strHref) { ((XMLAttribute) attribHash.get("href")).setAttribValue(strHref); }
((XMLAttribute) attribHash.get("href")).setAttribValue(strHref);
((XMLAttribute) attribHash.get("href")).setAttribValue(hrefObj);
public void setHref (String strHref) { ((XMLAttribute) attribHash.get("href")).setAttribValue(strHref); }
String nodeName = getClassXDFNodeName();
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href);
Href hrefObj = getHref(); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream = outputstream; if (hrefObj !=null) { String fileName = hrefObj.getSysId(); String hrefName = hrefObj.getName(); if(hrefName == null) { Log.errorln("Error: href object in dataCube lacks name. Data being written into metadata instead.\n"); } else if (fileName != null) { writeHrefAttribute = true; try { dataOutputStream = new FileOutputStream(hrefObj.getSysId()); } catch (IOException e) { Log.warnln("Error: cannot open file:"+fileName+" for writing. Data being written into metadata.\n"); writeHrefAttribute = false; } } else { Log.warnln("Error: href:"+hrefName+" lacks systemId, cannot write data to a separate file."); Log.warnln("Data are being written into metadata instead.\n"); writeHrefAttribute = false; } } else { } if (writeHrefAttribute) { writeOut(outputstream, " href=\""); writeOutAttribute(outputstream, hrefObj.getName());
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, ">"); XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { dataOutputStream = outputstream; } } else { dataOutputStream = outputstream; }
if (writeHrefAttribute) writeOut(outputstream, "/>"); else writeOut(outputstream, ">");
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
fastestAxis, NoDataValues );
fastestAxis, NoDataValues, writeHrefAttribute ? false : true );
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues );
writeFormattedData( dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues, writeHrefAttribute ? false : true );
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
if (niceOutput) {
if (!writeHrefAttribute && niceOutput) {
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, "</" + nodeName + ">");
if (!writeHrefAttribute) writeOut(outputstream, "</" + nodeName + ">");
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) { writeOut(outputstream, " href = \""); writeOutAttribute(outputstream, href); writeOut(outputstream, "\""); } String checksum = getChecksum(); if (checksum != null) { writeOut(outputstream, " checksum = \""); writeOutAttribute(outputstream, checksum.toString()); writeOut(outputstream, "\""); } writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
AxisInterface fastestAxis, String[] noDataValues) {
AxisInterface fastestAxis, String[] noDataValues, boolean writeCDATAStatement ) {
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, "]]>"); }
writeOut(outputstream, "<![CDATA[");
if(writeCDATAStatement) writeOut(outputstream, "<![CDATA[");
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, "]]>"); }
writeOut(outputstream, "]]>");
if (writeCDATAStatement) 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()); writeOut(outputstream, "]]>"); }
String[] noDataValues )
String[] noDataValues, boolean writeCDATAStatement )
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, "]]>"); }
writeOut(outputstream, "<![CDATA[");
if (writeCDATAStatement) writeOut(outputstream, "<![CDATA[");
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, "]]>"); }
writeOut(outputstream, "]]>");
if (writeCDATAStatement) 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 writeOut(outputstream, "]]>"); }
public DecimalFormat (String pattern)
public DecimalFormat ()
public DecimalFormat (String pattern) { this (pattern, new DecimalFormatSymbols ()); }
this (pattern, new DecimalFormatSymbols ());
this ("#,##0.###");
public DecimalFormat (String pattern) { this (pattern, new DecimalFormatSymbols ()); }
if (msg == null) { return ; }
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"); } }
public int getAxisLocation (Axis axisObj) {
public int getAxisLocation (AxisInterface axisObj) {
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 OptionArgument(String name, String description, Option o1) { this(name, description, new Option[] { o1}, SINGLE);
public OptionArgument(String name, String description, Option[] options, boolean multi) { super(name, description, multi); this.options = options;
public OptionArgument(String name, String description, Option o1) { this(name, description, new Option[] { o1}, SINGLE); }
public DeviceArgument(String name, String description) { super(name, description);
public DeviceArgument(String name, String description, boolean multi) { super(name, description, multi);
public DeviceArgument(String name, String description) { super(name, description); }
public IntegerArgument(String name, String description) { super(name, description);
public IntegerArgument(String name, String description, boolean multi) { super(name, description, multi);
public IntegerArgument(String name, String description) { super(name, description); }
public Parameter(Argument argument, boolean optional) { this(ANONYMOUS, NO_DESCRIPTION, argument, optional);
public Parameter(String name, String description, Argument argument, boolean optional) { super(name, description); this.argument = argument; this.optional = optional;
public Parameter(Argument argument, boolean optional) { this(ANONYMOUS, NO_DESCRIPTION, argument, optional); }
public Syntax(String description, Parameter p1) { this(description, new Parameter[] { p1});
public Syntax(String description, Parameter[] params) { this.description = description; this.params = params;
public Syntax(String description, Parameter p1) { this(description, new Parameter[] { p1}); }
setCursorOff();
setCursorActive(false);
protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); }
setCursorOn();
setCursorActive(true);
protected void crossHair() { setCursorOff(); crossHair++; if (crossHair > 3) crossHair = 0; setCursorOn(); }
return Integer.parseInt((String)appProps.get(prop));
if (appProps.containsKey(prop)) { try { int i = Integer.parseInt((String)appProps.get(prop)); return i; } catch (NumberFormatException ne) { return 0; } } else return 0;
protected final int getIntProperty(String prop) { return Integer.parseInt((String)appProps.get(prop)); }
setCursorOff();
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(); }
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(); } setCursorOn(); }
setCursorOff();
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(); }
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(); setCursorOn(); }
if (appProps.containsKey("cursorBottOffset")) { cursorBottOffset = getIntProperty("cursorBottOffset"); }
public void loadProps(Properties props) { appProps = props; loadColors(); if (appProps.containsKey("colSeparator")) { if (getStringProperty("colSeparator").equals("Line")) colSepLine = 0; if (getStringProperty("colSeparator").equals("ShortLine")) colSepLine = 1; if (getStringProperty("colSeparator").equals("Dot")) colSepLine = 2; } if (appProps.containsKey("showAttr")) { if (getStringProperty("showAttr").equals("Hex")) showHex = true; } if (appProps.containsKey("guiInterface")) { if (getStringProperty("guiInterface").equals("Yes")) guiInterface = true; else guiInterface = false; } if (appProps.containsKey("guiShowUnderline")) { if (getStringProperty("guiShowUnderline").equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (appProps.containsKey("hotspots")) { if (getStringProperty("hotspots").equals("Yes")) hotSpots = true; else hotSpots = false; } if (appProps.containsKey("hsMore")) { if (getStringProperty("hsMore").length() > 0) { hsMore.setLength(0); hsMore.append(getStringProperty("hsMore")); } } if (appProps.containsKey("hsBottom")) { if (getStringProperty("hsBottom").length() > 0) { hsBottom.setLength(0); hsBottom.append(getStringProperty("hsBottom")); } } if (appProps.containsKey("colSeparator")) { if (getStringProperty("colSeparator").equals("Line")) colSepLine = 0; if (getStringProperty("colSeparator").equals("ShortLine")) colSepLine = 1; if (getStringProperty("colSeparator").equals("Dot")) colSepLine = 2; } if (appProps.containsKey("cursorSize")) { if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; if (getStringProperty("cursorSize").equals("Line")) cursorSize = 0; } if (appProps.containsKey("crossHair")) { if (getStringProperty("crossHair").equals("None")) crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; } if (appProps.containsKey("fontScaleHeight")) { sfh = getFloatProperty("fontScaleHeight"); } if (appProps.containsKey("fontScaleWidth")) { sfw = getFloatProperty("fontScaleWidth"); } if (appProps.containsKey("fontPointSize")) { ps132 = getFloatProperty("fontPointSize"); } }
setCursorOff();
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(); }
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); } setCursorOn(); }
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(); gui.revalidate(); }
if (!cursorActive) setCursorOn();
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; } } } } }
while (strokenizer.hasMoreKeyStrokes() && !keyboardLocked && !isStatusErrorCode() && !done) {
setCursorActive(false); while (!done) { if (strokenizer.hasMoreKeyStrokes()) {
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; } } } } }
setCursorOn();
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; } } } } }
else { done = true; } } setCursorActive(true);
public void sendKeys(String text) {// if (text == null) {// return;// } if (isStatusErrorCode() && !resetRequired) { resetError(); if (!cursorActive) setCursorOn(); } if (keyboardLocked) { if(text.equals("[reset]") || text.equals("[sysreq]") || text.equals("[attn]")) { simulateMnemonic(getMnemonicValue(text)); } else { if (isStatusErrorCode()) { Toolkit.getDefaultToolkit().beep(); return; } keysBuffered = true; setKBIndicatorOn(); if(bufferedKeys == null){ bufferedKeys = text; return; } else { bufferedKeys += text; return; } } } else { if (keysBuffered) { if (bufferedKeys != null) { text = bufferedKeys + text; } 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; } } } } }
setCursorOn();
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(); }
setCursorActive(true);
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(); }
updateCursorLoc(); updateCursorLoc = false;
updateCursorLoc();
public void setCursorOff() { updateCursorLoc(); updateCursorLoc = false; }
updateCursorLoc = true; if (!keysBuffered) updateCursorLoc();
updateCursorLoc();
public void setCursorOn() { updateCursorLoc = true;// System.out.println("cursor on"); if (!keysBuffered) updateCursorLoc(); }
setCursorOff();
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; }
setCursorOn();
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; }
setCursorOff();
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; }
setCursorOn();
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; }
if (updateCursorLoc) { cursorActive = cursorActive ? false:true;
if (cursorActive) {
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; } }
font);
font,cursorBottOffset);
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; } }
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; } }
resized = true;
public BufferedImage getImageBuffer(int width, int height) { synchronized (lock) { if (bi == null || bi.getWidth() != width || bi.getHeight() != height) { // allocate a buffer Image with appropriate size bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; } // tell waiting threads to wake up lock.notifyAll(); } return bi; }
protected void getBoundingArea(Rectangle r) {
protected Rectangle getBoundingArea() {
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; }
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); }
Rectangle r = new Rectangle(); getBoundingArea(r); 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; }
public int getKeyPos(int pos) {
public int getKeyPos(int row1, int col1) {
public int getKeyPos(int pos) { int y = pos - startPos(); cursorPos = pos; return y; }
int y = pos - startPos(); cursorPos = pos;
int x = ((row1 * s.getCols()) + col1); int y = x - startPos(); cursorPos = x;
public int getKeyPos(int pos) { int y = pos - startPos(); cursorPos = pos; return y; }
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) { return isInField(pos,true);
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 synchronized void drawImageBuffer(Graphics2D gg2d) {
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) {
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(); } }
gg2d.drawImage(bi,null,0,0);
gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x + offLeft,y+ offTop);
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(); } }
resized = true;
public void resize(int width, int height) { if (bi.getWidth() != width || bi.getHeight() != height) { synchronized (lock) { bi = null; bi = new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB); this.width = width; this.height = height; // tell waiting threads to wake up lock.notifyAll(); } } }
log.debug("set "+ keyStrokes);
public void setKeyStrokes (String strokes) { if (strokes != null) { keyStrokes.setLength(0);// System.out.println("set "+ keyStrokes); length = strokes.length(); } else { keyStrokes = new StringBuffer(); length = 0; } keyStrokes.append(strokes); index = 0; }
System.out.println(" mnemonic key was incomplete :1 " +
log.warn(" mnemonic key was incomplete :1 " +
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; }
System.out.println(
log.warn(
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; }
log.debug("next "+ keyStrokes);
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 synchronized StringBuffer insert(int offset, char ch)
public synchronized StringBuffer insert(int offset, char[] str, int str_offset, int len)
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; }