bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
| 8,261
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
| 8,262
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
| 8,263
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = val.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
| 8,264
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
|
public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); }
| 8,265
|
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSAR_CL(valr); } vstack.push(val); // Release cnt.release(eContext); }
|
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSAR_CL(valr); } vstack.push(val); // Release cnt.release(eContext); }
| 8,266
|
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSAR_CL(valr); } vstack.push(val); // Release cnt.release(eContext); }
|
public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSAR_CL(valr); } vstack.push(val); // Release cnt.release(eContext); }
| 8,267
|
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSHR_CL(valr); } // Push vstack.push(val); // Release cnt.release(eContext); }
|
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSHR_CL(valr); } // Push vstack.push(val); // Release cnt.release(eContext); }
| 8,268
|
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSHR_CL(valr); } // Push vstack.push(val); // Release cnt.release(eContext); }
|
public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSHR_CL(valr); } // Push vstack.push(val); // Release cnt.release(eContext); }
| 8,269
|
public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); }
|
public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); }
| 8,272
|
public void run() { status.setText(stat); }
|
public void run() { status.setText(stat); }
| 8,273
|
private static void incorrect_plug_in(Throwable ex) throws NO_IMPLEMENT { NO_IMPLEMENT no = new NO_IMPLEMENT("Incorrect CORBA plug-in"); no.initCause(ex); throw no; }
|
static void incorrect_plug_in(Throwable ex) throws NO_IMPLEMENT { NO_IMPLEMENT no = new NO_IMPLEMENT("Incorrect CORBA plug-in"); no.initCause(ex); throw no; }
| 8,277
|
public static Serializable read(InputStream input) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { // We may need to jump back if the value is read via value factory. input.mark(512); int value_tag = input.read_long(); checkTag(value_tag); String codebase = null; String[] ids = null; String id = null; // The existing implementing object. java.lang.Object ox = null; // Check for the agreed null value. if (value_tag == vt_NULL) return null; else if (value_tag == vt_INDIRECTION) // TODO FIXME Implement support for indirections. throw new NO_IMPLEMENT("Indirections unsupported"); else { // Read the value. if ((value_tag & vf_CODEBASE) != 0) { // The codebase is present. The codebase is a space // separated list of URLs from where the implementing // code can be downloaded. codebase = input.read_string(); } if ((value_tag & vf_MULTIPLE_IDS) != 0) { // Multiple supported repository ids are present. ids = StringSeqHelper.read(input); for (int i = 0; (i < ids.length) && (ox == null); i++) { ox = ObjectCreator.Idl2Object(ids [ i ]); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(ids [ i ]); if (f != null) { // Reset, as the value factory reads from beginning. input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } else if ((value_tag & vf_ID) != 0) { // Single supported repository id is present. id = input.read_string(); ox = ObjectCreator.Idl2Object(id); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(id); if (f != null) { input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } if (ox == null) throw new MARSHAL("Unable to instantiate the value type"); else { read_instance(input, ox, value_tag); return (Serializable) ox; } } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
|
public static Serializable read(InputStream input) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { // We may need to jump back if the value is read via value factory. input.mark(512); int value_tag = input.read_long(); checkTag(value_tag); String codebase = null; String[] ids = null; String id = null; // The existing implementing object. java.lang.Object ox = null; // Check for the agreed null value. if (value_tag == vt_NULL) return null; else if (value_tag == vt_INDIRECTION) // TODO FIXME Implement support for indirections. throw new NO_IMPLEMENT("Indirections unsupported"); else { // Read the value. if ((value_tag & vf_CODEBASE) != 0) { // The codebase is present. The codebase is a space // separated list of URLs from where the implementing // code can be downloaded. codebase = input.read_string(); } if ((value_tag & vf_MULTIPLE_IDS) != 0) { // Multiple supported repository ids are present. ids = StringSeqHelper.read(input); for (int i = 0; (i < ids.length) && (ox == null); i++) { ox = ObjectCreator.Idl2Object(ids [ i ]); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(ids [ i ]); if (f != null) { // Reset, as the value factory reads from beginning. input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } else if ((value_tag & vf_ID) != 0) { // Single supported repository id is present. id = input.read_string(); ox = ObjectCreator.Idl2Object(id); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(id); if (f != null) { input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } if (ox == null) throw new MARSHAL("Unable to instantiate the value type"); else { read_instance(input, ox, value_tag, null); return (Serializable) ox; } } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } }
| 8,278
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
| 8,279
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size < 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
| 8,280
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new noHeaderInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
| 8,281
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
|
public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new noHeaderInput(r); } } else { if (input instanceof cdrBufInput) { input = new noHeaderInput(((cdrBufInput) input).buffer.getBuffer()); } else { cdrBufOutput bout = new cdrBufOutput(); int c; while ((c = input.read()) >= 0) bout.write((byte) c); input = new noHeaderInput(bout.buffer.toByteArray()); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } }
| 8,282
|
private static void write_instance(OutputStream output, Serializable value, String id ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); }
|
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); }
| 8,284
|
private static void write_instance(OutputStream output, Serializable value, String id ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); }
|
private static void write_instance(OutputStream output, Serializable value, String id ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue" + " or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); }
| 8,285
|
protected String basicXMLWriter ( Writer outputWriter, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + Specification.getInstance().getPrettyXDFOutputIndentation(); if (niceOutput) outputWriter.write( myIndent); //open the read block outputWriter.write( "<"+READ_NODE_NAME); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getEndian()) !=null) { outputWriter.write( " "+ENDIAN_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getReadId()) !=null) { outputWriter.write( " "+ID_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getReadIdRef()) !=null) { outputWriter.write( " "+IDREF_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } } outputWriter.write( ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputWriter, moreIndent); //close the read block if (niceOutput) { // outputWriter.write( Constants.NEW_LINE); outputWriter.write( indent); } outputWriter.write( "</"+READ_NODE_NAME+">");// if (niceOutput) { outputWriter.write(Constants.NEW_LINE); } return READ_NODE_NAME; }
|
protected String basicXMLWriter ( Writer outputWriter, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + Specification.getInstance().getPrettyXDFOutputIndentation(); if (niceOutput) outputWriter.write( myIndent); //open the read block outputWriter.write( "<"+READ_NODE_NAME); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } attrib = (String) ((Attribute) attribHash.get(ENDIAN_XML_ATTRIBUTE_NAME)).getAttribValue(); if ( attrib != null) { outputWriter.write( " "+ENDIAN_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getReadId()) !=null) { outputWriter.write( " "+ID_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getReadIdRef()) !=null) { outputWriter.write( " "+IDREF_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } } outputWriter.write( ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputWriter, moreIndent); //close the read block if (niceOutput) { // outputWriter.write( Constants.NEW_LINE); outputWriter.write( indent); } outputWriter.write( "</"+READ_NODE_NAME+">");// if (niceOutput) { outputWriter.write(Constants.NEW_LINE); } return READ_NODE_NAME; }
| 8,287
|
public boolean add(Attribute attribute) { return addInternal(attribute, interfaceName); }
|
public boolean add(Attribute attribute) { return addInternal(attribute, myInterface); }
| 8,288
|
public boolean addAll(AttributeSet attributes) { return addAllInternal(attributes, interfaceName); }
|
public boolean addAll(AttributeSet attributes) { return addAllInternal(attributes, myInterface); }
| 8,289
|
private boolean addInternal(Attribute attribute, Class interfaceName) { if (attribute == null) throw new NullPointerException("attribute may not be null"); AttributeSetUtilities.verifyAttributeCategory(interfaceName, this.interfaceName); Object old = attributeMap.put (attribute.getCategory(), AttributeSetUtilities.verifyAttributeValue (attribute, interfaceName)); return !attribute.equals(old); }
|
private boolean addInternal(Attribute attribute, Class interfaceName) { if (attribute == null) throw new NullPointerException("attribute may not be null"); AttributeSetUtilities.verifyAttributeCategory(interfaceName, myInterface); Object old = attributeMap.put (attribute.getCategory(), AttributeSetUtilities.verifyAttributeValue (attribute, interfaceName)); return !attribute.equals(old); }
| 8,290
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
| 8,291
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
| 8,292
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
| 8,293
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
| 8,294
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
|
private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); }
| 8,295
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model sessions = new JSortTable(ctm); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,296
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,297
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,298
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,299
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,300
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,301
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,302
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,303
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } if (e.getValueIsAdjusting()) return; //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } if (e.getValueIsAdjusting()) return; //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,304
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,305
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,306
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,307
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,308
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,309
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.add(sessionPanel, BorderLayout.CENTER); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,310
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionOpts.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); sessionOpts.add(scrollPane, BorderLayout.CENTER); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,311
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,312
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); addOptButton(LangTool.getString("ss.optAdd"), "ADD", sessionOptPanel); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,313
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,314
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons editButton = addOptButton( LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,315
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
|
private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); }
| 8,316
|
void jbInit() throws Exception { // make it non resizable setResizable(true); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create sessions panel createSessionsPanel(); // create emulator options panel createEmulatorOptionsPanel(); // create the button options createButtonOptions(); JTabbedPane optionTabs = new JTabbedPane(); optionTabs.addChangeListener(this); optionTabs.addTab(LangTool.getString("ss.labelConnections"),sessionPanel); optionTabs.addTab(LangTool.getString("ss.labelOptions1"),emulOptPanel); // add the panels to our dialog getContentPane().add(optionTabs,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row or default session if (sessions.getRowCount() > 0) { int selInterval = 0; for (int x = 0; x < sessions.getRowCount(); x++) { if (((Boolean)ctm.getValueAt(x,2)).booleanValue()) selInterval = x; } sessions.getSelectionModel().setSelectionInterval(selInterval,selInterval); } // Oh man what a pain in the ass. Had to add a window listener to request // focus of the sessions list. addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { sessions.requestFocus(); } }); } }); // now show the world what we and they can do this.setVisible(true); }
|
void jbInit() throws Exception { // make it non resizable setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create sessions panel createSessionsPanel(); // create emulator options panel createEmulatorOptionsPanel(); // create the button options createButtonOptions(); JTabbedPane optionTabs = new JTabbedPane(); optionTabs.addChangeListener(this); optionTabs.addTab(LangTool.getString("ss.labelConnections"),sessionPanel); optionTabs.addTab(LangTool.getString("ss.labelOptions1"),emulOptPanel); // add the panels to our dialog getContentPane().add(optionTabs,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row or default session if (sessions.getRowCount() > 0) { int selInterval = 0; for (int x = 0; x < sessions.getRowCount(); x++) { if (((Boolean)ctm.getValueAt(x,2)).booleanValue()) selInterval = x; } sessions.getSelectionModel().setSelectionInterval(selInterval,selInterval); } // Oh man what a pain in the ass. Had to add a window listener to request // focus of the sessions list. addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { sessions.requestFocus(); } }); } }); // now show the world what we and they can do this.setVisible(true); }
| 8,317
|
public void stateChanged(ChangeEvent e) { JTabbedPane p = (JTabbedPane)e.getSource(); int index = p.getSelectedIndex(); if (!p.getTitleAt(index).equals(LangTool.getString("ss.labelConnections"))) connectButton.setEnabled(false); else connectButton.setEnabled(true); }
|
public void stateChanged(ChangeEvent e) { JTabbedPane p = (JTabbedPane)e.getSource(); int index = p.getSelectedIndex(); if (!p.getTitleAt(index).equals(LangTool.getString("ss.labelConnections"))) connectButton.setEnabled(false); else connectButton.setEnabled(true); }
| 8,318
|
public abstract void startSystemPlugins() throws PluginException;
|
public abstract void startSystemPlugins(List descriptors) throws PluginException;
| 8,319
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalTreeUI(); return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTreeUI instance; if (o == null) { instance = new MetalTreeUI(); return instance; }
| 8,320
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
| 8,322
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
| 8,323
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
| 8,324
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
|
public void paintComponent(Graphics g) { super.paintComponent(g); if (iconOnly) { Rectangle bounds = getBounds(); int x = (bounds.width - comboIcon.getIconWidth()) / 2; int y = (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, x, y); } else { String text = ""; Object selected = comboBox.getModel().getSelectedItem(); if (selected != null) text = selected.toString(); Rectangle bounds = comboBox.getBounds(); Rectangle innerArea = SwingUtilities.calculateInnerArea(this, null); if (comboBox.hasFocus()) { g.setColor(MetalLookAndFeel.getFocusColor()); g.drawRect(innerArea.x, innerArea.y - 1, innerArea.width - 1, innerArea.height); } Insets insets = comboBox.getInsets(); int iconX = bounds.width - insets.right - comboIcon.getIconWidth() - 7; int iconY = insets.top + (bounds.height - comboIcon.getIconHeight()) / 2; comboIcon.paintIcon(comboBox, g, iconX, iconY); if (comboBox.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); Rectangle viewArea = new Rectangle(innerArea.x, innerArea.y, innerArea.width - comboIcon.getIconWidth() - 7, innerArea.height); FontMetrics fm = g.getFontMetrics(comboBox.getFont()); Rectangle textR = new Rectangle(); text = SwingUtilities.layoutCompoundLabel(fm, text, null, SwingConstants.CENTER, SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT, viewArea, new Rectangle(), textR, 0); // FIXME: this truncation should be done within layoutCompoundLabel() text = truncateText(text, innerArea.width - comboIcon.getIconWidth() - 7, fm); int yAdj = fm.getDescent() + fm.getLeading(); g.setFont(comboBox.getFont()); g.drawString(text, textR.x, textR.y + textR.height - yAdj); } }
| 8,325
|
void advanceMultipleSelection (ListSelectionModel firstModel, int firstMin, int firstMax, ListSelectionModel secondModel, int secondMin, int secondMax, boolean reverse, boolean eventIsTab) { // If eventIsTab, all the "firsts" correspond to columns, otherwise, to rows // "seconds" correspond to the opposite int firstLead = firstModel.getLeadSelectionIndex(); int secondLead = secondModel.getLeadSelectionIndex(); int numFirsts = eventIsTab ? table.getModel().getColumnCount() : table.getModel().getRowCount(); int numSeconds = eventIsTab ? table.getModel().getRowCount() : table.getModel().getColumnCount(); // check if we have to wrap the "firsts" around, going to the other side if ((firstLead == firstMax && !reverse) || (reverse && firstLead == firstMin)) { firstModel.addSelectionInterval(reverse ? firstMax : firstMin, reverse ? firstMax : firstMin); // check if we have to wrap the "seconds" if ((secondLead == secondMax && !reverse) || (reverse && secondLead == secondMin)) secondModel.addSelectionInterval(reverse ? secondMax : secondMin, reverse ? secondMax : secondMin); // if we're not wrapping the seconds, we have to find out where we // are within the secondModel and advance to the next cell (or // go back to the previous cell if reverse == true) else { int[] secondsSelected; if (eventIsTab && table.getRowSelectionAllowed() || !eventIsTab && table.getColumnSelectionAllowed()) secondsSelected = eventIsTab ? table.getSelectedRows() : table.getSelectedColumns(); else { // if row selection is not allowed, then the entire column gets // selected when you click on it, so consider ALL rows selected secondsSelected = new int[numSeconds]; for (int i = 0; i < numSeconds; i++) secondsSelected[i] = i; } // and now find the "next" index within the model int secondIndex = reverse ? secondsSelected.length - 1 : 0; if (!reverse) while (secondsSelected[secondIndex] <= secondLead) secondIndex++; else while (secondsSelected[secondIndex] >= secondLead) secondIndex--; // and select it - updating the lead selection index secondModel.addSelectionInterval(secondsSelected[secondIndex], secondsSelected[secondIndex]); } } // We didn't have to wrap the firsts, so just find the "next" first // and select it, we don't have to change "seconds" else { int[] firstsSelected; if (eventIsTab && table.getColumnSelectionAllowed() || !eventIsTab && table.getRowSelectionAllowed()) firstsSelected = eventIsTab ? table.getSelectedColumns() : table.getSelectedRows(); else { // if selection not allowed, consider ALL firsts to be selected firstsSelected = new int[numFirsts]; for (int i = 0; i < numFirsts; i++) firstsSelected[i] = i; } int firstIndex = reverse ? firstsSelected.length - 1 : 0; if (!reverse) while (firstsSelected[firstIndex] <= firstLead) firstIndex++; else while (firstsSelected[firstIndex] >= firstLead) firstIndex--; firstModel.addSelectionInterval(firstsSelected[firstIndex], firstsSelected[firstIndex]); secondModel.addSelectionInterval(secondLead, secondLead); } }
|
void advanceMultipleSelection (ListSelectionModel firstModel, int firstMin, int firstMax, ListSelectionModel secondModel, int secondMin, int secondMax, boolean reverse, boolean eventIsTab) { // If eventIsTab, all the "firsts" correspond to columns, otherwise, to rows // "seconds" correspond to the opposite int firstLead = firstModel.getLeadSelectionIndex(); int secondLead = secondModel.getLeadSelectionIndex(); int numFirsts = eventIsTab ? table.getModel().getColumnCount() : table.getModel().getRowCount(); int numSeconds = eventIsTab ? table.getModel().getRowCount() : table.getModel().getColumnCount(); // check if we have to wrap the "firsts" around, going to the other side if ((firstLead == firstMax && !reverse) || (reverse && firstLead == firstMin)) { firstModel.addSelectionInterval(reverse ? firstMax : firstMin, reverse ? firstMax : firstMin); // check if we have to wrap the "seconds" if ((secondLead == secondMax && !reverse) || (reverse && secondLead == secondMin)) secondModel.addSelectionInterval(reverse ? secondMax : secondMin, reverse ? secondMax : secondMin); // if we're not wrapping the seconds, we have to find out where we // are within the secondModel and advance to the next cell (or // go back to the previous cell if reverse == true) else { int[] secondsSelected; if (eventIsTab && table.getRowSelectionAllowed() || !eventIsTab && table.getColumnSelectionAllowed()) secondsSelected = eventIsTab ? table.getSelectedRows() : table.getSelectedColumns(); else { // if row selection is not allowed, then the entire column gets // selected when you click on it, so consider ALL rows selected secondsSelected = new int[numSeconds]; for (int i = 0; i < numSeconds; i++) secondsSelected[i] = i; // and now find the "next" index within the model int secondIndex = reverse ? secondsSelected.length - 1 : 0; if (!reverse) while (secondsSelected[secondIndex] <= secondLead) secondIndex++; else while (secondsSelected[secondIndex] >= secondLead) secondIndex--; // and select it - updating the lead selection index secondModel.addSelectionInterval(secondsSelected[secondIndex], secondsSelected[secondIndex]); // We didn't have to wrap the firsts, so just find the "next" first // and select it, we don't have to change "seconds" else { int[] firstsSelected; if (eventIsTab && table.getColumnSelectionAllowed() || !eventIsTab && table.getRowSelectionAllowed()) firstsSelected = eventIsTab ? table.getSelectedColumns() : table.getSelectedRows(); else { // if selection not allowed, consider ALL firsts to be selected firstsSelected = new int[numFirsts]; for (int i = 0; i < numFirsts; i++) firstsSelected[i] = i; int firstIndex = reverse ? firstsSelected.length - 1 : 0; if (!reverse) while (firstsSelected[firstIndex] <= firstLead) firstIndex++; else while (firstsSelected[firstIndex] >= firstLead) firstIndex--; firstModel.addSelectionInterval(firstsSelected[firstIndex], firstsSelected[firstIndex]); secondModel.addSelectionInterval(secondLead, secondLead);
| 8,327
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); if (comp instanceof JTextField) ((JTextField)comp).getCaret().paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); if (comp instanceof JTextField) ((JTextField)comp).getCaret().paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
| 8,328
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); if (comp instanceof JTextField) ((JTextField)comp).getCaret().paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); if (comp instanceof JTextField) ((JTextField)comp).getCaret().paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
| 8,329
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); if (comp instanceof JTextField) ((JTextField)comp).getCaret().paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
|
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); if (comp instanceof JTextField) ((JTextField)comp).getCaret().paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
| 8,330
|
Class generate(ClassLoader loader) { byte[] bytecode = new byte[pool.length() + stream.length()]; // More efficient to bypass calling charAt() repetitively. char[] c = pool.toString().toCharArray(); int i = c.length; while (--i >= 0) bytecode[i] = (byte) c[i]; c = stream.toString().toCharArray(); i = c.length; int j = bytecode.length; while (i > 0) bytecode[--j] = (byte) c[--i]; // Patch the constant pool size, which we left at 0 earlier. int count = poolEntries.size() + 1; bytecode[8] = (byte) (count >> 8); bytecode[9] = (byte) count; try { Class vmClassLoader = Class.forName("java.lang.VMClassLoader"); Class[] types = {ClassLoader.class, String.class, byte[].class, int.class, int.class, ProtectionDomain.class }; Method m = vmClassLoader.getDeclaredMethod("defineClass", types); // We can bypass the security check of setAccessible(true), since // we're in the same package. m.flag = true; Object[] args = {loader, qualName, bytecode, new Integer(0), new Integer(bytecode.length), Object.class.getProtectionDomain() }; Class clazz = (Class) m.invoke(null, args); // Finally, initialize the m field of the proxy class, before // returning it. Field f = clazz.getDeclaredField("m"); f.flag = true; // we can share the array, because it is not publicized f.set(null, methods); return clazz; } catch (Exception e) { // assert false; throw (Error) new InternalError("Unexpected: " + e).initCause(e); } }
|
Class generate(ClassLoader loader) { byte[] bytecode = new byte[pool.length() + stream.length()]; // More efficient to bypass calling charAt() repetitively. char[] c = pool.toString().toCharArray(); int i = c.length; while (--i >= 0) bytecode[i] = (byte) c[i]; c = stream.toString().toCharArray(); i = c.length; int j = bytecode.length; while (i > 0) bytecode[--j] = (byte) c[--i]; // Patch the constant pool size, which we left at 0 earlier. int count = poolEntries.size() + 1; bytecode[8] = (byte) (count >> 8); bytecode[9] = (byte) count; try { Class vmClassLoader = Class.forName("java.lang.VMClassLoader"); Class[] types = {ClassLoader.class, String.class, byte[].class, int.class, int.class, ProtectionDomain.class }; Method m = vmClassLoader.getDeclaredMethod("defineClass", types); // We can bypass the security check of setAccessible(true), since // we're in the same package. m.flag = true; Object[] args = {loader, qualName, bytecode, new Integer(0), new Integer(bytecode.length), protDomain }; Class clazz = (Class) m.invoke(null, args); // Finally, initialize the m field of the proxy class, before // returning it. Field f = clazz.getDeclaredField("m"); f.flag = true; // we can share the array, because it is not publicized f.set(null, methods); return clazz; } catch (Exception e) { // assert false; throw (Error) new InternalError("Unexpected: " + e).initCause(e); } }
| 8,331
|
public Throwable getException() { return getCause(); }
|
public Throwable getException() { return getCause(); }
| 8,332
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size = this.getPreferredSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else { popup = new HeavyWeightPopup(this); setLightWeightPopupEnabled(false); } } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); if (layeredPane.isShowing()) SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
|
public void setVisible(boolean visible) { if (visible == isVisible()) return; boolean old = isVisible(); this.visible = visible; if (old != isVisible()) { firePropertyChange("visible", old, isVisible()); if (visible) { firePopupMenuWillBecomeVisible(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker); Dimension screenSize = getToolkit().getScreenSize(); boolean fit = true; Dimension size = this.getSize(); if ((size.width > (rootContainer.getWidth() - popupLocation.x)) || (size.height > (rootContainer.getHeight() - popupLocation.y))) fit = false; if (lightWeightPopupEnabled && fit) popup = new LightWeightPopup(this); else { if (fit) popup = new MediumWeightPopup(this); else { popup = new HeavyWeightPopup(this); setLightWeightPopupEnabled(false); } } if (popup instanceof LightWeightPopup || popup instanceof MediumWeightPopup) { JLayeredPane layeredPane; layeredPane = SwingUtilities.getRootPane(invoker).getLayeredPane(); Point p = new Point(popupLocation.x, popupLocation.y); if (layeredPane.isShowing()) SwingUtilities.convertPointFromScreen(p, layeredPane); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(p.x, p.y, size.width, size.height); } else { // Subtract insets of the top-level container if popup menu's // top-left corner is inside it. Insets insets = rootContainer.getInsets(); if (size.width + popupLocation.x > screenSize.width) popupLocation.x -= size.width; if (size.height + popupLocation.y > screenSize.height) popupLocation.y -= size.height; popup.show(popupLocation.x - insets.left, popupLocation.y - insets.top, size.width, size.height); } } else { firePopupMenuWillBecomeInvisible(); popup.hide(); } } }
| 8,334
|
protected void loadImage(Image image) { try { tracker.addImage(image, id); id++; tracker.waitForID(id - 1); } catch (InterruptedException ex) { ; // ignore this for now } finally { loadStatus = tracker.statusID(id - 1, false); } }
|
protected void loadImage(Image image) { try { tracker.addImage(image, id) id++ tracker.waitForID(id - 1) } catch (InterruptedException ex) { // ignore this for now } finally { loadStatus = tracker.statusID(id - 1, false) } }
| 8,335
|
public void addCSSAttribute(MutableAttributeSet attr, CSS.Attribute key, String value) { attr.addAttribute(key, value); }
|
public void addCSSAttribute(MutableAttributeSet attr, CSS.Attribute key, String value) { Object val = CSS.getValue(key, value); attr.addAttribute(key, val); }
| 8,337
|
public void addRule(String rule) { CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { // Do nothing here. } }
|
public void addRule(String rule) { CssParser cp = new CssParser(); try { cp.parse(base, new StringReader(rule), false, false); } catch (IOException io) { // Do nothing here. } }
| 8,338
|
public Color getBackground(AttributeSet a) { return super.getBackground(a); }
|
public Color getBackground(AttributeSet a) { CSSColor c = (CSSColor) a.getAttribute(CSS.Attribute.BACKGROUND_COLOR); Color color = null; if (c != null) color = c.getValue(); return color; }
| 8,339
|
public Font getFont(AttributeSet a) { return super.getFont(a); }
|
public Font getFont(AttributeSet a) { FontSize size = (FontSize) a.getAttribute(CSS.Attribute.FONT_SIZE); int realSize = 12; if (size != null) realSize = size.getValue(); Object valign = a.getAttribute(CSS.Attribute.VERTICAL_ALIGN); if (valign != null) { String v = valign.toString(); if (v.contains("sup") || v.contains("sub")) realSize -= 2; } String family = "SansSerif"; int style = Font.PLAIN; FontWeight weight = (FontWeight) a.getAttribute(CSS.Attribute.FONT_WEIGHT); if (weight != null) style |= weight.getValue(); FontStyle fStyle = (FontStyle) a.getAttribute(CSS.Attribute.FONT_STYLE); if (fStyle != null) style |= fStyle.getValue(); return new Font(family, style, realSize); }
| 8,340
|
public Color getForeground(AttributeSet a) { return super.getForeground(a); }
|
public Color getForeground(AttributeSet a) { CSSColor c = (CSSColor) a.getAttribute(CSS.Attribute.COLOR); Color color = null; if (c != null) color = c.getValue(); return color; }
| 8,341
|
public Style getRule(HTML.Tag t, Element e) { // FIXME: Not implemented. return null; }
|
public Style getRule(HTML.Tag t, Element e) { // FIXME: Not implemented. ArrayList path = new ArrayList(); Element el; AttributeSet atts; for (el = e; el != null; el = el.getParentElement()) path.add(el); StringBuilder selector = new StringBuilder(); int count = path.size(); for (int i = count - 1; i > 0; i--) { el = (Element) path.get(i); atts = el.getAttributes(); Object name = atts.getAttribute(StyleConstants.NameAttribute); selector.append(name.toString()); if (atts.isDefined(HTML.Attribute.ID)) { selector.append('#'); selector.append(atts.getAttribute(HTML.Attribute.ID)); } else if (atts.isDefined(HTML.Attribute.CLASS)) { selector.append('.'); selector.append(atts.getAttribute(HTML.Attribute.CLASS)); } selector.append(' '); } selector.append(t.toString()); el = (Element) path.get(0); atts = el.getAttributes(); if (el.isLeaf()) { Object o = atts.getAttribute(t); if (o instanceof AttributeSet) atts = (AttributeSet) o; else atts = null; } if (atts != null) { if (atts.isDefined(HTML.Attribute.ID)) { selector.append('#'); selector.append(atts.getAttribute(HTML.Attribute.ID)); } else if (atts.isDefined(HTML.Attribute.CLASS)) { selector.append('.'); selector.append(atts.getAttribute(HTML.Attribute.CLASS)); } } return getResolvedStyle(selector.toString(), path, t); }
| 8,342
|
public AttributeSet getViewAttributes(View v) { // FIXME: Not implemented. return null; }
|
public AttributeSet getViewAttributes(View v) { // FIXME: Not implemented. return new ViewAttributeSet(v, this); }
| 8,343
|
public void loadRules(Reader in, URL ref) throws IOException { CssParser cp = new CssParser(); cp.parse(ref, in, false, false); }
|
public void loadRules(Reader in, URL ref) throws IOException { CssParser cp = new CssParser(); cp.parse(ref, in, false, false); }
| 8,344
|
public Color stringToColor(String color) { color = color.toLowerCase(); if (color.equals("black") || color.equals("#000000")) return Color.BLACK; else if (color.equals("aqua") || color.equals("#00FFFF")) return new Color(127, 255, 212); else if (color.equals("gray") || color.equals("#808080")) return Color.GRAY; else if (color.equals("navy") || color.equals("#000080")) return new Color(0, 0, 128); else if (color.equals("silver") || color.equals("#C0C0C0")) return Color.LIGHT_GRAY; else if (color.equals("green") || color.equals("#008000")) return Color.GREEN; else if (color.equals("olive") || color.equals("#808000")) return new Color(128, 128, 0); else if (color.equals("teal") || color.equals("#008080")) return new Color(0, 128, 128); else if (color.equals("blue") || color.equals("#0000FF")) return Color.BLUE; else if (color.equals("lime") || color.equals("#00FF00")) return new Color(0, 255, 0); else if (color.equals("purple") || color.equals("#800080")) return new Color(128, 0, 128); else if (color.equals("white") || color.equals("#FFFFFF")) return Color.WHITE; else if (color.equals("fuchsia") || color.equals("#FF00FF")) return Color.MAGENTA; else if (color.equals("maroon") || color.equals("#800000")) return new Color(128, 0, 0); else if (color.equals("Red") || color.equals("#FF0000")) return Color.RED; else if (color.equals("Yellow") || color.equals("#FFFF00")) return Color.YELLOW; return null; }
|
public Color stringToColor(String colorName) { color = color.toLowerCase(); if (color.equals("black") || color.equals("#000000")) return Color.BLACK; else if (color.equals("aqua") || color.equals("#00FFFF")) return new Color(127, 255, 212); else if (color.equals("gray") || color.equals("#808080")) return Color.GRAY; else if (color.equals("navy") || color.equals("#000080")) return new Color(0, 0, 128); else if (color.equals("silver") || color.equals("#C0C0C0")) return Color.LIGHT_GRAY; else if (color.equals("green") || color.equals("#008000")) return Color.GREEN; else if (color.equals("olive") || color.equals("#808000")) return new Color(128, 128, 0); else if (color.equals("teal") || color.equals("#008080")) return new Color(0, 128, 128); else if (color.equals("blue") || color.equals("#0000FF")) return Color.BLUE; else if (color.equals("lime") || color.equals("#00FF00")) return new Color(0, 255, 0); else if (color.equals("purple") || color.equals("#800080")) return new Color(128, 0, 128); else if (color.equals("white") || color.equals("#FFFFFF")) return Color.WHITE; else if (color.equals("fuchsia") || color.equals("#FF00FF")) return Color.MAGENTA; else if (color.equals("maroon") || color.equals("#800000")) return new Color(128, 0, 0); else if (color.equals("Red") || color.equals("#FF0000")) return Color.RED; else if (color.equals("Yellow") || color.equals("#FFFF00")) return Color.YELLOW; return null; }
| 8,345
|
public Color stringToColor(String color) { color = color.toLowerCase(); if (color.equals("black") || color.equals("#000000")) return Color.BLACK; else if (color.equals("aqua") || color.equals("#00FFFF")) return new Color(127, 255, 212); else if (color.equals("gray") || color.equals("#808080")) return Color.GRAY; else if (color.equals("navy") || color.equals("#000080")) return new Color(0, 0, 128); else if (color.equals("silver") || color.equals("#C0C0C0")) return Color.LIGHT_GRAY; else if (color.equals("green") || color.equals("#008000")) return Color.GREEN; else if (color.equals("olive") || color.equals("#808000")) return new Color(128, 128, 0); else if (color.equals("teal") || color.equals("#008080")) return new Color(0, 128, 128); else if (color.equals("blue") || color.equals("#0000FF")) return Color.BLUE; else if (color.equals("lime") || color.equals("#00FF00")) return new Color(0, 255, 0); else if (color.equals("purple") || color.equals("#800080")) return new Color(128, 0, 128); else if (color.equals("white") || color.equals("#FFFFFF")) return Color.WHITE; else if (color.equals("fuchsia") || color.equals("#FF00FF")) return Color.MAGENTA; else if (color.equals("maroon") || color.equals("#800000")) return new Color(128, 0, 0); else if (color.equals("Red") || color.equals("#FF0000")) return Color.RED; else if (color.equals("Yellow") || color.equals("#FFFF00")) return Color.YELLOW; return null; }
|
public Color stringToColor(String color) { color = color.toLowerCase(); if (color.equals("black") || color.equals("#000000")) return Color.BLACK; else if (color.equals("aqua") || color.equals("#00FFFF")) return new Color(127, 255, 212); else if (color.equals("gray") || color.equals("#808080")) return Color.GRAY; else if (color.equals("navy") || color.equals("#000080")) return new Color(0, 0, 128); else if (color.equals("silver") || color.equals("#C0C0C0")) return Color.LIGHT_GRAY; else if (color.equals("green") || color.equals("#008000")) return Color.GREEN; else if (color.equals("olive") || color.equals("#808000")) return new Color(128, 128, 0); else if (color.equals("teal") || color.equals("#008080")) return new Color(0, 128, 128); else if (color.equals("blue") || color.equals("#0000FF")) return Color.BLUE; else if (color.equals("lime") || color.equals("#00FF00")) return new Color(0, 255, 0); else if (color.equals("purple") || color.equals("#800080")) return new Color(128, 0, 128); else if (color.equals("white") || color.equals("#FFFFFF")) return Color.WHITE; else if (color.equals("fuchsia") || color.equals("#FF00FF")) return Color.MAGENTA; else if (color.equals("maroon") || color.equals("#800000")) return new Color(128, 0, 0); else if (color.equals("Red") || color.equals("#FF0000")) return Color.RED; else if (color.equals("Yellow") || color.equals("#FFFF00")) return Color.YELLOW; return null; }
| 8,346
|
public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet) { // FIXME: Not implemented. return null; }
|
public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet) { // FIXME: Not implemented. AttributeSet cssAttr = htmlAttrSet.copyAttributes(); MutableAttributeSet cssStyle = addStyle(null, null); cssStyle.addAttributes(cssAttr); return cssStyle; }
| 8,347
|
private void addMenuBar() { JMenuBar menubar = new JMenuBar(); JMenu jMenuFile = new JMenu("File"); jMenuFile.setMnemonic('F'); JMenuItem exit = new JMenuItem("Exit"); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { done(); } }); JMenuItem eval = new JMenuItem("Evaluate"); eval.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { evaluateText(); repaint(); } }); menubar.add(jMenuFile); jMenuFile.add(eval); jMenuFile.add(exit); setJMenuBar(menubar); }
|
private void addMenuBar() { JMenuBar menubar = new JMenuBar(); JMenu jMenuFile = new JMenu("File"); jMenuFile.setMnemonic('F'); JMenuItem exit = new JMenuItem("Exit"); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { done(); } }); JMenuItem eval = new JMenuItem("Evaluate"); eval.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { evaluateText(); repaint(); } }); menubar.add(jMenuFile); jMenuFile.add(eval); jMenuFile.add(exit); setJMenuBar(menubar); }
| 8,348
|
private void addMenuBar() { JMenuBar menubar = new JMenuBar(); JMenu jMenuFile = new JMenu("File"); jMenuFile.setMnemonic('F'); JMenuItem exit = new JMenuItem("Exit"); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { done(); } }); JMenuItem eval = new JMenuItem("Evaluate"); eval.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { evaluateText(); repaint(); } }); menubar.add(jMenuFile); jMenuFile.add(eval); jMenuFile.add(exit); setJMenuBar(menubar); }
|
private void addMenuBar() { JMenuBar menubar = new JMenuBar(); JMenu jMenuFile = new JMenu("File"); jMenuFile.setMnemonic('F'); JMenuItem exit = new JMenuItem("Exit"); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { done(); } }); JMenuItem eval = new JMenuItem("Evaluate"); eval.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { evaluateText(); repaint(); } }); menubar.add(jMenuFile); jMenuFile.add(eval); jMenuFile.add(exit); setJMenuBar(menubar); }
| 8,349
|
private void addMenuBar() { JMenuBar menubar = new JMenuBar(); JMenu jMenuFile = new JMenu("File"); jMenuFile.setMnemonic('F'); JMenuItem exit = new JMenuItem("Exit"); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { done(); } }); JMenuItem eval = new JMenuItem("Evaluate"); eval.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { evaluateText(); repaint(); } }); menubar.add(jMenuFile); jMenuFile.add(eval); jMenuFile.add(exit); setJMenuBar(menubar); }
|
private void addMenuBar() { JMenuBar menubar = new JMenuBar(); JMenu jMenuFile = new JMenu("File"); jMenuFile.setMnemonic('F'); JMenuItem exit = new JMenuItem("Exit"); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { done(); } }); JMenuItem eval = new JMenuItem("Evaluate"); eval.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae_) { evaluateText(); repaint(); } }); menubar.add(jMenuFile); jMenuFile.add(eval); jMenuFile.add(exit); setJMenuBar(menubar); }
| 8,350
|
public void actionPerformed(ActionEvent ae_) { done(); }
|
public void actionPerformed( ActionEvent ae_ ) { Thread t = new Thread( new Runnable() { public void run() { done(); } } ); done(); }
| 8,351
|
void done() { hide(); Toolkit.getDefaultToolkit().close(); Toolkit.getDefaultToolkit().waitTillFinished(); System.err.println("Finished Charva Shell"); }
|
void done() { hide(); Toolkit.getDefaultToolkit().close(); Toolkit.getDefaultToolkit().waitTillFinished(); System.err.println("Finished Charva Shell"); }
| 8,352
|
private void evaluateText() { String sourcecode = editor.getText(); System.out.println("Evaluating source string=" + sourcecode); topLabel.setText("Evaluating..."); repaint();// Interpreter interpreter = new Interpreter(); try { Object out = interpreter.eval(sourcecode); if (out != null) { bottomLabel.setText("Result=" + out); } else { bottomLabel.setText("Null Result."); } topLabel.setText("Press F12 to Evaluate."); repaint(); } catch (EvalError evalError) { evalError.printStackTrace(); //To change body of catch statement use Options | File Templates. } }
|
private void evaluateText() { String sourcecode = editor.getText(); System.out.println("Evaluating source string=" + sourcecode); topLabel.setText("Evaluating..."); repaint();// Interpreter interpreter = new Interpreter(); try { Object out = interpreter.eval(sourcecode); if (out != null) { bottomLabel.setText("Result=" + out); } else { bottomLabel.setText("Null Result."); } topLabel.setText("Press F12 to Evaluate."); repaint(); } catch (EvalError evalError) { evalError.printStackTrace(); //To change body of catch statement use Options | File Templates. } }
| 8,353
|
private void evaluateText() { String sourcecode = editor.getText(); System.out.println("Evaluating source string=" + sourcecode); topLabel.setText("Evaluating..."); repaint();// Interpreter interpreter = new Interpreter(); try { Object out = interpreter.eval(sourcecode); if (out != null) { bottomLabel.setText("Result=" + out); } else { bottomLabel.setText("Null Result."); } topLabel.setText("Press F12 to Evaluate."); repaint(); } catch (EvalError evalError) { evalError.printStackTrace(); //To change body of catch statement use Options | File Templates. } }
|
private void evaluateText() { String sourcecode = editor.getText(); System.out.println("Evaluating source string=" + sourcecode); topLabel.setText("Evaluating..."); repaint();// Interpreter interpreter = new Interpreter(); try { Object out = interpreter.eval(sourcecode); if (out != null) { bottomLabel.setText("Result=" + out); } else { bottomLabel.setText("Null Result."); } else { bottomLabel.setText( "Null Result." ); } topLabel.setText( "Press F12 to Evaluate." ); repaint(); } catch (EvalError evalError) { evalError.printStackTrace(); //To change body of catch statement use Options | File Templates. } }
| 8,354
|
public static void main(String[] args) { System.err.println("Starting Charva Shell"); CharvaShell testwin = new CharvaShell(); testwin.show(); Toolkit.getDefaultToolkit().waitTillFinished(); System.err.println("Finished Charva Shell"); }
|
public static void main(String[] args) { System.err.println("Starting Charva Shell"); CharvaShell testwin = new CharvaShell(); testwin.show(); Toolkit.getDefaultToolkit().waitTillFinished(); System.err.println("Finished Charva Shell"); }
| 8,355
|
private void pushURL(boolean isPE, String ename, ExternalIdentifiers ids, Reader reader, InputStream stream, String encoding, boolean doResolve) throws SAXException, IOException { boolean ignoreEncoding; String systemId; InputSource source; if (!isPE) { dataBufferFlush(); } scratch.setPublicId(ids.publicId); scratch.setSystemId(ids.systemId); // See if we should skip or substitute the entity. // If we're not skipping, resolving reports startEntity() // and updates the (handler's) stack of URIs. if (doResolve) { // assert (stream == null && reader == null && encoding == null) source = handler.resolveEntity(isPE, ename, scratch, ids.baseUri); if (source == null) { handler.warn("skipping entity: " + ename); handler.skippedEntity(ename); if (isPE) { skippedPE = true; } return; } // we might be using alternate IDs/encoding systemId = source.getSystemId(); // The following warning and setting systemId was deleted bcause // the application has the option of not setting systemId // provided that it has set the characte/byte stream. /* if (systemId == null) { handler.warn ("missing system ID, using " + ids.systemId); systemId = ids.systemId; } */ } else { // "[document]", or "[dtd]" via getExternalSubset() scratch.setCharacterStream(reader); scratch.setByteStream(stream); scratch.setEncoding(encoding); source = scratch; systemId = ids.systemId; if (handler.stringInterning) { handler.startExternalEntity(ename, systemId, "[document]" == ename); } else { handler.startExternalEntity(ename, systemId, "[document]".equals(ename)); } } // we may have been given I/O streams directly if (source.getCharacterStream() != null) { if (source.getByteStream() != null) error("InputSource has two streams!"); reader = source.getCharacterStream(); } else if (source.getByteStream() != null) { encoding = source.getEncoding(); if (encoding == null) { stream = source.getByteStream(); } else { try { reader = new InputStreamReader(source.getByteStream(), encoding); } catch (IOException e) { stream = source.getByteStream(); } } } else if (systemId == null) { error("InputSource has no URI!"); } scratch.setCharacterStream(null); scratch.setByteStream(null); scratch.setEncoding(null); // Push the existing status. pushInput(ename); // Create a new read buffer. // (Note the four-character margin) readBuffer = new char[READ_BUFFER_MAX + 4]; readBufferPos = 0; readBufferLength = 0; readBufferOverflow = -1; is = null; line = 1; column = 0; currentByteCount = 0; // If there's an explicit character stream, just // ignore encoding declarations. if (reader != null) { sourceType = INPUT_READER; this.reader = reader; tryEncodingDecl(true); return; } // Else we handle the conversion, and need to ensure // it's done right. sourceType = INPUT_STREAM; if (stream != null) { is = stream; } else { // We have to open our own stream to the URL. URL url = new URL(systemId); externalEntity = url.openConnection(); externalEntity.connect(); is = externalEntity.getInputStream(); } // If we get to here, there must be // an InputStream available. if (!is.markSupported()) { is = new BufferedInputStream(is); } // Get any external encoding label. if (encoding == null && externalEntity != null) { // External labels can be untrustworthy; filesystems in // particular often have the wrong default for content // that wasn't locally originated. Those we autodetect. if (!"file".equals(externalEntity.getURL().getProtocol())) { int temp; // application/xml;charset=something;otherAttr=... // ... with many variants on 'something' encoding = externalEntity.getContentType(); // MHK code (fix for Saxon 5.5.1/007): // protect against encoding==null if (encoding == null) { temp = -1; } else { temp = encoding.indexOf("charset"); } // RFC 2376 sez MIME text defaults to ASCII, but since the // JDK will create a MIME type out of thin air, we always // autodetect when there's no explicit charset attribute. if (temp < 0) { encoding = null; // autodetect } else { // only this one attribute if ((temp = encoding.indexOf(';')) > 0) { encoding = encoding.substring(0, temp); } if ((temp = encoding.indexOf('=', temp + 7)) > 0) { encoding = encoding.substring(temp + 1); // attributes can have comment fields (RFC 822) if ((temp = encoding.indexOf('(')) > 0) { encoding = encoding.substring(0, temp); } // ... and values may be quoted if ((temp = encoding.indexOf('"')) > 0) { encoding = encoding.substring(temp + 1, encoding.indexOf('"', temp + 2)); } encoding.trim(); } else { handler.warn("ignoring illegal MIME attribute: " + encoding); encoding = null; } } } } // if we got an external encoding label, use it ... if (encoding != null) { this.encoding = ENCODING_EXTERNAL; setupDecoding(encoding); ignoreEncoding = true; // ... else autodetect from first bytes. } else { detectEncoding(); ignoreEncoding = false; } // Read any XML or text declaration. // If we autodetected, it may tell us the "real" encoding. try { tryEncodingDecl(ignoreEncoding); } catch (UnsupportedEncodingException x) { encoding = x.getMessage(); // if we don't handle the declared encoding, // try letting a JVM InputStreamReader do it try { if (sourceType != INPUT_STREAM) { throw x; } is.reset(); readBufferPos = 0; readBufferLength = 0; readBufferOverflow = -1; line = 1; currentByteCount = column = 0; sourceType = INPUT_READER; this.reader = new InputStreamReader(is, encoding); is = null; tryEncodingDecl(true); } catch (IOException e) { error("unsupported text encoding", encoding, null); } } }
|
private void pushURL(boolean isPE, String ename, ExternalIdentifiers ids, Reader reader, InputStream stream, String encoding, boolean doResolve) throws SAXException, IOException { boolean ignoreEncoding; String systemId; InputSource source; if (!isPE) { dataBufferFlush(); } scratch.setPublicId(ids.publicId); scratch.setSystemId(ids.systemId); // See if we should skip or substitute the entity. // If we're not skipping, resolving reports startEntity() // and updates the (handler's) stack of URIs. if (doResolve) { // assert (stream == null && reader == null && encoding == null) source = handler.resolveEntity(isPE, ename, scratch, ids.baseUri); if (source == null) { handler.warn("skipping entity: " + ename); handler.skippedEntity(ename); if (isPE) { skippedPE = true; } return; } // we might be using alternate IDs/encoding systemId = source.getSystemId(); // The following warning and setting systemId was deleted bcause // the application has the option of not setting systemId // provided that it has set the characte/byte stream. /* if (systemId == null) { handler.warn ("missing system ID, using " + ids.systemId); systemId = ids.systemId; } */ } else { // "[document]", or "[dtd]" via getExternalSubset() scratch.setCharacterStream(reader); scratch.setByteStream(stream); scratch.setEncoding(encoding); source = scratch; systemId = ids.systemId; if (handler.stringInterning) { handler.startExternalEntity(ename, systemId, "[document]" == ename); } else { handler.startExternalEntity(ename, systemId, "[document]".equals(ename)); } } // we may have been given I/O streams directly if (source.getCharacterStream() != null) { if (source.getByteStream() != null) error("InputSource has two streams!"); reader = source.getCharacterStream(); } else if (source.getByteStream() != null) { encoding = source.getEncoding(); if (encoding == null) { stream = source.getByteStream(); } else { try { reader = new InputStreamReader(source.getByteStream(), encoding); } catch (IOException e) { stream = source.getByteStream(); } } } else if (systemId == null) { error("InputSource has no URI!"); } scratch.setCharacterStream(null); scratch.setByteStream(null); scratch.setEncoding(null); // Push the existing status. pushInput(ename); // Create a new read buffer. // (Note the four-character margin) readBuffer = new char[READ_BUFFER_MAX + 4]; readBufferPos = 0; readBufferLength = 0; readBufferOverflow = -1; is = null; line = 1; column = 0; currentByteCount = 0; // If there's an explicit character stream, just // ignore encoding declarations. if (reader != null) { sourceType = INPUT_READER; this.reader = reader; tryEncodingDecl(true); return; } // Else we handle the conversion, and need to ensure // it's done right. sourceType = INPUT_STREAM; if (stream != null) { is = stream; } else { // We have to open our own stream to the URL. URL url = new URL(systemId); externalEntity = url.openConnection(); externalEntity.connect(); is = externalEntity.getInputStream(); } // If we get to here, there must be // an InputStream available. if (!is.markSupported()) { is = new BufferedInputStream(is); } // Get any external encoding label. if (encoding == null && externalEntity != null) { // External labels can be untrustworthy; filesystems in // particular often have the wrong default for content // that wasn't locally originated. Those we autodetect. if (!"file".equals(externalEntity.getURL().getProtocol())) { int temp; // application/xml;charset=something;otherAttr=... // ... with many variants on 'something' encoding = externalEntity.getContentType(); // MHK code (fix for Saxon 5.5.1/007): // protect against encoding==null if (encoding == null) { temp = -1; } else { temp = encoding.indexOf("charset"); } // RFC 2376 sez MIME text defaults to ASCII, but since the // JDK will create a MIME type out of thin air, we always // autodetect when there's no explicit charset attribute. if (temp < 0) { encoding = null; // autodetect } else { // only this one attribute if ((temp = encoding.indexOf(';')) > 0) { encoding = encoding.substring(0, temp); } if ((temp = encoding.indexOf('=', temp + 7)) > 0) { encoding = encoding.substring(temp + 1); // attributes can have comment fields (RFC 822) if ((temp = encoding.indexOf('(')) > 0) { encoding = encoding.substring(0, temp); } // ... and values may be quoted if ((temp = encoding.indexOf('"')) > 0) { encoding = encoding.substring(temp + 1, encoding.indexOf('"', temp + 2)); } encoding = encoding.trim(); } else { handler.warn("ignoring illegal MIME attribute: " + encoding); encoding = null; } } } } // if we got an external encoding label, use it ... if (encoding != null) { this.encoding = ENCODING_EXTERNAL; setupDecoding(encoding); ignoreEncoding = true; // ... else autodetect from first bytes. } else { detectEncoding(); ignoreEncoding = false; } // Read any XML or text declaration. // If we autodetected, it may tell us the "real" encoding. try { tryEncodingDecl(ignoreEncoding); } catch (UnsupportedEncodingException x) { encoding = x.getMessage(); // if we don't handle the declared encoding, // try letting a JVM InputStreamReader do it try { if (sourceType != INPUT_STREAM) { throw x; } is.reset(); readBufferPos = 0; readBufferLength = 0; readBufferOverflow = -1; line = 1; currentByteCount = column = 0; sourceType = INPUT_READER; this.reader = new InputStreamReader(is, encoding); is = null; tryEncodingDecl(true); } catch (IOException e) { error("unsupported text encoding", encoding, null); } } }
| 8,356
|
public static void showRunScriptDialog(SessionGUI session) { JPanel rsp = new JPanel(); rsp.setLayout(new BorderLayout()); JLabel jl = new JLabel("Enter script to run"); final JTextField rst = new JTextField(); rsp.add(jl,BorderLayout.NORTH); rsp.add(rst,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = rsp; String[] options = {"Run","Cancel"}; final JOptionPane pane = new JOptionPane( message, // the dialog message array JOptionPane.QUESTION_MESSAGE, // message type JOptionPane.DEFAULT_OPTION, // option type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0]); // option that should be made into a default button // create a dialog wrapping the pane final JDialog dialog = pane.createDialog(session, // parent frame "Run Script" // dialog title ); // add the listener that will set the focus to // the desired option dialog.addWindowListener( new WindowAdapter() { public void windowOpened( WindowEvent e) { super.windowOpened( e ); // now we're setting the focus to the desired component // it's not the best solution as it depends on internals // of the OptionPane class, but you can use it temporarily // until the bug gets fixed // also you might want to iterate here thru the set of // the buttons and pick one to call requestFocus() for it rst.requestFocus(); } }); dialog.show(); // now we can process the value selected String value = (String)pane.getValue(); if (value.equals(options[0])) { // send option along with system request if (rst.getText().length() > 0) { invoke(rst.getText(),session); } } }
|
public static void showRunScriptDialog(SessionGUI session) { JPanel rsp = new JPanel(); rsp.setLayout(new BorderLayout()); JLabel jl = new JLabel("Enter script to run"); final JTextField rst = new JTextField(); rsp.add(jl,BorderLayout.NORTH); rsp.add(rst,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = rsp; String[] options = {"Run","Cancel"}; final JOptionPane pane = new JOptionPane( message, // the dialog message array JOptionPane.QUESTION_MESSAGE, // message type JOptionPane.DEFAULT_OPTION, // option type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0]); // option that should be made into a default button // create a dialog wrapping the pane final JDialog dialog = pane.createDialog(session, // parent frame "Run Script" // dialog title ); // add the listener that will set the focus to // the desired option dialog.addWindowListener( new WindowAdapter() { public void windowOpened( WindowEvent e) { super.windowOpened( e ); // now we're setting the focus to the desired component // it's not the best solution as it depends on internals // of the OptionPane class, but you can use it temporarily // until the bug gets fixed // also you might want to iterate here thru the set of // the buttons and pick one to call requestFocus() for it rst.requestFocus(); } }); dialog.setVisible(true); // now we can process the value selected String value = (String)pane.getValue(); if (value.equals(options[0])) { // send option along with system request if (rst.getText().length() > 0) { invoke(rst.getText(),session); } } }
| 8,357
|
clone(){ return(ci.clone());}
|
clone(){ return(ci.clone());}
| 8,358
|
current(){ return(ci.current());}
|
current(){ return(ci.current());}
| 8,359
|
first(){ return(ci.first());}
|
first(){ return(ci.first());}
| 8,360
|
getAllAttributeKeys(){ HashSet s = new HashSet(); if (attribs == null) return(s); for (int i = 0; i < attribs.length; i++) { if (attribs[i].begin_index > getEndIndex() || attribs[i].end_index <= getBeginIndex()) continue; Set key_set = attribs[i].attribs.keySet(); Iterator iter = key_set.iterator(); while (iter.hasNext()) { s.add(iter.next()); } } return(s);}
|
getAllAttributeKeys(){ HashSet s = new HashSet(); if (attribs == null) return(s); for (int i = 0; i < attribs.length; i++) { if (attribs[i].begin_index > getEndIndex() || attribs[i].end_index <= getBeginIndex()) continue; Set key_set = attribs[i].attribs.keySet(); Iterator iter = key_set.iterator(); while (iter.hasNext()) { s.add(iter.next()); } } return(s);}
| 8,361
|
getAttribute(AttributedCharacterIterator.Attribute attrib){ if (attribs == null) return(null); for (int i = 0; i < attribs.length; i++) { Set key_set = attribs[i].attribs.keySet(); Iterator iter = key_set.iterator(); while (iter.hasNext()) { Object obj = iter.next(); // Check for attribute match and range match if (obj.equals(attrib)) if ((ci.getIndex() >= attribs[i].begin_index) && (ci.getIndex() < attribs[i].end_index)) return(attribs[i].attribs.get(obj)); } } return(null);}
|
getAttribute(AttributedCharacterIterator.Attribute attrib){ if (attribs == null) return(null); for (int i = 0; i < attribs.length; i++) { Set key_set = attribs[i].attribs.keySet(); Iterator iter = key_set.iterator(); while (iter.hasNext()) { Object obj = iter.next(); // Check for attribute match and range match if (obj.equals(attrib)) if ((ci.getIndex() >= attribs[i].begin_index) && (ci.getIndex() < attribs[i].end_index)) return(attribs[i].attribs.get(obj)); } } return(null);}
| 8,362
|
getAttributes(){ HashMap m = new HashMap(); if (attribs == null) return(m); for (int i = 0; i < attribs.length; i++) { if ((ci.getIndex() >= attribs[i].begin_index) && (ci.getIndex() < attribs[i].end_index)) m.putAll(attribs[i].attribs); } return(m);}
|
getAttributes(){ HashMap m = new HashMap(); if (attribs == null) return(m); for (int i = 0; i < attribs.length; i++) { if ((ci.getIndex() >= attribs[i].begin_index) && (ci.getIndex() < attribs[i].end_index)) m.putAll(attribs[i].attribs); } return(m);}
| 8,363
|
getBeginIndex(){ return(ci.getBeginIndex());}
|
getBeginIndex(){ return(ci.getBeginIndex());}
| 8,364
|
getEndIndex(){ return(ci.getEndIndex());}
|
getEndIndex(){ return(ci.getEndIndex());}
| 8,365
|
getIndex(){ return(ci.getIndex());}
|
getIndex(){ return(ci.getIndex());}
| 8,366
|
getRunLimit(){ return(getRunLimit(getAttributes().keySet()));}
|
getRunLimit(){ return(getRunLimit(getAttributes().keySet()));}
| 8,367
|
getRunStart(){ return(getRunStart(getAttributes().keySet()));}
|
getRunStart(){ return(getRunStart(getAttributes().keySet()));}
| 8,368
|
last(){ return(ci.last());}
|
last(){ return(ci.last());}
| 8,369
|
next(){ return(ci.next());}
|
next(){ return(ci.next());}
| 8,370
|
previous(){ return(ci.previous());}
|
previous(){ return(ci.previous());}
| 8,371
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.