bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); LookAndFeel.installColorsAndFont(textComponent, prefix + ".background", prefix + ".foreground", prefix + ".font"); LookAndFeel.installBorder(textComponent, prefix + ".border"); textComponent.setMargin(UIManager.getInsets(prefix + ".margin")); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); // Fetch the colors for enabled/disabled text components. background = UIManager.getColor(prefix + ".background"); inactiveBackground = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor (UIManager.getColor(prefix + ".inactiveForeground")); textComponent.setSelectedTextColor(UIManager.getColor(prefix + ".selectionForeground")); textComponent.setSelectionColor(UIManager.getColor(prefix + ".selectionBackground")); }
|
protected void installDefaults() { Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) textComponent.setHighlighter(createHighlighter()); String prefix = getPropertyPrefix(); LookAndFeel.installColorsAndFont(textComponent, prefix + ".background", prefix + ".foreground", prefix + ".font"); LookAndFeel.installBorder(textComponent, prefix + ".border"); textComponent.setMargin(UIManager.getInsets(prefix + ".margin")); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); // Fetch the colors for enabled/disabled text components. background = UIManager.getColor(prefix + ".background"); inactiveBackground = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor (UIManager.getColor(prefix + ".inactiveForeground")); textComponent.setSelectedTextColor(UIManager.getColor(prefix + ".selectionForeground")); textComponent.setSelectionColor(UIManager.getColor(prefix + ".selectionBackground")); }
| 4,875
|
protected void installListeners() { textComponent.addFocusListener(focuslistener); textComponent.addPropertyChangeListener(updateHandler); installDocumentListeners(); }
|
protected void installListeners() { textComponent.addFocusListener(focuslistener); textComponent.addPropertyChangeListener(updateHandler); installDocumentListeners(); }
| 4,876
|
public void installUI(final JComponent c) { super.installUI(c); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } installDefaults(); installListeners(); installKeyboardActions(); // We need to trigger this so that the view hierarchy gets initialized. modelChanged(); }
|
public void installUI(final JComponent c) { textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } installDefaults(); installListeners(); installKeyboardActions(); // We need to trigger this so that the view hierarchy gets initialized. modelChanged(); }
| 4,877
|
public void installUI(final JComponent c) { super.installUI(c); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } installDefaults(); installListeners(); installKeyboardActions(); // We need to trigger this so that the view hierarchy gets initialized. modelChanged(); }
|
public void installUI(final JComponent c) { super.installUI(c); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } else { doc.addDocumentListener(documentHandler); modelChanged(); } installListeners(); installKeyboardActions(); // We need to trigger this so that the view hierarchy gets initialized. modelChanged(); }
| 4,878
|
public void installUI(final JComponent c) { super.installUI(c); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } installDefaults(); installListeners(); installKeyboardActions(); // We need to trigger this so that the view hierarchy gets initialized. modelChanged(); }
|
public void installUI(final JComponent c) { super.installUI(c); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } installDefaults(); installListeners(); installKeyboardActions(); // We need to trigger this so that the view hierarchy gets initialized. }
| 4,879
|
protected void modelChanged() { if (textComponent == null || rootView == null) return; ViewFactory factory = rootView.getViewFactory(); if (factory == null) return; Document doc = textComponent.getDocument(); if (doc == null) return; installDocumentListeners(); Element elem = doc.getDefaultRootElement(); if (elem == null) return; View view = factory.create(elem); setView(view); }
|
protected void modelChanged() { if (textComponent == null || rootView == null) return; ViewFactory factory = rootView.getViewFactory(); if (factory == null) return; Document doc = textComponent.getDocument(); if (doc == null) return; Element elem = doc.getDefaultRootElement(); if (elem == null) return; View view = factory.create(elem); setView(view); }
| 4,880
|
protected void uninstallListeners() { textComponent.removePropertyChangeListener(updateHandler); textComponent.removeFocusListener(focuslistener); textComponent.getDocument().removeDocumentListener(documentHandler); }
|
protected void uninstallListeners() { textComponent.removeFocusListener(focuslistener); textComponent.getDocument().removeDocumentListener(documentHandler); }
| 4,881
|
public int viewToModel(JTextComponent t, Point pt) { return viewToModel(t, pt, null); }
|
public int viewToModel(JTextComponent t, Point pt) { return viewToModel(t, pt, new Position.Bias[1]); }
| 4,882
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x + offLeft,y+ offTop); // tell waiting threads to wake up lock.notifyAll(); } }
|
public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { log.debug(" we got a null graphic object "); return; } synchronized (lock) { gg2d.drawImage(bi.getSubimage(x,y,width,height),null,x + offLeft,y+ offTop); // tell waiting threads to wake up lock.notifyAll(); } }
| 4,883
|
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println(" bi = null "); lock.wait(); } // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { System.out.println("getDrawingarea : " + ie.getMessage()); return null; } }
|
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) { log.debug(" bi = null "); lock.wait(); } // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { System.out.println("getDrawingarea : " + ie.getMessage()); return null; } }
| 4,884
|
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println(" bi = null "); lock.wait(); } // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { System.out.println("getDrawingarea : " + ie.getMessage()); return null; } }
|
public Graphics2D getDrawingArea() { try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println(" bi = null "); lock.wait(); } // we have the lock and state we're seeking Graphics2D g2; g2 = bi.createGraphics(); // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { log.warn("getDrawingarea : " + ie.getMessage()); return null; } }
| 4,885
|
public Graphics2D getWritingArea(Font font) { Graphics2D g2; // we could be in the middle of creating the graphics because of the // threads, resizing etc.... so lets wait until we have one. // If this causes problems we should implement a thresh-hold of sorts // to keep an infinate loop from occurring. So far not problems try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println( " bi = null wa "); lock.wait(); } // we have the lock and state we're seeking g2 = bi.createGraphics(); if (g2 != null) { if (antialiased) g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2.setFont(font); } // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { System.out.println("getWritingarea : " + ie.getMessage()); return null; } }
|
public Graphics2D getWritingArea(Font font) { Graphics2D g2; // we could be in the middle of creating the graphics because of the // threads, resizing etc.... so lets wait until we have one. // If this causes problems we should implement a thresh-hold of sorts // to keep an infinate loop from occurring. So far not problems try { synchronized (lock) { // wait until there is something to read while (bi == null) { log.debug( " bi = null wa "); lock.wait(); } // we have the lock and state we're seeking g2 = bi.createGraphics(); if (g2 != null) { if (antialiased) g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2.setFont(font); } // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { System.out.println("getWritingarea : " + ie.getMessage()); return null; } }
| 4,886
|
public Graphics2D getWritingArea(Font font) { Graphics2D g2; // we could be in the middle of creating the graphics because of the // threads, resizing etc.... so lets wait until we have one. // If this causes problems we should implement a thresh-hold of sorts // to keep an infinate loop from occurring. So far not problems try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println( " bi = null wa "); lock.wait(); } // we have the lock and state we're seeking g2 = bi.createGraphics(); if (g2 != null) { if (antialiased) g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2.setFont(font); } // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { System.out.println("getWritingarea : " + ie.getMessage()); return null; } }
|
public Graphics2D getWritingArea(Font font) { Graphics2D g2; // we could be in the middle of creating the graphics because of the // threads, resizing etc.... so lets wait until we have one. // If this causes problems we should implement a thresh-hold of sorts // to keep an infinate loop from occurring. So far not problems try { synchronized (lock) { // wait until there is something to read while (bi == null) { System.out.println( " bi = null wa "); lock.wait(); } // we have the lock and state we're seeking g2 = bi.createGraphics(); if (g2 != null) { if (antialiased) g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); g2.setFont(font); } // tell waiting threads to wake up lock.notifyAll(); return g2; } } catch (InterruptedException ie) { log.warn("getWritingarea : " + ie.getMessage()); return null; } }
| 4,887
|
public void setStatus(byte attr,byte value,String s, int fmWidth, int fmHeight, LineMetrics lm, Font font, Color colorBg, Color colorRed, Color colorWhite) { Graphics2D g2d = getWritingArea(font); 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) { g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } 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); } break; } g2d.dispose(); } catch (Exception e) { System.out.println(" gui graphics setStatus " + e.getMessage()); } }
|
public void setStatus(byte attr,byte value,String s, int fmWidth, int fmHeight, LineMetrics lm, Font font, Color colorBg, Color colorRed, Color colorWhite) { Graphics2D g2d = getWritingArea(font); 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) { g2d.setColor(colorWhite); if (s != null) g2d.drawString(s,(float)sArea.getX(),Y); else g2d.drawString(xSystem,(float)sArea.getX(),Y); } 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); } break; } g2d.dispose(); } catch (Exception e) { log.warn(" gui graphics setStatus " + e.getMessage()); } }
| 4,888
|
protected void create(ElementSpec[] data) { // Once the super behaviour is properly implemented it should be sufficient // to simply call super.create(data). super.create(data); }
|
protected void create(DefaultStyledDocument.ElementSpec[] data) { // Once the super behaviour is properly implemented it should be sufficient // to simply call super.create(data). super.create(data); }
| 4,891
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; // FIXME: Create a SecionElement here instead of a BranchElement. // Use createBranchElement() and createLeafElement instead. BranchElement section = new BranchElement(null, null); BranchElement paragraph = new BranchElement(section, null); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); LeafElement leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
|
protected AbstractDocument.AbstractElement createDefaultRoot() { Element[] tmp; // FIXME: Create a SecionElement here instead of a BranchElement. // Use createBranchElement() and createLeafElement instead. BranchElement section = new BranchElement(null, null); BranchElement paragraph = new BranchElement(section, null); tmp = new Element[1]; tmp[0] = paragraph; section.replace(0, 0, tmp); LeafElement leaf = new LeafElement(paragraph, null, 0, 1); tmp = new Element[1]; tmp[0] = leaf; paragraph.replace(0, 0, tmp); return section; }
| 4,892
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { // FIXME: Implement me. throw new Error("not implemented"); }
|
public void setParagraphAttributes(int offset, int length, AttributeSet attributes, boolean replace) { // FIXME: Implement me. int index = offset; while (index < offset + length) { AbstractElement par = (AbstractElement) getParagraphElement(index); AttributeContext ctx = getAttributeContext(); if (replace) par.removeAttributes(par); par.addAttributes(attributes); index = par.getElementCount(); } }
| 4,893
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
| 4,895
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
| 4,896
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
| 4,897
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
|
public boolean moveCursor(MouseEvent e, int pos) { if (!oia.isKeyBoardLocked()) { if (pos < 0) return false; // because getRowColFromPoint returns offset of 1,1 we need to // translate to offset 0,0 // pos -= (numCols + 1); int g = planes.getWhichGUI(pos); // lets check for hot spots if (g >= BUTTON_LEFT && g <= BUTTON_LAST) { StringBuffer aid = new StringBuffer(); boolean aidFlag = true; switch (g) { case BUTTON_RIGHT: case BUTTON_MIDDLE: while (planes.getWhichGUI(--pos) != BUTTON_LEFT) { } case BUTTON_LEFT: if (planes.getChar(pos) == 'F') { pos++; } else aidFlag = false; if (planes.getChar(pos + 1) != '=' && planes.getChar(pos + 1) != '.' && planes.getChar(pos + 1) != '/') { // System.out.println(" Hotspot clicked!!! we will send // characters " + // screen[pos].getChar() + // screen[pos+1].getChar()); aid.append(planes.getChar(pos)); aid.append(planes.getChar(pos + 1)); } else { log.debug(" Hotspot clicked!!! we will send character " + planes.getChar(pos)); aid.append(planes.getChar(pos)); } break; } if (aidFlag) { switch (g) { case BUTTON_LEFT_UP: case BUTTON_MIDDLE_UP: case BUTTON_RIGHT_UP: case BUTTON_ONE_UP: case BUTTON_SB_UP: case BUTTON_SB_GUIDE: sessionVT.sendAidKey(tnvt.AID_ROLL_UP); break; case BUTTON_LEFT_DN: case BUTTON_MIDDLE_DN: case BUTTON_RIGHT_DN: case BUTTON_ONE_DN: case BUTTON_SB_DN: case BUTTON_SB_THUMB: sessionVT.sendAidKey(tnvt.AID_ROLL_DOWN); break; case BUTTON_LEFT_EB: case BUTTON_MIDDLE_EB: case BUTTON_RIGHT_EB: StringBuffer eb = new StringBuffer(); while (planes.getWhichGUI(pos--) != BUTTON_LEFT_EB) ; while (planes.getWhichGUI(pos++) != BUTTON_RIGHT_EB) { eb.append(planes.getChar(pos)); } org.tn5250j.tools.system.OperatingSystem.displayURL(eb .toString()); // take out the log statement when we are sure it is // working log.info("Send to external Browser: " + eb.toString()); break; default: int aidKey = Integer.parseInt(aid.toString()); if (aidKey >= 1 && aidKey <= 12) sessionVT.sendAidKey(0x30 + aidKey); if (aidKey >= 13 && aidKey <= 24) sessionVT.sendAidKey(0xB0 + (aidKey - 12)); } } else { if (screenFields.getCurrentField() != null) { int xPos = screenFields.getCurrentField().startPos(); for (int x = 0; x < aid.length(); x++) { // System.out.println(sr + "," + (sc + x) + " " + // aid.charAt(x)); planes.setChar(xPos + x, aid.charAt(x)); } // System.out.println(aid); screenFields.setCurrentFieldMDT(); sessionVT.sendAidKey(tnvt.AID_ENTER); } } // return back to the calling routine that the cursor was not moved // but something else here was done like aid keys or the such return false; } else { // this is a note to not execute this code here when we // implement // the remain after edit function option. // if (gui.rubberband.isAreaSelected()) { // gui.rubberband.reset(); // gui.repaint(); // } else { goto_XY(pos); isInField(lastPos); // return back to the calling object that the cursor was indeed // moved with in the screen object return true; // } } } return false; }
| 4,898
|
private void distributeSpill(TableColumn[] cols, int spill) { int MIN = 0; int MAX = 0; int PREF = 0; int[] min = new int[cols.length]; int[] max = new int[cols.length]; int[] pref = new int[cols.length]; for (int i = 0; i < cols.length; ++i) { pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; } for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj); } }
|
private void distributeSpill(TableColumn[] cols, int spill) { int MIN = 0; int MAX = 0; int PREF = 0; int[] min = new int[cols.length]; int[] max = new int[cols.length]; int[] pref = new int[cols.length]; for (int i = 0; i < cols.length; ++i) { pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; } for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj); } }
| 4,900
|
private void distributeSpill(TableColumn[] cols, int spill) { int MIN = 0; int MAX = 0; int PREF = 0; int[] min = new int[cols.length]; int[] max = new int[cols.length]; int[] pref = new int[cols.length]; for (int i = 0; i < cols.length; ++i) { pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; } for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj); } }
|
private void distributeSpill(TableColumn[] cols, int spill) { int MIN = 0; int MAX = 0; int PREF = 0; int[] min = new int[cols.length]; int[] max = new int[cols.length]; int[] pref = new int[cols.length]; for (int i = 0; i < cols.length; ++i) { pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; } for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj); } }
| 4,901
|
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int[] pref = new int[ncols]; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getWidth(); pref[i] = p; prefSum += p; if (resizingColumn == col) rCol = i; } int spill = prefSum - getWidth(); if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: cols = new TableColumn[ncols]; for (int i = rCol; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_OFF: default: } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } }
|
public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int[] pref = new int[ncols]; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getWidth(); pref[i] = p; prefSum += p; if (resizingColumn == col) rCol = i; } int spill = getWidth() - prefSum; if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: cols = new TableColumn[ncols]; for (int i = rCol; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); break; case AUTO_RESIZE_OFF: default: } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } }
| 4,902
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute( StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } if (view == null) { String name = element.getName(); if (name.equals(AbstractDocument.ContentElementName)) view = new LabelView(element); else if (name.equals(AbstractDocument.ParagraphElementName)) view = new ParagraphView(element); else if (name.equals(AbstractDocument.SectionElementName)) view = new BoxView(element, View.Y_AXIS); else if (name.equals(StyleConstants.ComponentElementName)) view = new ComponentView(element); else if (name.equals(StyleConstants.IconElementName)) view = new IconView(element); } return view; }
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute( StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } if (view == null) { String name = element.getName(); if (name.equals(AbstractDocument.ContentElementName)) view = new LabelView(element); else if (name.equals(AbstractDocument.ParagraphElementName)) view = new ParagraphView(element); else if (name.equals(AbstractDocument.SectionElementName)) view = new BoxView(element, View.Y_AXIS); else if (name.equals(StyleConstants.ComponentElementName)) view = new ComponentView(element); else if (name.equals(StyleConstants.IconElementName)) view = new IconView(element); } return view; }
| 4,904
|
static final KDF getInstance(final byte[] K) { int ndx = -1; final byte[] keyMaterial; if (K != null) { keyMaterial = K; ndx = 0; } else { keyMaterial = new byte[AES_BLOCK_SIZE]; ndx = new Random ().nextInt (256); // XXX does this need to be secure? } return new KDF(keyMaterial, ndx); }
|
static final KDF getInstance(final byte[] K) { int ndx = -1; final byte[] keyMaterial; if (K != null) { keyMaterial = K; ndx = 0; } else { keyMaterial = new byte[AES_BLOCK_SIZE]; while (ndx < 1 || ndx > 255) ndx = (byte) nextByte(); // XXX does this need to be secure? } return new KDF(keyMaterial, ndx); }
| 4,906
|
public int getLayer(Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return ((Integer) componentToLayer.get(c)).intValue(); }
|
public int getLayer(Component c) { if (! componentToLayer.containsKey (c)) throw new IllegalArgumentException (); return ((Integer) componentToLayer.get(c)).intValue(); }
| 4,907
|
protected ChangeListener createChangeListener(JComponent c) { return new ChangeHandler(); }
|
protected ChangeListener createChangeListener(JComponent c) { return new ChangeHandler((JMenu) c, this); }
| 4,908
|
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 () { 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 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 pthread.yield(); } }
| 4,909
|
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
|
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) { if (! updateChildren(ec, ev, vf)) ec = null; } forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
| 4,910
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
| 4,912
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
| 4,913
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
| 4,914
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
| 4,915
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
| 4,916
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); forwardUpdateToView(child, ev, shape, vf); } } } }
|
protected void forwardUpdate(DocumentEvent.ElementChange ec, DocumentEvent ev, Shape shape, ViewFactory vf) { int count = getViewCount(); if (count > 0) { int startOffset = ev.getOffset(); int endOffset = startOffset + ev.getLength(); int startIndex = getViewIndex(startOffset, Position.Bias.Backward); int endIndex = getViewIndex(endOffset, Position.Bias.Forward); int index = -1; int addLength = -1; if (ec != null) { index = ec.getIndex(); addLength = ec.getChildrenAdded().length; } if (startIndex >= 0 && endIndex >= 0) { for (int i = startIndex; i <= endIndex; i++) { // Skip newly added child views. if (index >= 0 && i >= index && i < (index+addLength)) continue; View child = getView(i); if (child != null) { Shape childAlloc = getChildAllocation(i, shape); forwardUpdateToView(child, ev, childAlloc, vf); } } } } }
| 4,917
|
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) updateChildren(ec, ev, vf); forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
|
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { Element el = getElement(); DocumentEvent.ElementChange ec = ev.getChange(el); if (ec != null) { if (! updateChildren(ec, ev, vf)) ec = null; } forwardUpdate(ec, ev, shape, vf); updateLayout(ec, ev, shape); }
| 4,918
|
public int getIntData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getInt(longDataArray.get(longIndex), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
|
public int getIntData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getInt(longDataArray.get(longIndex+1), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
| 4,919
|
public long getLongData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getLong(longDataArray.get(longIndex), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
|
public long getLongData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getLong(longDataArray.get(longIndex+1), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
| 4,920
|
public short getShortData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getShort(longDataArray.get(longIndex), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
|
public short getShortData (Locator locator) throws NoDataException { int longIndex = getLongArrayIndex(locator); int shortIndex = getShortArrayIndex(locator); try { if (java.lang.reflect.Array.getByte(longDataArray.get(longIndex), shortIndex) !=1) throw new NoDataException(); //the location we try to access contains noDataValue return java.lang.reflect.Array.getShort(longDataArray.get(longIndex+1), shortIndex); } catch (Exception e) { //the location we try to access is not allocated, //i.e., no data in the cell throw new NoDataException(); } }
| 4,921
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame awtFrame) { super(toolkit, awtFrame, new SwingFrame(awtFrame)); jComponent.initialize(this); SwingToolkit.copyAwtProperties(awtFrame, this.jComponent); jComponent.getContentPane().setLayout(new SwingFrameLayout(this)); jComponent.setLocation(awtFrame.getLocation()); jComponent.setSize(awtFrame.getSize()); setResizable(awtFrame.isResizable()); jComponent.setIconifiable(true); jComponent.setMaximizable(true); jComponent.setClosable(true); try { jComponent.setIcon(awtFrame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(awtFrame.getState()); jComponent.setTitle(awtFrame.getTitle()); //frame.setIconImage(awtFrame.getIconImage()); setMenuBar(awtFrame.getMenuBar()); desktopPane.add(jComponent); desktopPane.setSelectedFrame(jComponent); jComponent.toFront(); desktopPane.doLayout(); }
|
public SwingFramePeer(SwingToolkit toolkit, JDesktopPane desktopPane, Frame awtFrame) { super(toolkit, awtFrame, new SwingFrame(awtFrame)); jComponent.initialize(this); SwingToolkit.copyAwtProperties(awtFrame, this.jComponent); jComponent.getContentPane().setLayout(new SwingContainerLayout(this)); jComponent.setLocation(awtFrame.getLocation()); jComponent.setSize(awtFrame.getSize()); setResizable(awtFrame.isResizable()); jComponent.setIconifiable(true); jComponent.setMaximizable(true); jComponent.setClosable(true); try { jComponent.setIcon(awtFrame.getState() == Frame.ICONIFIED); } catch (PropertyVetoException x) { } setState(awtFrame.getState()); jComponent.setTitle(awtFrame.getTitle()); //frame.setIconImage(awtFrame.getIconImage()); setMenuBar(awtFrame.getMenuBar()); desktopPane.add(jComponent); desktopPane.setSelectedFrame(jComponent); jComponent.toFront(); desktopPane.doLayout(); }
| 4,926
|
public void clear() { synchronized (lock) { vector.clear(); lock.notify(); } }
|
public void clear() { synchronized (lock) { vector.clear(); lock.notifyAll(); } }
| 4,927
|
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); /** * @todo here is the throttling code to look at * * just something here to try. OK it works but we need to be a little * more intelligent with the throttling. */ if (vector.size() >= 20) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);// System.out.println(vector.size()); } // we have the lock and state we're seeking return vector.remove(0); } }
|
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) { lock.wait(); /** * @todo here is the throttling code to look at * * just something here to try. OK it works but we need to be a little * more intelligent with the throttling. */ if (vector.size() >= 20) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);// System.out.println(vector.size()); } // we have the lock and state we're seeking return vector.remove(0); } }
| 4,928
|
public void put(Object o) { synchronized (lock) { vector.addElement(o);// if (vector.size() > 5)// System.out.println(vector.size()); // tell waiting threads to wake up lock.notify(); } }
|
public void put(Object o) { synchronized (lock) { vector.addElement(o);// if (vector.size() > 5)// System.out.println(vector.size()); // tell waiting threads to wake up lock.notifyAll(); } }
| 4,930
|
void visitParameter(Parameter p);
|
public void visitParameter(Parameter p);
| 4,931
|
String visitValue(String s, boolean last, int tokenType);
|
public String visitValue(String s, boolean last, int tokenType);
| 4,932
|
public void visitParameter(Parameter p) { this.param = p; String s = p.getName(); if( !Parameter.ANONYMOUS.equals(s) ) { line += "-" + s + " "; } }
|
public void visitParameter(Parameter p) { this.param = p; String s = p.getName(); if( !Parameter.ANONYMOUS.equals(s) ) { line += "-" + s + " "; } }
| 4,933
|
private void clearArguments() { for (int i = 0; i < params.length; i++) if (params[i].hasArgument()) params[i].getArgument().clear(); }
|
private void clearArguments() { for (int i = 0; i < params.length; i++) if (params[i].hasArgument()) params[i].getArgument().clear(); }
| 4,934
|
public String complete(CommandLine partial) throws CompletionException { CompletionVisitor visitor = new CompletionVisitor(); try { visitCommandLine(partial, visitor); } catch(SyntaxError ex) { throw new CompletionException(ex.getMessage()); } return visitor.getCompletedLine(); }
|
public String complete(CommandLine partial) throws CompletionException { CompletionVisitor visitor = new CompletionVisitor(); try { visitCommandLine(partial, visitor); } catch(SyntaxError ex) { throw new CompletionException(ex.getMessage()); } return visitor.getCompletedLine(); }
| 4,935
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
| 4,936
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
| 4,937
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
|
synchronized ParsedArguments parse(String[] args) throws SyntaxError { if (params.length == 0) { if( args.length == 0 ) return new ParsedArguments(new HashMap()); throw new SyntaxError("Syntax takes no parameter"); } CommandLine cmdLine = new CommandLine(args); ParseVisitor visitor = new ParseVisitor(); visitCommandLine(cmdLine, visitor); ParsedArguments result = new ParsedArguments(visitor.getArgumentMap()); // check if all mandatory parameters are set for( int i = 0; i < params.length; i++ ) if( !params[i].isOptional() && !params[i].isSet(result) ) throw new SyntaxError("Mandatory parameter " + params[i].getName() + " not set"); return result; }
| 4,938
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
| 4,939
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
| 4,940
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
| 4,941
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
|
private synchronized void visitCommandLine(CommandLine cmdLine, CommandLineVisitor visitor) { clearArguments(); Parameter param = null; do { String s = ""; if( cmdLine.hasNext() ) s = cmdLine.next(); // TODO: it didn't handle correctly the parameters starting with "-" /*if (s.startsWith("-") && (cmdLine.getTokenType() == CommandLine.LITERAL)) { // we got a named parameter here if (param != null) // last param takes an argument, but it's not given throw new SyntaxError("Unexpected Parameter " + s); param = getParameter(s.substring(1)); if (param == null) throw new SyntaxError("Unknown Parameter \"" + s + "\""); visitor.visitParameter(param); } else { // we got an argument */ if (param == null) {// must be an argument for an anonymous parameter param = getAnonymousParameter(); if (param == null) {// but...there are no more of them throw new SyntaxError("Unexpected argument \"" + s + "\""); } else { visitor.visitParameter(param); } //} // no check if there is an argument, as else we would have exited before (Parameter satisfied) Argument arg = param.getArgument(); String value = visitor.visitValue(s, !cmdLine.hasNext(), cmdLine.getTokenType()); if( value != null ) arg.setValue(value); } if (param.isSatisfied()) param = null; } while (cmdLine.hasNext()); }
| 4,942
|
private void processChild(Object child) { final int gcColor = helper.getObjectColor(child); if (gcColor <= GC_WHITE) { // Yellow or White helper.atomicChangeObjectColor(child, gcColor, GC_GREY); stack.push(child); } }
|
private void processChild(Object child) { final int gcColor = helper.getObjectColor(child); if (gcColor <= GC_WHITE) { // Yellow or White helper.atomicChangeObjectColor(child, gcColor, GC_GREY); try { helper.getVmClass(child); stack.push(child); } catch (NullPointerException ex) { Unsafe.debug("\nObject address "); Unsafe.debug(helper.addressOf32(child)); Unsafe.debug("\nObject TIB "); Unsafe.debug(helper.addressOf32(helper.getTib(child))); helper.die("NPE in processChild; probably corrupted heap"); } } }
| 4,944
|
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory fv) { setPropertiesFromAttributes(); }
|
public void changedUpdate(DocumentEvent ev, Shape a, ViewFactory vf) { setPropertiesFromAttributes(); }
| 4,947
|
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
|
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = 0.5F; else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
| 4,949
|
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else align = 0.0F; return align; }
|
public float getAlignment(int axis) { float align; if (axis == X_AXIS) align = super.getAlignment(axis); else if (getViewCount() > 0) { float prefHeight = getPreferredSpan(Y_AXIS); float firstRowHeight = getView(0).getPreferredSpan(Y_AXIS); align = (firstRowHeight / 2.F) / prefHeight; } else align = 0.5F; return align; }
| 4,950
|
private static Class getRepresentationClassFromMime(String mimeString, ClassLoader classLoader) { String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException("classname: " + e.getMessage()); } } else return java.io.InputStream.class; }
|
private static Class getRepresentationClassFromMime(String mimeString, ClassLoader classLoader) { String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { IllegalArgumentException iae; iae = new IllegalArgumentException("mimeString: " + mimeString + " classLoader: " + classLoader); iae.initCause(e); throw iae; } } else return java.io.InputStream.class; }
| 4,951
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return Class.forName(className); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,952
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,953
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { ClassLoader loader = ClassLoader.getSystemClassLoader(); return Class.forName(className, true, loader); } catch(ClassNotFoundException cnfe) { } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,954
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } */ // FIXME: What is the context class loader? /* try { } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,955
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return Class.forName(className, true, loader); } catch(ClassNotFoundException cnfe) { } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,956
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,957
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
|
protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException { try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Exception e) { ; } try { return(ClassLoader.getSystemClassLoader().findClass(className)); } catch(Exception e) { ; } */ // FIXME: What is the context class loader? /* try { } catch(Exception e) { ; } */ if (classLoader != null) return(classLoader.loadClass(className)); else throw new ClassNotFoundException(className); }
| 4,958
|
public void init(TestConfig config, MockObjectTestCase testCase) throws NameAlreadyBoundException, NamingException, IllegalArgumentException, DriverException, ResourceNotFreeException { IDEDiskDriver driver = new IDEDiskDriver(); // set the current testCase for our factory MockIDEDeviceFactory factory = (MockIDEDeviceFactory) FSDriverUtils.getIDEDeviceFactory(); factory.setTestCase(testCase); // create stub resource manager MockObjectFactory.createResourceManager(testCase); // create stub IDE device Device parent = createParentDevice(DEVICE_SIZE); IDEDevice device = MockObjectFactory.createIDEDevice(parent, testCase, true, SLOW_DEVICE_SIZE); init(null, driver, device); }
|
public void init(TestConfig config, MockObjectTestCase testCase) throws NameAlreadyBoundException, NamingException, IllegalArgumentException, DriverException, ResourceNotFreeException { IDEDiskDriver driver = new IDEDiskDriver(); // set the current testCase for our factory MockIDEDeviceFactory factory = (MockIDEDeviceFactory) IDEDriverUtils.getIDEDeviceFactory(); factory.setTestCase(testCase); // create stub resource manager MockObjectFactory.createResourceManager(testCase); // create stub IDE device Device parent = createParentDevice(DEVICE_SIZE); IDEDevice device = MockObjectFactory.createIDEDevice(parent, testCase, true, SLOW_DEVICE_SIZE); init(null, driver, device); }
| 4,959
|
public static Toolkit getDefaultToolkit() { if (toolkit != null) return toolkit; String toolkit_name = System.getProperty("awt.toolkit", default_toolkit_name); try { Class cls = Class.forName(toolkit_name); Object obj = cls.newInstance(); if (!(obj instanceof Toolkit)) throw new AWTError(toolkit_name + " is not a subclass of " + "java.awt.Toolkit"); toolkit = (Toolkit) obj; return toolkit; } catch (ThreadDeath death) { throw death; } catch (Throwable t) { AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name); throw (AWTError) e.initCause(t); } }
|
public static Toolkit getDefaultToolkit() { if (toolkit != null) return toolkit; String toolkit_name = System.getProperty("awt.toolkit", default_toolkit_name); try { ClassLoader cl = Thread.currentThread().getContextClassLoader(); Class cls = cl.loadClass(toolkit_name); Object obj = cls.newInstance(); if (!(obj instanceof Toolkit)) throw new AWTError(toolkit_name + " is not a subclass of " + "java.awt.Toolkit"); toolkit = (Toolkit) obj; return toolkit; } catch (ThreadDeath death) { throw death; } catch (Throwable t) { AWTError e = new AWTError("Cannot load AWT toolkit: " + toolkit_name); throw (AWTError) e.initCause(t); } }
| 4,960
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 4,961
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 4,962
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ System.out.println("Got param" + getParm("-dn",args)); sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
|
synchronized void newSession(String sel,String[] args) { Properties sesProps = new Properties(); String propFileName = null; String session = args[0]; // Start loading properties sesProps.put(SESSION_HOST,session); if (isSpecified("-e",args)) sesProps.put(SESSION_TN_ENHANCED,"1"); if (isSpecified("-p",args)) { sesProps.put(SESSION_HOST_PORT,getParm("-p",args)); } if (isSpecified("-f",args)) propFileName = getParm("-f",args); if (isSpecified("-cp",args)) sesProps.put(SESSION_CODE_PAGE ,getParm("-cp",args)); if (isSpecified("-gui",args)) sesProps.put(SESSION_USE_GUI,"1"); if (isSpecified("-132",args)) sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_27X132_STR); else sesProps.put(SESSION_SCREEN_SIZE,SCREEN_SIZE_24X80_STR); // are we to use a socks proxy if (isSpecified("-usp",args)) { // socks proxy host argument if (isSpecified("-sph",args)) { sesProps.put(SESSION_PROXY_HOST ,getParm("-sph",args)); } // socks proxy port argument if (isSpecified("-spp",args)) sesProps.put(SESSION_PROXY_PORT ,getParm("-spp",args)); } // are we to use a ssl and if we are what type if (isSpecified("-sslType",args)) { sesProps.put(SSL_TYPE,getParm("-sslType",args)); } System.out.println("args IS -------------'" + args); // check if device name is specified if (isSpecified("-dn=hostname",args)){ String dnParam; // use IP address as device name try{ dnParam = InetAddress.getLocalHost().getHostName(); } catch(UnknownHostException uhe){ dnParam = "UNKNOWN_HOST"; } System.out.println("DNNAME IS -------------'" + dnParam); sesProps.put(SESSION_DEVICE_NAME ,dnParam); } else if (isSpecified("-dn",args)){ sesProps.put(SESSION_DEVICE_NAME ,getParm("-dn",args)); } Session s = manager.openSession(sesProps,propFileName,sel); if (!frame1.isVisible()) { splash.updateProgress(++step); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } else { if (isSpecified("-noembed",args)) { splash.updateProgress(++step); newView(); frame1.setVisible(true); splash.setVisible(false); frame1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } if (isSpecified("-t",args)) frame1.addSessionView(sel,s); else frame1.addSessionView(session,s); s.connect(); }
| 4,963
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute(StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); else if (tag == HTML.Tag.HEAD) view = new NullView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } return view; }
|
public View create(Element element) { View view = null; Object attr = element.getAttributes().getAttribute(StyleConstants.NameAttribute); if (attr instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag) attr; if (tag.equals(HTML.Tag.IMPLIED) || tag.equals(HTML.Tag.P) || tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4) || tag.equals(HTML.Tag.H5) || tag.equals(HTML.Tag.H6) || tag.equals(HTML.Tag.DT)) view = new ParagraphView(element); else if (tag.equals(HTML.Tag.LI) || tag.equals(HTML.Tag.DL) || tag.equals(HTML.Tag.DD) || tag.equals(HTML.Tag.BODY) || tag.equals(HTML.Tag.HTML) || tag.equals(HTML.Tag.CENTER) || tag.equals(HTML.Tag.DIV) || tag.equals(HTML.Tag.BLOCKQUOTE) || tag.equals(HTML.Tag.PRE)) view = new BlockView(element, View.Y_AXIS); // FIXME: Uncomment when the views have been implemented else if (tag.equals(HTML.Tag.CONTENT)) view = new InlineView(element); else if (tag == HTML.Tag.HEAD) view = new NullView(element); /* else if (tag.equals(HTML.Tag.MENU) || tag.equals(HTML.Tag.DIR) || tag.equals(HTML.Tag.UL) || tag.equals(HTML.Tag.OL)) view = new ListView(element); else if (tag.equals(HTML.Tag.IMG)) view = new ImageView(element); else if (tag.equals(HTML.Tag.HR)) view = new HRuleView(element); else if (tag.equals(HTML.Tag.BR)) view = new BRView(element); else if (tag.equals(HTML.Tag.TABLE)) view = new TableView(element); else if (tag.equals(HTML.Tag.INPUT) || tag.equals(HTML.Tag.SELECT) || tag.equals(HTML.Tag.TEXTAREA)) view = new FormView(element); else if (tag.equals(HTML.Tag.OBJECT)) view = new ObjectView(element); else if (tag.equals(HTML.Tag.FRAMESET)) view = new FrameSetView(element); else if (tag.equals(HTML.Tag.FRAME)) view = new FrameView(element); */ } return view; }
| 4,964
|
public Vector getDirectories() { Vector tmp = new Vector(); for (int i = 0; i < directories; i++) tmp.add(contents.get(i)); return tmp; }
|
public Vector getDirectories() { Vector tmp = new Vector(); for (int i = 0; i < directories; i++) tmp.add(contents.get(i)); return tmp; }
| 4,968
|
public Object getElementAt(int index) { if (index > getSize() - 1) return null; if (listingMode == JFileChooser.FILES_ONLY) return contents.get(directories + index); else return contents.elementAt(index); }
|
public Object getElementAt(int index) { if (index > getSize() - 1) return null; if (listingMode == JFileChooser.FILES_ONLY) return contents.get(directories + index); else return contents.elementAt(index); }
| 4,969
|
public Vector getFiles() { Vector tmp = new Vector(); for (int i = directories; i < getSize(); i++) tmp.add(contents.get(i)); return tmp; }
|
public Vector getFiles() { Vector tmp = new Vector(); for (int i = directories; i < getSize(); i++) tmp.add(contents.get(i)); return tmp; }
| 4,970
|
public int getSize() { if (listingMode == JFileChooser.DIRECTORIES_ONLY) return directories; else if (listingMode == JFileChooser.FILES_ONLY) return contents.size() - directories; return contents.size(); }
|
public int getSize() { if (listingMode == JFileChooser.DIRECTORIES_ONLY) return directories; else if (listingMode == JFileChooser.FILES_ONLY) return contents.size() - directories; return contents.size(); }
| 4,971
|
public int indexOf(Object o) { if (listingMode == JFileChooser.FILES_ONLY) return contents.indexOf(o) - directories; return contents.indexOf(o); }
|
public int indexOf(Object o) { if (listingMode == JFileChooser.FILES_ONLY) return contents.indexOf(o) - directories; return contents.indexOf(o); }
| 4,972
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY)) listingMode = filechooser.getFileSelectionMode(); }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY)) listingMode = filechooser.getFileSelectionMode(); }
| 4,973
|
public boolean renameFile(File oldFile, File newFile) { // FIXME: implement return false; }
|
public boolean renameFile(File oldFile, File newFile) { // FIXME: implement return oldFile.renameTo( newFile ); }
| 4,974
|
protected void sort(Vector v) { Collections.sort(v, comparator); Enumeration e = Collections.enumeration(v); Vector tmp = new Vector(); for (; e.hasMoreElements();) tmp.add(e.nextElement()); contents = tmp; }
|
protected void sort(Vector v) { Collections.sort(v, comparator); Enumeration e = Collections.enumeration(v); Vector tmp = new Vector(); for (; e.hasMoreElements();) tmp.add(e.nextElement()); contents = tmp; }
| 4,975
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
| 4,976
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
| 4,977
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
| 4,978
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
|
public void validateFileCache() { contents.clear(); directories = 0; FileSystemView fsv = filechooser.getFileSystemView(); File[] list = fsv.getFiles(filechooser.getCurrentDirectory(), filechooser.isFileHidingEnabled()); if (list == null) return; for (int i = 0; i < list.length; i++) { if (list[i] == null) continue; if (filechooser.accept(list[i])) { contents.add(list[i]); if (filechooser.isTraversable(list[i])) directories++; } } sort(contents); filechooser.revalidate(); filechooser.repaint(); }
| 4,979
|
private String createO(final String aol) throws AuthenticationException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> createO(\"" + aol + "\")"); boolean replaydetectionAvailable = false; boolean integrityAvailable = false; boolean confidentialityAvailable = false; String option, mandatory = SRPRegistry.DEFAULT_MANDATORY; int i; String mdName = SRPRegistry.SRP_DEFAULT_DIGEST_NAME; final StringTokenizer st = new StringTokenizer(aol, ","); while (st.hasMoreTokens()) { option = st.nextToken(); if (option.startsWith(SRPRegistry.OPTION_SRP_DIGEST + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "mda: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.SRP_ALGORITHMS[i].equals(option)) { mdName = option; break; } } } else if (option.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { replaydetectionAvailable = true; } else if (option.startsWith(SRPRegistry.OPTION_INTEGRITY + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "ialg: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.INTEGRITY_ALGORITHMS[i].equals(option)) { chosenIntegrityAlgorithm = option; integrityAvailable = true; break; } } } else if (option.startsWith(SRPRegistry.OPTION_CONFIDENTIALITY + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "calg: <" + option + ">"); for (i = 0; i < SRPRegistry.CONFIDENTIALITY_ALGORITHMS.length; i++) { if (SRPRegistry.CONFIDENTIALITY_ALGORITHMS[i].equals(option)) { chosenConfidentialityAlgorithm = option; confidentialityAvailable = true; break; } } } else if (option.startsWith(SRPRegistry.OPTION_MANDATORY + "=")) { mandatory = option.substring(option.indexOf('=') + 1); } else if (option.startsWith(SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=")) { final String maxBufferSize = option.substring(option.indexOf('=') + 1); try { rawSendSize = Integer.parseInt(maxBufferSize); if (rawSendSize > Registry.SASL_BUFFER_MAX_LIMIT || rawSendSize < 1) { throw new AuthenticationException( "Illegal value for 'maxbuffersize' option"); } } catch (NumberFormatException x) { throw new AuthenticationException( SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=" + String.valueOf(maxBufferSize), x); } } } replayDetection = replaydetectionAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_REPLAY_DETECTION)).booleanValue(); boolean integrity = integrityAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_INTEGRITY_PROTECTION)).booleanValue(); boolean confidentiality = confidentialityAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_CONFIDENTIALITY)).booleanValue(); // make sure we do the right thing if (SRPRegistry.OPTION_REPLAY_DETECTION.equals(mandatory)) { replayDetection = true; integrity = true; } else if (SRPRegistry.OPTION_INTEGRITY.equals(mandatory)) { integrity = true; } else if (SRPRegistry.OPTION_CONFIDENTIALITY.equals(mandatory)) { confidentiality = true; } if (replayDetection) { if (chosenIntegrityAlgorithm == null) { throw new AuthenticationException( "Replay detection is required but no " + "integrity protection algorithm was chosen"); } } if (integrity) { if (chosenIntegrityAlgorithm == null) { throw new AuthenticationException( "Integrity protection is required but no " + "algorithm was chosen"); } } if (confidentiality) { if (chosenConfidentialityAlgorithm == null) { throw new AuthenticationException( "Confidentiality protection is required " + "but no algorithm was chosen"); } } // 1. check if we'll be using confidentiality; if not set IV to 0-byte if (chosenConfidentialityAlgorithm == null) { cIV = new byte[0]; } else { // 2. get the block size of the cipher final IBlockCipher cipher = CipherFactory.getInstance(chosenConfidentialityAlgorithm); if (cipher == null) { throw new AuthenticationException("createO()", new NoSuchAlgorithmException()); } final int blockSize = cipher.defaultBlockSize(); // 3. generate random iv cIV = new byte[blockSize]; new SecureRandom ().nextBytes(cIV); } srp = SRP.instance(mdName); // Now create the options list specifying which of the available options // we have chosen. // For now we just select the defaults. Later we need to add support for // properties (perhaps in a file) where a user can specify the list of // algorithms they would prefer to use. final StringBuffer sb = new StringBuffer(); sb.append(SRPRegistry.OPTION_SRP_DIGEST).append("=").append(mdName).append( ","); if (replayDetection) { sb.append(SRPRegistry.OPTION_REPLAY_DETECTION).append(","); } if (integrity) { sb.append(SRPRegistry.OPTION_INTEGRITY).append("=").append( chosenIntegrityAlgorithm).append( ","); } if (confidentiality) { sb.append(SRPRegistry.OPTION_CONFIDENTIALITY).append("=").append( chosenConfidentialityAlgorithm).append( ","); } final String result = sb.append(SRPRegistry.OPTION_MAX_BUFFER_SIZE).append( "=").append( Registry.SASL_BUFFER_MAX_LIMIT).toString(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== createO() --> " + result); return result; }
|
private String createO(final String aol) throws AuthenticationException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> createO(\"" + aol + "\")"); boolean replaydetectionAvailable = false; boolean integrityAvailable = false; boolean confidentialityAvailable = false; String option, mandatory = SRPRegistry.DEFAULT_MANDATORY; int i; String mdName = SRPRegistry.SRP_DEFAULT_DIGEST_NAME; final StringTokenizer st = new StringTokenizer(aol, ","); while (st.hasMoreTokens()) { option = st.nextToken(); if (option.startsWith(SRPRegistry.OPTION_SRP_DIGEST + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "mda: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.SRP_ALGORITHMS[i].equals(option)) { mdName = option; break; } } } else if (option.equals(SRPRegistry.OPTION_REPLAY_DETECTION)) { replaydetectionAvailable = true; } else if (option.startsWith(SRPRegistry.OPTION_INTEGRITY + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "ialg: <" + option + ">"); for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++) { if (SRPRegistry.INTEGRITY_ALGORITHMS[i].equals(option)) { chosenIntegrityAlgorithm = option; integrityAvailable = true; break; } } } else if (option.startsWith(SRPRegistry.OPTION_CONFIDENTIALITY + "=")) { option = option.substring(option.indexOf('=') + 1); if (DEBUG && debuglevel > 6) debug(TRACE, "calg: <" + option + ">"); for (i = 0; i < SRPRegistry.CONFIDENTIALITY_ALGORITHMS.length; i++) { if (SRPRegistry.CONFIDENTIALITY_ALGORITHMS[i].equals(option)) { chosenConfidentialityAlgorithm = option; confidentialityAvailable = true; break; } } } else if (option.startsWith(SRPRegistry.OPTION_MANDATORY + "=")) { mandatory = option.substring(option.indexOf('=') + 1); } else if (option.startsWith(SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=")) { final String maxBufferSize = option.substring(option.indexOf('=') + 1); try { rawSendSize = Integer.parseInt(maxBufferSize); if (rawSendSize > Registry.SASL_BUFFER_MAX_LIMIT || rawSendSize < 1) { throw new AuthenticationException( "Illegal value for 'maxbuffersize' option"); } } catch (NumberFormatException x) { throw new AuthenticationException( SRPRegistry.OPTION_MAX_BUFFER_SIZE + "=" + String.valueOf(maxBufferSize), x); } } } replayDetection = replaydetectionAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_REPLAY_DETECTION)).booleanValue(); boolean integrity = integrityAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_INTEGRITY_PROTECTION)).booleanValue(); boolean confidentiality = confidentialityAvailable && Boolean.valueOf( (String) properties.get(SRPRegistry.SRP_CONFIDENTIALITY)).booleanValue(); // make sure we do the right thing if (SRPRegistry.OPTION_REPLAY_DETECTION.equals(mandatory)) { replayDetection = true; integrity = true; } else if (SRPRegistry.OPTION_INTEGRITY.equals(mandatory)) { integrity = true; } else if (SRPRegistry.OPTION_CONFIDENTIALITY.equals(mandatory)) { confidentiality = true; } if (replayDetection) { if (chosenIntegrityAlgorithm == null) { throw new AuthenticationException( "Replay detection is required but no " + "integrity protection algorithm was chosen"); } } if (integrity) { if (chosenIntegrityAlgorithm == null) { throw new AuthenticationException( "Integrity protection is required but no " + "algorithm was chosen"); } } if (confidentiality) { if (chosenConfidentialityAlgorithm == null) { throw new AuthenticationException( "Confidentiality protection is required " + "but no algorithm was chosen"); } } // 1. check if we'll be using confidentiality; if not set IV to 0-byte if (chosenConfidentialityAlgorithm == null) { cIV = new byte[0]; } else { // 2. get the block size of the cipher final IBlockCipher cipher = CipherFactory.getInstance(chosenConfidentialityAlgorithm); if (cipher == null) { throw new AuthenticationException("createO()", new NoSuchAlgorithmException()); } final int blockSize = cipher.defaultBlockSize(); // 3. generate random iv cIV = new byte[blockSize]; getDefaultPRNG().nextBytes(cIV); } srp = SRP.instance(mdName); // Now create the options list specifying which of the available options // we have chosen. // For now we just select the defaults. Later we need to add support for // properties (perhaps in a file) where a user can specify the list of // algorithms they would prefer to use. final StringBuffer sb = new StringBuffer(); sb.append(SRPRegistry.OPTION_SRP_DIGEST).append("=").append(mdName).append( ","); if (replayDetection) { sb.append(SRPRegistry.OPTION_REPLAY_DETECTION).append(","); } if (integrity) { sb.append(SRPRegistry.OPTION_INTEGRITY).append("=").append( chosenIntegrityAlgorithm).append( ","); } if (confidentiality) { sb.append(SRPRegistry.OPTION_CONFIDENTIALITY).append("=").append( chosenConfidentialityAlgorithm).append( ","); } final String result = sb.append(SRPRegistry.OPTION_MAX_BUFFER_SIZE).append( "=").append( Registry.SASL_BUFFER_MAX_LIMIT).toString(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== createO() --> " + result); return result; }
| 4,980
|
private byte[] sendIdentities() throws SaslException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> sendIdentities()"); // If necessary, prompt the client for the username and password getUsernameAndPassword(); if (DEBUG && debuglevel > 6) debug(TRACE, "Password: \"" + new String(password.getPassword()) + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding U (username): \"" + U + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding I (userid): \"" + authorizationID + "\""); // if session re-use generate new 16-byte nonce if (sid.length != 0) { cn = new SecureRandom ().generateSeed (16); } else { cn = new byte[0]; } final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setText(U); frameOut.setText(authorizationID); frameOut.setEOS(sid); // session ID to re-use frameOut.setOS(cn); // client nonce frameOut.setEOS(channelBinding); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendIdentities()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendIdentities()"); if (DEBUG && debuglevel > 2) debug(INFO, "C: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " U = " + U); if (DEBUG && debuglevel > 2) debug(INFO, " I = " + authorizationID); if (DEBUG && debuglevel > 2) debug(INFO, "sid = " + new String(sid)); if (DEBUG && debuglevel > 2) debug(INFO, " cn = " + Util.dumpString(cn)); if (DEBUG && debuglevel > 2) debug(INFO, "cCB = " + Util.dumpString(channelBinding)); return result; }
|
private byte[] sendIdentities() throws SaslException { if (DEBUG && debuglevel > 8) debug(TRACE, "==> sendIdentities()"); // If necessary, prompt the client for the username and password getUsernameAndPassword(); if (DEBUG && debuglevel > 6) debug(TRACE, "Password: \"" + new String(password.getPassword()) + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding U (username): \"" + U + "\""); if (DEBUG && debuglevel > 6) debug(TRACE, "Encoding I (userid): \"" + authorizationID + "\""); // if session re-use generate new 16-byte nonce if (sid.length != 0) { cn = new byte[16]; getDefaultPRNG().nextBytes(cn); } else { cn = new byte[0]; } final OutputBuffer frameOut = new OutputBuffer(); try { frameOut.setText(U); frameOut.setText(authorizationID); frameOut.setEOS(sid); // session ID to re-use frameOut.setOS(cn); // client nonce frameOut.setEOS(channelBinding); } catch (IOException x) { if (x instanceof SaslException) { throw (SaslException) x; } throw new AuthenticationException("sendIdentities()", x); } final byte[] result = frameOut.encode(); if (DEBUG && debuglevel > 8) debug(TRACE, "<== sendIdentities()"); if (DEBUG && debuglevel > 2) debug(INFO, "C: " + Util.dumpString(result)); if (DEBUG && debuglevel > 2) debug(INFO, " U = " + U); if (DEBUG && debuglevel > 2) debug(INFO, " I = " + authorizationID); if (DEBUG && debuglevel > 2) debug(INFO, "sid = " + new String(sid)); if (DEBUG && debuglevel > 2) debug(INFO, " cn = " + Util.dumpString(cn)); if (DEBUG && debuglevel > 2) debug(INFO, "cCB = " + Util.dumpString(channelBinding)); return result; }
| 4,981
|
public void revalidate() { invalidate(); RepaintManager.currentManager(this).addInvalidComponent(this); }
|
public void revalidate() { invalidate(); RepaintManager.currentManager(this).addInvalidComponent(this); }
| 4,982
|
public abstract FileLock lock(long position, long size, boolean shared) throws IOException;
|
public abstract FileLock lock(long position, long size, boolean shared) throws IOException;
| 4,984
|
public abstract int read(ByteBuffer dst) throws IOException;
|
public abstract long read(ByteBuffer[] dsts, int offset, int length) throws IOException;
| 4,985
|
public abstract FileLock tryLock(long position, long size, boolean shared) throws IOException;
|
public abstract FileLock tryLock(long position, long size, boolean shared) throws IOException;
| 4,986
|
public abstract int write(ByteBuffer src) throws IOException;
|
public final long write(ByteBuffer[] srcs) throws IOException { long result = 0; for (int i = 0; i < srcs.length; i++) result += write(srcs[i]); return result; }
| 4,987
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY)) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY) && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.repaint(); }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("tabLayoutPolicy")) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY) && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.repaint(); }
| 4,990
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY)) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals(JTabbedPane.TAB_PLACEMENT_CHANGED_PROPERTY) && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.repaint(); }
|
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JTabbedPane.TAB_LAYOUT_POLICY_CHANGED_PROPERTY)) { layoutManager = createLayoutManager(); tabPane.setLayout(layoutManager); } else if (e.getPropertyName().equals("tabPlacement") && tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); } tabPane.layout(); tabPane.repaint(); }
| 4,991
|
public LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
|
protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.WRAP_TAB_LAYOUT) return new TabbedPaneLayout(); else { incrButton = createIncreaseButton(); decrButton = createDecreaseButton(); viewport = new ScrollingViewport(); viewport.setLayout(null); panel = new ScrollingPanel(); viewport.setView(panel); tabPane.add(incrButton); tabPane.add(decrButton); tabPane.add(viewport); currentScrollLocation = 0; decrButton.setEnabled(false); panel.addMouseListener(mouseListener); incrButton.addMouseListener(mouseListener); decrButton.addMouseListener(mouseListener); viewport.setBackground(Color.LIGHT_GRAY); return new TabbedPaneScrollLayout(); } }
| 4,992
|
public void addAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
|
public void addAccessibleSelection(int value0) throws NotImplementedException { // TODO: Implement this properly. }
| 4,993
|
public boolean doAccessibleAction(int value0) throws NotImplementedException { return false; }
|
public boolean doAccessibleAction(int value0) throws NotImplementedException { return false; }
| 4,996
|
public boolean doAccessibleAction(int value0) throws NotImplementedException { return false; }
|
public boolean doAccessibleAction(int value0) throws NotImplementedException { boolean actionPerformed = false; if (actionIndex == 0) { setPopupVisible(! isPopupVisible()); actionPerformed = true; } return actionPerformed; }
| 4,997
|
public AccessibleAction getAccessibleAction() throws NotImplementedException { return null; }
|
public AccessibleAction getAccessibleAction() { return null; }
| 4,998
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.