bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public TextHitInfo getStrongCaret (TextHitInfo hit1, TextHitInfo hit2, TextLayout layout) { return layout.peer.getStrongCaret(hit1, hit2); }
|
public TextHitInfo getStrongCaret (TextHitInfo hit1, TextHitInfo hit2, TextLayout layout) { return layout.peer.getStrongCaret(hit1, hit2); }
| 15,862
|
public TextHitInfo getStrongCaret (TextHitInfo hit1, TextHitInfo hit2, TextLayout layout) { return layout.peer.getStrongCaret(hit1, hit2); }
|
public TextHitInfo getStrongCaret (TextHitInfo hit1, TextHitInfo hit2, TextLayout layout) { throw new Error ("not implemented"); }
| 15,863
|
protected Object clone () { try { TextLayout tl = (TextLayout) super.clone (); tl.peer = (ClasspathTextLayoutPeer) this.peer.clone(); return tl; } catch (CloneNotSupportedException e) { // This should never occur throw new InternalError (); } }
|
protected Object clone () { try { TextLayout tl = (TextLayout) super.clone (); tl.peer = (ClasspathTextLayoutPeer) this.peer.clone(); return tl; } catch (CloneNotSupportedException e) { // This should never occur throw new InternalError (); } }
| 15,864
|
public float getAdvance () { return peer.getAdvance(); }
|
public float getAdvance () { float totalAdvance = 0f; for(int i = 0; i < runs.length; i++) totalAdvance += runs[i].getLogicalBounds().getWidth(); return totalAdvance; }
| 15,865
|
public float getAscent () { return peer.getAscent(); }
|
public float getAscent () { return lm.getAscent(); }
| 15,866
|
public byte getBaseline () { return peer.getBaseline(); }
|
public byte getBaseline () { return (byte)lm.getBaselineIndex(); }
| 15,867
|
public float[] getBaselineOffsets () { return peer.getBaselineOffsets(); }
|
public float[] getBaselineOffsets () { return lm.getBaselineOffsets(); }
| 15,868
|
public Shape getBlackBoxBounds (int firstEndpoint, int secondEndpoint) { return peer.getBlackBoxBounds(firstEndpoint, secondEndpoint); }
|
public Shape getBlackBoxBounds (int firstEndpoint, int secondEndpoint) { if( firstEndpoint < 0 || secondEndpoint > getCharacterCount() ) return new Rectangle2D.Float(); GeneralPath gp = new GeneralPath(); int i = 0; double advance = 0; while( runIndices[i + 1][1] < firstEndpoint ) { advance += runs[i].getLogicalBounds().getWidth(); i++; } int j = 0; if( runIndices[i][1] - runIndices[i][0] > 1 ) { while( runs[i].getGlyphCharIndex( j + 1 ) < (firstEndpoint - runIndices[i][0] ) )j++; } gp.append(runs[i].getGlyphVisualBounds( j ), false); boolean keepGoing = true;; do { while( j < runs[i].getNumGlyphs() && runs[i].getGlyphCharIndex( j ) + runIndices[i][0] < secondEndpoint ) { Rectangle2D r2 = (runs[i].getGlyphVisualBounds( j )). getBounds2D(); Point2D p = runs[i].getGlyphPosition( j ); r2.setRect( advance + p.getX(), r2.getY(), r2.getWidth(), r2.getHeight() ); gp.append(r2, false); j++; } if( j >= runs[i].getNumGlyphs() ) { advance += runs[i].getLogicalBounds().getWidth(); i++; j = 0; } else keepGoing = false; } while( keepGoing ); return gp; }
| 15,869
|
public Rectangle2D getBounds() { return peer.getBounds(); }
|
public Rectangle2D getBounds() { if( boundsCache == null ) boundsCache = getOutline(new AffineTransform()).getBounds(); return boundsCache; }
| 15,870
|
public int getCharacterCount () { return peer.getCharacterCount(); }
|
public int getCharacterCount () { return string.length(); }
| 15,871
|
public byte getCharacterLevel (int index) { return peer.getCharacterLevel(index); }
|
public byte getCharacterLevel (int index) { throw new Error ("not implemented"); }
| 15,872
|
public float getDescent () { return peer.getDescent(); }
|
public float getDescent () { return lm.getDescent(); }
| 15,873
|
public TextLayout getJustifiedLayout (float justificationWidth) { return peer.getJustifiedLayout(justificationWidth); }
|
public TextLayout getJustifiedLayout (float justificationWidth) { TextLayout newLayout = (TextLayout)clone(); if( hasWhitespace ) newLayout.handleJustify( justificationWidth ); return newLayout; }
| 15,874
|
public float getLeading () { return peer.getLeading(); }
|
public float getLeading () { return lm.getLeading(); }
| 15,875
|
public int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint, TextHitInfo secondEndpoint) { return peer.getLogicalRangesForVisualSelection(firstEndpoint, secondEndpoint); }
|
public int[] getLogicalRangesForVisualSelection (TextHitInfo firstEndpoint, TextHitInfo secondEndpoint) { throw new Error ("not implemented"); }
| 15,876
|
public TextHitInfo getNextLeftHit (int offset) { return getNextLeftHit(offset, DEFAULT_CARET_POLICY); }
|
public TextHitInfo getNextLeftHit (int offset) { throw new Error ("not implemented"); }
| 15,877
|
public TextHitInfo getNextRightHit (int offset) { return getNextRightHit(offset, DEFAULT_CARET_POLICY); }
|
public TextHitInfo getNextRightHit (int offset) { throw new Error ("not implemented"); }
| 15,878
|
public Shape getOutline (AffineTransform tx) { return peer.getOutline(tx); }
|
public Shape getOutline (AffineTransform tx) { float x = 0f; GeneralPath gp = new GeneralPath(); for(int i = 0; i < runs.length; i++) { gp.append( runs[i].getOutline( x, 0f ), false ); Rectangle2D r = runs[i].getLogicalBounds(); x += r.getWidth(); } if( tx != null ) gp.transform( tx ); return gp; }
| 15,879
|
public float getVisibleAdvance () { return peer.getVisibleAdvance(); }
|
public float getVisibleAdvance () { float totalAdvance = 0f; if( runs.length <= 0 ) return 0f; if( !Character.isWhitespace( string.charAt( string.length() -1 ) ) ) return getAdvance(); for(int i = 0; i < runs.length - 1; i++) totalAdvance += runs[i].getLogicalBounds().getWidth(); int lastRun = runIndices[ runs.length - 1 ][0]; int j = string.length() - 1; while( j >= lastRun && Character.isWhitespace( string.charAt( j ) ) ) j--; if( j < lastRun ) return totalAdvance; int lastNonWSChar = j - lastRun; j = 0; while( runs[ runs.length - 1 ].getGlyphCharIndex( j ) <= lastNonWSChar ) { totalAdvance += runs[ runs.length - 1 ].getGlyphLogicalBounds( j ). getBounds2D().getWidth(); j ++; } return totalAdvance; }
| 15,880
|
public TextHitInfo getVisualOtherHit (TextHitInfo hit) { return peer.getVisualOtherHit(hit); }
|
public TextHitInfo getVisualOtherHit (TextHitInfo hit) { throw new Error ("not implemented"); }
| 15,881
|
protected void handleJustify (float justificationWidth) { peer.handleJustify(justificationWidth); }
|
protected void handleJustify (float justificationWidth) { double deltaW = justificationWidth - getVisibleAdvance(); int nglyphs = 0; int lastNWS = string.length() - 1; while( Character.isWhitespace( string.charAt( lastNWS ) ) ) lastNWS--; int[] wsglyphs = new int[string.length() * 10]; for(int run = 0; run < runs.length; run++ ) for(int i = 0; i < runs[run].getNumGlyphs(); i++ ) { int cindex = runIndices[run][0] + runs[run].getGlyphCharIndex( i ); if( Character.isWhitespace( string.charAt( cindex ) ) ) { wsglyphs[ nglyphs * 2 ] = run; wsglyphs[ nglyphs * 2 + 1] = i; nglyphs++; } }
| 15,882
|
public int hashCode () { return peer.hashCode(); }
|
public int hashCode () { throw new Error ("not implemented"); }
| 15,884
|
public boolean isLeftToRight () { return peer.isLeftToRight(); }
|
public boolean isLeftToRight () { return leftToRight; }
| 15,885
|
public boolean isVertical () { return peer.isVertical(); }
|
public boolean isVertical () { return false; }
| 15,886
|
public String toString () { return peer.toString(); }
|
public String toString () { return "TextLayout [string:"+string+", Font:"+font+" Rendercontext:"+ frc+"]"; }
| 15,887
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { assert false : "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } repaint(); }
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; try { area = getComponent().modelToView(dot); } catch (BadLocationException ex) { assert false : "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } repaint(); }
| 15,888
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { assert false : "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } repaint(); }
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException e) { assert false : "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } repaint(); }
| 15,889
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { assert false : "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } repaint(); }
|
void appear() { // All machinery is only required if the carret is blinking. if (blinkListener != null) { blinkListener.ignoreNextEvent = true; // If the caret is visible, erase the current position by repainting // over. if (visible) repaint(); // Draw the caret in the new position. visible = true; Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; } if (area != null) damage(area); } repaint(); }
| 15,890
|
public void paint(Graphics g) { JTextComponent comp = getComponent(); if (comp == null) return; int dot = getDot(); Rectangle rect = null; try { rect = textComponent.modelToView(dot); } catch (BadLocationException e) { assert false : "Unexpected bad caret location: " + dot; return; } if (rect == null) return; // Check if paint has possibly been called directly, without a previous // call to damage(). In this case we need to do some cleanup first. if ((x != rect.x) || (y != rect.y)) { repaint(); // Erase previous location of caret. x = rect.x; y = rect.y; width = 1; height = rect.height; } // Now draw the caret on the new position if visible. if (visible) { g.setColor(textComponent.getCaretColor()); g.drawLine(rect.x, rect.y, rect.x, rect.y + rect.height); } }
|
public void paint(Graphics g) { JTextComponent comp = getComponent(); if (comp == null) return; int dot = getDot(); Rectangle rect = null; try { rect = textComponent.modelToView(dot); } catch (BadLocationException e) { assert false : "Unexpected bad caret location: " + dot; return; } if (rect == null) return; // Check if paint has possibly been called directly, without a previous // call to damage(). In this case we need to do some cleanup first. if ((x != rect.x) || (y != rect.y)) { repaint(); // Erase previous location of caret. x = rect.x; y = rect.y; width = 1; height = rect.height; } // Now draw the caret on the new position if visible. if (visible) { g.setColor(textComponent.getCaretColor()); g.drawLine(rect.x, rect.y, rect.x, rect.y + rect.height); } }
| 15,891
|
public void setDot(int dot) { if (dot >= 0) { this.mark = dot; this.dot = dot; handleHighlight(); adjustVisibility(this); appear(); } }
|
public void setDot(int dot) { if (dot >= 0) { this.mark = dot; handleHighlight(); adjustVisibility(this); appear(); } }
| 15,892
|
public void setVisible(boolean v) { if (v != visible) { visible = v; updateTimerStatus(); Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { assert false: "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } }
|
public void setVisible(boolean v) { if (v != visible) { visible = v; updateTimerStatus(); Rectangle area = null; try { area = getComponent().modelToView(dot); } catch (BadLocationException ex) { assert false: "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } }
| 15,893
|
public void setVisible(boolean v) { if (v != visible) { visible = v; updateTimerStatus(); Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { assert false: "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } }
|
public void setVisible(boolean v) { if (v != visible) { visible = v; updateTimerStatus(); Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException e) { assert false: "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } }
| 15,894
|
public void setVisible(boolean v) { if (v != visible) { visible = v; updateTimerStatus(); Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { assert false: "Unexpected bad caret location: " + getDot(); } if (area != null) damage(area); } }
|
public void setVisible(boolean v) { if (v != visible) { visible = v; updateTimerStatus(); Rectangle area = null; try { area = getComponent().modelToView(getDot()); } catch (BadLocationException ex) { AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae; } if (area != null) damage(area); } }
| 15,895
|
public void setElem(int i, int val) { data[i+offset] = (double) val; }
|
public void setElem(int i, int val) { data[i+offset] = val; }
| 15,896
|
public Insets getBorderInsets(Component c, Insets s) { if (s == null) s = new Insets(0,0,0,0); s.left = s.right = s.top = s.bottom = 5; return s; }
|
public Insets getBorderInsets(Component c, Insets s) { if (s == null) s = new Insets(0,0,0,0); s.left = s.right = s.top = s.bottom = 5; return s; }
| 15,897
|
public Insets getBorderInsets(Component c, Insets s) { if (s == null) s = new Insets(0,0,0,0); s.left = s.right = s.top = s.bottom = 5; return s; }
|
public Insets getBorderInsets(Component c, Insets s) { if (s == null) s = new Insets(0,0,0,0); s.left = s.right = s.top = s.bottom = 5; return s; }
| 15,898
|
public boolean isBorderOpaque() { return false; }
|
public boolean isBorderOpaque() { return false; }
| 15,900
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
| 15,901
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); progressBar.setFont(defaults.getFont("ProgressBar.font")); progressBar.setForeground(defaults.getColor("ProgressBar.foreground")); progressBar.setBackground(defaults.getColor("ProgressBar.background")); progressBar.setBorder(defaults.getBorder("ProgressBar.border")); progressBar.setOpaque(true); selectionForeground = defaults.getColor("ProgressBar.selectionForeground"); selectionBackground = defaults.getColor("ProgressBar.selectionBackground"); cellLength = defaults.getInt("ProgressBar.cellLength"); cellSpacing = defaults.getInt("ProgressBar.cellSpacing"); int repaintInterval = defaults.getInt("ProgressBar.repaintInterval"); int cycleTime = defaults.getInt("ProgressBar.cycleTime"); if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { int div = (cycleTime / repaintInterval) + 2; div /= 2; div *= 2; cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; animationTimer.setDelay(repaintInterval); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); progressBar.setFont(defaults.getFont("ProgressBar.font")); progressBar.setForeground(defaults.getColor("ProgressBar.foreground")); progressBar.setBackground(defaults.getColor("ProgressBar.background")); progressBar.setBorder(defaults.getBorder("ProgressBar.border")); progressBar.setOpaque(true); selectionForeground = defaults.getColor("ProgressBar.selectionForeground"); selectionBackground = defaults.getColor("ProgressBar.selectionBackground"); cellLength = defaults.getInt("ProgressBar.cellLength"); cellSpacing = defaults.getInt("ProgressBar.cellSpacing"); int repaintInterval = defaults.getInt("ProgressBar.repaintInterval"); int cycleTime = defaults.getInt("ProgressBar.cycleTime"); if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { int div = (cycleTime / repaintInterval) + 2; div /= 2; div *= 2; cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; animationTimer.setDelay(repaintInterval); }
| 15,911
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); progressBar.setFont(defaults.getFont("ProgressBar.font")); progressBar.setForeground(defaults.getColor("ProgressBar.foreground")); progressBar.setBackground(defaults.getColor("ProgressBar.background")); progressBar.setBorder(defaults.getBorder("ProgressBar.border")); progressBar.setOpaque(true); selectionForeground = defaults.getColor("ProgressBar.selectionForeground"); selectionBackground = defaults.getColor("ProgressBar.selectionBackground"); cellLength = defaults.getInt("ProgressBar.cellLength"); cellSpacing = defaults.getInt("ProgressBar.cellSpacing"); int repaintInterval = defaults.getInt("ProgressBar.repaintInterval"); int cycleTime = defaults.getInt("ProgressBar.cycleTime"); if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { int div = (cycleTime / repaintInterval) + 2; div /= 2; div *= 2; cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; animationTimer.setDelay(repaintInterval); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); progressBar.setFont(defaults.getFont("ProgressBar.font")); progressBar.setForeground(defaults.getColor("ProgressBar.foreground")); progressBar.setBackground(defaults.getColor("ProgressBar.background")); progressBar.setBorder(defaults.getBorder("ProgressBar.border")); progressBar.setOpaque(true); selectionForeground = defaults.getColor("ProgressBar.selectionForeground"); selectionBackground = defaults.getColor("ProgressBar.selectionBackground"); cellLength = defaults.getInt("ProgressBar.cellLength"); cellSpacing = defaults.getInt("ProgressBar.cellSpacing"); int repaintInterval = defaults.getInt("ProgressBar.repaintInterval"); int cycleTime = defaults.getInt("ProgressBar.cycleTime"); if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { int div = (cycleTime / repaintInterval) + 2; div /= 2; div *= 2; cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; animationTimer.setDelay(repaintInterval); }
| 15,912
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); progressBar.setFont(defaults.getFont("ProgressBar.font")); progressBar.setForeground(defaults.getColor("ProgressBar.foreground")); progressBar.setBackground(defaults.getColor("ProgressBar.background")); progressBar.setBorder(defaults.getBorder("ProgressBar.border")); progressBar.setOpaque(true); selectionForeground = defaults.getColor("ProgressBar.selectionForeground"); selectionBackground = defaults.getColor("ProgressBar.selectionBackground"); cellLength = defaults.getInt("ProgressBar.cellLength"); cellSpacing = defaults.getInt("ProgressBar.cellSpacing"); int repaintInterval = defaults.getInt("ProgressBar.repaintInterval"); int cycleTime = defaults.getInt("ProgressBar.cycleTime"); if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { int div = (cycleTime / repaintInterval) + 2; div /= 2; div *= 2; cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; animationTimer.setDelay(repaintInterval); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); progressBar.setFont(defaults.getFont("ProgressBar.font")); progressBar.setForeground(defaults.getColor("ProgressBar.foreground")); progressBar.setBackground(defaults.getColor("ProgressBar.background")); progressBar.setBorder(defaults.getBorder("ProgressBar.border")); progressBar.setOpaque(true); selectionForeground = defaults.getColor("ProgressBar.selectionForeground"); selectionBackground = defaults.getColor("ProgressBar.selectionBackground"); cellLength = defaults.getInt("ProgressBar.cellLength"); cellSpacing = defaults.getInt("ProgressBar.cellSpacing"); int repaintInterval = defaults.getInt("ProgressBar.repaintInterval"); int cycleTime = defaults.getInt("ProgressBar.cycleTime"); if (cycleTime % repaintInterval != 0 && (cycleTime / repaintInterval) % 2 != 0) { int div = (cycleTime / repaintInterval) + 2; div /= 2; div *= 2; cycleTime = div * repaintInterval; } setAnimationIndex(0); numFrames = cycleTime / repaintInterval; animationTimer.setDelay(repaintInterval); }
| 15,913
|
public Connection(URL url) { super (url); // @classpath-bugfix /* Set up some variables */ doInput = true; permission = new FilePermission(getURL().getFile(), DEFAULT_PERMISSION); }
|
public Connection(URL url) { super (url); // @classpath-bugfix /* Set up some variables */ permission = new FilePermission(getURL().getFile(), DEFAULT_PERMISSION); }
| 15,914
|
public static void writeAttributeSet(ObjectOutputStream out, AttributeSet a) throws IOException, NotImplementedException { // FIXME: Not implemented }
|
public static void writeAttributeSet(ObjectOutputStream out, AttributeSet a) throws IOException { // FIXME: Not implemented }
| 15,917
|
public InvalidAddressHolder(InvalidAddress initialValue) { value = initialValue; }
|
public InvalidAddressHolder() { value = initialValue; }
| 15,919
|
public InvalidAddressHolder(InvalidAddress initialValue) { value = initialValue; }
|
public InvalidAddressHolder(InvalidAddress initialValue) { }
| 15,920
|
public static int[] read(InputStream input) { LongSeqHolder h = new LongSeqHolder(); h._read(input); return h.value; }
|
public static int[] read(InputStream input) { LongSeqHolder h = new LongSeqHolder(); h._read(input); return h.value; }
| 15,921
|
public static void write(OutputStream output, int[] value) { LongSeqHolder h = new LongSeqHolder(value); h._write(output); }
|
public static void write(OutputStream output, int[] value) { LongSeqHolder h = new LongSeqHolder(value); h._write(output); }
| 15,922
|
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.TABLE)) view = new HTMLTableView(element); else if (tag.equals(HTML.Tag.TD)) view = new ParagraphView(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.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) { System.err.println("missing tag->view mapping for: " + element); view = new NullView(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.TABLE)) view = new HTMLTableView(element); else if (tag.equals(HTML.Tag.TD)) view = new ParagraphView(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.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) { System.err.println("missing tag->view mapping for: " + element); view = new NullView(element); } return view; }
| 15,923
|
public void addElement(Object object) { if (list.size() == 0) { list.add(object); selectedItem = object; fireContentsChanged(this, -1, -1); } else { list.add(object); fireIntervalAdded(this, list.size() - 1, list.size() - 1); } }
|
public void addElement(Object object) { if (list.size() == 0) { list.add(object); selectedItem = object; fireContentsChanged(this, -1, -1); } else { list.add(object); fireIntervalAdded(this, list.size() - 1, list.size() - 1); } }
| 15,924
|
public static Object[] getStackTrace(VmThread current) { if (current.inException) { Unsafe.debug("Exception in getStackTrace"); VmProcessor.current().getArchitecture().getStackReader() .debugStackTrace(); Unsafe.die("getStackTrace"); return null; } else { current.inException = true; } if (Vm.getHeapManager().isLowOnMemory()) { return null; } final VmProcessor proc = VmProcessor.current(); final VmStackReader reader = proc.getArchitecture().getStackReader(); final VmStackFrame[] mt; // Address lastIP = null; if (current.isInSystemException()) { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getExceptionStackFrame(), current.getExceptionInstructionPointer(), STACKTRACE_LIMIT); } finally { proc.enableReschedule(); } } else if (current == proc.getCurrentThread()) { final Address curFrame = VmMagic.getCurrentFrame(); mt = reader.getVmStackTrace(reader.getPrevious(curFrame), reader .getReturnAddress(curFrame), STACKTRACE_LIMIT); } else { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getStackFrame(), current .getInstructionPointer(), STACKTRACE_LIMIT); // lastIP = current.getInstructionPointer(); } finally { proc.enableReschedule(); } } final int cnt = (mt == null) ? 0 : mt.length; VmType lastClass = null; //skip the first element which is VMThrowable.fillInStackTrace() int i = 1; while (i < cnt) { final VmStackFrame f = mt[i]; if (f == null) { break; } final VmMethod method = f.getMethod(); if (method == null) { break; } final VmType< ? > vmClass = method.getDeclaringClass(); if (vmClass == null) { break; } final VmType< ? > sClass = vmClass.getSuperClass(); if ((lastClass != null) && (sClass != lastClass) && (vmClass != lastClass)) { break; } final String mname = method.getName(); if (mname == null) { break; } if (!("<init>".equals(mname) || "fillInStackTrace".equals(mname) || "getStackTrace" .equals(mname))) { break; } lastClass = vmClass; i++; } final VmStackFrame[] st = new VmStackFrame[cnt - i]; int j = 0; for (; i < cnt; i++) { st[j++] = mt[i]; } current.inException = false; return st; }
|
public static Object[] getStackTrace(VmThread current) { if (current.inException) { Unsafe.debug("Exception in getStackTrace"); VmProcessor.current().getArchitecture().getStackReader() .debugStackTrace(); Unsafe.die("getStackTrace"); return null; } else { current.inException = true; } if (Vm.getHeapManager().isLowOnMemory()) { return null; } final VmProcessor proc = VmProcessor.current(); final VmStackReader reader = proc.getArchitecture().getStackReader(); final VmStackFrame[] mt; // Address lastIP = null; if (current.isInSystemException()) { proc.disableReschedule(false); try { mt = reader.getVmStackTrace(current.getExceptionStackFrame(), current.getExceptionInstructionPointer(), STACKTRACE_LIMIT); } finally { proc.enableReschedule(); } } else if (current == proc.getCurrentThread()) { final Address curFrame = VmMagic.getCurrentFrame(); mt = reader.getVmStackTrace(reader.getPrevious(curFrame), reader .getReturnAddress(curFrame), STACKTRACE_LIMIT); } else { proc.disableReschedule(false); try { mt = reader.getVmStackTrace(current.getStackFrame(), current .getInstructionPointer(), STACKTRACE_LIMIT); // lastIP = current.getInstructionPointer(); } finally { proc.enableReschedule(); } } final int cnt = (mt == null) ? 0 : mt.length; VmType lastClass = null; //skip the first element which is VMThrowable.fillInStackTrace() int i = 1; while (i < cnt) { final VmStackFrame f = mt[i]; if (f == null) { break; } final VmMethod method = f.getMethod(); if (method == null) { break; } final VmType< ? > vmClass = method.getDeclaringClass(); if (vmClass == null) { break; } final VmType< ? > sClass = vmClass.getSuperClass(); if ((lastClass != null) && (sClass != lastClass) && (vmClass != lastClass)) { break; } final String mname = method.getName(); if (mname == null) { break; } if (!("<init>".equals(mname) || "fillInStackTrace".equals(mname) || "getStackTrace" .equals(mname))) { break; } lastClass = vmClass; i++; } final VmStackFrame[] st = new VmStackFrame[cnt - i]; int j = 0; for (; i < cnt; i++) { st[j++] = mt[i]; } current.inException = false; return st; }
| 15,926
|
public static Object[] getStackTrace(VmThread current) { if (current.inException) { Unsafe.debug("Exception in getStackTrace"); VmProcessor.current().getArchitecture().getStackReader() .debugStackTrace(); Unsafe.die("getStackTrace"); return null; } else { current.inException = true; } if (Vm.getHeapManager().isLowOnMemory()) { return null; } final VmProcessor proc = VmProcessor.current(); final VmStackReader reader = proc.getArchitecture().getStackReader(); final VmStackFrame[] mt; // Address lastIP = null; if (current.isInSystemException()) { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getExceptionStackFrame(), current.getExceptionInstructionPointer(), STACKTRACE_LIMIT); } finally { proc.enableReschedule(); } } else if (current == proc.getCurrentThread()) { final Address curFrame = VmMagic.getCurrentFrame(); mt = reader.getVmStackTrace(reader.getPrevious(curFrame), reader .getReturnAddress(curFrame), STACKTRACE_LIMIT); } else { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getStackFrame(), current .getInstructionPointer(), STACKTRACE_LIMIT); // lastIP = current.getInstructionPointer(); } finally { proc.enableReschedule(); } } final int cnt = (mt == null) ? 0 : mt.length; VmType lastClass = null; //skip the first element which is VMThrowable.fillInStackTrace() int i = 1; while (i < cnt) { final VmStackFrame f = mt[i]; if (f == null) { break; } final VmMethod method = f.getMethod(); if (method == null) { break; } final VmType< ? > vmClass = method.getDeclaringClass(); if (vmClass == null) { break; } final VmType< ? > sClass = vmClass.getSuperClass(); if ((lastClass != null) && (sClass != lastClass) && (vmClass != lastClass)) { break; } final String mname = method.getName(); if (mname == null) { break; } if (!("<init>".equals(mname) || "fillInStackTrace".equals(mname) || "getStackTrace" .equals(mname))) { break; } lastClass = vmClass; i++; } final VmStackFrame[] st = new VmStackFrame[cnt - i]; int j = 0; for (; i < cnt; i++) { st[j++] = mt[i]; } current.inException = false; return st; }
|
public static Object[] getStackTrace(VmThread current) { if (current.inException) { Unsafe.debug("Exception in getStackTrace"); VmProcessor.current().getArchitecture().getStackReader() .debugStackTrace(); Unsafe.die("getStackTrace"); return null; } else { current.inException = true; } if (Vm.getHeapManager().isLowOnMemory()) { return null; } final VmProcessor proc = VmProcessor.current(); final VmStackReader reader = proc.getArchitecture().getStackReader(); final VmStackFrame[] mt; // Address lastIP = null; if (current.isInSystemException()) { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getExceptionStackFrame(), current.getExceptionInstructionPointer(), STACKTRACE_LIMIT); } finally { proc.enableReschedule(false); } } else if (current == proc.getCurrentThread()) { final Address curFrame = VmMagic.getCurrentFrame(); mt = reader.getVmStackTrace(reader.getPrevious(curFrame), reader .getReturnAddress(curFrame), STACKTRACE_LIMIT); } else { proc.disableReschedule(); try { mt = reader.getVmStackTrace(current.getStackFrame(), current .getInstructionPointer(), STACKTRACE_LIMIT); // lastIP = current.getInstructionPointer(); } finally { proc.enableReschedule(false); } } final int cnt = (mt == null) ? 0 : mt.length; VmType lastClass = null; //skip the first element which is VMThrowable.fillInStackTrace() int i = 1; while (i < cnt) { final VmStackFrame f = mt[i]; if (f == null) { break; } final VmMethod method = f.getMethod(); if (method == null) { break; } final VmType< ? > vmClass = method.getDeclaringClass(); if (vmClass == null) { break; } final VmType< ? > sClass = vmClass.getSuperClass(); if ((lastClass != null) && (sClass != lastClass) && (vmClass != lastClass)) { break; } final String mname = method.getName(); if (mname == null) { break; } if (!("<init>".equals(mname) || "fillInStackTrace".equals(mname) || "getStackTrace" .equals(mname))) { break; } lastClass = vmClass; i++; } final VmStackFrame[] st = new VmStackFrame[cnt - i]; int j = 0; for (; i < cnt; i++) { st[j++] = mt[i]; } current.inException = false; return st; }
| 15,927
|
protected void formatDevice(Device device) throws IOException { /* Format the MBR & partitiontable */ GrubBootSector mbr = (GrubBootSector) (createFormatter() .getBootSector()); mbr.getPartition(0).clear(); mbr.getPartition(1).clear(); mbr.getPartition(2).clear(); mbr.getPartition(3).clear(); IBMPartitionTableEntry pte = mbr.getPartition(0); pte.setBootIndicator(true); pte.setStartLba(1); pte.setNrSectors(geom.getTotalSectors() - 1); pte.setSystemIndicator(IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); pte.setStartCHS(geom.getCHS(pte.getStartLba())); pte.setEndCHS(geom.getCHS(pte.getStartLba() + pte.getNrSectors() - 1)); /* * System.out.println("partition table:"); for (int i = 0; i < 4; i++) { * System.out.println("" + i + " " + mbr.getPartition(i)); } */ /* Format partition 0 */ part0 = new MappedFSBlockDeviceSupport(device, pte.getStartLba() * bytesPerSector, pte.getNrSectors() * bytesPerSector); GrubFatFormatter ff = createFormatter(); ff.setInstallPartition(0x0000FFFF); ff.format(part0); GrubBootSector part0bs = (GrubBootSector) ff.getBootSector(); /* Fixup stage2 sector in MBR */ mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); try { mbr.write((BlockDeviceAPI) device.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { throw new IOException("BlockDeviceAPI not found on device", ex); } //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); }
|
protected void formatDevice(Device device) throws IOException { /* Format the MBR & partitiontable */ GrubBootSector mbr = (GrubBootSector) (createFormatter() .getBootSector()); mbr.getPartition(0).clear(); mbr.getPartition(1).clear(); mbr.getPartition(2).clear(); mbr.getPartition(3).clear(); IBMPartitionTableEntry pte = mbr.getPartition(0); pte.setBootIndicator(true); pte.setStartLba(1); pte.setNrSectors(geom.getTotalSectors() - 1); pte.setSystemIndicator(IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); pte.setStartCHS(geom.getCHS(pte.getStartLba())); pte.setEndCHS(geom.getCHS(pte.getStartLba() + pte.getNrSectors() - 1)); /* * System.out.println("partition table:"); for (int i = 0; i < 4; i++) { * System.out.println("" + i + " " + mbr.getPartition(i)); } */ /* Format partition 0 */ part0 = new MappedFSBlockDeviceSupport(device, pte.getStartLba() * bytesPerSector, pte.getNrSectors() * bytesPerSector); GrubFatFormatter ff = createFormatter(); ff.setInstallPartition(0x0000FFFF); ff.format(part0); GrubBootSector part0bs = (GrubBootSector) ff.getBootSector(); /* Fixup stage2 sector in MBR */ mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); try { mbr.write((BlockDeviceAPI) device.getAPI(BlockDeviceAPI.class)); } catch (ApiNotFoundException ex) { final IOException ioe = new IOException("BlockDeviceAPI not found on device"); ioe.initCause(ex); throw ioe; } //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); }
| 15,929
|
public AccessibleContext getAccessibleContext() { return null; }
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJMenuBar(); return accessibleContext; }
| 15,930
|
private void makeTabs(AbstractColorChooserPanel[] panels) { pane.removeAll(); for (int i = 0; i < panels.length; i++) pane.addTab(panels[i].getDisplayName(), panels[i].getSmallDisplayIcon(), panels[i]); }
|
void makeTabs(AbstractColorChooserPanel[] panels) { pane.removeAll(); for (int i = 0; i < panels.length; i++) pane.addTab(panels[i].getDisplayName(), panels[i].getSmallDisplayIcon(), panels[i]); }
| 15,931
|
private void updatePreviewPanel(JComponent preview) { if (prevContainer == null) { prevContainer = new JPanel(); prevContainer.setLayout(new BorderLayout()); chooser.add(prevContainer, BorderLayout.CENTER); } prevContainer.removeAll(); prevContainer.add(preview, BorderLayout.CENTER); }
|
void updatePreviewPanel(JComponent preview) { if (prevContainer == null) { prevContainer = new JPanel(); prevContainer.setLayout(new BorderLayout()); chooser.add(prevContainer, BorderLayout.CENTER); } prevContainer.removeAll(); prevContainer.add(preview, BorderLayout.CENTER); }
| 15,932
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
| 15,934
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
| 15,935
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
| 15,936
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y4 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
| 15,937
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x4 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
| 15,938
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); } else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); } else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3)); } } }
|
public void layoutContainer(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { JViewport viewport = sc.getViewport(); Dimension viewSize = viewport.getViewSize(); Point viewPos = viewport.getViewPosition(); int x1 = 0, x2 = 0, x3 = 0, x4 = 0; int y1 = 0, y2 = 0, y3 = 0, y4 = 0; Rectangle scrollPaneBounds = SwingUtilities.calculateInnerArea(sc, null); x1 = scrollPaneBounds.x; y1 = scrollPaneBounds.y; x4 = scrollPaneBounds.x + scrollPaneBounds.width; y4 = scrollPaneBounds.y + scrollPaneBounds.height; if (colHead != null) y2 = y1 + colHead.getPreferredSize().height; else y2 = y1; if (rowHead != null) x2 = x1 + rowHead.getPreferredSize().width; else x2 = x1; int vsbPolicy = sc.getVerticalScrollBarPolicy(); int hsbPolicy = sc.getHorizontalScrollBarPolicy(); x3 = x4 - vsb.getPreferredSize().width; y3 = y4 - hsb.getPreferredSize().height; boolean showVsb = (vsb != null) && ((vsbPolicy == VERTICAL_SCROLLBAR_ALWAYS) || (vsbPolicy == VERTICAL_SCROLLBAR_AS_NEEDED && viewSize.height > (y3 - y2))); boolean showHsb = (hsb != null) && ((hsbPolicy == HORIZONTAL_SCROLLBAR_ALWAYS) || (hsbPolicy == HORIZONTAL_SCROLLBAR_AS_NEEDED && viewSize.width > (x3 - x2))); if (!showVsb) x3 = x4; if (!showHsb) y3 = y4; // now set the layout if (viewport != null) viewport.setBounds(new Rectangle(x2, y2, x3-x2, y3-y2)); if (colHead != null) colHead.setBounds(new Rectangle(x2, y1, x3-x2, y2-y1)); if (rowHead != null) rowHead.setBounds(new Rectangle(x1, y2, x2-x1, y3-y2)); if (showVsb) { vsb.setVisible(true); vsb.setBounds(new Rectangle(x3, y2, x4-x3, y3-y2)); else if (vsb != null) vsb.setVisible(false); if (showHsb) { hsb.setVisible(true); hsb.setBounds(new Rectangle(x2, y3, x3-x2, y4-y3)); else if (hsb != null) hsb.setVisible(false); if (upperLeft != null) upperLeft.setBounds(new Rectangle(x1, y1, x2-x1, y2-y1)); if (upperRight != null) upperRight.setBounds(new Rectangle(x3, y1, x4-x3, y2-y1)); if (lowerLeft != null) lowerLeft.setBounds(new Rectangle(x1, y3, x2-x1, y4-y3)); if (lowerRight != null) lowerRight.setBounds(new Rectangle(x3, y3, x4-x3, y4-y3));
| 15,939
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension minimumLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
| 15,940
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
| 15,941
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
| 15,942
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension minimumLayoutSize(Container parent) { if (parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); maybeSetMinimumSize(colHead, columnHeaderSize); maybeSetMinimumSize(rowHead, rowHeaderSize); if (vsbPolicy != VERTICAL_SCROLLBAR_NEVER) maybeSetMinimumSize(vsb, verticalScrollBarSize); if (hsbPolicy != HORIZONTAL_SCROLLBAR_NEVER) maybeSetMinimumSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); else { return new Dimension(0,0);
| 15,943
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); } maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); } maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
| 15,944
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); } maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); } maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
| 15,945
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); } if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); } maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); } } else { return new Dimension(0,0); } }
|
public Dimension preferredLayoutSize(Container parent) { if (parent != null && parent instanceof JScrollPane) { JScrollPane sc = (JScrollPane) parent; synchronized (sc.getTreeLock ()) { Dimension insetsSize = new Dimension(0,0); Dimension viewportSize = new Dimension(0,0); Dimension viewportInsetsSize = new Dimension(0,0); Dimension columnHeaderSize = new Dimension(0,0); Dimension rowHeaderSize = new Dimension(0,0); Dimension verticalScrollBarSize = new Dimension(0,0); Dimension horizontalScrollBarSize = new Dimension(0,0); Insets insets = sc.getInsets(); Border viewportBorder = sc.getViewportBorder(); Insets viewportInsets = null; if (viewportBorder != null) { viewportInsets = viewportBorder.getBorderInsets(parent); if (viewportInsets != null) viewportInsetsSize.setSize(viewportInsets.left + viewportInsets.right, viewportInsets.top + viewportInsets.bottom); if (insets != null) insetsSize.setSize(insets.left + insets.right, insets.top + insets.bottom); if (viewport != null) { Component view = null; Scrollable scr = null; Dimension pref = null; view = viewport.getView(); if (view != null && view instanceof Scrollable) scr = (Scrollable) view; if (scr != null) pref = scr.getPreferredScrollableViewportSize(); if (pref == null) pref = viewport.getPreferredSize(); if (pref != null) viewportSize.setSize(pref); maybeSetPreferredSize(colHead, columnHeaderSize); maybeSetPreferredSize(rowHead, rowHeaderSize); maybeSetPreferredSize(vsb, verticalScrollBarSize); maybeSetPreferredSize(hsb, horizontalScrollBarSize); return new Dimension(insetsSize.width + viewportSize.width + viewportInsetsSize.width + rowHeaderSize.width + verticalScrollBarSize.width, insetsSize.height + viewportSize.height + viewportInsetsSize.height + columnHeaderSize.height + horizontalScrollBarSize.height); else { return new Dimension(0,0);
| 15,946
|
public boolean isAbsolute() { return (scheme != null); }
|
public boolean isAbsolute() { return scheme != null; }
| 15,947
|
public static void setErr(PrintStream err) { setStaticField(System.class, "err", err); }
|
public static void setErr(PrintStream err) throws PrivilegedActionPragma { setStaticField(System.class, "err", err); }
| 15,949
|
public static void setOut(PrintStream out) { setStaticField(System.class, "out", out); }
|
public static void setOut(PrintStream out) throws PrivilegedActionPragma { setStaticField(System.class, "out", out); }
| 15,950
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding the rootPane (initialization stages) use super.add. // Otherwise pass the add onto the content pane. if (comp == rootPane) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're adding the rootPane (initialization stages) use super.add. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not add directly to JDialog." + " Use getContentPane().add instead."); getContentPane().add(comp, constraints, index); } }
| 15,951
|
public boolean dispatchKeyEvent (KeyEvent e) { Component focusOwner = getGlobalPermanentFocusOwner (); if (focusOwner != null) redispatchEvent(focusOwner, e); // Loop through all registered KeyEventPostProcessors, giving // each a chance to process this event. Iterator i = getKeyEventPostProcessors().iterator(); while (i.hasNext ()) { KeyEventPostProcessor processor = (KeyEventPostProcessor) i.next (); if (processor.postProcessKeyEvent ((KeyEvent) e)) return true; } // The event hasn't been consumed yet. Check if it is an // MenuShortcut. if (postProcessKeyEvent (e)) return true; // Always return true. return true; }
|
public boolean dispatchKeyEvent (KeyEvent e) { Component focusOwner = getFocusOwner(); if (focusOwner == null) focusOwner = getFocusedWindow(); if (focusOwner != null) redispatchEvent(focusOwner, e); // Loop through all registered KeyEventPostProcessors, giving // each a chance to process this event. Iterator i = getKeyEventPostProcessors().iterator(); while (i.hasNext ()) { KeyEventPostProcessor processor = (KeyEventPostProcessor) i.next (); if (processor.postProcessKeyEvent ((KeyEvent) e)) return true; } // The event hasn't been consumed yet. Check if it is an // MenuShortcut. if (postProcessKeyEvent (e)) return true; // Always return true. return true; }
| 15,952
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
|
public byte[][] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
| 15,953
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toByteArray()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
| 15,954
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
| 15,955
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (InetAddress[])list.toArray(new InetAddress[list.size()]); } }
|
public InetAddress[] getHostByName(String hostname) throws UnknownHostException { ArrayList list = null; for (Iterator i = nlm.getNetworkLayers().iterator(); i.hasNext(); ) { final NetworkLayer layer = (NetworkLayer)i.next(); final ProtocolAddress[] addrs = layer.getHostByName(hostname); if (addrs != null) { if (list == null) { list = new ArrayList(); } final int cnt = addrs.length; for (int j = 0; j < cnt; j++) { final ProtocolAddress pa = addrs[j]; if (pa != null) { list.add(pa.toInetAddress()); } } } } if (list == null) { return null; } else { return (byte[][])list.toArray(new byte[list.size()][]); } }
| 15,956
|
public static Pattern compile(String regex) { throw new InternalError("Not implemented yet"); }
|
public static Pattern compile (String regex) throws PatternSyntaxException { throw new InternalError("Not implemented yet"); }
| 15,957
|
public static Pattern compile(String regex) { throw new InternalError("Not implemented yet"); }
|
public static Pattern compile(String regex) { return compile(regex, 0); }
| 15,958
|
public Matcher matcher(CharSequence input) { throw new InternalError("Not implemented yet"); }
|
public Matcher matcher(CharSequence input) { return new Matcher(this, input); }
| 15,959
|
public static boolean matches(String regex, CharSequence input) { throw new InternalError("Not implemented yet"); }
|
public static boolean matches(String regex, CharSequence input) { return compile(regex).matcher(input).matches(); }
| 15,960
|
public String[] split(CharSequence input, int limit) { throw new InternalError("Not implemented yet"); }
|
public String[] split (CharSequence input) { throw new InternalError("Not implemented yet"); }
| 15,961
|
public String[] split(CharSequence input, int limit) { throw new InternalError("Not implemented yet"); }
|
public String[] split(CharSequence input, int limit) { return split(input, 0); }
| 15,962
|
public static Reader newReader(ReadableByteChannel ch, CharsetDecoder dec, int minBufferCap) { throw new Error("not implemented"); }
|
public static Reader newReader(ReadableByteChannel ch, CharsetDecoder dec, int minBufferCap) { return new ChannelReader(ch, dec, minBufferCap); }
| 15,963
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); if (end != toRec.getEndOffset()) { recreateLeaves(end, toRec, onlyContent); if (onlyContent) edit.addRemovedElement(target); } } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
|
private void insertContentTag(ElementSpec tag) { BranchElement paragraph = (BranchElement) elementStack.peek(); int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinNextDirection) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); Edit edit = getEditForParagraphAndIndex(paragraph, index); if (paragraph.getStartOffset() > pos) { Element first = paragraph.getElement(0); Element newEl = createLeafElement(paragraph, first.getAttributes(), pos, first.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(first); } else if (paragraph.getElementCount() > (index + 1) && (pos == target.getStartOffset() && !target.equals(lastFractured))) { Element next = paragraph.getElement(index + 1); Element newEl = createLeafElement(paragraph, next.getAttributes(), pos, next.getEndOffset()); edit.addAddedElement(newEl); edit.addRemovedElement(next); edit.addRemovedElement(target); } else { BranchElement parent = (BranchElement) paragraph.getParentElement(); int i = parent.getElementIndex(pos); BranchElement next = (BranchElement) parent.getElement(i + 1); AttributeSet atts = tag.getAttributes(); if (next != null) { Element nextLeaf = next.getElement(0); Edit e = getEditForParagraphAndIndex(next, 0); Element newEl2 = createLeafElement(next, atts, pos, nextLeaf.getEndOffset()); e.addAddedElement(newEl2); e.addRemovedElement(nextLeaf); } } } else { int end = pos + len; Element leaf = createLeafElement(paragraph, tag.getAttributes(), pos, end); // Check for overlap with other leaves/branches if (paragraph.getElementCount() > 0) { int index = paragraph.getElementIndex(pos); Element target = paragraph.getElement(index); boolean onlyContent = target.isLeaf(); BranchElement toRec = paragraph; if (!onlyContent) toRec = (BranchElement) target; // Check if we should place the leaf before or after target if (pos > target.getStartOffset()) index++; Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addAddedElement(leaf); if (end != toRec.getEndOffset()) { recreateLeaves(end, toRec, onlyContent); if (onlyContent) edit.addRemovedElement(target); } } else paragraph.replace(0, 0, new Element[] { leaf }); } pos += len; }
| 15,965
|
private Object processResolution(ObjectStreamClass osc, Object obj, int handle) throws IOException { if (osc != null && obj instanceof Serializable) { try { Method m = osc.readResolveMethod; if(m != null) { obj = m.invoke(obj, new Object[] {}); } } catch (IllegalAccessException ignore) { } catch (InvocationTargetException ignore) { } } if (this.resolveEnabled) obj = resolveObject(obj); this.objectLookupTable.put(new Integer(handle), new ObjectIdentityWrapper(obj)); return obj; }
|
private Object processResolution(ObjectStreamClass osc, Object obj, int handle) throws IOException { if (osc != null && obj instanceof Serializable) { try { Method m = osc.readResolveMethod; if(m != null) { obj = m.invoke(obj, new Object[] {}); } } catch (IllegalAccessException ignore) { } catch (InvocationTargetException exception) { } } if (this.resolveEnabled) obj = resolveObject(obj); this.objectLookupTable.put(new Integer(handle), new ObjectIdentityWrapper(obj)); return obj; }
| 15,967
|
protected ObjectStreamClass readClassDescriptor() throws ClassNotFoundException, IOException { if(dump) dumpElement("CLASSDESC NAME="); String name = this.realInputStream.readUTF(); if(dump) dumpElement(name + "; UID="); long uid = this.realInputStream.readLong (); if(dump) dumpElement(Long.toHexString(uid) + "; FLAGS="); byte flags = this.realInputStream.readByte (); if(dump) dumpElement(Integer.toHexString(flags) + "; FIELD COUNT="); short field_count = this.realInputStream.readShort(); if(dump) dumpElementln(Short.toString(field_count)); ObjectStreamField[] fields = new ObjectStreamField[field_count]; ObjectStreamClass osc = new ObjectStreamClass(name, uid, flags, fields); assignNewHandle(osc); ClassLoader callersClassLoader = currentLoader(); for (int i = 0; i < field_count; i++) { if(dump) dumpElement(" TYPE CODE="); char type_code = (char)this.realInputStream.readByte(); if(dump) dumpElement(type_code + "; FIELD NAME="); String field_name = this.realInputStream.readUTF(); if(dump) dumpElementln(field_name); String class_name; // If the type code is an array or an object we must // decode a String here. In the other case we convert // the type code and pass it to ObjectStreamField. // Type codes are decoded by gnu.java.lang.reflect.TypeSignature. if (type_code == 'L' || type_code == '[') class_name = (String)readObject(); else class_name = String.valueOf(type_code); fields[i] = new ObjectStreamField(field_name, class_name, callersClassLoader); } /* Now that fields have been read we may resolve the class * (and read annotation if needed). */ Class clazz = resolveClass(osc); boolean oldmode = setBlockDataMode(true); osc.setClass(clazz, lookupClass(clazz.getSuperclass())); classLookupTable.put(clazz, osc); setBlockDataMode(oldmode); // find the first non-serializable, non-abstract // class in clazz's inheritance hierarchy Class first_nonserial = clazz.getSuperclass(); // Maybe it is a primitive class, those don't have a super class, // or Object itself. Otherwise we can keep getting the superclass // till we hit the Object class, or some other non-serializable class. if (first_nonserial == null) first_nonserial = clazz; else while (Serializable.class.isAssignableFrom(first_nonserial) || Modifier.isAbstract(first_nonserial.getModifiers())) first_nonserial = first_nonserial.getSuperclass(); final Class local_constructor_class = first_nonserial; osc.firstNonSerializableParentConstructor = (Constructor)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Constructor c = local_constructor_class. getDeclaredConstructor(new Class[0]); if (Modifier.isPrivate(c.getModifiers())) return null; return c; } catch (NoSuchMethodException e) { // error will be reported later, in newObject() return null; } } }); osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz); osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz); ObjectStreamField[] stream_fields = osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields; ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)]; int stream_idx = 0; int real_idx = 0; int map_idx = 0; /* * Check that there is no type inconsistencies between the lists. * A special checking must be done for the two groups: primitive types and * not primitive types. */ checkTypeConsistency(name, real_fields, stream_fields); checkTypeConsistency(name, stream_fields, real_fields); while (stream_idx < stream_fields.length || real_idx < real_fields.length) { ObjectStreamField stream_field = null; ObjectStreamField real_field = null; if (stream_idx == stream_fields.length) { real_field = real_fields[real_idx++]; } else if (real_idx == real_fields.length) { stream_field = stream_fields[stream_idx++]; } else { int comp_val = real_fields[real_idx].compareTo (stream_fields[stream_idx]); if (comp_val < 0) { real_field = real_fields[real_idx++]; } else if (comp_val > 0) { stream_field = stream_fields[stream_idx++]; } else { stream_field = stream_fields[stream_idx++]; real_field = real_fields[real_idx++]; if (stream_field.getType() != real_field.getType()) throw new InvalidClassException ("invalid field type for " + real_field.getName() + " in class " + name); } } /* If some of stream_fields does not correspond to any of real_fields, * or the opposite, then fieldmapping will go short. */ if (map_idx == fieldmapping.length) { ObjectStreamField[] newfieldmapping = new ObjectStreamField[fieldmapping.length + 2]; System.arraycopy(fieldmapping, 0, newfieldmapping, 0, fieldmapping.length); fieldmapping = newfieldmapping; } fieldmapping[map_idx++] = stream_field; fieldmapping[map_idx++] = real_field; } osc.fieldMapping = fieldmapping; return osc; }
|
protected ObjectStreamClass readClassDescriptor() throws ClassNotFoundException, IOException { if(dump) dumpElement("CLASSDESC NAME="); String name = this.realInputStream.readUTF(); if(dump) dumpElement(name + "; UID="); long uid = this.realInputStream.readLong (); if(dump) dumpElement(Long.toHexString(uid) + "; FLAGS="); byte flags = this.realInputStream.readByte (); if(dump) dumpElement(Integer.toHexString(flags) + "; FIELD COUNT="); short field_count = this.realInputStream.readShort(); if(dump) dumpElementln(Short.toString(field_count)); ObjectStreamField[] fields = new ObjectStreamField[field_count]; ObjectStreamClass osc = new ObjectStreamClass(name, uid, flags, fields); assignNewHandle(osc); for (int i = 0; i < field_count; i++) { if(dump) dumpElement(" TYPE CODE="); char type_code = (char)this.realInputStream.readByte(); if(dump) dumpElement(type_code + "; FIELD NAME="); String field_name = this.realInputStream.readUTF(); if(dump) dumpElementln(field_name); String class_name; // If the type code is an array or an object we must // decode a String here. In the other case we convert // the type code and pass it to ObjectStreamField. // Type codes are decoded by gnu.java.lang.reflect.TypeSignature. if (type_code == 'L' || type_code == '[') class_name = (String)readObject(); else class_name = String.valueOf(type_code); fields[i] = new ObjectStreamField(field_name, class_name, callersClassLoader); } /* Now that fields have been read we may resolve the class * (and read annotation if needed). */ Class clazz = resolveClass(osc); boolean oldmode = setBlockDataMode(true); osc.setClass(clazz, lookupClass(clazz.getSuperclass())); classLookupTable.put(clazz, osc); setBlockDataMode(oldmode); // find the first non-serializable, non-abstract // class in clazz's inheritance hierarchy Class first_nonserial = clazz.getSuperclass(); // Maybe it is a primitive class, those don't have a super class, // or Object itself. Otherwise we can keep getting the superclass // till we hit the Object class, or some other non-serializable class. if (first_nonserial == null) first_nonserial = clazz; else while (Serializable.class.isAssignableFrom(first_nonserial) || Modifier.isAbstract(first_nonserial.getModifiers())) first_nonserial = first_nonserial.getSuperclass(); final Class local_constructor_class = first_nonserial; osc.firstNonSerializableParentConstructor = (Constructor)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Constructor c = local_constructor_class. getDeclaredConstructor(new Class[0]); if (Modifier.isPrivate(c.getModifiers())) return null; return c; } catch (NoSuchMethodException e) { // error will be reported later, in newObject() return null; } } }); osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz); osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz); ObjectStreamField[] stream_fields = osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields; ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)]; int stream_idx = 0; int real_idx = 0; int map_idx = 0; /* * Check that there is no type inconsistencies between the lists. * A special checking must be done for the two groups: primitive types and * not primitive types. */ checkTypeConsistency(name, real_fields, stream_fields); checkTypeConsistency(name, stream_fields, real_fields); while (stream_idx < stream_fields.length || real_idx < real_fields.length) { ObjectStreamField stream_field = null; ObjectStreamField real_field = null; if (stream_idx == stream_fields.length) { real_field = real_fields[real_idx++]; } else if (real_idx == real_fields.length) { stream_field = stream_fields[stream_idx++]; } else { int comp_val = real_fields[real_idx].compareTo (stream_fields[stream_idx]); if (comp_val < 0) { real_field = real_fields[real_idx++]; } else if (comp_val > 0) { stream_field = stream_fields[stream_idx++]; } else { stream_field = stream_fields[stream_idx++]; real_field = real_fields[real_idx++]; if (stream_field.getType() != real_field.getType()) throw new InvalidClassException ("invalid field type for " + real_field.getName() + " in class " + name); } } /* If some of stream_fields does not correspond to any of real_fields, * or the opposite, then fieldmapping will go short. */ if (map_idx == fieldmapping.length) { ObjectStreamField[] newfieldmapping = new ObjectStreamField[fieldmapping.length + 2]; System.arraycopy(fieldmapping, 0, newfieldmapping, 0, fieldmapping.length); fieldmapping = newfieldmapping; } fieldmapping[map_idx++] = stream_field; fieldmapping[map_idx++] = real_field; } osc.fieldMapping = fieldmapping; return osc; }
| 15,969
|
protected ObjectStreamClass readClassDescriptor() throws ClassNotFoundException, IOException { if(dump) dumpElement("CLASSDESC NAME="); String name = this.realInputStream.readUTF(); if(dump) dumpElement(name + "; UID="); long uid = this.realInputStream.readLong (); if(dump) dumpElement(Long.toHexString(uid) + "; FLAGS="); byte flags = this.realInputStream.readByte (); if(dump) dumpElement(Integer.toHexString(flags) + "; FIELD COUNT="); short field_count = this.realInputStream.readShort(); if(dump) dumpElementln(Short.toString(field_count)); ObjectStreamField[] fields = new ObjectStreamField[field_count]; ObjectStreamClass osc = new ObjectStreamClass(name, uid, flags, fields); assignNewHandle(osc); ClassLoader callersClassLoader = currentLoader(); for (int i = 0; i < field_count; i++) { if(dump) dumpElement(" TYPE CODE="); char type_code = (char)this.realInputStream.readByte(); if(dump) dumpElement(type_code + "; FIELD NAME="); String field_name = this.realInputStream.readUTF(); if(dump) dumpElementln(field_name); String class_name; // If the type code is an array or an object we must // decode a String here. In the other case we convert // the type code and pass it to ObjectStreamField. // Type codes are decoded by gnu.java.lang.reflect.TypeSignature. if (type_code == 'L' || type_code == '[') class_name = (String)readObject(); else class_name = String.valueOf(type_code); fields[i] = new ObjectStreamField(field_name, class_name, callersClassLoader); } /* Now that fields have been read we may resolve the class * (and read annotation if needed). */ Class clazz = resolveClass(osc); boolean oldmode = setBlockDataMode(true); osc.setClass(clazz, lookupClass(clazz.getSuperclass())); classLookupTable.put(clazz, osc); setBlockDataMode(oldmode); // find the first non-serializable, non-abstract // class in clazz's inheritance hierarchy Class first_nonserial = clazz.getSuperclass(); // Maybe it is a primitive class, those don't have a super class, // or Object itself. Otherwise we can keep getting the superclass // till we hit the Object class, or some other non-serializable class. if (first_nonserial == null) first_nonserial = clazz; else while (Serializable.class.isAssignableFrom(first_nonserial) || Modifier.isAbstract(first_nonserial.getModifiers())) first_nonserial = first_nonserial.getSuperclass(); final Class local_constructor_class = first_nonserial; osc.firstNonSerializableParentConstructor = (Constructor)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Constructor c = local_constructor_class. getDeclaredConstructor(new Class[0]); if (Modifier.isPrivate(c.getModifiers())) return null; return c; } catch (NoSuchMethodException e) { // error will be reported later, in newObject() return null; } } }); osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz); osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz); ObjectStreamField[] stream_fields = osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields; ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)]; int stream_idx = 0; int real_idx = 0; int map_idx = 0; /* * Check that there is no type inconsistencies between the lists. * A special checking must be done for the two groups: primitive types and * not primitive types. */ checkTypeConsistency(name, real_fields, stream_fields); checkTypeConsistency(name, stream_fields, real_fields); while (stream_idx < stream_fields.length || real_idx < real_fields.length) { ObjectStreamField stream_field = null; ObjectStreamField real_field = null; if (stream_idx == stream_fields.length) { real_field = real_fields[real_idx++]; } else if (real_idx == real_fields.length) { stream_field = stream_fields[stream_idx++]; } else { int comp_val = real_fields[real_idx].compareTo (stream_fields[stream_idx]); if (comp_val < 0) { real_field = real_fields[real_idx++]; } else if (comp_val > 0) { stream_field = stream_fields[stream_idx++]; } else { stream_field = stream_fields[stream_idx++]; real_field = real_fields[real_idx++]; if (stream_field.getType() != real_field.getType()) throw new InvalidClassException ("invalid field type for " + real_field.getName() + " in class " + name); } } /* If some of stream_fields does not correspond to any of real_fields, * or the opposite, then fieldmapping will go short. */ if (map_idx == fieldmapping.length) { ObjectStreamField[] newfieldmapping = new ObjectStreamField[fieldmapping.length + 2]; System.arraycopy(fieldmapping, 0, newfieldmapping, 0, fieldmapping.length); fieldmapping = newfieldmapping; } fieldmapping[map_idx++] = stream_field; fieldmapping[map_idx++] = real_field; } osc.fieldMapping = fieldmapping; return osc; }
|
protected ObjectStreamClass readClassDescriptor() throws ClassNotFoundException, IOException { if(dump) dumpElement("CLASSDESC NAME="); String name = this.realInputStream.readUTF(); if(dump) dumpElement(name + "; UID="); long uid = this.realInputStream.readLong (); if(dump) dumpElement(Long.toHexString(uid) + "; FLAGS="); byte flags = this.realInputStream.readByte (); if(dump) dumpElement(Integer.toHexString(flags) + "; FIELD COUNT="); short field_count = this.realInputStream.readShort(); if(dump) dumpElementln(Short.toString(field_count)); ObjectStreamField[] fields = new ObjectStreamField[field_count]; ObjectStreamClass osc = new ObjectStreamClass(name, uid, flags, fields); assignNewHandle(osc); ClassLoader callersClassLoader = currentLoader(); for (int i = 0; i < field_count; i++) { if(dump) dumpElement(" TYPE CODE="); char type_code = (char)this.realInputStream.readByte(); if(dump) dumpElement(type_code + "; FIELD NAME="); String field_name = this.realInputStream.readUTF(); if(dump) dumpElementln(field_name); String class_name; // If the type code is an array or an object we must // decode a String here. In the other case we convert // the type code and pass it to ObjectStreamField. // Type codes are decoded by gnu.java.lang.reflect.TypeSignature. if (type_code == 'L' || type_code == '[') class_name = (String)readObject(); else class_name = String.valueOf(type_code); fields[i] = new ObjectStreamField(field_name, class_name); } /* Now that fields have been read we may resolve the class * (and read annotation if needed). */ Class clazz = resolveClass(osc); boolean oldmode = setBlockDataMode(true); osc.setClass(clazz, lookupClass(clazz.getSuperclass())); classLookupTable.put(clazz, osc); setBlockDataMode(oldmode); // find the first non-serializable, non-abstract // class in clazz's inheritance hierarchy Class first_nonserial = clazz.getSuperclass(); // Maybe it is a primitive class, those don't have a super class, // or Object itself. Otherwise we can keep getting the superclass // till we hit the Object class, or some other non-serializable class. if (first_nonserial == null) first_nonserial = clazz; else while (Serializable.class.isAssignableFrom(first_nonserial) || Modifier.isAbstract(first_nonserial.getModifiers())) first_nonserial = first_nonserial.getSuperclass(); final Class local_constructor_class = first_nonserial; osc.firstNonSerializableParentConstructor = (Constructor)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Constructor c = local_constructor_class. getDeclaredConstructor(new Class[0]); if (Modifier.isPrivate(c.getModifiers())) return null; return c; } catch (NoSuchMethodException e) { // error will be reported later, in newObject() return null; } } }); osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz); osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz); ObjectStreamField[] stream_fields = osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields; ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)]; int stream_idx = 0; int real_idx = 0; int map_idx = 0; /* * Check that there is no type inconsistencies between the lists. * A special checking must be done for the two groups: primitive types and * not primitive types. */ checkTypeConsistency(name, real_fields, stream_fields); checkTypeConsistency(name, stream_fields, real_fields); while (stream_idx < stream_fields.length || real_idx < real_fields.length) { ObjectStreamField stream_field = null; ObjectStreamField real_field = null; if (stream_idx == stream_fields.length) { real_field = real_fields[real_idx++]; } else if (real_idx == real_fields.length) { stream_field = stream_fields[stream_idx++]; } else { int comp_val = real_fields[real_idx].compareTo (stream_fields[stream_idx]); if (comp_val < 0) { real_field = real_fields[real_idx++]; } else if (comp_val > 0) { stream_field = stream_fields[stream_idx++]; } else { stream_field = stream_fields[stream_idx++]; real_field = real_fields[real_idx++]; if (stream_field.getType() != real_field.getType()) throw new InvalidClassException ("invalid field type for " + real_field.getName() + " in class " + name); } } /* If some of stream_fields does not correspond to any of real_fields, * or the opposite, then fieldmapping will go short. */ if (map_idx == fieldmapping.length) { ObjectStreamField[] newfieldmapping = new ObjectStreamField[fieldmapping.length + 2]; System.arraycopy(fieldmapping, 0, newfieldmapping, 0, fieldmapping.length); fieldmapping = newfieldmapping; } fieldmapping[map_idx++] = stream_field; fieldmapping[map_idx++] = real_field; } osc.fieldMapping = fieldmapping; return osc; }
| 15,970
|
protected ObjectStreamClass readClassDescriptor() throws ClassNotFoundException, IOException { if(dump) dumpElement("CLASSDESC NAME="); String name = this.realInputStream.readUTF(); if(dump) dumpElement(name + "; UID="); long uid = this.realInputStream.readLong (); if(dump) dumpElement(Long.toHexString(uid) + "; FLAGS="); byte flags = this.realInputStream.readByte (); if(dump) dumpElement(Integer.toHexString(flags) + "; FIELD COUNT="); short field_count = this.realInputStream.readShort(); if(dump) dumpElementln(Short.toString(field_count)); ObjectStreamField[] fields = new ObjectStreamField[field_count]; ObjectStreamClass osc = new ObjectStreamClass(name, uid, flags, fields); assignNewHandle(osc); ClassLoader callersClassLoader = currentLoader(); for (int i = 0; i < field_count; i++) { if(dump) dumpElement(" TYPE CODE="); char type_code = (char)this.realInputStream.readByte(); if(dump) dumpElement(type_code + "; FIELD NAME="); String field_name = this.realInputStream.readUTF(); if(dump) dumpElementln(field_name); String class_name; // If the type code is an array or an object we must // decode a String here. In the other case we convert // the type code and pass it to ObjectStreamField. // Type codes are decoded by gnu.java.lang.reflect.TypeSignature. if (type_code == 'L' || type_code == '[') class_name = (String)readObject(); else class_name = String.valueOf(type_code); fields[i] = new ObjectStreamField(field_name, class_name, callersClassLoader); } /* Now that fields have been read we may resolve the class * (and read annotation if needed). */ Class clazz = resolveClass(osc); boolean oldmode = setBlockDataMode(true); osc.setClass(clazz, lookupClass(clazz.getSuperclass())); classLookupTable.put(clazz, osc); setBlockDataMode(oldmode); // find the first non-serializable, non-abstract // class in clazz's inheritance hierarchy Class first_nonserial = clazz.getSuperclass(); // Maybe it is a primitive class, those don't have a super class, // or Object itself. Otherwise we can keep getting the superclass // till we hit the Object class, or some other non-serializable class. if (first_nonserial == null) first_nonserial = clazz; else while (Serializable.class.isAssignableFrom(first_nonserial) || Modifier.isAbstract(first_nonserial.getModifiers())) first_nonserial = first_nonserial.getSuperclass(); final Class local_constructor_class = first_nonserial; osc.firstNonSerializableParentConstructor = (Constructor)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Constructor c = local_constructor_class. getDeclaredConstructor(new Class[0]); if (Modifier.isPrivate(c.getModifiers())) return null; return c; } catch (NoSuchMethodException e) { // error will be reported later, in newObject() return null; } } }); osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz); osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz); ObjectStreamField[] stream_fields = osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields; ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)]; int stream_idx = 0; int real_idx = 0; int map_idx = 0; /* * Check that there is no type inconsistencies between the lists. * A special checking must be done for the two groups: primitive types and * not primitive types. */ checkTypeConsistency(name, real_fields, stream_fields); checkTypeConsistency(name, stream_fields, real_fields); while (stream_idx < stream_fields.length || real_idx < real_fields.length) { ObjectStreamField stream_field = null; ObjectStreamField real_field = null; if (stream_idx == stream_fields.length) { real_field = real_fields[real_idx++]; } else if (real_idx == real_fields.length) { stream_field = stream_fields[stream_idx++]; } else { int comp_val = real_fields[real_idx].compareTo (stream_fields[stream_idx]); if (comp_val < 0) { real_field = real_fields[real_idx++]; } else if (comp_val > 0) { stream_field = stream_fields[stream_idx++]; } else { stream_field = stream_fields[stream_idx++]; real_field = real_fields[real_idx++]; if (stream_field.getType() != real_field.getType()) throw new InvalidClassException ("invalid field type for " + real_field.getName() + " in class " + name); } } /* If some of stream_fields does not correspond to any of real_fields, * or the opposite, then fieldmapping will go short. */ if (map_idx == fieldmapping.length) { ObjectStreamField[] newfieldmapping = new ObjectStreamField[fieldmapping.length + 2]; System.arraycopy(fieldmapping, 0, newfieldmapping, 0, fieldmapping.length); fieldmapping = newfieldmapping; } fieldmapping[map_idx++] = stream_field; fieldmapping[map_idx++] = real_field; } osc.fieldMapping = fieldmapping; return osc; }
|
protected ObjectStreamClass readClassDescriptor() throws ClassNotFoundException, IOException { if(dump) dumpElement("CLASSDESC NAME="); String name = this.realInputStream.readUTF(); if(dump) dumpElement(name + "; UID="); long uid = this.realInputStream.readLong (); if(dump) dumpElement(Long.toHexString(uid) + "; FLAGS="); byte flags = this.realInputStream.readByte (); if(dump) dumpElement(Integer.toHexString(flags) + "; FIELD COUNT="); short field_count = this.realInputStream.readShort(); if(dump) dumpElementln(Short.toString(field_count)); ObjectStreamField[] fields = new ObjectStreamField[field_count]; ObjectStreamClass osc = new ObjectStreamClass(name, uid, flags, fields); assignNewHandle(osc); ClassLoader callersClassLoader = currentLoader(); for (int i = 0; i < field_count; i++) { if(dump) dumpElement(" TYPE CODE="); char type_code = (char)this.realInputStream.readByte(); if(dump) dumpElement(type_code + "; FIELD NAME="); String field_name = this.realInputStream.readUTF(); if(dump) dumpElementln(field_name); String class_name; // If the type code is an array or an object we must // decode a String here. In the other case we convert // the type code and pass it to ObjectStreamField. // Type codes are decoded by gnu.java.lang.reflect.TypeSignature. if (type_code == 'L' || type_code == '[') class_name = (String)readObject(); else class_name = String.valueOf(type_code); fields[i] = new ObjectStreamField(field_name, class_name, callersClassLoader); } /* Now that fields have been read we may resolve the class * (and read annotation if needed). */ Class clazz = resolveClass(osc); boolean oldmode = setBlockDataMode(true); osc.setClass(clazz, lookupClass(clazz.getSuperclass())); classLookupTable.put(clazz, osc); setBlockDataMode(oldmode); // find the first non-serializable, non-abstract // class in clazz's inheritance hierarchy Class first_nonserial = clazz.getSuperclass(); // Maybe it is a primitive class, those don't have a super class, // or Object itself. Otherwise we can keep getting the superclass // till we hit the Object class, or some other non-serializable class. if (first_nonserial == null) first_nonserial = clazz; else while (Serializable.class.isAssignableFrom(first_nonserial) || Modifier.isAbstract(first_nonserial.getModifiers())) first_nonserial = first_nonserial.getSuperclass(); final Class local_constructor_class = first_nonserial; osc.firstNonSerializableParentConstructor = (Constructor)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { try { Constructor c = local_constructor_class. getDeclaredConstructor(new Class[0]); if (Modifier.isPrivate(c.getModifiers())) return null; return c; } catch (NoSuchMethodException e) { // error will be reported later, in newObject() return null; } } }); osc.realClassIsSerializable = Serializable.class.isAssignableFrom(clazz); osc.realClassIsExternalizable = Externalizable.class.isAssignableFrom(clazz); ObjectStreamField[] stream_fields = osc.fields; ObjectStreamField[] real_fields = ObjectStreamClass.lookupForClassObject(clazz).fields; ObjectStreamField[] fieldmapping = new ObjectStreamField[2 * Math.max(stream_fields.length, real_fields.length)]; int stream_idx = 0; int real_idx = 0; int map_idx = 0; /* * Check that there is no type inconsistencies between the lists. * A special checking must be done for the two groups: primitive types and * not primitive types. */ checkTypeConsistency(name, real_fields, stream_fields); checkTypeConsistency(name, stream_fields, real_fields); while (stream_idx < stream_fields.length || real_idx < real_fields.length) { ObjectStreamField stream_field = null; ObjectStreamField real_field = null; if (stream_idx == stream_fields.length) { real_field = real_fields[real_idx++]; } else if (real_idx == real_fields.length) { stream_field = stream_fields[stream_idx++]; } else { int comp_val = real_fields[real_idx].compareTo (stream_fields[stream_idx]); if (comp_val < 0) { real_field = real_fields[real_idx++]; } else if (comp_val > 0) { stream_field = stream_fields[stream_idx++]; } else { stream_field = stream_fields[stream_idx++]; real_field = real_fields[real_idx++]; if (stream_field.getType() != real_field.getType()) throw new InvalidClassException ("invalid field type for " + real_field.getName() + " in class " + name); } } /* If some of stream_fields does not correspond to any of real_fields, * or the opposite, then fieldmapping will go short. */ if (map_idx == fieldmapping.length) { ObjectStreamField[] newfieldmapping = new ObjectStreamField[fieldmapping.length + 2]; System.arraycopy(fieldmapping, 0, newfieldmapping, 0, fieldmapping.length); fieldmapping = newfieldmapping; } fieldmapping[map_idx++] = stream_field; fieldmapping[map_idx++] = real_field; } osc.fieldMapping = fieldmapping; return osc; }
| 15,971
|
private void readNextBlock() throws IOException { readNextBlock(this.realInputStream.readByte()); }
|
private void readNextBlock() throws IOException { byte marker = this.realInputStream.readByte(); while (marker == TC_RESET) { if(dump) dumpElementln("RESET"); clearHandles(); marker = this.realInputStream.readByte(); } readNextBlock(marker); }
| 15,972
|
public static AlgorithmParameters getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("AlgorithmParameters." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
|
public static AlgorithmParameters getInstance(String algorithm) throws NoSuchAlgorithmException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("AlgorithmParameters." + algorithm); if (classname != null) return getInstance(classname, algorithm, p[i]); } throw new NoSuchAlgorithmException(algorithm); }
| 15,973
|
private void addNotifyContainerChildren() { synchronized (getTreeLock ()) { for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); if (component[i].isLightweight ()) { // If we're not lightweight, and we just got a lightweight // child, we need a lightweight dispatcher to feed it events. if (!this.isLightweight() && dispatcher == null) dispatcher = new LightweightDispatcher (this); if (dispatcher != null) dispatcher.enableEvents(component[i].eventMask); enableEvents(component[i].eventMask); if (peer != null && !isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } } }
|
private void addNotifyContainerChildren() { synchronized (getTreeLock ()) { for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); if (component[i].isLightweight ()) { // If we're not lightweight, and we just got a lightweight // child, we need a lightweight dispatcher to feed it events. if (!this.isLightweight() && dispatcher == null) dispatcher = new LightweightDispatcher (this); if (dispatcher != null) dispatcher.enableEvents(component[i].eventMask); enableEvents(component[i].eventMask); if (peer != null && !isLightweight ()) enableEvents (AWTEvent.PAINT_EVENT_MASK); } } } }
| 15,975
|
public GroupDescriptor(byte src[]) { data = new byte[src.length]; System.arraycopy(src, 0, data, 0, src.length); }
|
public GroupDescriptor(byte src[]) { data = new byte[src.length]; System.arraycopy(src, 0, data, 0, src.length); }
| 15,976
|
public String toString () { String string = null; if (source instanceof Component) string = getClass ().getName () + "[" + paramString () + "] on " + ((Component) source).getName (); else if (source instanceof MenuComponent) string = getClass ().getName () + "[" + paramString () + "] on " + ((MenuComponent) source).getName (); else string = getClass ().getName () + "[" + paramString () + "] on " + source; return string; }
|
public String toString () { String string = null; if (source instanceof Component) string = getClass ().getName () + "[" + paramString () + "] on " + ((Component) source).getName (); else if (source instanceof MenuComponent) string = getClass ().getName () + "[" + paramString () + "] on " + ((MenuComponent) source).getName (); else string = getClass ().getName () + "[" + paramString () + "] on " + source; return string; }
| 15,977
|
private Node successor(Node here, boolean forward) { Node next; // the "leftmost" end is funky if (here == null) { return forward ? root : null; } // // Forward, this is preorder: children before siblings. // Backward, it's postorder: we saw the children already. // if (forward && !isLeaf(here)) { return here.getFirstChild(); } // // Siblings ... if forward, we visit them, if backwards // we visit their children first. // if (forward) { if ((next = here.getNextSibling()) != null) { return next; } } else if ((next = here.getPreviousSibling()) != null) { if (isLeaf(next)) { return next; } next = next.getLastChild(); while (!isLeaf(next)) { next = next.getLastChild(); } return next; } // // We can't go down or lateral -- it's up, then. The logic is // the converse of what's above: backwards is easy (the parent // is next), forwards isn't. // next = here.getParentNode(); if (!forward) { return next; } Node temp = null; while (next != null && next != root && (temp = next.getNextSibling()) == null) { next = next.getParentNode(); } if (next == root) { return null; } return temp; }
|
private Node successor(Node here, boolean forward) { Node next; // the "leftmost" end is funky if (here == null) { return forward ? root : null; } // // Forward, this is preorder: children before siblings. // Backward, it's postorder: we saw the children already. // if (forward && !isLeaf(here)) { return here.getFirstChild(); } // // Siblings ... if forward, we visit them, if backwards // we visit their children first. // if (forward) { if ((next = here.getNextSibling()) != null) { return next; } } else if ((next = here.getPreviousSibling()) != null) { if (isLeaf(next)) { return next; } next = next.getLastChild(); while (!isLeaf(next)) { next = next.getLastChild(); } return next; } // // We can't go down or lateral -- it's up, then. The logic is // the converse of what's above: backwards is easy (the parent // is next), forwards isn't. // next = here.getParentNode(); if (!forward) { return next; } Node temp = null; while (next != null && next != root && (temp = next.getNextSibling()) == null) { next = next.getParentNode(); } if (next == root.getParentNode()) { return null; } return temp; }
| 15,978
|
private IconvProvider() { IconvMetaData.setup(); }
|
public IconvProvider() { IconvMetaData.setup(); }
| 15,979
|
ValueOfNode(TemplateNode children, TemplateNode next, Expr select, boolean disableOutputEscaping) { super(children, next); this.select = select; this.disableOutputEscaping = disableOutputEscaping; }
|
ValueOfNode(TemplateNode children, TemplateNode next, Expr select, boolean disableOutputEscaping) { super(children, next); this.select = select; this.disableOutputEscaping = disableOutputEscaping; }
| 15,980
|
ValueOfNode(TemplateNode children, TemplateNode next, Expr select, boolean disableOutputEscaping) { super(children, next); this.select = select; this.disableOutputEscaping = disableOutputEscaping; }
|
ValueOfNode(TemplateNode children, TemplateNode next, Expr select, boolean disableOutputEscaping) { this.select = select; this.disableOutputEscaping = disableOutputEscaping; }
| 15,981
|
TemplateNode clone(Stylesheet stylesheet) { return new ValueOfNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet), disableOutputEscaping); }
|
TemplateNode clone(Stylesheet stylesheet) { return new ValueOfNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), select.clone(stylesheet), disableOutputEscaping); }
| 15,982
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = select.evaluate(context, pos, len); String value = Expr._string(context, ret); //System.err.println("value-of: "+context+" "+ select + " -> "+ value); if (value != null && value.length() > 0) { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) { textNode.setUserData("disable-output-escaping", "yes", stylesheet); } if (nextSibling != null) { parent.insertBefore(textNode, nextSibling); } else { parent.appendChild(textNode); } } // value-of doesn't process children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
|
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Object ret = select.evaluate(context, pos, len); String value; if (ret instanceof Collection) { StringBuffer buf = new StringBuffer(); for (Iterator i = ((Collection) ret).iterator(); i.hasNext(); ) { Node node = (Node) i.next(); buf.append(Expr.stringValue(node)); } value = buf.toString(); } else { value = Expr._string(context, ret); } //System.err.println("value-of: "+context+" "+ select + " -> "+ value); if (value != null && value.length() > 0) { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); Text textNode = doc.createTextNode(value); if (disableOutputEscaping) { textNode.setUserData("disable-output-escaping", "yes", stylesheet); } if (nextSibling != null) { parent.insertBefore(textNode, nextSibling); } else { parent.appendChild(textNode); } } // value-of doesn't process children if (next != null) { next.apply(stylesheet, mode, context, pos, len, parent, nextSibling); } }
| 15,984
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.