rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; }
boolean handleEvent(AWTEvent e) { if ((eventMask & e.getID()) == 0) return false; if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent(me); // Avoid dispatching an ENTERED event twice. if (mouseEventTarget != null && mouse...
String selectorImpl = "default"; if (KqueueSelectorImpl.kqueue_supported()) selectorImpl = SELECTOR_IMPL_KQUEUE; if (EpollSelectorImpl.epoll_supported() && !epoll_failed) selectorImpl = SELECTOR_IMPL_EPOLL; selectorImpl = SystemProperties.getProperty(SELECTOR_IMPL, selectorImpl); if (selectorImpl.equals(SELECTOR_IMPL_...
public AbstractSelector openSelector () throws IOException { return new SelectorImpl (this); }
serverSocket = new NIOServerSocket (this);
serverSocket = new NIOServerSocket(this); channel = serverSocket.getPlainSocketImpl().getVMChannel();
protected ServerSocketChannelImpl (SelectorProvider provider) throws IOException { super (provider); serverSocket = new NIOServerSocket (this); configureBlocking(true); }
serverSocket.getPlainSocketImpl().setInChannelOperation(true); NIOSocket socket = (NIOSocket) serverSocket.accept(); completed = true; return socket.getChannel(); } catch (SocketTimeoutException e) { return null;
VMChannel client = channel.accept(); if (client == null) return null; else { completed = true; return new SocketChannelImpl(provider(), client, false); }
public SocketChannel accept () throws IOException { if (!isOpen()) throw new ClosedChannelException(); if (!serverSocket.isBound()) throw new NotYetBoundException(); boolean completed = false; try { begin(); serverSocket.getPlainSocketImpl().setInChannelOperation(true); ...
serverSocket.getPlainSocketImpl().setInChannelOperation(false);
public SocketChannel accept () throws IOException { if (!isOpen()) throw new ClosedChannelException(); if (!serverSocket.isBound()) throw new NotYetBoundException(); boolean completed = false; try { begin(); serverSocket.getPlainSocketImpl().setInChannelOperation(true); ...
if (connected)
if (channel.getState().isValid())
public void finalizer() { if (connected) { try { close (); } catch (Exception e) { } } }
connected = false; serverSocket.close(); }
connected = false; channel.close(); }
protected void implCloseSelectableChannel () throws IOException { connected = false; serverSocket.close(); }
serverSocket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT); }
channel.setBlocking(blocking); }
protected void implConfigureBlocking (boolean blocking) throws IOException { serverSocket.setSoTimeout (blocking ? 0 : NIOConstants.DEFAULT_TIMEOUT); }
public int getExtent();
int getExtent();
public int getExtent();
public int getMaximum();
int getMaximum();
public int getMaximum();
public int getMinimum();
int getMinimum();
public int getMinimum();
public int getValue();
int getValue();
public int getValue();
public boolean getValueIsAdjusting();
boolean getValueIsAdjusting();
public boolean getValueIsAdjusting();
public void setExtent(int extent);
void setExtent(int extent);
public void setExtent(int extent);
public void setMaximum(int maximum);
void setMaximum(int maximum);
public void setMaximum(int maximum);
public void setMinimum(int minimum);
void setMinimum(int minimum);
public void setMinimum(int minimum);
public void setRangeProperties(int value, int extent, int min,
void setRangeProperties(int value, int extent, int min,
public void setRangeProperties(int value, int extent, int min, int max, boolean adjusting);
public void setValue(int value);
void setValue(int value);
public void setValue(int value);
public void setValueIsAdjusting(boolean adjusting);
void setValueIsAdjusting(boolean adjusting);
public void setValueIsAdjusting(boolean adjusting);
"ToolBar.rolloverBorder", MetalBorders.getToolbarButtonBorder(), "ToolBar.nonrolloverBorder", MetalBorders.getToolbarButtonBorder(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", get...
{ }
{ super(color); }
public LineBorderUIResource(Color color) { }
{
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new AttributeNode(name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), source); if (children != null) { ret.children = chi...
}
TemplateNode clone(Stylesheet stylesheet) { TemplateNode ret = new AttributeNode(name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), source); if (children != null) { ret.children = chi...
{
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); // Create a document fragment to hold the...
}
void doApply(Stylesheet stylesheet, QName mode, Node context, int pos, int len, Node parent, Node nextSibling) throws TransformerException { Document doc = (parent instanceof Document) ? (Document) parent : parent.getOwnerDocument(); // Create a document fragment to hold the...
StringBuffer buf = new StringBuffer(getClass().getName());
StringBuffer buf = new StringBuffer("attribute");
public String toString() { StringBuffer buf = new StringBuffer(getClass().getName()); buf.append('['); buf.append("name="); buf.append(name); buf.append(']'); return buf.toString(); }
protected byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
private byte[] replicatePixels(int srcx, int srcy, int srcw, int srch,
protected byte[] replicatePixels(int srcx, int srcy, int srcw, int srch, ColorModel model, byte[] srcPixels, int srcOffset, int srcScansize, double rx, double ry, int destScansize) { byte[] destPixels = new...
int firstSpc, nextSpc;
int firstSpc; int nextSpc;
private void getResponseVals() throws IOException { // getHeaderField() will connect for us, but do it here first in // order to pick up IOExceptions. if (!connected) connect(); gotResponseVals = true; // If responseCode not yet explicitly set by subclass if (responseCode == -1) { /...
if(getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException("setLength in readonly filesystem"); }
public synchronized void setLength(long length) throws IOException { if (this.length == length) { // Do nothing return; } final FatFileSystem fs = getFatFileSystem(); final Fat fat = fs.getFat(); final int nrClusters = (int)((length + clusterSize-1) / clusterSize); if (this.length == 0) { final l...
if(getFileSystem().isReadOnly()) { throw new ReadOnlyFileSystemException("write in readonly filesystem"); }
public synchronized void write(long fileOffset, byte[] src, int srcOfs, int len) throws IOException { final long max = (isDir) ? getLengthOnDisk() : getLength(); if (fileOffset > max) { throw new IOException("Cannot write beyond the EOF"); } if (fileOffset + len > max) { // this is too short increase...
public void selectAll();
void selectAll();
public void selectAll();
public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant, boolean use_forwarding) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy
public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy
public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant, boolean use_forwarding) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); // If the UNIQUE_ID applies, the servant being passed must not be // a...
checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); if (applies(IdUniquenessPolicyValue.UNIQUE_ID)) { AOM.Obj sx = aom.findServant(a_servant, false); if (sx != null) throw new ServantAlreadyActive(); } AOM.Obj exists = aom.get(an_Object_Id); if (exists != null) { if (exists.servant == null) { locateSer...
activate_object_with_id(an_Object_Id, a_servant, false);
public void activate_object_with_id(byte[] an_Object_Id, Servant a_servant, boolean use_forwarding) throws ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); // If the UNIQUE_ID applies, the servant being passed must not be // a...
public abstract void copy(Address src, Address dst, int size);
public abstract void copy(Address src, Address dst, Extent size);
public abstract void copy(Address src, Address dst, int size);
public Insets getBorderInsets(Component c, Insets s) { s.left = s.right = s.top = s.bottom = 5; return s; }
public Insets getBorderInsets(Component c) { return getBorderInsets(c, new Insets(0, 0, 0, 0)); }
public Insets getBorderInsets(Component c, Insets s) { s.left = s.right = s.top = s.bottom = 5; return s; }
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); class BorderPainter
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
switch (titlePosition) { case ABOVE_TOP: textY = y; break; case TOP: case DEFAULT_POSITION: default: textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent; break; case BELOW_TOP: textY = y + mes.borderSpacing.top + mes.borderInsets.top + TEXT_SPACING; break; case ABOVE_BOTTOM: textY = y + height ...
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { }
if (comboBox.getFont() instanceof UIResource)
Font f = comboBox.getFont(); Color fore = comboBox.getForeground(); Color back = comboBox.getBackground(); if (f == null || f instanceof UIResource)
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (comboBox.getFont() instanceof UIResource) comboBox.setFont(defaults.getFont("ComboBox.font")); if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(defaults.getColor("ComboBox...
if (comboBox.getForeground() instanceof UIResource)
if (fore == null || fore instanceof UIResource)
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (comboBox.getFont() instanceof UIResource) comboBox.setFont(defaults.getFont("ComboBox.font")); if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(defaults.getColor("ComboBox...
if (comboBox.getBackground() instanceof UIResource)
if (back == null || back instanceof UIResource)
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); if (comboBox.getFont() instanceof UIResource) comboBox.setFont(defaults.getFont("ComboBox.font")); if (comboBox.getForeground() instanceof UIResource) comboBox.setForeground(defaults.getColor("ComboBox...
ServiceContext[] cx)
org.omg.IOP.ServiceContext[] cx)
public static org.omg.IOP.ServiceContext findContext(int ctx_name, ServiceContext[] cx) { for (int i = 0; i < cx.length; i++) if (cx[i].context_id == ctx_name) return new org.omg.IOP.ServiceContext(ctx_name, cx[i].context_data); throw new BAD_PARAM("No context with id " + ctx_name); }
return new org.omg.IOP.ServiceContext(ctx_name, cx[i].context_data);
return cx[i];
public static org.omg.IOP.ServiceContext findContext(int ctx_name, ServiceContext[] cx) { for (int i = 0; i < cx.length; i++) if (cx[i].context_id == ctx_name) return new org.omg.IOP.ServiceContext(ctx_name, cx[i].context_data); throw new BAD_PARAM("No context with id " + ctx_name); }
i.left = borderSpacing.left + borderInsets.left + edgeSpacing.left; i.right = borderSpacing.right + borderInsets.right + edgeSpacing.right; i.top = borderSpacing.top + borderInsets.top + edgeSpacing.top; i.bottom = borderSpacing.bottom + borderInsets.bottom + edgeSpacing.bottom;
i.left = outerSpacing.left + borderInsets.left + innerSpacing.left; i.right = outerSpacing.right + borderInsets.right + innerSpacing.right; i.top = outerSpacing.top + borderInsets.top + innerSpacing.top; i.bottom = outerSpacing.bottom + borderInsets.bottom + innerSpacing.bottom;
public Insets getContentInsets(Insets i) { if (i == null) i = new Insets(0, 0, 0, 0); i.left = borderSpacing.left + borderInsets.left + edgeSpacing.left; i.right = borderSpacing.right + borderInsets.right + edgeSpacing.right; i.top = borderSpacing.top + borderInsets.top + edgeSpacing.t...
title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION,
title, LEADING, TOP,
public TitledBorder(String title) { this(/* border */ null, title, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, /* titleFont */ null, /* titleColor */ null); }
m.textDescent = fmet.getDescent();
m.textDescent = fmet.getDescent() + fmet.getLeading();
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
if (m.trimmedText != null) m.textWidth = fmet.stringWidth(m.trimmedText) + 3; m.edgeSpacing = new Insets(EDGE_SPACING, EDGE_SPACING, EDGE_SPACING, EDGE_SPACING); m.borderSpacing = new Insets(0, 0, 0, 0);
m.innerSpacing = new Insets(EDGE_SPACING, EDGE_SPACING, EDGE_SPACING, EDGE_SPACING); m.outerSpacing = new Insets(EDGE_SPACING, EDGE_SPACING, EDGE_SPACING, EDGE_SPACING);
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
m.borderSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
m.outerSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING; break; case TOP: m.outerSpacing.top += m.textDescent + m.lineHeight; m.innerSpacing.top += m.textAscent - m.lineHeight;
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
m.edgeSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
m.innerSpacing.top += m.textAscent + m.textDescent + TEXT_SPACING;
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
m.edgeSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
m.innerSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
m.edgeSpacing.bottom += Math.max(m.textAscent - m.borderInsets.bottom, 0); m.borderSpacing.bottom += m.textDescent;
m.innerSpacing.bottom += Math.max(m.textAscent - m.lineHeight, 0); m.outerSpacing.bottom += m.textDescent + m.lineHeight;
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
m.borderSpacing.bottom += m.textAscent + m.textDescent + TEXT_SPACING;
m.outerSpacing.bottom += m.textAscent + m.textDescent;
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
m.borderSpacing.top += m.textAscent;
m.outerSpacing.top += m.textAscent;
private Measurements getMeasurements(Component c) { Measurements m = new Measurements(); FontMetrics fmet; m.font = getFont(c); fmet = c.getFontMetrics(m.font); m.border = getBorder(); if (m.border != null) m.borderInsets = m.border.getBorderInsets(c); else m.borderInsets = new Insets(...
b.paintBorder(c, g, x, y, width - 1, height - 1);
b.paintBorder(c, g, x, y, width, height);
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
paint(g, holeX + holeWidth, holeY, width - (holeX + holeWidth), stripeHeight);
paint(g, holeX + holeWidth, holeY, x + width - (holeX + holeWidth), stripeHeight);
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
borderWidth = width - (mes.borderSpacing.left + mes.borderSpacing.right); borderHeight = height - (mes.borderSpacing.top + mes.borderSpacing.bottom);
borderWidth = width - (mes.outerSpacing.left + mes.outerSpacing.right); borderHeight = height - (mes.outerSpacing.top + mes.outerSpacing.bottom);
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
x + mes.borderSpacing.left, y + mes.borderSpacing.top,
x + mes.outerSpacing.left, y + mes.outerSpacing.top,
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
textX = x + TEXT_INSET_H;
textX = x + EDGE_SPACING + TEXT_INSET_H;
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
textY = y;
textY = y + EDGE_SPACING;
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
textY = y + mes.borderSpacing.top + mes.borderInsets.top - mes.textAscent
textY = y + mes.outerSpacing.top + mes.borderInsets.top - mes.textAscent
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
textY = y + mes.borderSpacing.top + mes.borderInsets.top + TEXT_SPACING;
textY = y + mes.outerSpacing.top + mes.borderInsets.top + TEXT_SPACING;
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
textY = y + height - mes.borderSpacing.bottom - mes.borderInsets.bottom
textY = y + height - mes.outerSpacing.bottom - mes.borderInsets.bottom
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
bp.paintExcept(g, textX - 2, textY, mes.textWidth + 2, mes.textAscent + mes.textDescent);
bp.paintExcept(g, textX, textY, mes.textWidth, mes.textAscent + mes.textDescent);
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Measurements mes = getMeasurements(c); Font oldFont = g.getFont(); Color oldColor = g.getColor(); /** * A local helper class for painting the border without changing * any pixels ins...
b.paintBorder(c, g, x, y, width - 1, height - 1);
b.paintBorder(c, g, x, y, width, height);
public void paint(Graphics g) { if (b != null) b.paintBorder(c, g, x, y, width - 1, height - 1); }
paint(g, holeX + holeWidth, holeY, width - (holeX + holeWidth), stripeHeight);
paint(g, holeX + holeWidth, holeY, x + width - (holeX + holeWidth), stripeHeight);
public void paintExcept(Graphics g, int holeX, int holeY, int holeWidth, int holeHeight) { int stripeHeight; stripeHeight = holeY - y; if (stripeHeight > 0) paint(g, x, y, width, stripeHeight); // patch #1 in the image above stripeHeight = h...
String[] tokens = cn.split(".");
String[] tokens = cn.split("\\.");
private String validateClassName(String cn) throws IOException { if (cn.startsWith(".") || cn.endsWith(".")) abort("MODULE_CLASS MUST NOT start or end with a '.'"); String[] tokens = cn.split("."); for (int i = 0; i < tokens.length; i++) { String t = tokens[i]; if (Character.isJavaId...
if (Character.isJavaIdentifierStart(cn.toCharArray()[0])) abort("");
if (! Character.isJavaIdentifierStart(t.toCharArray()[0])) abort("Class name [" + cn + "] contains an invalid sub-package identifier: " + t);
private String validateClassName(String cn) throws IOException { if (cn.startsWith(".") || cn.endsWith(".")) abort("MODULE_CLASS MUST NOT start or end with a '.'"); String[] tokens = cn.split("."); for (int i = 0; i < tokens.length; i++) { String t = tokens[i]; if (Character.isJavaId...
public abstract void put (String name, Object value);
public abstract void put (String name, boolean value);
public abstract void put (String name, Object value);
throw new IOException("Invalid protocol version requested.");
throw new IllegalArgumentException("Invalid protocol version requested.");
public void useProtocolVersion(int version) throws IOException { if (version != PROTOCOL_VERSION_1 && version != PROTOCOL_VERSION_2) throw new IOException("Invalid protocol version requested."); protocolVersion = version; }
if (nextOID != baseWireHandle) throw new IllegalStateException("Protocol version cannot be changed " + "after serialization started.");
public void useProtocolVersion(int version) throws IOException { if (version != PROTOCOL_VERSION_1 && version != PROTOCOL_VERSION_2) throw new IOException("Invalid protocol version requested."); protocolVersion = version; }
if (fields == ObjectStreamClass.INVALID_FIELDS) throw new InvalidClassException (osc.getName(), "serialPersistentFields is invalid");
protected void writeClassDescriptor(ObjectStreamClass osc) throws IOException { if (osc.isProxyClass) { realOutput.writeByte(TC_PROXYCLASSDESC); Class[] intfs = osc.forClass().getInterfaces(); realOutput.writeInt(intfs.length); for (int i = 0; i < intfs.length; i++) realOutput.writeUTF(intfs[i].getN...
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); p.setForeground(defaults.getColor("ScrollPane.foreground")); p.setBackground(defaults.getColor("ScrollPane.background")); p.setFont(defaults.getFont("ScrollPane.font")); p.setBorder(defaults.getBorder("ScrollPane.border"));
LookAndFeel.installColorsAndFont(p, "ScrollPane.background", "ScrollPane.foreground", "ScrollPane.font"); LookAndFeel.installBorder(p, "ScrollPane.border");
protected void installDefaults(JScrollPane p) { scrollpane = p; UIDefaults defaults = UIManager.getLookAndFeelDefaults(); p.setForeground(defaults.getColor("ScrollPane.foreground")); p.setBackground(defaults.getColor("ScrollPane.background")); p.setFont(defaults.getFont("ScrollPane.font")); p.setBo...
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); popupMenu.setBackground(defaults.getColor("PopupMenu.background")); popupMenu.setBorder(defaults.getBorder("PopupMenu.border")); popupMenu.setFont(defaults.getFont("PopupMenu.font")); popupMenu.setForeground(defaults.getColor("PopupMenu.foreground"));
LookAndFeel.installColorsAndFont(popupMenu, "PopupMenu.background", "PopupMenu.foreground", "PopupMenu.font"); LookAndFeel.installBorder(popupMenu, "PopupMenu.border");
public void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); popupMenu.setBackground(defaults.getColor("PopupMenu.background")); popupMenu.setBorder(defaults.getBorder("PopupMenu.border")); popupMenu.setFont(defaults.getFont("PopupMenu.font")); popupMenu.setForeground(defa...
public final Object getContent() throws IOException {
public Object getContent() throws IOException {
public final Object getContent() throws IOException { return openConnection().getContent(); }
public int getDefaultPort() { return handler.getDefaultPort();
public int getDefaultPort() { return ph.getDefaultPort();
public int getDefaultPort() { return handler.getDefaultPort(); }
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) {
private static synchronized URLStreamHandler getURLStreamHandler(String protocol) { URLStreamHandler ph = null;
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { return (URLStreamHandler) cls.newInstance(); } catch (Exception e) { } } }
if (cache_handlers) { if ((ph = (URLStreamHandler) ph_cache.get(protocol)) != null) return ph; }
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
if (factory != null) { URLStreamHandler ph; ph = factory.createURLStreamHandler(protocol); if (ph != null) { if (cache_handlers) { ph_cache.put(protocol, ph.getClass()); } return (ph); } }
if (factory != null) { ph = factory.createURLStreamHandler(protocol); }
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
StringTokenizer st = new StringTokenizer(ph_search_path, "|"); while (st.hasMoreTokens()) { String clsname = st.nextToken() + "." + protocol + ".Handler";
if (ph == null) { String ph_search_path = System.getProperty("java.protocol.handler.pkgs");
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
try { final ClassLoader cl = Thread.currentThread() .getContextClassLoader(); final Class cls = cl.loadClass(clsname); Object obj = cls.newInstance(); URLStreamHandler ph; if (!(obj instanceof URLStreamHandler)) { continue; } else { ph = (URLStreamHandler) obj; }
if (ph_search_path != null) ph_search_path += "|" + DEFAULT_SEARCH_PATH; else ph_search_path = DEFAULT_SEARCH_PATH;
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
if (cache_handlers) { ph_cache.put(protocol, cls); }
StringTokenizer pkgPrefix = new StringTokenizer(ph_search_path, "|");
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
return (ph); } catch (Exception e) { } }
if (systemClassLoader == null) { systemClassLoader = (ClassLoader) AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return ClassLoader.getSystemClassLoader(); } }); }
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
return null;
do { try { String clsName = (pkgPrefix.nextToken() + "." + protocol + ".Handler"); Class c = Class.forName(clsName, true, systemClassLoader); ph = (URLStreamHandler) c.newInstance(); } catch (ThreadDeath death) { throw death; } catch (Throwable t) { } } while (ph == null && pkgPrefix.hasMoreTokens()); } if (ph !=...
private static synchronized URLStreamHandler getURLStreamHandler( String protocol) { // First, see if a protocol handler is in our cache if (cache_handlers) { final Class cls = (Class) ph_cache.get(protocol); if (cls != null) { try { r...
public String getUserInfo() {
public String getUserInfo() { if (userInfo != null) return userInfo;
public String getUserInfo() { int at = (host == null) ? -1 : host.indexOf('@'); return at < 0 ? null : host.substring(0, at); }
this.handler = getURLStreamHandler(protocol); if (this.handler == null) throw new IOException("Handler for protocol " + protocol + " not found");
this.ph = getURLStreamHandler(protocol); if (this.ph == null) throw new IOException("Handler for protocol " + protocol + " not found");
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { ois.defaultReadObject(); this.handler = getURLStreamHandler(protocol); if (this.handler == null) throw new IOException("Handler for protocol " + protocol ...
public boolean sameFile(URL other) { return handler.sameFile(this, other);
public boolean sameFile(URL url) { return ph.sameFile(this, url);
public boolean sameFile(URL other) { return handler.sameFile(this, other); }
String ref) { this.handler = getURLStreamHandler(protocol); this.protocol = protocol.toLowerCase(); this.authority = null;
String ref) { URLStreamHandler protocolHandler = null; protocol = protocol.toLowerCase(); if (! this.protocol.equals(protocol)) protocolHandler = getURLStreamHandler(protocol); if (protocolHandler != null) { this.ph = protocolHandler; this.protocol = protocol; } this.authority = "";
protected void set(String protocol, String host, int port, String file, String ref) { // TBD: Theoretically, a poorly written StreamHandler could pass an // invalid protocol. It will cause the handler to be set to null // thus overriding a valid handler. Callers of this method should...
if (host != null) this.authority += host; if (port >= 0) this.authority += ":" + port;
protected void set(String protocol, String host, int port, String file, String ref) { // TBD: Theoretically, a poorly written StreamHandler could pass an // invalid protocol. It will cause the handler to be set to null // thus overriding a valid handler. Callers of this method should...
public static synchronized void setURLStreamHandlerFactory( URLStreamHandlerFactory fac) { if ((factory != null) && (fac != null)) {
public static synchronized void setURLStreamHandlerFactory(URLStreamHandlerFactory fac) { if (factory != null)
public static synchronized void setURLStreamHandlerFactory( URLStreamHandlerFactory fac) { if ((factory != null) && (fac != null)) { throw new Error("URLStreamHandlerFactory already set"); } // Throw an exception if an extant security mgr precludes // setting the ...
}
public static synchronized void setURLStreamHandlerFactory( URLStreamHandlerFactory fac) { if ((factory != null) && (fac != null)) { throw new Error("URLStreamHandlerFactory already set"); } // Throw an exception if an extant security mgr precludes // setting the ...
if (s != null) {
if (s != null)
public static synchronized void setURLStreamHandlerFactory( URLStreamHandlerFactory fac) { if ((factory != null) && (fac != null)) { throw new Error("URLStreamHandlerFactory already set"); } // Throw an exception if an extant security mgr precludes // setting the ...
dst.put (data, offset, len);
dst.put (data, offset, readBytes);
public int read(ByteBuffer dst) throws IOException { if (!isConnected()) throw new NotYetConnectedException(); byte[] data; int offset = 0; InputStream input = socket.getInputStream(); int available = input.available(); int len = dst.capacity() - dst.position(); if ((! isBlocking()) && ava...
localName = name;
localName = intern(name);
Attribute(String name, String type, boolean specified, String value) { this.name = name; this.type = type; this.specified = specified; this.value = value; int ci = name.indexOf(':'); if (ci == -1) { prefix = null; localName = name; } else ...
return ((Attribute) other).name.equals(name);
Attribute a = (Attribute) other; if (namespaceAware) { if (!a.localName.equals(localName)) return false; String auri = getNamespaceURI(a.prefix); String uri = getNamespaceURI(prefix); if (uri == null && (auri == null || (input.xml11 && "".equals(auri)))) return true; if (uri != null) { if ("".equals(uri) && input.xml11...
public boolean equals(Object other) { if (other instanceof Attribute) { return ((Attribute) other).name.equals(name); } return false; }
int valueType, String enumeration)
int valueType, String enumeration, HashSet values, boolean external)
AttributeDecl(String type, String value, int valueType, String enumeration) { this.type = type; this.value = value; this.valueType = valueType; this.enumeration = enumeration; }
this.values = values; this.external = external;
AttributeDecl(String type, String value, int valueType, String enumeration) { this.type = type; this.value = value; this.valueType = valueType; this.enumeration = enumeration; }
void addElementDecl(String name, String model)
void addElementDecl(String name, String text, ContentModel model)
void addElementDecl(String name, String model) { if (elements.containsKey(name)) return; elements.put(name, model); entries.add("E" + name); }
model.text = text; model.external = (inputStack.size() != 1);
void addElementDecl(String name, String model) { if (elements.containsKey(name)) return; elements.put(name, model); entries.add("E" + name); }
Input(InputStream in, String publicId, String systemId, String name)
Input(InputStream in, Reader reader, String publicId, String systemId, String name, String inputEncoding, boolean report, boolean normalize)
Input(InputStream in, String publicId, String systemId, String name) { this(in, null, publicId, systemId, name, null); }
this(in, null, publicId, systemId, name, null);
if (inputEncoding == null) inputEncoding = "UTF-8"; this.inputEncoding = inputEncoding; this.publicId = publicId; this.systemId = systemId; this.name = name; this.report = report; this.normalize = normalize; if (in != null) { if (reader != null) throw new IllegalStateException("both byte and char streams "+ "specified"...
Input(InputStream in, String publicId, String systemId, String name) { this(in, null, publicId, systemId, name, null); }
setInputEncoding("UTF-16BE");
private void detectEncoding() throws IOException { int[] signature = new int[4]; in.mark(4); for (int i = 0; i < 4; i++) signature[i] = in.read(); in.reset(); // 4-byte encodings if (equals(SIGNATURE_UCS_4_1234, signature)) setInputEncoding("UTF-32BE"); else ...