rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
synchronized (raf)
if (pos == buffer.length)
public int read() throws IOException { if (filepos == end) return -1; synchronized (raf) { raf.seek(filepos++); return raf.read(); } }
raf.seek(filepos++); return raf.read();
bufferOffset += buffer.length; pos = 0; fillBuffer();
public int read() throws IOException { if (filepos == end) return -1; synchronized (raf) { raf.seek(filepos++); return raf.read(); } }
return buffer[pos++] & 0xFF;
public int read() throws IOException { if (filepos == end) return -1; synchronized (raf) { raf.seek(filepos++); return raf.read(); } }
public long skip(long amount)
public long skip(long amount) throws IOException
public long skip(long amount) { if (amount < 0) throw new IllegalArgumentException(); if (amount > end - filepos) amount = end - filepos; filepos += amount; return amount; }
throw new IllegalArgumentException(); if (amount > end - filepos) amount = end - filepos; filepos += amount;
return 0; if (amount > end - (bufferOffset + pos)) amount = end - (bufferOffset + pos); seek(bufferOffset + pos + amount);
public long skip(long amount) { if (amount < 0) throw new IllegalArgumentException(); if (amount > end - filepos) amount = end - filepos; filepos += amount; return amount; }
private void checkZipFile() throws IOException, ZipException
private void checkZipFile() throws ZipException
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
byte[] magicBuf = new byte[4]; boolean validRead = true;
boolean valid = false;
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
raf.readFully(magicBuf);
byte[] buf = new byte[4]; raf.readFully(buf); int sig = buf[0] & 0xFF | ((buf[1] & 0xFF) << 8) | ((buf[2] & 0xFF) << 16) | ((buf[3] & 0xFF) << 24); valid = sig == LOCSIG;
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
catch (EOFException eof)
catch (IOException _)
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
validRead = false;
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG)
if (!valid) { try
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
} catch (IOException _) { }
private void checkZipFile() throws IOException, ZipException { byte[] magicBuf = new byte[4]; boolean validRead = true; try { raf.readFully(magicBuf); } catch (EOFException eof) { validRead = false; } if (validRead == false || readLeInt(magicBuf, 0) != LOCSIG) { raf.close(...
long start = checkLocalHeader(zipEntry);
PartialInputStream inp = new PartialInputStream(raf, 1024); inp.seek(zipEntry.offset); if (inp.readLeInt() != LOCSIG) throw new ZipException("Wrong Local header signature: " + name); inp.skip(4); if (zipEntry.getMethod() != inp.readLeShort()) throw new ZipException("Compression method mismatch: " + name); inp.skip(...
public InputStream getInputStream(ZipEntry entry) throws IOException { checkClosed(); HashMap entries = getEntries(); String name = entry.getName(); ZipEntry zipEntry = (ZipEntry) entries.get(name); if (zipEntry == null) return null; long start = checkLocalHeader(zipEntry); int method = zipEntry.getMet...
InputStream is = new BufferedInputStream(new PartialInputStream (raf, start, zipEntry.getCompressedSize()));
public InputStream getInputStream(ZipEntry entry) throws IOException { checkClosed(); HashMap entries = getEntries(); String name = entry.getName(); ZipEntry zipEntry = (ZipEntry) entries.get(name); if (zipEntry == null) return null; long start = checkLocalHeader(zipEntry); int method = zipEntry.getMet...
return is;
return inp;
public InputStream getInputStream(ZipEntry entry) throws IOException { checkClosed(); HashMap entries = getEntries(); String name = entry.getName(); ZipEntry zipEntry = (ZipEntry) entries.get(name); if (zipEntry == null) return null; long start = checkLocalHeader(zipEntry); int method = zipEntry.getMet...
return new InflaterInputStream(is, new Inflater(true));
return new InflaterInputStream(inp, new Inflater(true));
public InputStream getInputStream(ZipEntry entry) throws IOException { checkClosed(); HashMap entries = getEntries(); String name = entry.getName(); ZipEntry zipEntry = (ZipEntry) entries.get(name); if (zipEntry == null) return null; long start = checkLocalHeader(zipEntry); int method = zipEntry.getMet...
* FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file.
* Note that a comment has a maximum length of 64K, so that is the * maximum we search backwards.
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
byte[] ebs = new byte[CENHDR];
long top = Math.max(0, pos - 65536);
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
if (pos < 0)
if (pos < top)
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
raf.seek(pos--);
inp.seek(pos--);
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
while (readLeInt(raf, ebs) != ENDSIG);
while (inp.readLeInt() != ENDSIG);
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
if (raf.skipBytes(ENDTOT - ENDNRD) != ENDTOT - ENDNRD)
if (inp.skip(ENDTOT - ENDNRD) != ENDTOT - ENDNRD)
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
int count = readLeShort(raf, ebs); if (raf.skipBytes(ENDOFF - ENDSIZ) != ENDOFF - ENDSIZ)
int count = inp.readLeShort(); if (inp.skip(ENDOFF - ENDSIZ) != ENDOFF - ENDSIZ)
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
int centralOffset = readLeInt(raf, ebs);
int centralOffset = inp.readLeInt();
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
raf.seek(centralOffset);
inp.seek(centralOffset);
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
byte[] buffer = new byte[16];
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
raf.readFully(ebs); if (readLeInt(ebs, 0) != CENSIG)
if (inp.readLeInt() != CENSIG)
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
int method = readLeShort(ebs, CENHOW); int dostime = readLeInt(ebs, CENTIM); int crc = readLeInt(ebs, CENCRC); int csize = readLeInt(ebs, CENSIZ); int size = readLeInt(ebs, CENLEN); int nameLen = readLeShort(ebs, CENNAM); int extraLen = readLeShort(ebs, CENEXT); int commentLen = readLeShort(ebs, CENCOM); int offset = ...
inp.skip(6); int method = inp.readLeShort(); int dostime = inp.readLeInt(); int crc = inp.readLeInt(); int csize = inp.readLeInt(); int size = inp.readLeInt(); int nameLen = inp.readLeShort(); int extraLen = inp.readLeShort(); int commentLen = inp.readLeShort(); inp.skip(8); int offset = inp.readLeInt(); String name = ...
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
raf.readFully(extra);
inp.readFully(extra);
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
raf.readFully(buffer, 0, commentLen); try { entry.setComment(new String(buffer, 0, commentLen, "UTF-8")); } catch (UnsupportedEncodingException uee) { throw new AssertionError(uee); }
entry.setComment(inp.readString(commentLen));
private void readEntries() throws ZipException, IOException { /* Search for the End Of Central Directory. When a zip comment is * present the directory may start earlier. * FIXME: This searches the whole file in a very slow manner if the * file isn't a zip file. */ long pos = raf.length() - ENDHDR; byte...
angExtDeg = a.getAngleExtent(); startAngRad = a.getAngleStart() * (Math.PI / 180); extentAngRad = angExtDeg * (Math.PI / 180); type = a.getArcType(); double e = extentAngRad < 0 ? -extentAngRad : extentAngRad;
start = a.getAngleStart() * (Math.PI / 180); extent = a.getAngleExtent() * (Math.PI / 180); type = a.type; double e = extent < 0 ? -extent : extent;
ArcIterator(Arc2D a, AffineTransform xform) { this.xform = xform; x = a.getX(); y = a.getY(); w = a.getWidth(); h = a.getHeight(); angExtDeg = a.getAngleExtent(); startAngRad = a.getAngleStart() * (Math.PI / 180); extentAngRad = angExtDeg * (Math.PI / 180); type = a.getArcType(); double e = extent...
else if (e <= 90)
else if (e <= Math.PI / 2.0)
ArcIterator(Arc2D a, AffineTransform xform) { this.xform = xform; x = a.getX(); y = a.getY(); w = a.getWidth(); h = a.getHeight(); angExtDeg = a.getAngleExtent(); startAngRad = a.getAngleStart() * (Math.PI / 180); extentAngRad = angExtDeg * (Math.PI / 180); type = a.getArcType(); double e = extent...
else if (e <= 180)
else if (e <= Math.PI)
ArcIterator(Arc2D a, AffineTransform xform) { this.xform = xform; x = a.getX(); y = a.getY(); w = a.getWidth(); h = a.getHeight(); angExtDeg = a.getAngleExtent(); startAngRad = a.getAngleStart() * (Math.PI / 180); extentAngRad = angExtDeg * (Math.PI / 180); type = a.getArcType(); double e = extent...
else if (e <= 270)
else if (e <= 3.0 * (Math.PI / 2.0))
ArcIterator(Arc2D a, AffineTransform xform) { this.xform = xform; x = a.getX(); y = a.getY(); w = a.getWidth(); h = a.getHeight(); angExtDeg = a.getAngleExtent(); startAngRad = a.getAngleStart() * (Math.PI / 180); extentAngRad = angExtDeg * (Math.PI / 180); type = a.getArcType(); double e = extent...
double increment = angExtDeg; if (increment > 360.0) { increment = 360.0; } else if (increment < -360.0) { increment = -360.0; } increment /= limit; this.increment = Math.toRadians(increment);
ArcIterator(Arc2D a, AffineTransform xform) { this.xform = xform; x = a.getX(); y = a.getY(); w = a.getWidth(); h = a.getHeight(); angExtDeg = a.getAngleExtent(); startAngRad = a.getAngleStart() * (Math.PI / 180); extentAngRad = angExtDeg * (Math.PI / 180); type = a.getArcType(); double e = extent...
public int currentSegment(float[] coords) { if (current > limit) { throw new NoSuchElementException("arc iterator out of bounds"); } if (current == 0) { coords[0] = (float) (Math.cos(startAngRad) * w + x) / 2; coords[1] = (float) (Math.sin(startAngRad) * h + y) / 2; if (xform != null) { xform.transform(coords, 0, coord...
public int currentSegment(float[] coords) { double[] double_coords = new double[6]; int code = currentSegment (double_coords); for (int i = 0; i < 6; ++i) coords[i] = (float) double_coords[i]; return code;
public int currentSegment(float[] coords) { if (current > limit) { throw new NoSuchElementException("arc iterator out of bounds"); } if (current == 0) { coords[0] = (float) (Math.cos(startAngRad) * w + x) / 2; coords[1] = (float) (Math.sin(startAngRad) * h + y) / 2; if (xform != null) { xform.tr...
public boolean containsAngle(double a) { throw new Error("not implemented");
public boolean containsAngle(double a) { double start = getAngleStart(); double end = start + getAngleExtent(); start %= 360; if (start < 0) start += 360; end %= 360; if (end < 0) end += 360; a %= 360; if (a < 0) a += 360; return a >= start && a <= end;
public boolean containsAngle(double a) { // XXX Implement. throw new Error("not implemented"); }
throw new Error("not implemented");
double rX = getWidth() / 2; double rY = getHeight() / 2; double centerX = getX() + rX; double centerY = getY() + rY; Point2D p1 = getStartPoint(); Rectangle2D result = makeBounds(p1.getX(), p1.getY(), 0, 0); result.add(getEndPoint()); if (type == PIE) result.add(centerX, centerY); if (containsAngle(0)) result.add(cen...
public Rectangle2D getBounds2D() { double extent = getAngleExtent(); if (Math.abs(extent) >= 360) return makeBounds(getX(), getY(), getWidth(), getHeight()); // XXX Finish implementing. throw new Error("not implemented"); }
public Point2D getEndPoint() { double angle = (getAngleStart() + getAngleExtent()) * (-180 / Math.PI); double x = (Math.cos(angle) * getWidth() + getX()) / 2; double y = (Math.sin(angle) * getHeight() + getY()) / 2;
public Point2D getEndPoint() { double angle = Math.toRadians(getAngleStart() + getAngleExtent()); double rx = getWidth() / 2; double ry = getHeight() / 2; double x = getX() + rx + rx * Math.cos(angle); double y = getY() + ry - ry * Math.sin(angle);
public Point2D getEndPoint() { double angle = (getAngleStart() + getAngleExtent()) * (-180 / Math.PI); double x = (Math.cos(angle) * getWidth() + getX()) / 2; double y = (Math.sin(angle) * getHeight() + getY()) / 2; return new Point2D.Double(x, y); }
public Point2D getStartPoint() { double angle = getAngleStart() * (-180 / Math.PI); double x = (Math.cos(angle) * getWidth() + getX()) / 2; double y = (Math.sin(angle) * getHeight() + getY()) / 2;
public Point2D getStartPoint() { double angle = Math.toRadians(getAngleStart()); double rx = getWidth() / 2; double ry = getHeight() / 2; double x = getX() + rx + rx * Math.cos(angle); double y = getY() + ry - ry * Math.sin(angle);
public Point2D getStartPoint() { double angle = getAngleStart() * (-180 / Math.PI); double x = (Math.cos(angle) * getWidth() + getX()) / 2; double y = (Math.sin(angle) * getHeight() + getY()) / 2; return new Point2D.Double(x, y); }
x1 = ((x1 * 2) - mx) / mw; y1 = ((y1 * 2) - my) / mh; x2 = ((x2 * 2) - mx) / mw; y2 = ((y2 * 2) - my) / mh; double start = Math.atan2(y1, x1) * (-180 / Math.PI); double extent = Math.atan2(y2, x2) * (-180 / Math.PI) - start;
x1 = x1 - (mx + mw / 2); y1 = y1 - (my + mh / 2); x2 = x2 - (mx + mw / 2); y2 = y2 - (my + mh / 2); double start = Math.toDegrees(Math.atan2(y1, x1)); double extent = Math.toDegrees(Math.atan2(y2, x2)) - start;
public void setAngles(double x1, double y1, double x2, double y2) { // Normalize the points. double mx = getX(); double my = getY(); double mw = getWidth(); double mh = getHeight(); x1 = ((x1 * 2) - mx) / mw; y1 = ((y1 * 2) - my) / mh; x2 = ((x2 * 2) - mx) / mw; y2 = ((y2 * 2) - my) / mh; double start = Math...
private int current;
private int current = 0;
public PathIterator getPathIterator(final AffineTransform at) { return new PathIterator() { /** Current coordinate. */ private int current; public int getWindingRule() { return WIND_NON_ZERO; } public boolean isDone() { return current >= 2; } public void next() { current++; } public int cur...
button.setBorderPainted(false);
button.setBorder(null);
protected JButton createLeftOneTouchButton() { int dir = SwingConstants.WEST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.NORTH; JButton button = new BasicArrowButton(dir); button.setBorderPainted(false); return button; }
button.setBorderPainted(false);
button.setBorder(null);
protected JButton createRightOneTouchButton() { int dir = SwingConstants.EAST; if (orientation == JSplitPane.VERTICAL_SPLIT) dir = SwingConstants.SOUTH; JButton button = new BasicArrowButton(dir); button.setBorderPainted(false); return button; }
protected URLConnection openConnection(URL url) throws IOException { return (new gnu.java.net.protocol.file.FileURLConnection(url)); }
protected URLConnection openConnection(URL url) throws IOException { String host = url.getHost(); if ((host != null) && (! host.equals(""))) { throw new IOException("ftp protocol handler not yet implemented."); } return new Connection(url); }
protected URLConnection openConnection(URL url) throws IOException { return (new gnu.java.net.protocol.file.FileURLConnection(url)); }
if (end < start) return; if (end - start < 2) return; if (start > url_string.length()) return; if (end > url_string.length()) end = url_string.length();
if (end < start) return; if (end - start < 2) return; if (start > url_string.length()) return; if (end > url_string.length()) end = url_string.length(); end = url_string.length() - end; url_string = url_string.substring (start); if ( !url.getProtocol().equals ("file")) return; url_string = url_string.replace (S...
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
end = url_string.length() - end;
boolean needContext = url.getFile() != null; if (url_string.startsWith (" { url_string = url_string.substring (2); needContext = false; }
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
url_string = url_string.substring(start);
String host = null; int port = -1; String file = null; String anchor = null; String prefix = "/"; if (!needContext) { boolean hostpart = true; if (url_string.startsWith (" { hostpart = true; url_string = url_string.substring (2); } else { if (url_string.startsWith ("/")) { hostpart = false; } } if ((i = Platform...
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
if (!url.getProtocol().equals("file")) return;
try { port = Integer.parseInt(port_str); } catch (NumberFormatException e) { return; } } if (slash_index < (url_string.length() - 1)) url_string = url_string.substring (slash_index + 1); else url_string = ""; } } if (needContext) { host = url.getHost(); port = url.getPort();
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
url_string = url_string.replace( System.getProperty("file.separator").charAt(0), '/');
if ((i = PlatformHelper.beginWithRootPathPrefix (url_string)) > 0) { file = url.getFile(); int j = PlatformHelper.beginWithRootPathPrefix (file);
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
url_string = url_string.replace('|', ':'); int i; if ((i = url_string.toUpperCase().indexOf("%7C")) >= 0) url_string = url_string.substring(0, i) + ":" + url_string.substring(i + 3);
if (j >= i) file = file.substring (0, j) + url_string.substring (i); else file = url_string; } else { file = url.getFile();
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
boolean needContext = url.getFile() != null; if (url_string.startsWith(" url_string = url_string.substring(2); needContext = false; }
int idx = file.lastIndexOf ("/");
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
String host = null; int port = -1; String file = null; String anchor = null; String prefix = "/";
if (idx == -1) file = url_string; else if (idx == (file.length() - 1)) file = file + url_string; else file = file.substring (0, idx + 1) + url_string; } } else file = prefix + url_string; if (end == 0) { anchor = null; } else { if (file.charAt (file.length() - end) == '#') { int len = file.length(); anchor = file.s...
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
if (!needContext) { boolean hostpart = true;
if (host == null) { host = ""; }
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
if (url_string.startsWith(" hostpart = true; url_string = url_string.substring(2); } else { if (url_string.startsWith("/")) { hostpart = false; } } if ((i = PlatformHelper.beginWithRootPathPrefix(url_string)) > 0) { hostpart = false; prefix = url_string.substring(0, i); url_string = url_string.substring(i); } if ...
setURL (url, url.getProtocol(), host, port, file, anchor); }
protected void parseURL(URL url, String url_string, int start, int end) { // This method does not throw an exception or return a value. Thus our // strategy when we encounter an error in parsing is to return without // doing anything. // Bunches of things should be true. Make sure. if (end < start) return; i...
protected String toExternalForm(URL url) { StringBuffer sb = new StringBuffer(PlatformHelper.INITIAL_MAX_PATH); sb.append("file:");
protected String toExternalForm (URL url) { StringBuffer sb = new StringBuffer (PlatformHelper.INITIAL_MAX_PATH); sb.append ("file:"); String prefix = url.getHost();
protected String toExternalForm(URL url) { StringBuffer sb = new StringBuffer(PlatformHelper.INITIAL_MAX_PATH); sb.append("file:"); String prefix = url.getHost(); if (prefix != null && prefix.length() > 0) { sb.append(prefix); int port = url.getPort(); if (port > 0) { sb.append(':'); sb.append(port); ...
String prefix = url.getHost(); if (prefix != null && prefix.length() > 0) { sb.append(prefix); int port = url.getPort(); if (port > 0) { sb.append(':'); sb.append(port); } } String file = url.getFile(); if (file != null) sb.append(file); else sb.append('/'); String anchor = url.getRef(); if (anchor != null) { sb.appe...
if (prefix != null && prefix.length() > 0) { sb.append (prefix); int port = url.getPort(); if (port > 0) { sb.append (':'); sb.append (port); } } String file = url.getFile(); if (file != null) sb.append (file); else sb.append ('/'); String anchor = url.getRef(); if (anchor != null) { sb.append ('#'); sb.append (anch...
protected String toExternalForm(URL url) { StringBuffer sb = new StringBuffer(PlatformHelper.INITIAL_MAX_PATH); sb.append("file:"); String prefix = url.getHost(); if (prefix != null && prefix.length() > 0) { sb.append(prefix); int port = url.getPort(); if (port > 0) { sb.append(':'); sb.append(port); ...
vars[i].setLocation(new StackLocation(displacement));
vars[i].setLocation(new StackLocation<T>(displacement));
public void setArgumentVariables(Variable<T>[] vars, int nArgs) { displacement = 0; for (int i = 0; i < nArgs; i += 1) { // TODO this might not be right, check with Ewout displacement = vars[i].getIndex() * 4; vars[i].setLocation(new StackLocation(displacement)); ...
return this.assignQuad.getLHSLiveAddress();
return assignQuad.getLHSLiveAddress();
public int getAssignAddress() { if (assignQuad == null) { return 0; } // Add one so this live range starts just after this operation. // This way live range interference computation is simplified. return this.assignQuad.getLHSLiveAddress(); }
throw new InvalidKeySpecException("only supports PKCS8 key specs");
throw new InvalidKeySpecException("Unsupported key specification");
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { if (! (keySpec instanceof PKCS8EncodedKeySpec)) throw new InvalidKeySpecException("only supports PKCS8 key specs"); byte[] input = ((PKCS8EncodedKeySpec) keySpec).getEncoded(); // try DSS try { ...
throw new InvalidKeySpecException();
return decodeDHPrivateKey(input);
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { if (! (keySpec instanceof PKCS8EncodedKeySpec)) throw new InvalidKeySpecException("only supports PKCS8 key specs"); byte[] input = ((PKCS8EncodedKeySpec) keySpec).getEncoded(); // try DSS try { ...
throw new InvalidKeySpecException("only supports X.509 key specs");
throw new InvalidKeySpecException("Unsupported key specification");
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { if (! (keySpec instanceof X509EncodedKeySpec)) throw new InvalidKeySpecException("only supports X.509 key specs"); byte[] input = ((X509EncodedKeySpec) keySpec).getEncoded(); // try DSS try { ...
throw new InvalidKeySpecException();
return decodeDHPublicKey(input);
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { if (! (keySpec instanceof X509EncodedKeySpec)) throw new InvalidKeySpecException("only supports X.509 key specs"); byte[] input = ((X509EncodedKeySpec) keySpec).getEncoded(); // try DSS try { ...
for (int i = 0; i < attrs.length; ++i)
for (int i = 0; i < attrs.length - 1; ++i)
public String toString() { StringBuffer sb = new StringBuffer(); sb.append("[StyleContext.SmallattributeSet:"); for (int i = 0; i < attrs.length; ++i) { sb.append(" ("); sb.append(attrs[i].toString()); sb.append("="); sb.append(attrs[i+1].toString()); ...
consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
Rectangle filterBounds = new Rectangle(this.x, this.y, this.width, this.height); Rectangle pixelBounds = new Rectangle(x, y, w, h); if (filterBounds.intersects(pixelBounds)) { Rectangle bounds = filterBounds.intersection(pixelBounds); byte[] cropped = new byte[bounds.width * bounds.height]; for (int i = 0; i < bounds...
public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int offset, int scansize) { consumer.setPixels(x, y, w, h, model, pixels, offset, scansize); }
props.put("filters", "CropImageFilter");
public void setProperties(Hashtable props) {// props.put("filters", "ReplicateScaleFilter"); consumer.setProperties(props); }
public void addVetoableChangeListener(String name, VetoableChangeListener l)
public void addVetoableChangeListener(VetoableChangeListener l)
public void addVetoableChangeListener(String name, VetoableChangeListener l) { if (l != null) vetoableChangeSupport.addVetoableChangeListener(name, l); }
vetoableChangeSupport.addVetoableChangeListener(name, l);
vetoableChangeSupport.addVetoableChangeListener(l);
public void addVetoableChangeListener(String name, VetoableChangeListener l) { if (l != null) vetoableChangeSupport.addVetoableChangeListener(name, l); }
public void clearGlobalFocusOwner()
public void clearGlobalFocusOwner () { synchronized (currentFocusOwners) { Component focusOwner = getGlobalFocusOwner (); Component permanentFocusOwner = getGlobalPermanentFocusOwner (); setGlobalFocusOwner (null); setGlobalPermanentFocusOwner (null); if (focusOwner != null)
public void clearGlobalFocusOwner() { // XXX Is this enough? setGlobalFocusOwner(null); }
setGlobalFocusOwner(null);
EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue (); if (focusOwner != permanentFocusOwner) q.postEvent (new FocusEvent (focusOwner, FocusEvent.FOCUS_LOST, true)); else q.postEvent (new FocusEvent (focusOwner, FocusEvent.FOCUS_LOST, false));
public void clearGlobalFocusOwner() { // XXX Is this enough? setGlobalFocusOwner(null); }
if (focusOwner != permanentFocusOwner) { EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue (); q.postEvent (new FocusEvent (permanentFocusOwner, FocusEvent.FOCUS_LOST, false)); } } }
public void clearGlobalFocusOwner() { // XXX Is this enough? setGlobalFocusOwner(null); }
public Container getCurrentFocusCycleRoot() { try
public Container getCurrentFocusCycleRoot ()
public Container getCurrentFocusCycleRoot() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalCurrentFocusCycleRoot(); } catch (SecurityException e) { retu...
return getGlobalCurrentFocusCycleRoot(); } catch (SecurityException e) { return null; }
return (Container) getObject (currentFocusCycleRoots);
public Container getCurrentFocusCycleRoot() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalCurrentFocusCycleRoot(); } catch (SecurityException e) { retu...
try { return getGlobalPermanentFocusOwner(); } catch (SecurityException e) { return null; }
return (Component) getObject (currentPermanentFocusOwners);
public Component getPermanentFocusOwner() { // XXX Need an easy way to test if this thread is in the context of the // global focus owner, to avoid creating the exception in the first place. try { return getGlobalPermanentFocusOwner(); } catch (SecurityException e) { return n...
/* if (awtFrame.isVisible()) {
if (!swingPeer.isReshapeInProgress) {
public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); //TODO fix it /* if (awtFrame.isVisible()) { Point p = awtFrame.getLocationOnScreen(); Insets ins = swingPeer.getInsets(); awtFr...
awtFrame.reshape(p.x + x, p.y + y, width + ins.left + ins.right, height + ins.top + ins.bottom); }*/ if (!swingPeer.isReshapeInProgress) { Insets ins = swingPeer.getInsets(); awtFrame.reshape(x + x, y + y, width + ins.left + ins.right, height + ins.top + ins.bottom);
awtFrame.reshape(p.x + x, p.y, width + ins.left + ins.right, height + ins.bottom + ins.top);
public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); //TODO fix it /* if (awtFrame.isVisible()) { Point p = awtFrame.getLocationOnScreen(); Insets ins = swingPeer.getInsets(); awtFr...
super(backwardAction); }
super(backwardAction, SwingConstants.WEST); }
BackwardAction() { super(backwardAction); }
super(downAction);
super(downAction, SwingConstants.SOUTH);
DownAction() { super(downAction); }
super(forwardAction); }
super(forwardAction, SwingConstants.EAST); }
ForwardAction() { super(forwardAction); }
} catch(BadLocationException ble) { } }
public void actionPerformed(ActionEvent event) { try { JTextComponent t = getTextComponent(event); if (t != null) { int offs = Utilities.getNextWord(t, t.getCaretPosition()); Caret c = t.getCaret(); c.setDot(offs); ...
super(selectionBackwardAction);
super(selectionBackwardAction, SwingConstants.WEST);
SelectionBackwardAction() { super(selectionBackwardAction); }
try { Point p = t.modelToView(t.getCaret().getDot()).getLocation(); int cur = t.getCaretPosition(); int y = p.y; while (y == p.y && cur > 0) y = t.modelToView(--cur).getLocation().y; if (cur != 0) cur++; Caret c = t.getCaret(); c.moveDot(cur); c.setMagicCaretPosition(t.modelToView(cur).getLocation()); } catch (Bad...
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { // TODO: There is a more efficent solution, but // viewToModel doesn't work properly. Point p = t.modelToView(t.getCaret().getDot()).getLocation(); int cur = t.getCaretPos...
super(selectionDownAction);
super(selectionDownAction, SwingConstants.SOUTH);
SelectionDownAction() { super(selectionDownAction); }
try { Point p = t.modelToView(t.getCaret().getDot()).getLocation(); int cur = t.getCaretPosition(); int y = p.y; int length = t.getDocument().getLength(); while (y == p.y && cur < length) y = t.modelToView(++cur).getLocation().y; if (cur != length) cur--;
Caret c = t.getCaret(); try { int offs = Utilities.getRowEnd(t, c.getDot()); c.setMagicCaretPosition(t.modelToView(offs).getLocation()); } catch(BadLocationException ble) { }
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { Point p = t.modelToView(t.getCaret().getDot()).getLocation(); int cur = t.getCaretPosition(); int y = p.y; int length = t.getDocument().getLength(); while (y == p.y && cur...
Caret c = t.getCaret(); c.moveDot(cur); c.setMagicCaretPosition(t.modelToView(cur).getLocation()); } catch (BadLocationException ble) { }
public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { Point p = t.modelToView(t.getCaret().getDot()).getLocation(); int cur = t.getCaretPosition(); int y = p.y; int length = t.getDocument().getLength(); while (y == p.y && cur...
{ super(selectionForwardAction); }
{ super(selectionForwardAction, SwingConstants.EAST); }
SelectionForwardAction() { super(selectionForwardAction); }
{ super(selectionUpAction);
{ super(selectionUpAction, SwingConstants.NORTH);
SelectionUpAction() { super(selectionUpAction); }
super(upAction);
super(upAction, SwingConstants.NORTH);
UpAction() { super(upAction); }
private final void writeLeInt(int value) throws IOException
private void writeLeInt(int value) throws IOException
private final void writeLeInt(int value) throws IOException { writeLeShort(value); writeLeShort(value >> 16); }
private final void writeLeShort(int value) throws IOException
private void writeLeShort(int value) throws IOException
private final void writeLeShort(int value) throws IOException { out.write(value & 0xff); out.write((value >> 8) & 0xff); }
return new AffineTransform(m11 / det, -m10 / det, m01 / det, -m00 / det, -m02, -m12);
double im00 = m11 / det; double im10 = -m10 / det; double im01 = -m01 / det; double im11 = m00 / det; double im02 = (m01 * m12 - m02 * m11) / det; double im12 = (-m00 * m12 + m10 * m02) / det; return new AffineTransform (im00, im10, im01, im11, im02, im12);
public AffineTransform createInverse() throws NoninvertibleTransformException { double det = getDeterminant(); if (det == 0) throw new NoninvertibleTransformException("can't invert transform"); return new AffineTransform(m11 / det, -m10 / det, m01 / det, -m00 / det, -m02, -m12); }
public void shear(double shx, double shy) { double n00 = m00 + shx * m01; double n01 = shx * m00 + m01; double n10 = m10 * shy + m11; double n11 = shx * m10 + m11;
public void shear(double shx, double shy) { double n00 = m00 + (shy * m01); double n01 = m01 + (shx * m00); double n10 = m10 + (shy * m11); double n11 = m11 + (shx * m10);
public void shear(double shx, double shy) { double n00 = m00 + shx * m01; double n01 = shx * m00 + m01; double n10 = m10 * shy + m11; double n11 = shx * m10 + m11; m00 = n00; m01 = n01; m10 = n10; m11 = n11; updateType(); }
public List getInetAddresses(VMNetDevice netDevice) {
public List<InetAddress> getInetAddresses(VMNetDevice netDevice) {
public List getInetAddresses(VMNetDevice netDevice) { final ArrayList<InetAddress> list = new ArrayList<InetAddress>(); final SecurityManager sm = System.getSecurityManager(); try { final NetDeviceImpl netDeviceImpl = (NetDeviceImpl) netDevice; final NetDeviceAPI api = (Ne...
public Collection getNetDevices() {
public Collection<VMNetDevice> getNetDevices() {
public Collection getNetDevices() { final ArrayList<VMNetDevice> list = new ArrayList<VMNetDevice>(); final Collection<Device> devs = DeviceUtils .getDevicesByAPI(NetDeviceAPI.class); for (Device dev : devs) { list.add(new NetDeviceImpl(dev)); } return li...
if (fc.getDialogType() == JFileChooser.SAVE_DIALOG)
if (fc.getApproveButtonText() != null) return fc.getApproveButtonText(); else if (fc.getDialogType() == JFileChooser.SAVE_DIALOG)
public String getApproveButtonText(JFileChooser fc) { if (fc.getDialogType() == JFileChooser.SAVE_DIALOG) return saveButtonText; else return openButtonText; }
public void doPass2(BootableHashMap liveVariables) {
public void doPass2() {
public void doPass2(BootableHashMap liveVariables) { refs[0] = refs[0].simplify(); refs[1] = refs[1].simplify(); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (refs[1] instanceof Variable) { Variable v = (Variable)...
if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (refs[1] instanceof Variable) { Variable v = (Variable) refs[1]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); }
public void doPass2(BootableHashMap liveVariables) { refs[0] = refs[0].simplify(); refs[1] = refs[1].simplify(); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (refs[1] instanceof Variable) { Variable v = (Variable)...
scrollTimer = new Timer(); scrollTimer.setDelay(200);
scrollTimer = new Timer(200, null);
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(); scrollTimer.setDelay(200); scrollTimer.setRepeats(true); installComponents(); installListeners(); instal...
{ listeners [i].stateChanged (new ChangeEvent (this)); }
listeners[i].stateChanged(changeEvent);
protected void fireStateChanged () { ChangeListener[] listeners = getChangeListeners (); for (int i = 0; i < listeners.length; i++) { listeners [i].stateChanged (new ChangeEvent (this)); } }
path.add(0, c);
while (c instanceof MenuElement) { path.add(0, (MenuElement) c);
private MenuElement[] getPath (Component c) { ArrayList path = new ArrayList(); path.add(0, c); Component parent = c.getParent (); while (parent instanceof JMenu || parent instanceof JPopupMenu || parent instanceof JMenuItem || parent instanceof JMenuBar) { pa...