bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public AbstractButton() { actionListener = createActionListener(); changeListener = createChangeListener(); itemListener = createItemListener(); horizontalAlignment = CENTER; horizontalTextPosition = TRAILING; verticalAlignment = CENTER; verticalTextPosition = CENTER; borderPainted = true; contentAreaFilled = true; focusPainted = true; setFocusable(true); setAlignmentX(CENTER_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); setDisplayedMnemonicIndex(-1); setOpaque(true); text = ""; updateUI(); }
|
public AbstractButton() { actionListener = createActionListener(); changeListener = createChangeListener(); itemListener = createItemListener(); horizontalAlignment = CENTER; horizontalTextPosition = TRAILING; verticalAlignment = CENTER; verticalTextPosition = CENTER; borderPainted = true; contentAreaFilled = true; focusPainted = true; setFocusable(true); setAlignmentX(CENTER_ALIGNMENT); setAlignmentY(CENTER_ALIGNMENT); setDisplayedMnemonicIndex(-1); setOpaque(true); text = ""; updateUI(); }
| 1,686
|
protected ActionListener createActionListener() { return new ActionListener() { public void actionPerformed(ActionEvent e) { AbstractButton.this.fireActionPerformed(e); } }; }
|
protected ActionListener createActionListener() { return new ActionListener() { public void actionPerformed(ActionEvent e) { AbstractButton.this.fireActionPerformed(e); } }; }
| 1,687
|
protected ChangeListener createChangeListener() { return new ButtonChangeListener(); }
|
protected ChangeListener createChangeListener() { return getEventHandler(); }
| 1,688
|
protected ItemListener createItemListener() { return new ItemListener() { public void itemStateChanged(ItemEvent e) { AbstractButton.this.fireItemStateChanged(e); } }; }
|
protected ItemListener createItemListener() { return new ItemListener() { public void itemStateChanged(ItemEvent e) { AbstractButton.this.fireItemStateChanged(e); } }; }
| 1,689
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
|
public Icon getDisabledIcon() { if (disabledIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
| 1,690
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabledIcon = new ImageIcon(grayImage); } return disabeldIcon; }
| 1,691
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabeldIcon; }
|
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); } return disabledIcon; }
| 1,692
|
protected void init(String text, Icon icon) { // If text is null, we fall back to the empty // string (which is set using AbstractButton's // constructor). // This way the behavior of the JDK is matched. if(text != null) this.text = text; if (icon != null) default_icon = icon; }
|
protected void init(String text, Icon icon) { // If text is null, we fall back to the empty // string (which is set using AbstractButton's // constructor). // This way the behavior of the JDK is matched. if(text != null) setText(text); if (icon != null) default_icon = icon; }
| 1,693
|
public void setDisabledIcon(Icon d) { disabeldIcon = d; revalidate(); repaint(); }
|
public void setDisabledIcon(Icon d) { if (disabledIcon == d) return; Icon old = disabledIcon; disabledIcon = d; firePropertyChange(DISABLED_ICON_CHANGED_PROPERTY, old, d); revalidate(); repaint(); }
| 1,694
|
public ConditionalBranchQuad(int address, IRBasicBlock block, int varIndex1, int condition, int varIndex2, int targetAddress) { super(address, block, targetAddress); if (condition < IF_ICMPEQ || condition > IF_ACMPNE) { throw new IllegalArgumentException("can't use that condition here"); } this.operand1 = getOperand(varIndex1); this.condition = condition; this.commutative = condition == IF_ICMPEQ || condition == IF_ICMPNE || condition == IF_ACMPEQ || condition == IF_ACMPNE; this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2}; }
|
public ConditionalBranchQuad(int address, IRBasicBlock block, int varIndex1, int condition, int varIndex2, int targetAddress) { super(address, block, targetAddress); if (condition < IF_ICMPEQ || condition > IF_ACMPNE) { throw new IllegalArgumentException("can't use that condition here"); } this.condition = condition; this.commutative = condition == IF_ICMPEQ || condition == IF_ICMPNE || condition == IF_ACMPEQ || condition == IF_ACMPNE; this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2}; }
| 1,702
|
public ConditionalBranchQuad(int address, IRBasicBlock block, int varIndex1, int condition, int varIndex2, int targetAddress) { super(address, block, targetAddress); if (condition < IF_ICMPEQ || condition > IF_ACMPNE) { throw new IllegalArgumentException("can't use that condition here"); } this.operand1 = getOperand(varIndex1); this.condition = condition; this.commutative = condition == IF_ICMPEQ || condition == IF_ICMPNE || condition == IF_ACMPEQ || condition == IF_ACMPNE; this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2}; }
|
public ConditionalBranchQuad(int address, IRBasicBlock block, int varIndex1, int condition, int varIndex2, int targetAddress) { super(address, block, targetAddress); if (condition < IF_ICMPEQ || condition > IF_ACMPNE) { throw new IllegalArgumentException("can't use that condition here"); } this.operand1 = getOperand(varIndex1); this.condition = condition; this.commutative = condition == IF_ICMPEQ || condition == IF_ICMPNE || condition == IF_ACMPEQ || condition == IF_ACMPNE; this.operand2 = getOperand(varIndex2); refs = new Operand[]{operand1, operand2}; }
| 1,703
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } }
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } }
| 1,704
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } }
|
public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 != null) { operand2 = operand2.simplify(); if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } }
| 1,705
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 1,706
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) refs[0]; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) refs[0]; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 1,707
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) refs[1]; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) refs[1]; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 1,708
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) refs[0]; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 1,709
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
|
public void generateCodeForBinary(CodeGenerator cg) { cg.checkLabel(getAddress()); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) refs[1]; } int aMode = (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_CC: cg.generateCodeFor(this, c2, condition, c3); break; case MODE_CR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, c2); } else { cg.generateCodeFor(this, c2, condition, reg3); } break; case MODE_CS: cg.generateCodeFor(this, c2, condition, disp3); break; case MODE_RC: cg.generateCodeFor(this, reg2, condition, c3); break; case MODE_RR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, reg2); } else { cg.generateCodeFor(this, reg2, condition, reg3); } break; case MODE_RS: cg.generateCodeFor(this, reg2, condition, disp3); break; case MODE_SC: cg.generateCodeFor(this, disp2, condition, c3); break; case MODE_SR: if (commutative && !cg.supports3AddrOps()) { cg.generateCodeFor(this, reg3, condition, disp2); } else { cg.generateCodeFor(this, disp2, condition, reg3); } break; case MODE_SS: cg.generateCodeFor(this, disp2, condition, disp3); break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } }
| 1,710
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
| 1,711
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (refs[0] instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
| 1,712
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) refs[0]; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
| 1,713
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + operand1); } }
|
public void generateCodeForUnary(CodeGenerator cg) { if (operand1 instanceof Variable) { Location varLoc = ((Variable) operand1).getLocation(); if (varLoc instanceof RegisterLocation) { RegisterLocation vregLoc = (RegisterLocation) varLoc; cg.generateCodeFor(this, condition, vregLoc.getRegister()); } else if (varLoc instanceof StackLocation) { StackLocation stackLoc = (StackLocation) varLoc; cg.generateCodeFor(this, condition, stackLoc.getDisplacement()); } else { throw new IllegalArgumentException("Unknown location: " + varLoc); } } else if (operand1 instanceof Constant) { // this probably won't happen, is should be folded earlier Constant con = (Constant) operand1; cg.generateCodeFor(this, condition, con); } else { throw new IllegalArgumentException("Unknown operand: " + refs[0]); } }
| 1,714
|
public Operand getOperand1() { return operand1; }
|
public Operand getOperand1() { return refs[0]; }
| 1,715
|
public Operand getOperand2() { return operand2; }
|
public Operand getOperand2() { return refs[1]; }
| 1,716
|
public String toString() { if (condition >= IF_ICMPEQ) { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() + " goto " + getTargetAddress(); } else { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " goto " + getTargetAddress(); } }
|
public String toString() { if (condition >= IF_ICMPEQ) { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() + " goto " + getTargetAddress(); } else { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " goto " + getTargetAddress(); } }
| 1,717
|
public String toString() { if (condition >= IF_ICMPEQ) { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() + " goto " + getTargetAddress(); } else { return getAddress() + ": if " + operand1.toString() + " " + CONDITION_MAP[condition] + " goto " + getTargetAddress(); } }
|
public String toString() { if (condition >= IF_ICMPEQ) { return getAddress() + ": if " + refs[0].toString() + " " + CONDITION_MAP[condition] + " " + operand2.toString() + " goto " + getTargetAddress(); } else { return getAddress() + ": if " + refs[0].toString() + " " + CONDITION_MAP[condition] + " goto " + getTargetAddress(); } }
| 1,718
|
public KeyboardHandler(Session session) { this.session = session; this.screen = session.getScreen(); String os = System.getProperty("os.name"); if (os.toLowerCase().indexOf("linux") != -1) { System.out.println("using os " + os); isLinux = true; } keyMap = new KeyMapper(); keyMap.init(); keyMap.addKeyChangeListener(this); // initialize the keybingings of the components InputMap initKeyBindings(); }
|
public KeyboardHandler(Session session) { this.session = session; this.screen = session.getScreen(); String os = System.getProperty("os.name"); if (os.toLowerCase().indexOf("linux") != -1) { System.out.println("using os " + os); isLinux = true; } keyMap = new KeyMapper(); KeyMapper.init(); keyMap.addKeyChangeListener(this); // initialize the keybingings of the components InputMap initKeyBindings(); }
| 1,720
|
public KeyboardHandler(Session session) { this.session = session; this.screen = session.getScreen(); String os = System.getProperty("os.name"); if (os.toLowerCase().indexOf("linux") != -1) { System.out.println("using os " + os); isLinux = true; } keyMap = new KeyMapper(); keyMap.init(); keyMap.addKeyChangeListener(this); // initialize the keybingings of the components InputMap initKeyBindings(); }
|
public KeyboardHandler(Session session) { this.session = session; this.screen = session.getScreen(); String os = System.getProperty("os.name"); if (os.toLowerCase().indexOf("linux") != -1) { System.out.println("using os " + os); isLinux = true; } keyMap = new KeyMapper(); keyMap.init(); KeyMapper.addKeyChangeListener(this); // initialize the keybingings of the components InputMap initKeyBindings(); }
| 1,721
|
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } if (lastKeyMnemonic != null && lastKeyMnemonic.endsWith(".alt2")) { lastKeyMnemonic = lastKeyMnemonic.substring(0,lastKeyMnemonic.indexOf(".alt2")); } return lastKeyMnemonic; }
|
public final static String getKeyStrokeText(KeyEvent ke,boolean isAltGr) { if (!workStroke.equals(ke,isAltGr)) { workStroke.setAttributes(ke,isAltGr); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } if (lastKeyMnemonic != null && lastKeyMnemonic.endsWith(".alt2")) { lastKeyMnemonic = lastKeyMnemonic.substring(0,lastKeyMnemonic.indexOf(".alt2")); } return lastKeyMnemonic; }
| 1,722
|
public void executeMeMacro(String macro) { Macronizer.invoke(macro,(Session)this); }
|
public void executeMeMacro(ActionEvent ae) { Macronizer.invoke(macro,(Session)this); }
| 1,723
|
public void executeMeMacro(String macro) { Macronizer.invoke(macro,(Session)this); }
|
public void executeMeMacro(String macro) { executeMeMacro(ae.getActionCommand()); }
| 1,724
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
| 1,725
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
| 1,726
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
| 1,727
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
| 1,728
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0 || (x - (width - cWidth) / 2) < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0 || (x - (width - cWidth) / 2) < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
| 1,729
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; } else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; } y = screenSize.height - height; } else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; } else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; } setLocation(x, y); } }
|
public void setLocationRelativeTo (Component c) { if (c == null || !c.isShowing ()) { int x = 0; int y = 0; GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); else { int x = c.getX(); int y = c.getY(); int cWidth = c.getWidth(); int cHeight = c.getHeight(); Dimension screenSize = getToolkit().getScreenSize(); // If bottom of component is cut off, window placed // on the left or the right side of component if ((y + cHeight) > screenSize.height) { // If the right side of the component is closer to the center if ((screenSize.width / 2 - x) <= 0) { if ((x - width) >= 0) x -= width; else x = 0; else { if ((x + cWidth + width) <= screenSize.width) x += cWidth; else x = screenSize.width - width; y = screenSize.height - height; else if (cWidth > width || cHeight > height) { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x += (cWidth - width) / 2; y += (cHeight - height) / 2; else { // If right side of component is cut off if ((x + width) > screenSize.width) x = screenSize.width - width; // If left side of component is cut off else if (x < 0) x = 0; else x -= (width - cWidth) / 2; y -= (height - cHeight) / 2; setLocation(x, y);
| 1,730
|
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back, FlipContents flip) { this.front = front; this.back = back; this.flip = flip; if (front == null || back == null) throw new IllegalArgumentException(); }
|
public BufferCapabilities(ImageCapabilities front, ImageCapabilities back, FlipContents flip) { this.front = front; this.back = back; this.flip = flip; if (front == null || back == null) throw new IllegalArgumentException(); }
| 1,731
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
|
public synchronized void postEvent(AWTEvent evt) { if (evt == null) throw new NullPointerException(); if (next != null) { next.postEvent(evt); return; } /* Check for any events already on the queue with the same source and ID. */ int i = next_out; while (i != next_in) { AWTEvent qevt = queue[i]; Object src; if (qevt.id == evt.id && (src = qevt.getSource()) == evt.getSource() && src instanceof Component) { /* If there are, call coalesceEvents on the source component to see if they can be combined. */ Component srccmp = (Component) src; AWTEvent coalesced_evt = srccmp.coalesceEvents(qevt, evt); if (coalesced_evt != null) { /* Yes. Replace the existing event with the combined event. */ queue[i] = coalesced_evt; return; } break; } if (++i == queue.length) i = 0; } queue[next_in] = evt; if (++next_in == queue.length) next_in = 0; if (next_in == next_out) { /* Queue is full. Extend it. */ AWTEvent[] oldQueue = queue; queue = new AWTEvent[queue.length * 2]; int len = oldQueue.length - next_out; System.arraycopy(oldQueue, next_out, queue, 0, len); if (next_out != 0) System.arraycopy(oldQueue, 0, queue, len, next_out); next_out = 0; next_in = oldQueue.length; } notify(); }
| 1,732
|
public boolean postEvent(Event e) { // XXX Add backward compatibility handling. return false; }
|
public boolean postEvent(Event e) { // XXX Add backward compatibility handling. boolean handled = handleEvent (e); if (!handled && getParent() != null) handled = getParent ().postEvent (e); return handled; }
| 1,733
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalRadioButtonUI(); return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalRadioButtonUI(); return instance; }
| 1,735
|
public void updateUI() { MenuBarUI ui = ((MenuBarUI) UIManager.getUI(this)); setUI(ui); invalidate(); }
|
public void updateUI() { MenuBarUI ui = ((MenuBarUI) UIManager.getUI(this)); setUI(ui); invalidate(); }
| 1,736
|
private static void parseKeyStrokes(Properties keystrokes) { String theStringList = ""; String theKey = ""; Enumeration ke = keystrokes.propertyNames(); while (ke.hasMoreElements()) { theKey = (String)ke.nextElement(); theStringList = keystrokes.getProperty(theKey); int x = 0; int kc = 0; boolean is = false; boolean ic = false; boolean ia = false; boolean iag = false; StringTokenizer tokenizer = new StringTokenizer(theStringList, ","); // first is the keycode kc = Integer.parseInt(tokenizer.nextToken()); // isShiftDown if (tokenizer.nextToken().equals("true")) is = true; else is =false; // isControlDown if (tokenizer.nextToken().equals("true")) ic = true; else ic =false; // isAltDown if (tokenizer.nextToken().equals("true")) ia = true; else ia =false; // isAltDown Gr if (tokenizer.hasMoreTokens()) if (tokenizer.nextToken().equals("true")) iag = true; else iag =false; mappedKeys.put(new KeyStroker(kc, is, ic, ia, iag),theKey); } }
|
private static void parseKeyStrokes(Properties keystrokes) { String theStringList = ""; String theKey = ""; Enumeration ke = keystrokes.propertyNames(); while (ke.hasMoreElements()) { theKey = (String)ke.nextElement(); theStringList = keystrokes.getProperty(theKey); int x = 0; int kc = 0; boolean is = false; boolean ic = false; boolean ia = false; boolean iag = false; StringTokenizer tokenizer = new StringTokenizer(theStringList, ","); // first is the keycode kc = Integer.parseInt(tokenizer.nextToken()); // isShiftDown if (tokenizer.nextToken().equals("true")) is = true; else is =false; // isControlDown if (tokenizer.nextToken().equals("true")) ic = true; else ic =false; // isAltDown if (tokenizer.nextToken().equals("true")) ia = true; else ia =false; // isAltDown Gr if (tokenizer.hasMoreTokens()) { if (tokenizer.nextToken().equals("true")) iag = true; else iag =false; mappedKeys.put(new KeyStroker(kc, is, ic, ia, iag),theKey); } }
| 1,737
|
private static void parseKeyStrokes(Properties keystrokes) { String theStringList = ""; String theKey = ""; Enumeration ke = keystrokes.propertyNames(); while (ke.hasMoreElements()) { theKey = (String)ke.nextElement(); theStringList = keystrokes.getProperty(theKey); int x = 0; int kc = 0; boolean is = false; boolean ic = false; boolean ia = false; boolean iag = false; StringTokenizer tokenizer = new StringTokenizer(theStringList, ","); // first is the keycode kc = Integer.parseInt(tokenizer.nextToken()); // isShiftDown if (tokenizer.nextToken().equals("true")) is = true; else is =false; // isControlDown if (tokenizer.nextToken().equals("true")) ic = true; else ic =false; // isAltDown if (tokenizer.nextToken().equals("true")) ia = true; else ia =false; // isAltDown Gr if (tokenizer.hasMoreTokens()) if (tokenizer.nextToken().equals("true")) iag = true; else iag =false; mappedKeys.put(new KeyStroker(kc, is, ic, ia, iag),theKey); } }
|
private static void parseKeyStrokes(Properties keystrokes) { String theStringList = ""; String theKey = ""; Enumeration ke = keystrokes.propertyNames(); while (ke.hasMoreElements()) { theKey = (String)ke.nextElement(); theStringList = keystrokes.getProperty(theKey); int x = 0; int kc = 0; boolean is = false; boolean ic = false; boolean ia = false; boolean iag = false; StringTokenizer tokenizer = new StringTokenizer(theStringList, ","); // first is the keycode kc = Integer.parseInt(tokenizer.nextToken()); // isShiftDown if (tokenizer.nextToken().equals("true")) is = true; else is =false; // isControlDown if (tokenizer.nextToken().equals("true")) ic = true; else ic =false; // isAltDown if (tokenizer.nextToken().equals("true")) ia = true; else ia =false; // isAltDown Gr if (tokenizer.hasMoreTokens()) if (tokenizer.nextToken().equals("true")) iag = true; else iag =false; if (tokenizer.hasMoreTokens()) { location = Integer.parseInt(tokenizer.nextToken()); } } mappedKeys.put(newKeyStroker(kc, is, ic, ia, iag,location),theKey); } }
| 1,738
|
private void loadDefaults() { try { sesProps = ConfigureFactory.getInstance().getProperties( "dfltSessionProps", getConfigurationResource()); if (sesProps.size() == 0) { Properties schemaProps = new Properties(); java.net.URL file=null; ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); file = cl.getResource("tn5250jSchemas.properties"); schemaProps.load(file.openStream()); // we will now load the default schema String prefix = schemaProps.getProperty("schemaDefault"); sesProps.setProperty("colorBg",schemaProps.getProperty(prefix + ".colorBg")); sesProps.setProperty("colorRed",schemaProps.getProperty(prefix + ".colorRed")); sesProps.setProperty("colorTurq",schemaProps.getProperty(prefix + ".colorTurq")); sesProps.setProperty("colorCursor",schemaProps.getProperty(prefix + ".colorCursor")); sesProps.setProperty("colorGUIField",schemaProps.getProperty(prefix + ".colorGUIField")); sesProps.setProperty("colorWhite",schemaProps.getProperty(prefix + ".colorWhite")); sesProps.setProperty("colorYellow",schemaProps.getProperty(prefix + ".colorYellow")); sesProps.setProperty("colorGreen",schemaProps.getProperty(prefix + ".colorGreen")); sesProps.setProperty("colorPink",schemaProps.getProperty(prefix + ".colorPink")); sesProps.setProperty("colorBlue",schemaProps.getProperty(prefix + ".colorBlue")); sesProps.setProperty("colorSep",schemaProps.getProperty(prefix + ".colorSep")); sesProps.setProperty("colorHexAttr",schemaProps.getProperty(prefix + ".colorHexAttr")); sesProps.setProperty("font",GUIGraphicsUtils.getDefaultFont()); ConfigureFactory.getInstance().saveSettings("dfltSessionProps", getConfigurationResource(), ""); } } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + getConfigurationResource()); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
|
private void loadDefaults() { try { sesProps = ConfigureFactory.getInstance().getProperties( "dfltSessionProps", getConfigurationResource(),true, "Default Settings"); if (sesProps.size() == 0) { Properties schemaProps = new Properties(); java.net.URL file=null; ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); file = cl.getResource("tn5250jSchemas.properties"); schemaProps.load(file.openStream()); // we will now load the default schema String prefix = schemaProps.getProperty("schemaDefault"); sesProps.setProperty("colorBg",schemaProps.getProperty(prefix + ".colorBg")); sesProps.setProperty("colorRed",schemaProps.getProperty(prefix + ".colorRed")); sesProps.setProperty("colorTurq",schemaProps.getProperty(prefix + ".colorTurq")); sesProps.setProperty("colorCursor",schemaProps.getProperty(prefix + ".colorCursor")); sesProps.setProperty("colorGUIField",schemaProps.getProperty(prefix + ".colorGUIField")); sesProps.setProperty("colorWhite",schemaProps.getProperty(prefix + ".colorWhite")); sesProps.setProperty("colorYellow",schemaProps.getProperty(prefix + ".colorYellow")); sesProps.setProperty("colorGreen",schemaProps.getProperty(prefix + ".colorGreen")); sesProps.setProperty("colorPink",schemaProps.getProperty(prefix + ".colorPink")); sesProps.setProperty("colorBlue",schemaProps.getProperty(prefix + ".colorBlue")); sesProps.setProperty("colorSep",schemaProps.getProperty(prefix + ".colorSep")); sesProps.setProperty("colorHexAttr",schemaProps.getProperty(prefix + ".colorHexAttr")); sesProps.setProperty("font",GUIGraphicsUtils.getDefaultFont()); ConfigureFactory.getInstance().saveSettings("dfltSessionProps", getConfigurationResource(), ""); } } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + getConfigurationResource(),true, "Default Settings"); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
| 1,740
|
public void run () { boolean keepTrucking = true; while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming(); screen52.setKeyboardLocked(false); cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try { screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } }
|
public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming(); screen52.setKeyboardLocked(false); cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try { screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); } if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } }
| 1,742
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
| 1,743
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId(), AxisAliasId)); newaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newaxis.getAxisId(), newaxis); } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
| 1,744
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator(); myLocator.setIterationOrder(AxisReadOrder); formatObj.setIOAxesOrder(AxisReadOrder);/*Iterator thisIter = AxisReadOrder.iterator();while(thisIter.hasNext()) { Log.debugln("ReadAxis: "+((AxisInterface) thisIter.next()).getAxisId());}*/ CurrentDataFormatIndex = 0; ArrayList strValueList; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) { // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. String thisData = (String) iter.next(); addDataToCurrentArray(myLocator, thisData, CurrentDataFormat, IntRadix[CurrentDataFormatIndex]); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisIndex(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator(); myLocator.setIterationOrder(AxisReadOrder); /*Iterator thisIter = AxisReadOrder.iterator();while(thisIter.hasNext()) { Log.debugln("ReadAxis: "+((AxisInterface) thisIter.next()).getAxisId());}*/ CurrentDataFormatIndex = 0; ArrayList strValueList; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) { // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. String thisData = (String) iter.next(); addDataToCurrentArray(myLocator, thisData, CurrentDataFormat, IntRadix[CurrentDataFormatIndex]); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisIndex(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
| 1,746
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately FieldAxis newfieldaxis = new FieldAxis(); newfieldaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newfieldaxis.getAxisId()) != null || (axisIdRef = newfieldaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newfieldaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newfieldaxis = (FieldAxis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone field object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newfieldaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newfieldaxis.setAxisId(findUniqueIdName(AxisObj, newfieldaxis.getAxisId())); newfieldaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newfieldaxis.getAxisId(), newfieldaxis); } else { Log.warnln("Error: Reader got an fieldaxis with AxisIdRef=\""+axisIdRef+"\" but no previous field axis has that id! Ignoring add fieldAxis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.setFieldAxis(newfieldaxis); } else { Log.errorln("FieldAxis object:"+newfieldaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newfieldaxis; }
|
public Object action (SaxDocumentHandler handler, Attributes attrs) { // create new object appropriately FieldAxis newfieldaxis = new FieldAxis(); newfieldaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newfieldaxis.getAxisId()) != null || (axisIdRef = newfieldaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newfieldaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newfieldaxis = (FieldAxis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone field object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newfieldaxis.setXMLAttributes(attrs); // give the clone a unique Id and remove IdRef newfieldaxis.setAxisId(findUniqueIdName(AxisObj, newfieldaxis.getAxisId(), AxisAliasId)); newfieldaxis.setAxisIdRef(null); // add this into the list of axis objects AxisObj.put(newfieldaxis.getAxisId(), newfieldaxis); } else { Log.warnln("Error: Reader got an fieldaxis with AxisIdRef=\""+axisIdRef+"\" but no previous field axis has that id! Ignoring add fieldAxis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.setFieldAxis(newfieldaxis); } else { Log.errorln("FieldAxis object:"+newfieldaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newfieldaxis; }
| 1,747
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
| 1,750
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
|
private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*Log.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") "); // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) {//Log.debugln("(String)"); CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) {//Log.debugln("(Double)"); Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString);//Log.debugln("(Integer)"); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } }
| 1,751
|
public String findUniqueIdName( Hashtable list, String baseIdName) { StringBuffer testName = new StringBuffer(baseIdName); while (list.containsKey(testName.toString())) { testName.append("0"); // isnt there something better to append here?? } return testName.toString(); }
|
public String findUniqueIdName( Hashtable idTable, String baseIdName) { StringBuffer testName = new StringBuffer(baseIdName); while (list.containsKey(testName.toString())) { testName.append("0"); // isnt there something better to append here?? } return testName.toString(); }
| 1,752
|
public String findUniqueIdName( Hashtable list, String baseIdName) { StringBuffer testName = new StringBuffer(baseIdName); while (list.containsKey(testName.toString())) { testName.append("0"); // isnt there something better to append here?? } return testName.toString(); }
|
public String findUniqueIdName( Hashtable list, String baseIdName) { StringBuffer testName = new StringBuffer(baseIdName); while (idTable.containsKey(testName.toString())) { testName.append("0"); // isnt there something better to append here?? } return testName.toString(); }
| 1,753
|
public void add(AbstractButton b) { b.getModel().setGroup(this); if (b.isSelected()) sel = b.getModel(); buttons.addElement(b); }
|
public void add(AbstractButton b) { b.getModel().setGroup(this); if (b.isSelected()) sel = b.getModel(); else b.setSelected(false); } buttons.addElement(b); }
| 1,754
|
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); int currRun = 1; if (tabCount > runCount) runCount = tabCount; if (tabCount < 1) return; if (runCount > 1) currRun = 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } } for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun); } if (! isScroll) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
|
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); int currRun = 1; if (tabCount > runCount) runCount = tabCount; if (tabCount < 1) return; if (runCount > 1) currRun = 0; for (int i = 0; i < runCount; i++) { int first = lastTabInRun(tabCount, getPreviousTabRun(currRun)) + 1; if (isScroll) first = currentScrollLocation; else if (first == tabCount) first = 0; int last = lastTabInRun(tabCount, currRun); if (isScroll) { for (int k = first; k < tabCount; k++) { if (rects[k].x + rects[k].width - rects[first].x > viewport .getWidth()) { last = k; break; } } } for (int j = first; j <= last; j++) { if (j != selectedIndex || isScroll) paintTab(g, tabPlacement, rects, j, ir, tr); } currRun = getPreviousTabRun(currRun); } if (! isScroll) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
| 1,757
|
public void goHome() { // now we try to move to first input field according to // 14.6 WRITE TO DISPLAY Command // If the WTD command is valid, after the command is processed, // the cursor moves to one of three locations: // - The location set by an insert cursor order (unless control // character byte 1, bit 1 is equal to B'1'.) // - The start of the first non-bypass input field defined in the // format table // - A default starting address of row 1 column 1. if (pendingInsert) { goto_XY(getRow(homePos),getCol(homePos)); isInField(); // we now check if we are in a field } else { if(!gotoField(1)) { homePos = getPos(1,1); goto_XY(1,1); isInField(0,0); // we now check if we are in a field } else { homePos = getPos(getCurrentRow(),getCurrentCol()); } } }
|
public void goHome() { // now we try to move to first input field according to // 14.6 WRITE TO DISPLAY Command // If the WTD command is valid, after the command is processed, // the cursor moves to one of three locations: // - The location set by an insert cursor order (unless control // character byte 1, bit 1 is equal to B'1'.) // - The start of the first non-bypass input field defined in the // format table // - A default starting address of row 1 column 1. if (pendingInsert && homePos > 0) { goto_XY(getRow(homePos),getCol(homePos)); isInField(); // we now check if we are in a field } else { if(!gotoField(1)) { homePos = getPos(1,1); goto_XY(1,1); isInField(0,0); // we now check if we are in a field } else { homePos = getPos(getCurrentRow(),getCurrentCol()); } } }
| 1,758
|
public void propertyChange(PropertyChangeEvent pce) { String pn = pce.getPropertyName(); boolean resetAttr = false; if (pn.equals("colorBg")) { colorBg = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorBlue")) { colorBlue = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorTurq")) { colorTurq = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorRed")) { colorRed = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorWhite")) { colorWhite = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorYellow")) { colorYellow = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGreen")) { colorGreen = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorPink")) { colorPink = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGUIField")) { colorGUIField = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorCursor")) { colorCursor = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorSep")) { colorSep = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorHexAttr")) { colorHexAttr = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("cursorSize")) { if (pce.getNewValue().equals("Full")) cursorSize = 2; if (pce.getNewValue().equals("Half")) cursorSize = 1; if (pce.getNewValue().equals("Line")) cursorSize = 0; } if (pn.equals("crossHair")) { if (pce.getNewValue().equals("None")) crossHair = 0; if (pce.getNewValue().equals("Horz")) crossHair = 1; if (pce.getNewValue().equals("Vert")) crossHair = 2; if (pce.getNewValue().equals("Both")) crossHair = 3; } if (pn.equals("colSeparator")) { if (pce.getNewValue().equals("Line")) colSepLine = 0; if (pce.getNewValue().equals("ShortLine")) colSepLine = 1; if (pce.getNewValue().equals("Dot")) colSepLine = 2; } if (pn.equals("showAttr")) { if (pce.getNewValue().equals("Hex")) showHex = true; else showHex= false; } if (pn.equals("guiInterface")) { if (pce.getNewValue().equals("Yes")) guiInterface = true; else guiInterface = false; } if (pn.equals("guiShowUnderline")) { if (pce.getNewValue().equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (pn.equals("hotspots")) { if (pce.getNewValue().equals("Yes")) hotSpots = true; else hotSpots = false; } if (pn.equals("hsMore")) { hsMore.setLength(0); hsMore.append((String)pce.getNewValue()); } if (pn.equals("hsBottom")) { hsBottom.setLength(0); hsBottom.append((String)pce.getNewValue()); } if (pn.equals("font")) { font = new Font((String)pce.getNewValue(),Font.PLAIN,14); updateFont = true; } if (pn.equals("fontScaleHeight")) {// try { sfh = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontScaleWidth")) {// try { sfw = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontPointSize")) {// try { ps132 = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (updateFont) { Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width,r.height); updateFont = false; } if (resetAttr) for (int y = 0;y < lenScreen; y++) { screen[y].setAttribute(screen[y].getCharAttr()); } gui.repaint(); gui.revalidate(); }
|
public void propertyChange(PropertyChangeEvent pce) { String pn = pce.getPropertyName(); boolean resetAttr = false; if (pn.equals("colorBg")) { colorBg = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorBlue")) { colorBlue = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorTurq")) { colorTurq = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorRed")) { colorRed = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorWhite")) { colorWhite = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorYellow")) { colorYellow = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGreen")) { colorGreen = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorPink")) { colorPink = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorGUIField")) { colorGUIField = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorCursor")) { colorCursor = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorSep")) { colorSep = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("colorHexAttr")) { colorHexAttr = (Color)pce.getNewValue(); resetAttr = true; } if (pn.equals("cursorSize")) { if (pce.getNewValue().equals("Full")) cursorSize = 2; if (pce.getNewValue().equals("Half")) cursorSize = 1; if (pce.getNewValue().equals("Line")) cursorSize = 0; } if (pn.equals("crossHair")) { if (pce.getNewValue().equals("None")) crossHair = 0; if (pce.getNewValue().equals("Horz")) crossHair = 1; if (pce.getNewValue().equals("Vert")) crossHair = 2; if (pce.getNewValue().equals("Both")) crossHair = 3; } if (pn.equals("colSeparator")) { if (pce.getNewValue().equals("Line")) colSepLine = 0; if (pce.getNewValue().equals("ShortLine")) colSepLine = 1; if (pce.getNewValue().equals("Dot")) colSepLine = 2; } if (pn.equals("showAttr")) { if (pce.getNewValue().equals("Hex")) showHex = true; else showHex= false; } if (pn.equals("guiInterface")) { if (pce.getNewValue().equals("Yes")) guiInterface = true; else guiInterface = false; } if (pn.equals("guiShowUnderline")) { if (pce.getNewValue().equals("Yes")) guiShowUnderline = true; else guiShowUnderline = false; } if (pn.equals("hotspots")) { if (pce.getNewValue().equals("Yes")) hotSpots = true; else hotSpots = false; } if (pn.equals("hsMore")) { hsMore.setLength(0); hsMore.append((String)pce.getNewValue()); } if (pn.equals("hsBottom")) { hsBottom.setLength(0); hsBottom.append((String)pce.getNewValue()); } if (pn.equals("font")) { font = new Font((String)pce.getNewValue(),Font.PLAIN,14); updateFont = true; } if (pn.equals("fontScaleHeight")) {// try { sfh = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontScaleWidth")) {// try { sfw = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (pn.equals("fontPointSize")) {// try { ps132 = Float.parseFloat((String)pce.getNewValue()); updateFont = true;// } } if (updateFont) { Rectangle r = gui.getDrawingBounds(); resizeScreenArea(r.width,r.height); updateFont = false; } if (resetAttr) { for (int y = 0;y < lenScreen; y++) { screen[y].setAttribute(screen[y].getCharAttr()); } gui.repaint(); gui.revalidate(); }
| 1,760
|
public static Package getPackage(String name) { // Get the caller's classloader ClassLoader cl = VMSecurityManager.currentClassLoader(); return cl != null ? cl.getPackage(name) : null; }
|
public static Package getPackage(String name) { // Get the caller's classloader ClassLoader cl = VMSecurityManager.currentClassLoader(); return cl != null ? cl.getPackage(name) : null; }
| 1,764
|
public static Package[] getPackages() { // Get the caller's classloader Class c = VMSecurityManager.getClassContext()[1]; ClassLoader cl = c.getClassLoader(); // Sun's implementation returns the packages loaded by the bootstrap // classloader if cl is null, but right now our bootstrap classloader // does not create any Packages. return cl != null ? cl.getPackages() : new Package[0]; }
|
public static Package[] getPackages() { // Get the caller's classloader Class c = VMSecurityManager.getClassContext()[1]; ClassLoader cl = c.getClassLoader(); // Sun's implementation returns the packages loaded by the bootstrap // classloader if cl is null, but right now our bootstrap classloader // does not create any Packages. return cl != null ? cl.getPackages() : new Package[0]; }
| 1,765
|
public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset) { int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset); BreakIterator breaker = BreakIterator.getWordInstance(); breaker.setText(s.toString()); // If mark is equal to the end of the string, just use that position if (mark == s.count) return mark; // Try to find a word boundary previous to the mark at which we // can break the text int preceding = breaker.preceding(mark + 1); if (preceding != 0) return preceding; else // If preceding is 0 we couldn't find a suitable word-boundary so // just break it on the character boundary return mark; }
|
public static final int getBreakLocation(Segment s, FontMetrics metrics, int x0, int x, TabExpander e, int startOffset) { int mark = Utilities.getTabbedTextOffset(s, metrics, x0, x, e, startOffset); BreakIterator breaker = BreakIterator.getWordInstance(); breaker.setText(s); // If mark is equal to the end of the string, just use that position if (mark == s.count) return mark; // Try to find a word boundary previous to the mark at which we // can break the text int preceding = breaker.preceding(mark + 1); if (preceding != 0) return preceding; else // If preceding is 0 we couldn't find a suitable word-boundary so // just break it on the character boundary return mark; }
| 1,766
|
public static final int getPositionAbove(JTextComponent c, int offset, int x) throws BadLocationException { int offs = getRowStart(c, offset); if(offs == -1) return -1; // Effectively calculates the y value of the previous line. Point pt = c.modelToView(offs-1).getLocation(); pt.x = x; // Calculate a simple fitting offset. offs = c.viewToModel(pt); // Find out the real x positions of the calculated character and its // neighbour. int offsX = c.modelToView(offs).getLocation().x; int offsXNext = c.modelToView(offs+1).getLocation().x; // Chose the one which is nearer to us and return its offset. if (Math.abs(offsX-x) < Math.abs(offsXNext-x)) return offs; else return offs+1; }
|
public static final int getPositionAbove(JTextComponent c, int offset, int x) throws BadLocationException { int offs = getRowStart(c, offset); if(offs == -1) return -1; // Effectively calculates the y value of the previous line. Point pt = c.modelToView(offs-1).getLocation(); pt.x = x; // Calculate a simple fitting offset. offs = c.viewToModel(pt); // Find out the real x positions of the calculated character and its // neighbour. int offsX = c.modelToView(offs).getLocation().x; int offsXNext = c.modelToView(offs+1).getLocation().x; // Chose the one which is nearer to us and return its offset. if (Math.abs(offsX-x) <= Math.abs(offsXNext-x)) return offs; else return offs+1; }
| 1,767
|
public static final int getPositionBelow(JTextComponent c, int offset, int x) throws BadLocationException { int offs = getRowEnd(c, offset); if(offs == -1) return -1; // Effectively calculates the y value of the previous line. Point pt = c.modelToView(offs+1).getLocation(); pt.x = x; // Calculate a simple fitting offset. offs = c.viewToModel(pt); if (offs == c.getDocument().getLength()) return offs; // Find out the real x positions of the calculated character and its // neighbour. int offsX = c.modelToView(offs).getLocation().x; int offsXNext = c.modelToView(offs+1).getLocation().x; // Chose the one which is nearer to us and return its offset. if (Math.abs(offsX-x) < Math.abs(offsXNext-x)) return offs; else return offs+1; }
|
public static final int getPositionBelow(JTextComponent c, int offset, int x) throws BadLocationException { int offs = getRowEnd(c, offset); if(offs == -1) return -1; // Effectively calculates the y value of the previous line. Point pt = c.modelToView(offs+1).getLocation(); pt.x = x; // Calculate a simple fitting offset. offs = c.viewToModel(pt); if (offs == c.getDocument().getLength()) return offs; // Find out the real x positions of the calculated character and its // neighbour. int offsX = c.modelToView(offs).getLocation().x; int offsXNext = c.modelToView(offs+1).getLocation().x; // Chose the one which is nearer to us and return its offset. if (Math.abs(offsX-x) <= Math.abs(offsXNext-x)) return offs; else return offs+1; }
| 1,768
|
protected boolean getFileInfo(String tFile, boolean useInternal) { int memberOffset = tFile.indexOf("."); String file2 = null; String member2 = null; if (memberOffset > 0) { System.out.println(tFile.substring(0,memberOffset)); file2 = tFile.substring(0,memberOffset); member2 = tFile.substring(memberOffset + 1); } else { file2 = tFile; } final String file = file2; final String member = member2; final boolean internal = useInternal; Runnable getInfo = new Runnable () { // set the thread to run. public void run() { executeCommand("RCMD","dspffd FILE(" + file + ") OUTPUT(*OUTFILE) " + "OUTFILE(QTEMP/FFD) "); if (lastResponse.startsWith("2")) { if (loadFFD(internal)) { if (lastResponse.startsWith("2")) { if (getMbrInfo(file,member)) { fireInfoEvent(); } } } } } }; Thread infoThread = new Thread(getInfo); infoThread.start(); return true; }
|
protected boolean getFileInfo(String tFile, boolean useInternal) { int memberOffset = tFile.indexOf("."); String file2 = null; String member2 = null; if (memberOffset > 0) { file2 = tFile.substring(0,memberOffset); member2 = tFile.substring(memberOffset + 1); } else { file2 = tFile; } final String file = file2; final String member = member2; final boolean internal = useInternal; Runnable getInfo = new Runnable () { // set the thread to run. public void run() { executeCommand("RCMD","dspffd FILE(" + file + ") OUTPUT(*OUTFILE) " + "OUTFILE(QTEMP/FFD) "); if (lastResponse.startsWith("2")) { if (loadFFD(internal)) { if (lastResponse.startsWith("2")) { if (getMbrInfo(file,member)) { fireInfoEvent(); } } } } } }; Thread infoThread = new Thread(getInfo); infoThread.start(); return true; }
| 1,769
|
private boolean getMbrSize(String member) { boolean flag = true; if(ftpOutputStream == null) { printFTPInfo("Not connected to any server!"); return false; } if(!loggedIn) { printFTPInfo("Login was not successful! Aborting!"); return false; } Socket socket = null; DataInputStream datainputstream = null; executeCommand("TYPE","I"); String remoteFile = "QTEMP/FML"; try { socket = createPassiveSocket("RETR " + remoteFile); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); byte abyte0[] = new byte[858]; int c = 0; int kj = 0; int len = 0; StringBuffer sb = new StringBuffer(10); printFTPInfo("<----------------- Member Information ---------------->"); for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == abyte0.length) { sb.setLength(0); // the offset for member name MBNAME is 164 with offset of 1 but // we have to offset the buffer by 0 which makes it 164 - 1 // or 163 for (int f = 0;f < 10; f++) { sb.append(vt.getASCIIChar(abyte0[163 + f] & 0xff)); } printFTPInfo(sb + " " + packed2int(abyte0,345,5)); if (member == null && fileSize == 0) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); member = sb.toString(); } else { if (sb.toString().equalsIgnoreCase(member)) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } else { fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } } len =0; } } printFTPInfo("Member list Transfer complete!"); } else flag = false; } catch(Exception _ex) { printFTPInfo("Error! " + _ex); return false; } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } } parseResponse(); return flag; }
|
private boolean getMbrSize(String member) { boolean flag = true; if(ftpOutputStream == null) { printFTPInfo("Not connected to any server!"); return false; } if(!loggedIn) { printFTPInfo("Login was not successful! Aborting!"); return false; } Socket socket = null; DataInputStream datainputstream = null; executeCommand("TYPE","I"); String remoteFile = "QTEMP/FML"; try { socket = createPassiveSocket("RETR " + remoteFile); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); byte abyte0[] = new byte[858]; int c = 0; int kj = 0; int len = 0; StringBuffer sb = new StringBuffer(10); printFTPInfo("<----------------- Member Information ---------------->"); for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == abyte0.length) { sb.setLength(0); // the offset for member name MBNAME is 164 with offset of 1 but // we have to offset the buffer by 0 which makes it 164 - 1 // or 163 for (int f = 0;f < 10; f++) { sb.append(vt.getASCIIChar(abyte0[163 + f] & 0xff)); } printFTPInfo(sb + " " + packed2int(abyte0,345,5)); if (member == null && fileSize == 0) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); member = sb.toString(); } else { if (sb.toString().equalsIgnoreCase(member)) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } else { fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } } len =0; } } printFTPInfo("Member list Transfer complete!"); } else flag = false; } catch(Exception _ex) { printFTPInfo("Error! " + _ex); return false; } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } } parseResponse(); return flag; }
| 1,770
|
private boolean getMbrSize(String member) { boolean flag = true; if(ftpOutputStream == null) { printFTPInfo("Not connected to any server!"); return false; } if(!loggedIn) { printFTPInfo("Login was not successful! Aborting!"); return false; } Socket socket = null; DataInputStream datainputstream = null; executeCommand("TYPE","I"); String remoteFile = "QTEMP/FML"; try { socket = createPassiveSocket("RETR " + remoteFile); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); byte abyte0[] = new byte[858]; int c = 0; int kj = 0; int len = 0; StringBuffer sb = new StringBuffer(10); printFTPInfo("<----------------- Member Information ---------------->"); for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == abyte0.length) { sb.setLength(0); // the offset for member name MBNAME is 164 with offset of 1 but // we have to offset the buffer by 0 which makes it 164 - 1 // or 163 for (int f = 0;f < 10; f++) { sb.append(vt.getASCIIChar(abyte0[163 + f] & 0xff)); } printFTPInfo(sb + " " + packed2int(abyte0,345,5)); if (member == null && fileSize == 0) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); member = sb.toString(); } else { if (sb.toString().equalsIgnoreCase(member)) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } else { fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } } len =0; } } printFTPInfo("Member list Transfer complete!"); } else flag = false; } catch(Exception _ex) { printFTPInfo("Error! " + _ex); return false; } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } } parseResponse(); return flag; }
|
private boolean getMbrSize(String member) { boolean flag = true; if(ftpOutputStream == null) { printFTPInfo("Not connected to any server!"); return false; } if(!loggedIn) { printFTPInfo("Login was not successful! Aborting!"); return false; } Socket socket = null; DataInputStream datainputstream = null; executeCommand("TYPE","I"); String remoteFile = "QTEMP/FML"; try { socket = createPassiveSocket("RETR " + remoteFile); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); byte abyte0[] = new byte[858]; int c = 0; int kj = 0; int len = 0; StringBuffer sb = new StringBuffer(10); printFTPInfo("<----------------- Member Information ---------------->"); for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == abyte0.length) { sb.setLength(0); // the offset for member name MBNAME is 164 with offset of 1 but // we have to offset the buffer by 0 which makes it 164 - 1 // or 163 for (int f = 0;f < 10; f++) { sb.append(vt.getASCIIChar(abyte0[163 + f] & 0xff)); } printFTPInfo(sb + " " + packed2int(abyte0,345,5)); if (member == null && fileSize == 0) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); member = sb.toString(); } else { if (sb.toString().equalsIgnoreCase(member)) { // get current number of records fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } else { fileSize = packed2int(abyte0,345,5); status.setFileLength(fileSize); } } len =0; } } printFTPInfo("Member list Transfer complete!"); } else flag = false; } catch(Exception _ex) { printFTPInfo("Error! " + _ex); return false; } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } } parseResponse(); return flag; }
| 1,771
|
public Socket accept() throws IOException { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkAccept(impl.getInetAddress().getHostAddress(), impl.getLocalPort()); Socket socket = new Socket(); try { implAccept(socket); } catch (IOException e) { try { socket.close(); } catch (IOException e2) { // Ignore. } throw e; } return socket; }
|
public Socket accept() throws IOException { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkAccept(impl.getInetAddress().getHostAddress(), impl.getLocalPort()); Socket socket = new Socket(); try { implAccept(socket); } catch (IOException e) { try { socket.close(); } catch (IOException e2) { // Ignore. } throw e; } return socket; }
| 1,772
|
public Gui5250(SessionConfig config) { propFileName = config.getConfigurationResource(); sesConfig = config; enableEvents(AWTEvent.WINDOW_EVENT_MASK | AWTEvent.KEY_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
|
public Gui5250(SessionConfig config) { propFileName = config.getConfigurationResource(); sesConfig = config; enableEvents(AWTEvent.WINDOW_EVENT_MASK | AWTEvent.KEY_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
| 1,773
|
public Bus(Bus parent) { this.parent = parent; this.parentDevice = null; }
|
public Bus(Bus parent) { this.parent = parent; this.parentDevice = null; }
| 1,774
|
public DeviceException(String s) { super(s); }
|
public DeviceException(String s) { super(s); }
| 1,775
|
private FloatItem(int kind, Register reg, int offsetToFP, float value) { super(kind, reg, offsetToFP); this.value = value; }
|
private FloatItem(int kind, Register reg, int offsetToFP, float value) { super(kind, reg, offsetToFP); this.value = value; }
| 1,776
|
protected WordItem cloneConstant() { return createConst(getValue()); }
|
protected WordItem cloneConstant() { return factory.createFConst(getValue()); }
| 1,777
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
|
public void setStatus(byte attr,byte value,String s) { statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
| 1,779
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
| 1,780
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
| 1,781
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
| 1,782
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
|
public void setStatus(byte attr,byte value,String s) { Graphics2D g2d = getWritingArea(); statusString = s; if (g2d == null) return; try { g2d.setColor(colorBg); g2d.fill(sArea); float Y = ((int)sArea.getY() + fmHeight)- (lm.getLeading() + lm.getDescent()); switch (attr) { case STATUS_SYSTEM: if (value == STATUS_VALUE_ON) { statusXSystem =true; g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } else statusXSystem = false; break; case STATUS_ERROR_CODE: if (value == STATUS_VALUE_ON) { g2d.setColor(colorRed); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xError,(float)sArea.getX(),Y); statusErrorCode = true; setKeyboardLocked(true); Toolkit.getDefaultToolkit().beep(); } else { statusErrorCode = false; setKeyboardLocked(false); homePos = saveHomePos; saveHomePos = 0; pendingInsert = false; } break; } updateImage(sArea.getBounds()); g2d.dispose(); } catch (Exception e) { System.out.println(" setStatus " + e.getMessage()); } }
| 1,783
|
protected void resolve() throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
|
protected void resolve(PluginRegistryModel registry) throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
| 1,785
|
protected void resolve() throws PluginException { if (getDeclaringPluginDescriptor().getPluginRegistry().getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
|
protected void resolve() throws PluginException { if (registry.getPluginDescriptor(plugin) == null) { throw new PluginException("Unknown plugin " + plugin + " in import of " + getDeclaringPluginDescriptor().getId()); } }
| 1,786
|
protected void unresolve() throws PluginException { // Nothing to do }
|
protected void unresolve(PluginRegistryModel registry) throws PluginException { // Nothing to do }
| 1,787
|
public int getMinimumDividerLocation(JSplitPane jc) { int value = layoutManager.getInitialLocation(jc.getInsets()); if (layoutManager.components[0] != null) value += layoutManager.minimumSizeOfComponent(0); return value; }
|
public int getMinimumDividerLocation(JSplitPane jc) { int value = layoutManager.getInitialLocation(jc.getInsets()); if (layoutManager.components[0] != null) value += layoutManager.minimumSizeOfComponent(0); return value; }
| 1,788
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; String property; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
| 1,789
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { localizedString = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); localizedString = bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { localizedString = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { localizedString = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
| 1,790
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
| 1,791
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
| 1,792
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
| 1,793
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
|
public static String getLocalizedString(Locale inLocale, String key, String name, boolean checkEnglish, boolean checkRoot) { String localizedString; Hashtable table; if (key.equals("")) return ""; /* Localize to inLocale */ try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", inLocale).getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } /* Localize to default locale */ if (localizedString == null) { try { ResourceBundle bundle; bundle = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation"); table = (Hashtable) bundle.getObject(name); localizedString = (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Localize to English */ if (localizedString == null && checkEnglish) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", Locale.ENGLISH).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return unlocalized version */ if (localizedString == null && checkRoot) { try { table = (Hashtable) ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", new Locale("","","")).getObject(name); localizedString= (String) table.get(key); } catch (MissingResourceException exception) { localizedString = null; } } /* Return original input string */ if (localizedString == null) { localizedString = key; } return localizedString; }
| 1,794
|
private void encodeDer() { ArrayList name = new ArrayList(components.size()); for (Iterator it = components.iterator(); it.hasNext(); ) { Map m = (Map) it.next(); if (m.isEmpty()) continue; Set rdn = new HashSet(); for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); ) { Map.Entry e = (Map.Entry) it.next(); ArrayList atav = new ArrayList(2); atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey())); atav.add(new DERValue(DER.UTF8_STRING, e.getValue())); rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav)); } name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn)); } DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name); encoded = val.getEncoded(); }
|
private void encodeDer() { ArrayList name = new ArrayList(components.size()); for (Iterator it = components.iterator(); it.hasNext(); ) { Map m = (Map) it.next(); if (m.isEmpty()) continue; Set rdn = new HashSet(); for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); ) { Map.Entry e = (Map.Entry) it2.next(); ArrayList atav = new ArrayList(2); atav.add(new DERValue(DER.OBJECT_IDENTIFIER, e.getKey())); atav.add(new DERValue(DER.UTF8_STRING, e.getValue())); rdn.add(new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, atav)); } name.add(new DERValue(DER.SET|DER.CONSTRUCTED, rdn)); } DERValue val = new DERValue(DER.SEQUENCE|DER.CONSTRUCTED, name); encoded = val.getEncoded(); }
| 1,795
|
private String readAttributeType(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch; while ((ch = in.read()) != '=') { if (ch == -1) { if (buf.length() > 0) throw new EOFException(); return null; } if (ch > 127) throw new IOException("Invalid char: " + (char) ch); if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.') buf.append((char) ch); else throw new IOException("Invalid char: " + (char) ch); } return buf.toString(); }
|
private String readAttributeType(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch; while ((ch = in.read()) != '=') { if (ch == -1) { if (buf.length() > 0) throw new EOFException("partial name read: " + buf); return null; } if (ch > 127) throw new IOException("Invalid char: " + (char) ch); if (Character.isLetterOrDigit((char) ch) || ch == '-' || ch == '.') buf.append((char) ch); else throw new IOException("Invalid char: " + (char) ch); } return buf.toString(); }
| 1,797
|
private String readAttributeValue(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch = in.read(); if (ch == '#') { while (true) { ch = in.read(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) buf.append((char) ch); else if (ch == '+' || ch == ',') { sep = ch; String hex = buf.toString(); return new String(toByteArray(hex)); } else throw new IOException("illegal character: " + (char) ch); } } else if (ch == '"') { while (true) { ch = in.read(); if (ch == '"') break; else if (ch == '\\') { ch = in.read(); if (ch == -1) throw new EOFException(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); } else buf.append((char) ch); } sep = in.read(); if (sep != '+' || sep != ',') throw new IOException("illegal character: " + (char) ch); return buf.toString(); } else { while (true) { switch (ch) { case '+': case ',': sep = ch; return buf.toString(); case '\\': ch = in.read(); if (ch == -1) throw new EOFException(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); break; case '=': case '<': case '>': case '#': case ';': throw new IOException("illegal character: " + (char) ch); case -1: throw new EOFException(); default: buf.append((char) ch); } } } }
|
private String readAttributeValue(Reader in) throws IOException { StringBuffer buf = new StringBuffer(); int ch = in.read(); if (ch == '#') { while (true) { ch = in.read(); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) buf.append((char) ch); else if (ch == '+' || ch == ',') { sep = ch; String hex = buf.toString(); return new String(toByteArray(hex)); } else throw new IOException("illegal character: " + (char) ch); } } else if (ch == '"') { while (true) { ch = in.read(); if (ch == '"') break; else if (ch == '\\') { ch = in.read(); if (ch == -1) sep = -1; return buf.toString (); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); } else buf.append((char) ch); } sep = in.read(); if (sep != '+' || sep != ',') throw new IOException("illegal character: " + (char) ch); return buf.toString(); } else { while (true) { switch (ch) { case '+': case ',': sep = ch; return buf.toString(); case '\\': ch = in.read(); if (ch == -1) sep = -1; return buf.toString (); if (('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch)) { int i = Character.digit((char) ch, 16) << 4; ch = in.read(); if (!(('a' <= ch && ch <= 'f') || ('A' <= ch && ch <= 'F') || Character.isDigit((char) ch))) throw new IOException("illegal hex char"); i |= Character.digit((char) ch, 16); buf.append((char) i); } else buf.append((char) ch); break; case '=': case '<': case '>': case '#': case ';': throw new IOException("illegal character: " + (char) ch); case -1: sep = -1; return buf.toString (); default: buf.append((char) ch); } } } }
| 1,798
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { return new AccessibleJList(); }
| 1,800
|
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
|
public void actionPerformed(ActionEvent e) { Object obj = new String(parentPath + entry.getText()); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
| 1,801
|
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
|
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY) filechooser.setCurrentDirectory(f); else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } }
| 1,802
|
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
|
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { String path = list.getSelectedValue().toString(); File f = fsv.createFileObject(path); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
| 1,803
|
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = list.getSelectedValue().toString(); timer.restart(); } }
|
public void mouseClicked(MouseEvent e) { if (list.getSelectedValue() == null) return; FileSystemView fsv = filechooser.getFileSystemView(); if (timer.isRunning() && list.getSelectedValue().toString().equals(lastSelected.toString())) { File f = fsv.createFileObject(lastSelected.toString()); timer.stop(); if (filechooser.isTraversable(f)) { filechooser.setCurrentDirectory(f); filechooser.rescanCurrentDirectory(); } else { filechooser.setSelectedFile(f); filechooser.approveSelection(); closeDialog(); } } else { File f = fsv.createFileObject(list.getSelectedValue().toString()); if (filechooser.isTraversable(f)) { setDirectorySelected(true); setDirectory(f); } else { setDirectorySelected(false); setDirectory(null); } lastSelected = path; parentPath = path.substring(0, path.lastIndexOf("/") + 1); entry.setText(path.substring(path.lastIndexOf("/") + 1)); timer.restart(); } }
| 1,804
|
public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); JTextField entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); }
|
public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); }
| 1,805
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); newaxis.setAxisId(null); // shouldnt have the axisId from refObj } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // create new object appropriately Axis newaxis = new Axis(); newaxis.setXMLAttributes(attrs); // set XML attributes from passed list // Every axis must have *either* axisId *or* an axisIdRef // else, its illegal! String axisId = null; String axisIdRef = null; if ( (axisId = newaxis.getAxisId()) != null || (axisIdRef = newaxis.getAxisIdRef()) != null ) { // add this object to the lookup table, if it has an ID if (axisId != null) { // a warning check, just in case if (AxisObj.containsKey(axisId)) Log.warnln("More than one axis node with axisId=\""+axisId+"\", using latest node." ); // add this into the list of axis objects AxisObj.put(axisId, newaxis); } // If there is a reference object, clone it to get // the new axis if (axisIdRef != null) { if (AxisObj.containsKey(axisIdRef)) { BaseObject refAxisObj = (BaseObject) AxisObj.get(axisIdRef); try { newaxis = (Axis) refAxisObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone axis object. Aborting read."); System.exit(-1); } // override attrs with those in passed list newaxis.setXMLAttributes(attrs); newaxis.setAxisId(findUniqueIdName(AxisObj,newaxis.getAxisId())); AxisObj.put(newaxis.getAxisId(), newaxis); // shouldnt have the axisId from refObj } else { Log.warnln("Error: Reader got an axis with AxisIdRef=\""+axisIdRef+"\" but no previous axis has that id! Ignoring add axis request."); return (Object) null; } } // add this axis to the current array object CurrentArray.addAxis(newaxis); // I dont believe this is actually used // CurrentDatatypeObject = newaxis; } else { Log.errorln("Axis object:"+newaxis+" lacks either axisId or axisIdRef, ignoring!"); } return newaxis; }
| 1,807
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
| 1,808
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. addDataToCurrentArray(myLocator, (String) iter.next(), CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
|
public void action (SaxDocumentHandler handler) { // we stopped reading datanode, lower count by one DataNodeLevel--; // we might still be nested within a data node // if so, return now to accumulate more data within the DATABLOCK if(DataNodeLevel != 0) return; // now we are ready to read in untagged data (both delimited/formmatted styles) // from the DATABLOCK // Note: unfortunately we are reduced to using regex style matching // instead of a buffer read in formatted reads. Come back and // improve this later if possible. XMLDataIOStyle formatObj = CurrentArray.getXMLDataIOStyle(); if ( formatObj instanceof DelimitedXMLDataIOStyle || formatObj instanceof FormattedXMLDataIOStyle ) { // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } Locator myLocator = CurrentArray.createLocator();List iterationList = myLocator.getIterationOrder();Iterator liter = iterationList.iterator();while (liter.hasNext()) { Axis axis = (Axis) liter.next(); Log.errorln("ITERATION AXIS NAME:"+axis.getName());} myLocator.setIterationOrder(AxisReadOrder); CurrentDataFormatIndex = 0; ArrayList strValueList;// boolean dataHasSpecialIntegers = false; // set up appropriate instructions for reading if ( formatObj instanceof FormattedXMLDataIOStyle ) {/* $template = $formatObj->_templateNotation(1); $recordSize = $formatObj->bytes(); $data_has_special_integers = $formatObj->hasSpecialIntegers;*/ // snag the string representation of the values strValueList = formattedSplitStringIntoStringObjects( DATABLOCK.toString(), ((FormattedXMLDataIOStyle) formatObj) ); if (strValueList.size() == 0) { Log.errorln("Error: XDF Reader is unable to acquire formatted data, bad format?"); System.exit(-1); } } else { // snag the string representation of the values strValueList = splitStringIntoStringObjects( DATABLOCK.toString(), ((DelimitedXMLDataIOStyle) formatObj).getDelimiter(), ((DelimitedXMLDataIOStyle) formatObj).getRepeatable(), ((DelimitedXMLDataIOStyle) formatObj).getRecordTerminator() ); } // fire data into dataCube Iterator iter = strValueList.iterator(); while (iter.hasNext()) { DataFormat CurrentDataFormat = DataFormatList[CurrentDataFormatIndex]; // adding data based on what type.. String thisData = (String) iter.next(); addDataToCurrentArray(myLocator, thisData, CurrentDataFormat); // bump up DataFormat appropriately if (MaxDataFormatIndex > 0) { int currentFastAxisCoordinate = myLocator.getAxisLocation(FastestAxis); if ( currentFastAxisCoordinate != LastFastAxisCoordinate ) { LastFastAxisCoordinate = currentFastAxisCoordinate; if (CurrentDataFormatIndex == MaxDataFormatIndex) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; } } myLocator.next(); } } else if ( formatObj instanceof TaggedXMLDataIOStyle ) { // Tagged case: do nothing } else { Log.errorln("ERROR: Completely unknown DATA IO style:"+formatObj.toString() +" aborting read!"); System.exit(-1); } }
| 1,809
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // update the array dataCube with passed attributes CurrentArray.getDataCube().setXMLAttributes(attrs); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); FastestAxis = (AxisInterface) CurrentArray.getAxisList().get(0); LastFastAxisCoordinate = 0; if ( readObj instanceof TaggedXMLDataIOStyle) { TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; return readObj; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // update the array dataCube with passed attributes CurrentArray.getDataCube().setXMLAttributes(attrs); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); FastestAxis = (AxisInterface) CurrentArray.getAxisList().get(0); LastFastAxisCoordinate = -1; if ( readObj instanceof TaggedXMLDataIOStyle) { TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; return readObj; }
| 1,810
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.