bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = contentRect.y; } else { thumbRect.x = contentRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
|
protected void calculateThumbLocation() { int value = slider.getValue(); if (slider.getOrientation() == JSlider.HORIZONTAL) { thumbRect.x = xPositionForValue(value) - thumbRect.width / 2; thumbRect.y = contentRect.y; } else { thumbRect.x = contentRect.x; thumbRect.y = yPositionForValue(value) - thumbRect.height / 2; } }
| 8,760
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
| 8,761
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
|
protected void calculateThumbSize() { if (slider.getOrientation() == JSlider.HORIZONTAL) { if (thumbWidth > contentRect.width) thumbRect.width = contentRect.width / 4; else thumbRect.width = thumbWidth; if (thumbHeight > contentRect.height) thumbRect.height = contentRect.height; else thumbRect.height = thumbHeight; } else { // The thumb gets flipped when inverted, so thumbWidth // actually is the height and vice versa. if (thumbWidth > contentRect.height) thumbRect.height = contentRect.height / 4; else thumbRect.height = thumbWidth; if (thumbHeight > contentRect.width) thumbRect.width = contentRect.width; else thumbRect.width = thumbHeight; } }
| 8,762
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width; else trackBuffer = thumbRect.height; }
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width / 2; else trackBuffer = thumbRect.height; }
| 8,763
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width; else trackBuffer = thumbRect.height; }
|
protected void calculateTrackBuffer() { if (slider.getOrientation() == JSlider.HORIZONTAL) trackBuffer = thumbRect.width; else trackBuffer = thumbRect.height / 2; }
| 8,764
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
| 8,765
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
|
protected void calculateTrackRect() { if (slider.getOrientation() == JSlider.HORIZONTAL) { trackRect.x = contentRect.x + trackBuffer; trackRect.y = contentRect.y; trackRect.width = contentRect.width - 2 * trackBuffer; trackRect.height = thumbRect.height; } else { trackRect.x = contentRect.x; trackRect.y = contentRect.y + trackBuffer; trackRect.width = thumbRect.width; trackRect.height = contentRect.height - 2 * trackBuffer; } }
| 8,766
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) { int height = getThumbSize().height; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += getTickLength(); if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(32767, height); } else return getPreferredVerticalSize(); }
| 8,767
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMaximumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else { int width = getThumbSize().width; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += getTickLength(); if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, 32767); } }
| 8,768
|
public Dimension getMinimumHorizontalSize() { return getPreferredHorizontalSize(); }
|
public Dimension getMinimumHorizontalSize() { Insets insets = slider.getInsets(); int height = getThumbSize().height; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += getTickLength(); if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(36, height); }
| 8,769
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getMinimumHorizontalSize(); else return getPreferredVerticalSize(); }
| 8,770
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getPreferredVerticalSize(); }
|
public Dimension getMinimumSize(JComponent c) { if (slider.getOrientation() == JSlider.HORIZONTAL) return getPreferredHorizontalSize(); else return getMinimumVerticalSize(); }
| 8,771
|
public Dimension getMinimumVerticalSize() { return getPreferredVerticalSize(); }
|
public Dimension getMinimumVerticalSize() { Insets insets = slider.getInsets(); int width = getThumbSize().width; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += getTickLength(); if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, 36); }
| 8,772
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += tickHeight; if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = getThumbSize().height; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += tickHeight; if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
| 8,773
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += tickHeight; if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
|
public Dimension getPreferredHorizontalSize() { Insets insets = slider.getInsets(); // The width should cover all the labels (which are usually the // deciding factor of the width) int width = getWidthOfWidestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); // If there are not enough labels. // This number is pretty much arbitrary, but it looks nice. if (width < 200) width = 200; // We can only draw inside of the focusRectangle, so we have to // pad it with insets. width += insets.left + insets.right + focusInsets.left + focusInsets.right; // Height is determined by the thumb, the ticks and the labels. int height = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) height += getTickLength(); if (slider.getPaintLabels()) height += getHeightOfTallestLabel(); height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; return new Dimension(width, height); }
| 8,774
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += tickHeight; if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = getThumbSize().width; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += tickHeight; if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
| 8,775
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += tickHeight; if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
|
public Dimension getPreferredVerticalSize() { Insets insets = slider.getInsets(); int height = getHeightOfTallestLabel() * (slider.getLabelTable() == null ? 0 : slider.getLabelTable() .size()); if (height < 200) height = 200; height += insets.top + insets.bottom + focusInsets.top + focusInsets.bottom; int width = thumbHeight; if (slider.getPaintTicks() && slider.getMajorTickSpacing() > 0 || slider.getMinorTickSpacing() > 0) width += getTickLength(); if (slider.getPaintLabels()) width += getWidthOfWidestLabel(); width += insets.left + insets.right + focusInsets.left + focusInsets.right; return new Dimension(width, height); }
| 8,776
|
protected Dimension getThumbSize() { // This is really just the bounds box for the thumb. // The thumb will actually be pointed (like a rectangle + triangle at bottom) return thumbRect.getSize(); }
|
protected Dimension getThumbSize() { // This is really just the bounds box for the thumb. // The thumb will actually be pointed (like a rectangle + triangle at bottom) if (slider.getOrientation() == JSlider.HORIZONTAL) return new Dimension(11, 20); else return new Dimension(20, 11); }
| 8,777
|
protected int getTickLength() { return tickHeight; }
|
protected int getTickLength() { return 8; }
| 8,778
|
protected void installDefaults(JSlider slider) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); slider.setForeground(defaults.getColor("Slider.foreground")); slider.setBackground(defaults.getColor("Slider.background")); shadowColor = defaults.getColor("Slider.shadow"); highlightColor = defaults.getColor("Slider.highlight"); focusColor = defaults.getColor("Slider.focus"); slider.setBorder(defaults.getBorder("Slider.border")); slider.setOpaque(true); thumbHeight = defaults.getInt("Slider.thumbHeight"); thumbWidth = defaults.getInt("Slider.thumbWidth"); tickHeight = defaults.getInt("Slider.tickHeight"); focusInsets = defaults.getInsets("Slider.focusInsets"); }
|
protected void installDefaults(JSlider slider) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); slider.setForeground(defaults.getColor("Slider.foreground")); slider.setBackground(defaults.getColor("Slider.background")); shadowColor = defaults.getColor("Slider.shadow"); highlightColor = defaults.getColor("Slider.highlight"); focusColor = defaults.getColor("Slider.focus"); slider.setBorder(defaults.getBorder("Slider.border")); slider.setOpaque(true); thumbHeight = defaults.getInt("Slider.thumbHeight"); thumbWidth = defaults.getInt("Slider.thumbWidth"); tickHeight = defaults.getInt("Slider.tickHeight"); focusInsets = defaults.getInsets("Slider.focusInsets"); }
| 8,779
|
protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.y + tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 2); g.setColor(saved); }
|
protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 2); g.setColor(saved); }
| 8,780
|
protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.x + tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 2, y); g.setColor(saved); }
|
protected void paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 2, y); g.setColor(saved); }
| 8,781
|
protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.y + tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 4); g.setColor(saved); }
|
protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) { int y = tickRect.height / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x, y + tickRect.height / 4); g.setColor(saved); }
| 8,782
|
protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.x + tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 4, y); g.setColor(saved); }
|
protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) { int x = tickRect.width / 4; Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(x, y, x + tickRect.width / 4, y); g.setColor(saved); }
| 8,783
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,784
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon light; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,785
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,786
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,787
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,788
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,789
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,790
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,791
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,792
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
|
public void paintThumb(Graphics g) { Color saved_color = g.getColor(); Polygon thumb = new Polygon(); Point a = new Point(thumbRect.x, thumbRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Point e = new Point(a); Polygon bright; Polygon dark; Polygon all; // This will be in X-dimension if the slider is inverted and y if it isn't. int turnPoint; if (slider.getOrientation() == JSlider.HORIZONTAL) { turnPoint = thumbRect.height * 3 / 4; b.translate(thumbRect.width, 0); c.translate(thumbRect.width, turnPoint); d.translate(thumbRect.width / 2, thumbRect.height); e.translate(0, turnPoint); bright = new Polygon(new int[] { b.x, a.x, e.x, d.x }, new int[] { b.y, a.y, e.y, d.y }, 4); dark = new Polygon(new int[] { b.x, c.x, d.x }, new int[] { b.y, c.y, d.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y + 1, e.y }, 5); } else { turnPoint = thumbRect.width * 3 / 4; b.translate(turnPoint, 0); c.translate(thumbRect.width, thumbRect.height / 2); d.translate(turnPoint, thumbRect.height); e.translate(0, thumbRect.height); bright = new Polygon(new int[] { c.x, b.x, a.x, e.x }, new int[] { c.y, b.y, a.y, e.y }, 4); dark = new Polygon(new int[] { c.x, d.x, e.x + 1 }, new int[] { c.y, d.y, e.y }, 3); all = new Polygon(new int[] { a.x + 1, b.x, c.x - 1, d.x, e.x + 1 }, new int[] { a.y + 1, b.y + 1, c.y, d.y, e.y }, 5); } g.setColor(Color.WHITE); g.drawPolyline(bright.xpoints, bright.ypoints, bright.npoints); g.setColor(Color.BLACK); g.drawPolyline(dark.xpoints, dark.ypoints, dark.npoints); g.setColor(Color.GRAY); g.fillPolygon(all); g.setColor(saved_color); }
| 8,793
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,795
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,796
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,797
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,798
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,799
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,800
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,801
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,802
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,803
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
|
public void paintTicks(Graphics g) { int max = slider.getMaximum(); int min = slider.getMinimum(); int majorSpace = slider.getMajorTickSpacing(); int minorSpace = slider.getMinorTickSpacing(); if (majorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : majorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -majorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += majorSpace) { paintMajorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } if (minorSpace > 0) { if (slider.getOrientation() == JSlider.HORIZONTAL) { double loc = tickRect.x; double increment = (max == min) ? 0 : minorSpace * (double) tickRect.width / (max - min); if (drawInverted()) { loc += tickRect.width; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForHorizSlider(g, tickRect, (int) loc); loc += increment; } } else { double loc = tickRect.height + tickRect.y; double increment = (max == min) ? 0 : -minorSpace * (double) tickRect.height / (max - min); if (drawInverted()) { loc = tickRect.y; increment *= -1; } for (int i = min; i <= max; i += minorSpace) { paintMinorTickForVertSlider(g, tickRect, (int) loc); loc += increment; } } } }
| 8,804
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Polygon high; Polygon shadow; if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
|
public void paintTrack(Graphics g) { Color saved_color = g.getColor(); int width; int height; Point a = new Point(trackRect.x, trackRect.y); Point b = new Point(a); Point c = new Point(a); Point d = new Point(a); Polygon high; Polygon shadow; if (slider.getOrientation() == JSlider.HORIZONTAL) { width = trackRect.width; height = (thumbRect.height / 4 == 0) ? 1 : thumbRect.height / 4; a.translate(0, (trackRect.height / 2) - (height / 2)); b.translate(0, (trackRect.height / 2) + (height / 2)); c.translate(trackRect.width, (trackRect.height / 2) + (height / 2)); d.translate(trackRect.width, (trackRect.height / 2) - (height / 2)); } else { width = (thumbRect.width / 4 == 0) ? 1 : thumbRect.width / 4; height = trackRect.height; a.translate((trackRect.width / 2) - (width / 2), 0); b.translate((trackRect.width / 2) - (width / 2), trackRect.height); c.translate((trackRect.width / 2) + (width / 2), trackRect.height); d.translate((trackRect.width / 2) + (width / 2), 0); } g.setColor(Color.GRAY); g.fillRect(a.x, a.y, width, height); g.setColor(getHighlightColor()); g.drawLine(b.x, b.y, c.x, c.y); g.drawLine(c.x, c.y, d.x, d.y); g.setColor(getShadowColor()); g.drawLine(b.x, b.y, a.x, a.y); g.drawLine(a.x, a.y, d.x, d.y); g.setColor(saved_color); }
| 8,806
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForXPosition(int xPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((xPos - trackRect.x) * (max - min) / len + min); else value = ((len - (xPos - trackRect.x)) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 8,807
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
|
public int valueForYPosition(int yPos) { int min = slider.getMinimum(); int max = slider.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. if (len == 0) return ((max - min) / 2); if (! drawInverted()) value = ((len - (yPos - trackRect.y)) * (max - min) / len + min); else value = ((yPos - trackRect.y) * (max - min) / len + min); // If this isn't a legal value, then we'll have to move to one now. if (value > max) value = max; else if (value < min) value = min; return value; }
| 8,808
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
| 8,809
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
|
protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.width; int xPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) xPos += trackRect.x; else { xPos = trackRect.width - xPos; xPos += trackRect.x; } return xPos; }
| 8,810
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
| 8,811
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
|
protected int yPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); int extent = slider.getExtent(); int len = trackRect.height; int yPos = (max == min) ? 0 : (value - min) * len / (max - min); if (! drawInverted()) { yPos = trackRect.height - yPos; yPos += trackRect.y; } else yPos += trackRect.y; return yPos; }
| 8,812
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObj(this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
|
public Group removeFromGroup (Group groupObject) { if (groupObject != null) { if (groupMemberHash.contains(groupObject)) { //this object does belong to the indicated Group object groupObject.removeMemberObject((Object) this); groupMemberHash.remove(groupObject); return groupObject; } else { Log.error("Can't delete from group. not a member of the group" + groupObject.getName()); return null; } } else { Log.error("Error: The group to add to is null"); return null; } }
| 8,813
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList !=null) { if ( what !=null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
|
protected boolean removeFromList ( Object what, List fromList, String listName ) { if (fromList !=null) { if ( what !=null) { int index = fromList.indexOf(what); if (index !=-1) { //object to be removed is found in the list fromList.remove(index); return true; } else { //cant find the object in the list Log.warn("warn: can't find object in" + listName + ", ignoring remove"); return false; } } else { //object to remove is null Log.error("Error: object to remove is null"); return false; } } else { //the list to remove from is null Log.error("Error: Passed list to remove from is null, no object to remove"); return false; } }
| 8,814
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.error("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXDFOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes if (!XMLDeclAttribs.isEmpty()) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); } // 1. open this node, print its simple XML attributes if (nodeNameString != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired // For printing the opening statement we need to invoke a little // Voodoo to keep the DTD happy: the first structure node is always // called by the root node name instead of the usual nodeNameString // We can tell this by checking if this object is derived from class // Structure and if XMLDeclAttrib defined/populated with information // NOTE: This isnt really the way to do this. We need to check if 'this' is // is or has as a superclass xdf.Structure instead of the 'string check' below. // check is class Strucuture & XMLDeclAttribs populated? if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream,"<" + sXDFRootNodeName); // print opening root node statement } else { writeOut(outputstream,"<" + nodeNameString); // print opening statement } } // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); // is synchronized here correct? synchronized(attribs) { for (int i = 0; i < attribs.size(); i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } // 3. Print out Node PCData or Child Nodes as specified by object ref // XML attributes. The way this stuff occurs will also affect how we // close the node. ArrayList childObjs = (ArrayList) xmlInfo.get("childObjList"); String pcdata = (String) xmlInfo.get("PCDATA"); if ( childObjs.size() > 0 || pcdata != null || noChildObjectNodeName != null) { // close the opening tag if (nodeNameString != null) { writeOut(outputstream, ">"); if (sPrettyXDFOutput && pcdata == null) writeOut(outputstream, Constants.NEW_LINE); } // deal with object/list XML attributes, if any in our list for (int i = 0; i < childObjs.size(); i++) { Hashtable item = (Hashtable) childObjs.get(i); if (item.get("type") == Constants.LIST_TYPE) { List objectList = (List) item.get("value"); // Im not sure this synchronized wrapper is needed, we are // only accessing stuff here.. Also, should synchronzied wrapper // occur back in the getXMLInfo method instead where the orig // access occured?!? synchronized(objectList) { Iterator iter = objectList.iterator(); // Must be in synchronized block while (iter.hasNext()) { BaseObject containedObj = (BaseObject) iter.next(); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } } else if (item.get("type") == Constants.OBJECT_TYPE) { BaseObject containedObj = (BaseObject) item.get("value"); if (containedObj != null) { // can happen from pre-allocation of axis values, etc (?) // shouldnt this be synchronized too?? synchronized(containedObj) { String newindent = indent + sPrettyXDFOutputIndentation; dealWithOpeningGroupNodes(containedObj, outputstream, indent); dealWithClosingGroupNodes(containedObj, outputstream, indent); containedObj.toXDFOutputStream(outputstream, new Hashtable(), newindent); } } } else { // error: weird type, actually shouldnt occur. Is this needed?? Log.errorln("Weird error: unknown XML attribute type for item:"+item); } } // print out PCDATA, if any if(pcdata != null) { writeOut(outputstream, pcdata); //write out closing node after PCDATA, leaving no space between them. //k.z. 10/18/2000 if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); return ; //now we are done, return! //k.z. 10/18/2000 }; // if there are no PCDATA or child objects/nodes then // we print out noChildObjectNodeName if ( childObjs.size() == 0 && pcdata == null && noChildObjectNodeName != null) { if (sPrettyXDFOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + noChildObjectNodeName + "/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // ok, now deal with closing the node if (nodeNameString != null) { // Needed?? //dealWithClosingGroupNodes(containedObj, outputstream, indent); //Brian: we have to fix this, no whitespace should be allowed between //PCDATA and closing node if (sPrettyXDFOutput) writeOut(outputstream, indent); if (!dontCloseNode) if ( nodeNameString.equals(sXDFStructureNodeName) && !XMLDeclAttribs.isEmpty() ) { writeOut(outputstream, "</"+sXDFRootNodeName+">"); } else { writeOut(outputstream, "</"+nodeNameString+">"); } } } else { if(dontCloseNode) { // it may not have sub-objects, but we dont want to close it // (happens for group objects) } else { // no sub-objects, just close this node writeOut(outputstream, "/>"); } } if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 8,815
|
public static Component createGlue() { Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE,Short.MAX_VALUE) ); return glue; }
|
public static Component createGlue() { Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE,Short.MAX_VALUE) ); return glue; }
| 8,817
|
public static Component createHorizontalGlue() { Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE, 0) ); return glue; }
|
public static Component createHorizontalGlue() { Filler glue = new Filler(new Dimension(0,0), new Dimension(0,0), new Dimension(Short.MAX_VALUE, 0) ); return glue; }
| 8,818
|
public final KeyboardEvent interpretScancode(int scancode) { final boolean extendedMode = this.extendedMode; if (scancode == XT_EXTENDED) { this.extendedMode = true; return null; } else { this.extendedMode = false; } final boolean released = ((scancode & XT_RELEASE) != 0); final long time = System.currentTimeMillis(); scancode &= 0x7f; int vk = deriveKeyCode(scancode, extendedMode); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey(); adjustFlags(vk, released); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); try { final char ch; ch = interpretExtendedScanCode(scancode, vk, released, extendedMode); return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (UnsupportedKeyException e) { final char ch; if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getUpperChar(); if (!extendedMode) vk = keys.getKey(scancode).getUpperVirtuelKey(); } else if ((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getAltGrChar(); if (!extendedMode) vk = keys.getKey(scancode).getAltGrVirtuelKey(); } else { ch = keys.getKey(scancode).getLowerChar(); } return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (DeadKeyException e) { return null; } }
|
public final KeyboardEvent interpretScancode(int scancode) { final boolean extendedMode = this.extendedMode; if (scancode == XT_EXTENDED) { this.extendedMode = true; return null; } else { this.extendedMode = false; } final boolean released = ((scancode & XT_RELEASE) != 0); final long time = System.currentTimeMillis(); scancode &= 0x7f; int vk = deriveKeyCode(scancode, extendedMode); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey(); adjustFlags(vk, released); // debug output to find new keycodes// System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/); try { final char ch; ch = interpretExtendedScanCode(scancode, vk, released, extendedMode); return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (UnsupportedKeyException e) { final char ch; if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getUpperChar(); if (!extendedMode) vk = keys.getKey(scancode).getUpperVirtuelKey(); } else if ((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { ch = keys.getKey(scancode).getAltGrChar(); if (!extendedMode) vk = keys.getKey(scancode).getAltGrVirtuelKey(); } else { ch = keys.getKey(scancode).getLowerChar(); } return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch); } catch (DeadKeyException e) { return null; } }
| 8,819
|
public TabSet(TabStop[] t) { tabs = t; }
|
public TabSet(TabStop[] t) { if (t != null) tabs = (TabStop[]) t.clone(); else tabs = new TabStop[0]; }
| 8,820
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
| 8,822
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
| 8,823
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return idx; }
|
public int getTabIndexAfter(float location) { int idx = -1; for (int i = 0; i < tabs.length; ++i) { if (location < tabs[i].getPosition()) idx = i; } return -1; }
| 8,824
|
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < tabs.length; ++i) { if (i != 0) sb.append(" - "); sb.append(tabs[i].toString()); } sb.append("]"); return sb.toString(); }
|
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[ "); for (int i = 0; i < tabs.length; ++i) { if (i != 0) sb.append(" - "); sb.append(tabs[i].toString()); } sb.append("]"); return sb.toString(); }
| 8,825
|
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < tabs.length; ++i) { if (i != 0) sb.append(" - "); sb.append(tabs[i].toString()); } sb.append("]"); return sb.toString(); }
|
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < tabs.length; ++i) { if (i != 0) sb.append(" - "); sb.append(tabs[i].toString()); } sb.append(" ]"); return sb.toString(); }
| 8,826
|
public static Font decode (String fontspec){ String name = null; int style = PLAIN; int size = 12; StringTokenizer st = new StringTokenizer(fontspec, "-"); while (st.hasMoreTokens()) { String token = st.nextToken(); if (name == null) { name = token; continue; } if (token.toUpperCase().equals("BOLD")) { style = BOLD; continue; } if (token.toUpperCase().equals("ITALIC")) { style = ITALIC; continue; } if (token.toUpperCase().equals("BOLDITALIC")) { style = BOLD | ITALIC; continue; } int tokenval = 0; try { tokenval = Integer.parseInt(token); } catch(NumberFormatException e) { // Ignored. } if (tokenval != 0) size = tokenval; } HashMap attrs = new HashMap(); ClasspathFontPeer.copyStyleToAttrs (style, attrs); ClasspathFontPeer.copySizeToAttrs (size, attrs); return getFontFromToolkit (name, attrs);}
|
public static Font decode (String fontspec){ String name = null; int style = PLAIN; int size = 12; StringTokenizer st = new StringTokenizer(fontspec, "- "); while (st.hasMoreTokens()) { String token = st.nextToken(); if (name == null) { name = token; continue; } if (token.toUpperCase().equals("BOLD")) { style = BOLD; continue; } if (token.toUpperCase().equals("ITALIC")) { style = ITALIC; continue; } if (token.toUpperCase().equals("BOLDITALIC")) { style = BOLD | ITALIC; continue; } int tokenval = 0; try { tokenval = Integer.parseInt(token); } catch(NumberFormatException e) { // Ignored. } if (tokenval != 0) size = tokenval; } HashMap attrs = new HashMap(); ClasspathFontPeer.copyStyleToAttrs (style, attrs); ClasspathFontPeer.copySizeToAttrs (size, attrs); return getFontFromToolkit (name, attrs);}
| 8,827
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); DerUtil.checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 8,830
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); DerUtil.checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 8,831
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); DerUtil.checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 8,832
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 8,833
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 8,834
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
|
public PrivateKey decodePrivateKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger version, p, q, g, x; DERReader der = new DERReader(input); try { DERValue derPKI = der.read(); checkIsConstructed(derPKI, "Wrong PrivateKeyInfo field"); DERValue derVersion = der.read(); if (! (derVersion.getValue() instanceof BigInteger)) throw new InvalidParameterException("Wrong Version field"); version = (BigInteger) derVersion.getValue(); if (version.compareTo(BigInteger.ZERO) != 0) throw new InvalidParameterException("Unexpected Version: " + version); DERValue derAlgoritmID = der.read(); checkIsConstructed(derAlgoritmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DSS Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); byte[] xBytes = (byte[]) val.getValue(); x = new BigInteger(1, xBytes); } catch (IOException e) { InvalidParameterException y = new InvalidParameterException(); y.initCause(e); throw y; } return new GnuDHPrivateKey(Registry.PKCS8_ENCODING_ID, q, p, g, x); }
| 8,835
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); DerUtil.checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,836
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); DerUtil.checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,837
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); DerUtil.checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,838
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,839
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,840
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); DerUtil.checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,841
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
|
public PublicKey decodePublicKey(byte[] input) { if (input == null) throw new InvalidParameterException("Input bytes MUST NOT be null"); BigInteger p, g, q, y; DERReader der = new DERReader(input); try { DERValue derSPKI = der.read(); checkIsConstructed(derSPKI, "Wrong SubjectPublicKeyInfo field"); DERValue derAlgorithmID = der.read(); checkIsConstructed(derAlgorithmID, "Wrong AlgorithmIdentifier field"); DERValue derOID = der.read(); if (! (derOID.getValue() instanceof OID)) throw new InvalidParameterException("Wrong Algorithm field"); OID algOID = (OID) derOID.getValue(); if (! algOID.equals(DH_ALG_OID)) throw new InvalidParameterException("Unexpected OID: " + algOID); DERValue derParams = der.read(); checkIsConstructed(derParams, "Wrong DH Parameters field"); DERValue val = der.read(); checkIsBigInteger(val, "Wrong P field"); p = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong G field"); g = (BigInteger) val.getValue(); val = der.read(); checkIsBigInteger(val, "Wrong Q field"); q = (BigInteger) val.getValue(); val = der.read(); if (! (val.getValue() instanceof BitString)) throw new InvalidParameterException("Wrong SubjectPublicKey field"); byte[] yBytes = ((BitString) val.getValue()).toByteArray(); DERReader dhPub = new DERReader(yBytes); val = dhPub.read(); DerUtil.checkIsBigInteger(val, "Wrong Y field"); y = (BigInteger) val.getValue(); } catch (IOException x) { InvalidParameterException e = new InvalidParameterException(); e.initCause(x); throw e; } return new GnuDHPublicKey(Registry.X509_ENCODING_ID, q, p, g, y); }
| 8,842
|
public synchronized void readConfiguration() throws IOException, SecurityException { String path; InputStream inputStream; path = System.getProperty("java.util.logging.config.file"); if ((path == null) || (path.length() == 0)) { String url = (System.getProperty("gnu.classpath.home.url") + "/logging.properties"); inputStream = new URL(url).openStream(); } else inputStream = new java.io.FileInputStream(path); try { readConfiguration(inputStream); } finally { /* Close the stream in order to save * resources such as file descriptors. */ inputStream.close(); } }
|
public synchronized void readConfiguration() throws IOException, SecurityException { String path; InputStream inputStream; path = System.getProperty("java.util.logging.config.file"); if ((path == null) || (path.length() == 0)) { String url = (System.getProperty("gnu.classpath.home.url") + "/logging.properties"); inputStream = new URL(url).openStream(); } else inputStream = new java.io.FileInputStream(path); try { readConfiguration(inputStream); } finally { /* Close the stream in order to save * resources such as file descriptors. */ inputStream.close(); } }
| 8,844
|
public DHCPMessage(BOOTPHeader hdr, int msgType) { this(hdr); messageType = msgType; }
|
public DHCPMessage(BOOTPHeader hdr, int msgType) { this(hdr); messageType = msgType; }
| 8,845
|
public void invalidateLayout(Container target) { synchronized (this) { glassPaneBounds = null; layeredPaneBounds = null; contentPaneBounds = null; menuBarBounds = null; prefSize = null; } }
|
public void invalidateLayout(Container target) { synchronized (this) { glassPaneBounds = null; layeredPaneBounds = null; contentPaneBounds = null; menuBarBounds = null; } }
| 8,846
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
| 8,847
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
|
public Dimension preferredLayoutSize(Container c) { // We must synchronize here, otherwise we cannot guarantee that the // prefSize is still non-null when returning. synchronized (this) { if (prefSize == null) { Insets i = getInsets(); prefSize = new Dimension(i.left + i.right, i.top + i.bottom); Dimension contentPrefSize = contentPane.getPreferredSize(); prefSize.width += contentPrefSize.width; prefSize.height += contentPrefSize.height; if (menuBar != null) { Dimension menuBarSize = menuBar.getPreferredSize(); if (menuBarSize.width > contentPrefSize.width) prefSize.width += menuBarSize.width - contentPrefSize.width; prefSize.height += menuBarSize.height; } } // Return a copy here so the cached value won't get trashed by some // other component. return new Dimension(prefSize); } }
| 8,848
|
protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w); titlePane.setBorder(new EmptyBorder(2, 2, 2, 2)); return titlePane; }
|
protected JComponent createNorthPane(JInternalFrame w) { titlePane = new MetalInternalFrameTitlePane(w); return titlePane; }
| 8,849
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalInternalFrameUI instance; if (o == null) { instance = new MetalInternalFrameUI((JInternalFrame) component); instances.put(component, instance); } else instance = (MetalInternalFrameUI) o; return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalInternalFrameUI instance; if (o == null) { instance = new MetalInternalFrameUI((JInternalFrame) component); instances.put(component, instance); } else instance = (MetalInternalFrameUI) o; return instance; }
| 8,850
|
public static RepaintManager currentManager(Component component) { if (currentRepaintManagers == null) currentRepaintManagers = new HashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); RepaintManager currentManager = (RepaintManager) currentRepaintManagers.get(threadGroup); if (currentManager == null) { currentManager = new RepaintManager(); currentRepaintManagers.put(threadGroup, currentManager); } return currentManager; }
|
public static RepaintManager currentManager(Component component) { if (currentRepaintManagers == null) currentRepaintManagers = new WeakHashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); RepaintManager currentManager = (RepaintManager) currentRepaintManagers.get(threadGroup); if (currentManager == null) { currentManager = new RepaintManager(); currentRepaintManagers.put(threadGroup, currentManager); } return currentManager; }
| 8,851
|
public static void setCurrentManager(RepaintManager manager) { if (currentRepaintManagers == null) currentRepaintManagers = new HashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); currentRepaintManagers.put(threadGroup, manager); }
|
public static void setCurrentManager(RepaintManager manager) { if (currentRepaintManagers == null) currentRepaintManagers = new WeakHashMap(); ThreadGroup threadGroup = Thread.currentThread().getThreadGroup(); currentRepaintManagers.put(threadGroup, manager); }
| 8,852
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
| 8,853
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
|
public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // grab parent node name String parentNodeName = getParentNodeName(); // create new object appropriately Value newvalue = new Value(); // reconsitute the value node PCdata from passed information. // and add value to object newvalue.setValue( new String (buf, offset, len) ); // determine where this goes and then insert it if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { newvalue = LastParameterObject.addValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.AXIS) ) { List axisList = (List) CurrentArray.getAxisList(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); newvalue = lastAxisObject.addAxisValue(newvalue); } else if ( parentNodeName.equals(XDFNodeName.VALUEGROUP) ) { // nothing here yet } else { Log.errorln("Error: weird parent node "+parentNodeName+" for value."); System.exit(-1); // fatal error, shut down } // 4. add this object to all open groups Iterator iter = CurrentValueGroupList.iterator(); while (iter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) iter.next(); newvalue.addToGroup(nextValueGroupObj); } }
| 8,854
|
public void processingInstruction(String target, String data) throws SAXException { // Log.debugln("<?"+target+" "+data+"?>"); // do nothing, method required by interface }
|
Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); publicLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); voidLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); processingInstruction(StringLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); target,Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); StringLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); data)Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); throwsLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); SAXExceptionLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); {Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); //Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("<?"+target+"Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); "+data+"?>");Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); //Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); doLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); nothing,Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); methodLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); requiredLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); byLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); interfaceLog.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); Log.debugln("H_PROCESSING_INSTRUCTION:"+"<?"+target+" "+data+"?>"); }
| 8,856
|
public void setDocumentLocator (org.xml.sax.Locator l) { // we'd record this if we needed to resolve relative URIs // in content or attributes, or wanted to give diagnostics. // Right now, do nothing here. // do nothing, method required by interface }
|
publicvoidsetDocumentLocator(org.xml.sax.Locatorl){//we'drecordthisifweneededtoresolverelativeURIs//incontentorattributes,orwantedtogivediagnostics.//Rightnow,donothinghere.//donothing,methodrequiredbyinterface}
| 8,857
|
public final void invokeJavaMethod(String signature, X86CompilerContext context) { os.writeCALL(Register.EAX, context.getVmMethodNativeCodeField().getOffset()); //writeJumpTableCALL(X86JumpTable.VM_INVOKE_OFS); char ch = signature.charAt(signature.length() - 1); if (ch == 'V') { /** No return value */ } else if ((ch == 'J') || (ch == 'D')) { /** Wide return value */ writePUSH(Register.EDX); writePUSH(Register.EAX); } else { /** Normal return value */ writePUSH(Register.EAX); } }
|
public final void invokeJavaMethod(String signature, X86CompilerContext context) { os.writeCALL(Register.EAX, context.getVmMethodNativeCodeField().getOffset()); //writeJumpTableCALL(X86JumpTable.VM_INVOKE_OFS); char ch = signature.charAt(signature.length() - 1); if (ch == 'V') { /** No return value */ } else if ((ch == 'J') || (ch == 'D')) { /** Wide return value */ writePUSH(Register.EDX); writePUSH(Register.EAX); } else { /** Normal return value */ writePUSH(Register.EAX); } }
| 8,859
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
| 8,860
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
|
public final void writeLoadSTATICS(X86CompilerContext context) { final int offset = context.getVmProcessorStaticsTable().getOffset(); os.writeXOR(STATICS, STATICS); os.writePrefix(X86Constants.FS_PREFIX); os.writeMOV(INTSIZE, STATICS, STATICS, offset); }
| 8,861
|
public ISO9660File(ISO9660Entry entry) { this.entry = entry; }
|
public ISO9660File(ISO9660Entry entry) { this.entry = entry; }
| 8,862
|
public void flush() throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void flush() throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
| 8,863
|
public FileSystem getFileSystem() { return null; }
|
public FileSystem getFileSystem() { return null; }
| 8,864
|
public long getLength() { return entry.getCDFSentry().getDataLength(); }
|
public long getLength() { return entry.getCDFSentry().getDataLength(); }
| 8,865
|
public boolean isValid() { return true; }
|
public boolean isValid() { return true; }
| 8,866
|
public void read(long fileOffset, byte[] dest, int off, int len) throws IOException { this.entry.getCDFSentry().readFileData(fileOffset,dest,off,len); }
|
public void read(long fileOffset, byte[] dest, int off, int len) throws IOException { this.entry.getCDFSentry().readFileData(fileOffset,dest,off,len); }
| 8,867
|
public void setLength(long length) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
|
public void setLength(long length) throws IOException { throw new UnsupportedOperationException("Not yet implemented"); }
| 8,868
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.