rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
public Node removeChild(Node refChild) { try { DomNode ref = (DomNode) refChild; if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (readonly && !owner.building) { throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR, null, this, 0); } for (DomNode child = first; child != null; child = child.next) { if (child == ref) { if (reportMutations) { removalEvent(null, child); } length--; if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } // renumber indices int i = 0; for (DomNode ctx = first; ctx != null; ctx = ctx.next) { ctx.index = i++; } ref.parent = null; ref.setDepth(0); ref.index = 0; ref.previous = null; ref.next = null; return ref; } } throw new DomEx(DomEx.NOT_FOUND_ERR, "that's no child of mine", refChild, 0); } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, refChild, 0); } }
throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0);
throw new DomDOMException(DOMException.NOT_FOUND_ERR, null, ref, 0);
public Node replaceChild(Node newChild, Node refChild) { try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; DomEvent.DomMutationEvent event = getMutationEvent(); boolean doFree = (event != null); if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } length--; length += child.length; if (child.length == 0) { // Removal if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } } else { int i = ref.index; for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { // Insertion ctx.parent = this; ctx.index = i++; ctx.setDepth(ref.depth); if (ctx == child.first) { ctx.previous = ref.previous; } if (ctx == child.last) { ctx.next = ref.next; } } if (first == ref) { first = child.first; } if (last == ref) { last = child.last; } } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = ref.index; child.setDepth(ref.depth); if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; if (ref.next != null) { ref.next.previous = child; } child.next = ref.next; if (first == ref) { first = child; } if (last == ref) { last = child; } if (reportMutations) { insertionEvent(event, child); } if (doFree) { freeMutationEvent(); } } ref.parent = null; ref.index = 0; ref.setDepth(0); ref.previous = null; ref.next = null; return ref; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR,
public Node replaceChild(Node newChild, Node refChild) { try { DomNode child = (DomNode) newChild; DomNode ref = (DomNode) refChild; DomEvent.DomMutationEvent event = getMutationEvent(); boolean doFree = (event != null); if (child.nodeType == DOCUMENT_FRAGMENT_NODE) { // Append all nodes in the fragment to this node for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { checkMisc(ctx); } if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } length--; length += child.length; if (child.length == 0) { // Removal if (ref.previous != null) { ref.previous.next = ref.next; } if (ref.next != null) { ref.next.previous = ref.previous; } if (first == ref) { first = ref.next; } if (last == ref) { last = ref.previous; } } else { int i = ref.index; for (DomNode ctx = child.first; ctx != null; ctx = ctx.next) { // Insertion ctx.parent = this; ctx.index = i++; ctx.setDepth(ref.depth); if (ctx == child.first) { ctx.previous = ref.previous; } if (ctx == child.last) { ctx.next = ref.next; } } if (first == ref) { first = child.first; } if (last == ref) { last = child.last; } } } else { checkMisc(child); if (ref == null || ref.parent != this) { throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0); } if (reportMutations) { removalEvent(event, ref); } if (child.parent != null) { child.parent.removeChild(child); } child.parent = this; child.index = ref.index; child.setDepth(ref.depth); if (ref.previous != null) { ref.previous.next = child; } child.previous = ref.previous; if (ref.next != null) { ref.next.previous = child; } child.next = ref.next; if (first == ref) { first = child; } if (last == ref) { last = child; } if (reportMutations) { insertionEvent(event, child); } if (doFree) { freeMutationEvent(); } } ref.parent = null; ref.index = 0; ref.setDepth(0); ref.previous = null; ref.next = null; return ref; } catch (ClassCastException e) { throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, newChild, 0); } }
ElementNode(TemplateNode children, TemplateNode next, TemplateNode name,
ElementNode(TemplateNode name,
ElementNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, String uas, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.uas = uas; this.source = source; NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } }
super(children, next);
ElementNode(TemplateNode children, TemplateNode next, TemplateNode name, TemplateNode namespace, String uas, Node source) { super(children, next); this.name = name; this.namespace = namespace; this.uas = uas; this.source = source; NamedNodeMap attrs = source.getAttributes(); Node attr = attrs.getNamedItemNS(Stylesheet.XSL_NS, "exclude-result-prefixes"); if (attr != null) { elementExcludeResultPrefixes = new HashSet(); StringTokenizer st = new StringTokenizer(attr.getNodeValue()); while (st.hasMoreTokens()) { elementExcludeResultPrefixes.add(st.nextToken()); } } else { elementExcludeResultPrefixes = Collections.EMPTY_SET; } }
return new ElementNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet),
TemplateNode ret = new ElementNode(name.clone(stylesheet),
TemplateNode clone(Stylesheet stylesheet) { return new ElementNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), uas, source); }
if (children != null) { ret.children = children.clone(stylesheet); } if (next != null) { ret.next = next.clone(stylesheet); } return ret;
TemplateNode clone(Stylesheet stylesheet) { return new ElementNode((children == null) ? null : children.clone(stylesheet), (next == null) ? null : next.clone(stylesheet), name.clone(stylesheet), (namespace == null) ? null : namespace.clone(stylesheet), uas, source); }
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border"));
LookAndFeel.installColors(scrollbar, "ScrollBar.background", "ScrollBar.foreground"); LookAndFeel.installBorder(scrollbar, "ScrollBar.border");
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow");
thumbColor = UIManager.getColor("ScrollBar.thumb"); thumbDarkShadowColor = UIManager.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = UIManager.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = UIManager.getColor("ScrollBar.thumbShadow");
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize");
maximumThumbSize = UIManager.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = UIManager.getDimension("ScrollBar.minimumThumbSize");
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); scrollbar.setForeground(defaults.getColor("ScrollBar.foreground")); scrollbar.setBackground(defaults.getColor("ScrollBar.background")); scrollbar.setBorder(defaults.getBorder("ScrollBar.border")); scrollbar.setOpaque(true); scrollbar.setLayout(this); thumbColor = defaults.getColor("ScrollBar.thumb"); thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow"); thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight"); thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow"); maximumThumbSize = defaults.getDimension("ScrollBar.maximumThumbSize"); minimumThumbSize = defaults.getDimension("ScrollBar.minimumThumbSize"); }
public void addSubjectName(Principal subjectName) throws IOException
public void addSubjectName(byte[] subjectName) throws IOException
public void addSubjectName(Principal subjectName) throws IOException { if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName())); }
if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName()));
subjectNames.add(new X500DistinguishedName(subjectName));
public void addSubjectName(Principal subjectName) throws IOException { if (subjectName instanceof X500DistinguishedName) subjectNames.add(subjectName); else if (subjectName instanceof X500Principal) subjectNames.add(new X500DistinguishedName(((X500Principal) subjectName).getEncoded())); else subjectNames.add(new X500DistinguishedName(subjectName.getName())); }
public InvalidAlgorithmParameterException(String msg)
public InvalidAlgorithmParameterException()
public InvalidAlgorithmParameterException(String msg) { super(msg); }
super(msg);
super();
public InvalidAlgorithmParameterException(String msg) { super(msg); }
public void select(int start_pos, int endPos)
public void select(int startPos, int endPos)
public void select(int start_pos, int endPos) { // TODO: Must be implemented. }
public AlreadyBoundHolder(AlreadyBound initialValue)
public AlreadyBoundHolder()
public AlreadyBoundHolder(AlreadyBound initialValue) { value = initialValue; }
value = initialValue;
public AlreadyBoundHolder(AlreadyBound initialValue) { value = initialValue; }
super(dataType, w, h, 1, w, new int[numBands]);
this(dataType, w, h, w, createBankArray(numBands), new int[numBands]);
public BandedSampleModel(int dataType, int w, int h, int numBands) { super(dataType, w, h, 1, w, new int[numBands]); }
if (bands.length > bankIndices.length) throw new RasterFormatException("BandedSampleModel createSubsetSampleModel too" +" many bands");
public SampleModel createSubsetSampleModel(int[] bands) { int[] newoff = new int[bands.length]; int[] newbanks = new int[bands.length]; for (int i=0; i < bands.length; i++) { int b = bands[i]; newoff[i] = bandOffsets[b]; newbanks[i] = bankIndices[b]; } if (bands.length > bankIndices.length) throw new RasterFormatException("BandedSampleModel createSubsetSampleModel too" +" many bands"); return new BandedSampleModel(dataType, width, height, scanlineStride, newbanks, newoff); }
iArray[i] = getSample(x, y, 0, data);
iArray[i] = getSample(x, y, i, data);
public int[] getPixel(int x, int y, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[numBands]; for (int i=0; i < numBands; i++) iArray[i] = getSample(x, y, 0, data); return iArray; }
for (y=0; y<h; y++)
int maxX = x + w; int maxY = y + h; for (int yy = x; yy < maxY; yy++)
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
for (x=0; x<w;)
for (int xx = x; xx < maxX; xx++)
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
int offset = bandOffsets[b] + y * scanlineStride + x;
int offset = bandOffsets[b] + yy * scanlineStride + xx;
public int[] getPixels(int x, int y, int w, int h, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h*numBands]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { for (int b=0; b < numBands; b++) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } } return iArray; }
for (y=0; y<h; y++)
int maxX = x + w; int maxY = y + h; for (int yy = y; yy < maxY; yy++)
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
for (x=0; x<w;)
for (int xx = x; xx < maxX; xx++)
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
int offset = bandOffsets[b] + y * scanlineStride + x;
int offset = bandOffsets[b] + yy * scanlineStride + xx;
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray, DataBuffer data) { if (iArray == null) iArray = new int[w*h]; int outOffset = 0; for (y=0; y<h; y++) { for (x=0; x<w;) { int offset = bandOffsets[b] + y * scanlineStride + x; iArray[outOffset++] = data.getElem(bankIndices[b], offset); } } return iArray; }
out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0];
out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[i];
public void setDataElements(int x, int y, Object obj, DataBuffer data) { int transferType = getTransferType(); if (getTransferType() != data.getDataType()) { throw new IllegalArgumentException("transfer type ("+ getTransferType()+"), "+ "does not match data "+ "buffer type (" + data.getDataType() + ")."); } int offset = y * scanlineStride + x; try { switch (transferType) { case DataBuffer.TYPE_BYTE: { DataBufferByte out = (DataBufferByte) data; byte[] in = (byte[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_SHORT: { DataBufferShort out = (DataBufferShort) data; short[] in = (short[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_USHORT: { DataBufferUShort out = (DataBufferUShort) data; short[] in = (short[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_INT: { DataBufferInt out = (DataBufferInt) data; int[] in = (int[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_FLOAT: { DataBufferFloat out = (DataBufferFloat) data; float[] in = (float[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } case DataBuffer.TYPE_DOUBLE: { DataBufferDouble out = (DataBufferDouble) data; double[] in = (double[]) obj; for (int i=0; i < numBands; i++) out.getData(bankIndices[i])[offset + bandOffsets[i]] = in[0]; return; } default: throw new ClassCastException("Unsupported data type"); } } catch (ArrayIndexOutOfBoundsException aioobe) { String msg = "While writing data elements" + ", x="+x+", y="+y+ ", width="+width+", height="+height+ ", scanlineStride="+scanlineStride+ ", offset="+offset+ ", data.getSize()="+data.getSize()+ ", data.getOffset()="+data.getOffset()+ ": " + aioobe; throw new ArrayIndexOutOfBoundsException(msg); } }
public String getMessage() { return super.getMessage(); }
public String getMessage() { String message = super.getMessage(); if (message == null && exception != null) { message = exception.getMessage(); } return message; }
public String getMessage() { return super.getMessage(); } // getMessage()
= ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", locale);
= ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", locale, ClassLoader.getSystemClassLoader());
public DateFormatSymbols (Locale locale) throws MissingResourceException { ResourceBundle res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", locale); ampms = res.getStringArray ("ampms"); eras = res.getStringArray ("eras"); localPatternChars = res.getString ("localPatternChars"); months = res.getStringArray ("months"); shortMonths = res.getStringArray ("shortMonths"); shortWeekdays = res.getStringArray ("shortWeekdays"); weekdays = res.getStringArray ("weekdays"); zoneStrings = (String[][]) res.getObject ("zoneStrings"); dateFormats = formatsForKey(res, "DateFormat"); timeFormats = formatsForKey(res, "TimeFormat"); }
public String group (int group) throws IllegalStateException
public String group ()
public String group (int group) throws IllegalStateException { assertMatchOp(); return match.toString(group); }
return match.toString(group);
return match.toString();
public String group (int group) throws IllegalStateException { assertMatchOp(); return match.toString(group); }
public boolean equals (Object obj)
private static boolean equals (Object x, Object y)
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
if (! (obj instanceof DateFormatSymbols))
if (x == y) return true; if (x == null || y == null)
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings));
if (! (x instanceof Object[]) || ! (y instanceof Object[])) return x.equals(y); Object[] xa = (Object[]) x; Object[] ya = (Object[]) y; if (xa.length != ya.length) return false; for (int i = xa.length; --i >= 0; ) { if (! equals(xa[i], ya[i])) return false; } return true;
public boolean equals (Object obj) { if (! (obj instanceof DateFormatSymbols)) return false; DateFormatSymbols other = (DateFormatSymbols) obj; return (equals(ampms, other.ampms) && equals(eras, other.eras) && equals(localPatternChars, other.localPatternChars) && equals(months, other.months) && equals(shortMonths, other.shortMonths) && equals(shortWeekdays, other.shortWeekdays) && equals(weekdays, other.weekdays) && equals(zoneStrings, other.zoneStrings)); }
public int hashCode ()
private static int hashCode (Object x)
public int hashCode () { return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings)); }
return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings));
if (x == null) return 0; if (! (x instanceof Object[])) return x.hashCode(); Object[] xa = (Object[]) x; int hash = 0; for (int i = 0; i < xa.length; i++) hash = 37 * hashCode(xa[i]); return hash;
public int hashCode () { return (hashCode(ampms) ^ hashCode(eras) ^ hashCode(localPatternChars) ^ hashCode(months) ^ hashCode(shortMonths) ^ hashCode(shortWeekdays) ^ hashCode(weekdays) ^ hashCode(zoneStrings)); }
return ((selection == null) || (selection.length == 0));
return (selection == null) || (selection.length == 0);
public boolean isSelectionEmpty() { return ((selection == null) || (selection.length == 0)); }
if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalSplitPaneUI instance; if (o == null) { instance = new MetalSplitPaneUI(); instances.put(component, instance); } else instance = (MetalSplitPaneUI) o; return instance;
return new MetalSplitPaneUI();
public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalSplitPaneUI instance; if (o == null) { instance = new MetalSplitPaneUI(); instances.put(component, instance); } else instance = (MetalSplitPaneUI) o; return instance; }
return displayName;
return (displayName == null) ? name : displayName;
public String getDisplayName() { return displayName; }
return shortDescription;
return (shortDescription == null) ? getDisplayName() : shortDescription;
public String getShortDescription() { return shortDescription; }
else if (!obj._is_a(id())) throw new BAD_PARAM("Not a Policy");
public static Policy narrow(org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof Policy) return (Policy) obj; else if (!obj._is_a(id())) throw new BAD_PARAM("Not a Policy"); else { Delegate delegate = ((ObjectImpl) obj)._get_delegate(); return new _PolicyStub(delegate); } }
public PolicyHolder(Policy initialValue)
public PolicyHolder()
public PolicyHolder(Policy initialValue) { value = initialValue; }
value = initialValue;
public PolicyHolder(Policy initialValue) { value = initialValue; }
}
if (c instanceof JPanel) { JPanel p = (JPanel) c; installDefaults(p); } }
public void installUI(JComponent c) { super.installUI(c); }
final ParsedArguments cmdLine = HELP_INFO.parse(args); final URL url = openURL(ARG_FILE.getValue(cmdLine)); final InputStream is = url.openStream(); if (is == null) { System.err.println("Not found " + ARG_FILE.getValue(cmdLine)); } else { int len; final byte[] buf = new byte[ 1024]; while ((len = is.read(buf)) > 0) { System.out.write(buf, 0, len); } System.out.flush(); is.close(); }
new CatCommand().execute(new CommandLine(args), System.in, System.out, System.err);
public static void main(String[] args) throws Exception { final ParsedArguments cmdLine = HELP_INFO.parse(args); final URL url = openURL(ARG_FILE.getValue(cmdLine)); final InputStream is = url.openStream(); if (is == null) { System.err.println("Not found " + ARG_FILE.getValue(cmdLine)); } else { int len; final byte[] buf = new byte[ 1024]; while ((len = is.read(buf)) > 0) { System.out.write(buf, 0, len); } System.out.flush(); is.close(); } }
private static URL openURL(String fname) throws MalformedURLException {
private URL openURL(String fname) throws MalformedURLException {
private static URL openURL(String fname) throws MalformedURLException { try { return new URL(fname); } catch (MalformedURLException ex) { return new File(fname).toURL(); } }
return null;
return systemPreferences;
public Preferences systemRoot() { return null; }
return null;
return userPreferences;
public Preferences userRoot() { return null; }
private Component findTarget(Component c)
private Component findTarget(Container c, Point loc)
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
Component target = c; while (target != null && target.getMouseListeners().length == 0)
Component[] children = c.getComponents(); Component target = null; if (c != null)
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
target = target.getParent();
for (int i = 0; i < children.length; i++) { Component child = children[i]; if (child.isShowing()) { if (child.contains(loc.x - child.getX(), loc.y - child.getY()) && (child.getMouseListeners().length > 0 || child.getMouseMotionListeners().length > 0)) { target = child; break; } } }
private Component findTarget(Component c) { Component target = c; while (target != null && target.getMouseListeners().length == 0) { target = target.getParent(); } return target; }
Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target);
Component deepest = window.findComponentAt(ev.getX(), ev.getY()); if (deepest == null) return false; Container parent = deepest.getParent(); Point loc = ev.getPoint(); loc = convertPointToChild(window, loc, parent); Component target = null; if (parent != null) { target = findTarget(parent, loc); while (target == null && parent != null) { if (parent.getMouseListeners().length > 0 || parent.getMouseMotionListeners().length > 0) { target = parent; } else parent = parent.getParent(); } }
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget);
Point p1 = convertPointToChild(window, ev.getPoint(), lastTarget);
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
if (target != null)
if (target != null && (dragTarget == null || dragTarget == target))
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target);
Point p = convertPointToChild(window, ev.getPoint(), target);
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
dragTarget = target;
if (dragTarget == null) { lastTarget = dragTarget = target; dragButton = ev.getButton(); } else return false;
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
if (dragTarget != null)
if (dragTarget != null && dragButton == ev.getButton()) {
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
lastTarget = target;
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
lastTarget = target;
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target);
Point targetCoordinates = convertPointToChild(window, ev.getPoint(), target);
private boolean handleMouseEvent(MouseEvent ev) { Window window = (Window) ev.getSource(); Component target = window.findComponentAt(ev.getX(), ev.getY()); target = findTarget(target); if (target == null || target.isLightweight()) { // Dispatch additional MOUSE_EXITED and MOUSE_ENTERED if event target // is different from the last event target. if (target != lastTarget) { if (lastTarget != null) { Point p1 = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), lastTarget); MouseEvent mouseExited = new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED, ev.getWhen(), ev.getModifiers(), p1.x, p1.y, ev.getClickCount(), ev.isPopupTrigger()); lastTarget.dispatchEvent(mouseExited); } if (target != null) { Point p = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); MouseEvent mouseEntered = new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(), ev.getModifiers(), p.x, p.y, ev.getClickCount(), ev.isPopupTrigger()); target.dispatchEvent(mouseEntered); } } switch (ev.getID()) { case MouseEvent.MOUSE_PRESSED: dragTarget = target; break; case MouseEvent.MOUSE_RELEASED: if (dragTarget != null) target = dragTarget; dragTarget = null; break; case MouseEvent.MOUSE_CLICKED: // When we receive a MOUSE_CLICKED, we set the target to the // previous target, which must have been a MOUSE_RELEASED event. // This is necessary for the case when the MOUSE_RELEASED has // caused the original target (like an internal component) go // away. target = lastTarget; break; case MouseEvent.MOUSE_DRAGGED: target = dragTarget; break; default: // Do nothing in other cases. break; } lastTarget = target; if (target != null) { Point targetCoordinates = AWTUtilities.convertPoint(window, ev.getX(), ev.getY(), target); int dx = targetCoordinates.x - ev.getX(); int dy = targetCoordinates.y - ev.getY(); ev.translatePoint(dx, dy); ev.setSource(target); target.dispatchEvent(ev); // We reset the event, so that the normal event dispatching is not // influenced by this modified event. ev.setSource(window); ev.translatePoint(-dx, -dy); } return true; } else return false; }
void set_value(byte[] a_value);
void set_value(byte[] a_value) throws InvalidValue;
void set_value(byte[] a_value);
Object getOption(int option_id) throws SocketException;
Object getOption(int optionId) throws SocketException;
Object getOption(int option_id) throws SocketException;
void setOption(int option_id, Object val) throws SocketException;
void setOption(int optionId, Object val) throws SocketException;
void setOption(int option_id, Object val) throws SocketException;
public TreePath getPathForRow(int value0) { return null;
public TreePath getPathForRow(int row) { return null;
public TreePath getPathForRow(int value0) { return null; // TODO } // getPathForRow()
public InstantiationException(String s) { super(s);
public InstantiationException() {
public InstantiationException(String s) { super(s); }
this.modifiers = EventModifier.extend(modifiers);
this.modifiers = modifiers & EventModifier.OLD_MASK; this.modifiersEx = modifiers & EventModifier.NEW_MASK;
InputEvent(Component source, int id, long when, int modifiers) { super(source, id); this.when = when; this.modifiers = EventModifier.extend(modifiers); }
return EventModifier.revert(modifiers);
return modifiers;
public int getModifiers() { return EventModifier.revert(modifiers); }
return modifiers;
return modifiersEx;
public int getModifiersEx() { return modifiers; }
return (modifiers & ALT_DOWN_MASK) != 0;
return ((modifiers & ALT_MASK) != 0) || ((modifiersEx & ALT_DOWN_MASK) != 0);
public boolean isAltDown() { return (modifiers & ALT_DOWN_MASK) != 0; }
return (modifiers & ALT_GRAPH_DOWN_MASK) != 0;
return ((modifiers & ALT_GRAPH_MASK) != 0) || ((modifiersEx & ALT_GRAPH_DOWN_MASK) != 0);
public boolean isAltGraphDown() { return (modifiers & ALT_GRAPH_DOWN_MASK) != 0; }
return (modifiers & CTRL_DOWN_MASK) != 0;
return ((modifiers & CTRL_MASK) != 0) || ((modifiersEx & CTRL_DOWN_MASK) != 0);
public boolean isControlDown() { return (modifiers & CTRL_DOWN_MASK) != 0; }
return (modifiers & META_DOWN_MASK) != 0;
return ((modifiers & META_MASK) != 0) || ((modifiersEx & META_DOWN_MASK) != 0);
public boolean isMetaDown() { return (modifiers & META_DOWN_MASK) != 0; }
return (modifiers & SHIFT_DOWN_MASK) != 0;
return ((modifiers & SHIFT_MASK) != 0) || ((modifiersEx & SHIFT_DOWN_MASK) != 0);
public boolean isShiftDown() { return (modifiers & SHIFT_DOWN_MASK) != 0; }
((ClasspathToolkit)Toolkit.getDefaultToolkit()).registerImageIOSpis(this);
private IIORegistry() { super(defaultCategories.iterator()); // XXX: Register built-in Spis here. registerApplicationClasspathSpis(); }
public synchronized void registerServiceProvider(Object provider)
private synchronized boolean registerServiceProvider(Object provider, int cat)
public synchronized void registerServiceProvider(Object provider) { boolean ok = false; if (provider == null) throw new IllegalArgumentException(); for (int i = 0; i < categories.length; i++) if (categories[i].isInstance(provider)) { ok = true; registerServiceProvider(provider, i); } if (!ok) throw new IllegalArgumentException(); }
boolean ok = false;
LinkedList provs; boolean result; Class category;
public synchronized void registerServiceProvider(Object provider) { boolean ok = false; if (provider == null) throw new IllegalArgumentException(); for (int i = 0; i < categories.length; i++) if (categories[i].isInstance(provider)) { ok = true; registerServiceProvider(provider, i); } if (!ok) throw new IllegalArgumentException(); }
for (int i = 0; i < categories.length; i++) if (categories[i].isInstance(provider)) { ok = true; registerServiceProvider(provider, i); }
category = categories[cat]; if (!category.isInstance(provider)) throw new ClassCastException(category.getName());
public synchronized void registerServiceProvider(Object provider) { boolean ok = false; if (provider == null) throw new IllegalArgumentException(); for (int i = 0; i < categories.length; i++) if (categories[i].isInstance(provider)) { ok = true; registerServiceProvider(provider, i); } if (!ok) throw new IllegalArgumentException(); }
if (!ok) throw new IllegalArgumentException();
provs = providers[cat]; if (provs == null) { result = true; provs = providers[cat] = new LinkedList(); } else result = false; provs.add(provider); if (provider instanceof RegisterableService) ((RegisterableService) provider).onRegistration(this, category); return result;
public synchronized void registerServiceProvider(Object provider) { boolean ok = false; if (provider == null) throw new IllegalArgumentException(); for (int i = 0; i < categories.length; i++) if (categories[i].isInstance(provider)) { ok = true; registerServiceProvider(provider, i); } if (!ok) throw new IllegalArgumentException(); }
public String getUIClassID() { return "JCheckBox"; }
public String getUIClassID() { return "CheckBoxUI"; }
public String getUIClassID() { //Returns a string that specifies the name of the L&F class that renders this component. return "JCheckBox"; }
public int getLayoutFlags () throws NotImplementedException
public int getLayoutFlags()
public int getLayoutFlags () throws NotImplementedException { throw new Error ("not implemented"); }
throw new Error ("not implemented");
return 0;
public int getLayoutFlags () throws NotImplementedException { throw new Error ("not implemented"); }
public BindingHolder(Binding initialValue)
public BindingHolder()
public BindingHolder(Binding initialValue) { value = initialValue; }
value = initialValue;
public BindingHolder(Binding initialValue) { value = initialValue; }
paintComponent(g); paintBorder(g); paintChildren(g);
RepaintManager rm = RepaintManager.currentManager(this); if (!isPaintingDoubleBuffered && isDoubleBuffered() && rm.isDoubleBufferingEnabled()) paintDoubleBuffered(g); else { if (g.getClip() == null) g.setClip(0, 0, getWidth(), getHeight()); paintComponent(g); paintBorder(g); paintChildren(g); }
public void paint(Graphics g) { paintComponent(g); paintBorder(g); paintChildren(g); }
void paintDoubleBuffered(Rectangle r)
void paintDoubleBuffered(Graphics g)
void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Image buffer = rm.getOffscreenBuffer(this, getWidth(), getHeight()); Graphics g = buffer.getGraphics(); Graphics g2 = getComponentGraphics(g); g2.setClip(r.x, r.y, r.width, r.height); paint(g2); g2.dispose(); g.dispose(); // Paint the buffer contents on screen. Graphics g3 = getGraphics(); g3.setClip(r.x, r.y, r.width, r.height); g3.drawImage(buffer, 0, 0, this); g3.dispose(); }
Image buffer = rm.getOffscreenBuffer(this, getWidth(), getHeight()); Graphics g = buffer.getGraphics(); Graphics g2 = getComponentGraphics(g); g2.setClip(r.x, r.y, r.width, r.height); paint(g2); g2.dispose(); g.dispose();
synchronized (paintLock) { Image buffer = rm.getOffscreenBuffer(this, getWidth(), getHeight()); Graphics g2 = buffer.getGraphics(); g2 = getComponentGraphics(g2); g2.setClip(r.x, r.y, r.width, r.height); isPaintingDoubleBuffered = true; paint(g2); isPaintingDoubleBuffered = false; g2.dispose();
void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Image buffer = rm.getOffscreenBuffer(this, getWidth(), getHeight()); Graphics g = buffer.getGraphics(); Graphics g2 = getComponentGraphics(g); g2.setClip(r.x, r.y, r.width, r.height); paint(g2); g2.dispose(); g.dispose(); // Paint the buffer contents on screen. Graphics g3 = getGraphics(); g3.setClip(r.x, r.y, r.width, r.height); g3.drawImage(buffer, 0, 0, this); g3.dispose(); }
Graphics g3 = getGraphics(); g3.setClip(r.x, r.y, r.width, r.height); g3.drawImage(buffer, 0, 0, this); g3.dispose();
g.drawImage(buffer, 0, 0, this); }
void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Image buffer = rm.getOffscreenBuffer(this, getWidth(), getHeight()); Graphics g = buffer.getGraphics(); Graphics g2 = getComponentGraphics(g); g2.setClip(r.x, r.y, r.width, r.height); paint(g2); g2.dispose(); g.dispose(); // Paint the buffer contents on screen. Graphics g3 = getGraphics(); g3.setClip(r.x, r.y, r.width, r.height); g3.drawImage(buffer, 0, 0, this); g3.dispose(); }
paintDoubleBuffered(r);
paintDoubleBuffered(g);
void paintImmediately2(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); if (rm.isDoubleBufferingEnabled() && isDoubleBuffered()) paintDoubleBuffered(r); else paintSimple(r); }
paintSimple(r);
paintSimple(g); g.dispose();
void paintImmediately2(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); if (rm.isDoubleBufferingEnabled() && isDoubleBuffered()) paintDoubleBuffered(r); else paintSimple(r); }
void paintSimple(Rectangle r)
void paintSimple(Graphics g)
void paintSimple(Rectangle r) { Graphics g = getGraphics(); Graphics g2 = getComponentGraphics(g); paint(g2); g2.dispose(); g2.dispose(); }
Graphics g = getGraphics();
void paintSimple(Rectangle r) { Graphics g = getGraphics(); Graphics g2 = getComponentGraphics(g); paint(g2); g2.dispose(); g2.dispose(); }
g2.dispose(); g2.dispose();
void paintSimple(Rectangle r) { Graphics g = getGraphics(); Graphics g2 = getComponentGraphics(g); paint(g2); g2.dispose(); g2.dispose(); }
int getDefaultCloseOperation()
public int getDefaultCloseOperation()
int getDefaultCloseOperation() { return close_action; }
System.exit(1);
System.exit(0);
protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); switch (e.getID()) { case WindowEvent.WINDOW_CLOSING: { switch(close_action) { case EXIT_ON_CLOSE: { System.exit(1); break; } case DISPOSE_ON_CLOSE: { dispose(); break; } case HIDE_ON_CLOSE: { setVisible(false); break; } case DO_NOTHING_ON_CLOSE: break; } break; } case WindowEvent.WINDOW_CLOSED: case WindowEvent.WINDOW_OPENED: case WindowEvent.WINDOW_ICONIFIED: case WindowEvent.WINDOW_DEICONIFIED: case WindowEvent.WINDOW_ACTIVATED: case WindowEvent.WINDOW_DEACTIVATED: break; } }
{ close_action = operation; }
{ SecurityManager sm = System.getSecurityManager(); if (sm != null && operation == EXIT_ON_CLOSE) sm.checkExit(0); if (operation != EXIT_ON_CLOSE && operation != DISPOSE_ON_CLOSE && operation != HIDE_ON_CLOSE && operation != DO_NOTHING_ON_CLOSE) throw new IllegalArgumentException("operation = " + operation); close_action = operation; }
public void setDefaultCloseOperation(int operation) { close_action = operation; }
protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); switch (e.getID()) { case WindowEvent.WINDOW_CLOSING : { switch (close_action) { case DISPOSE_ON_CLOSE : { System.out.println("user requested dispose on close"); dispose(); break; } case HIDE_ON_CLOSE : { setVisible(false); break; } case DO_NOTHING_ON_CLOSE : break; } break; } case WindowEvent.WINDOW_CLOSED : case WindowEvent.WINDOW_OPENED : case WindowEvent.WINDOW_ICONIFIED : case WindowEvent.WINDOW_DEICONIFIED : case WindowEvent.WINDOW_ACTIVATED : case WindowEvent.WINDOW_DEACTIVATED :
protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); switch (e.getID()) { case WindowEvent.WINDOW_CLOSING: { switch(close_action) { case DISPOSE_ON_CLOSE: { System.out.println("user requested dispose on close"); dispose();
protected void processWindowEvent(WindowEvent e) { // System.out.println("PROCESS_WIN_EV-1: " + e); super.processWindowEvent(e); // System.out.println("PROCESS_WIN_EV-2: " + e); switch (e.getID()) { case WindowEvent.WINDOW_CLOSING : { switch (close_action) { case DISPOSE_ON_CLOSE : { System.out.println("user requested dispose on close"); dispose(); break; } case HIDE_ON_CLOSE : { setVisible(false); break; } case DO_NOTHING_ON_CLOSE : break; } break; } case WindowEvent.WINDOW_CLOSED : case WindowEvent.WINDOW_OPENED : case WindowEvent.WINDOW_ICONIFIED : case WindowEvent.WINDOW_DEICONIFIED : case WindowEvent.WINDOW_ACTIVATED : case WindowEvent.WINDOW_DEACTIVATED : break; } }
}
case WindowEvent.WINDOW_CLOSED: case WindowEvent.WINDOW_OPENED: case WindowEvent.WINDOW_ICONIFIED: case WindowEvent.WINDOW_DEICONIFIED: case WindowEvent.WINDOW_ACTIVATED: case WindowEvent.WINDOW_DEACTIVATED: break; } }
protected void processWindowEvent(WindowEvent e) { // System.out.println("PROCESS_WIN_EV-1: " + e); super.processWindowEvent(e); // System.out.println("PROCESS_WIN_EV-2: " + e); switch (e.getID()) { case WindowEvent.WINDOW_CLOSING : { switch (close_action) { case DISPOSE_ON_CLOSE : { System.out.println("user requested dispose on close"); dispose(); break; } case HIDE_ON_CLOSE : { setVisible(false); break; } case DO_NOTHING_ON_CLOSE : break; } break; } case WindowEvent.WINDOW_CLOSED : case WindowEvent.WINDOW_OPENED : case WindowEvent.WINDOW_ICONIFIED : case WindowEvent.WINDOW_DEICONIFIED : case WindowEvent.WINDOW_ACTIVATED : case WindowEvent.WINDOW_DEACTIVATED : break; } }
public abstract BufferedImage createCompatibleImage(int w, int h, int transparency);
public abstract BufferedImage createCompatibleImage(int w, int h);
public abstract BufferedImage createCompatibleImage(int w, int h, int transparency);
public JRadioButton(String text) { this(text, null); }
public JRadioButton() { this(null, null); }
public JRadioButton(String text) { this(text, null); }
public String getUIClassID() { return "JRadioButton"; }
public String getUIClassID() { return "RadioButtonUI"; }
public String getUIClassID() { //Returns a string that specifies the name of the L&F class that renders this component. return "JRadioButton"; }