rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
public FSEntry addFile(String name) throws IOException { | public synchronized FSEntry addFile(String name) throws IOException { | public FSEntry addFile(String name) throws IOException { if(isReadOnly()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; Ext2DirectoryRec... |
public FSEntry getEntry(String name) throws IOException{ | public synchronized FSEntry getEntry(String name) throws IOException{ | public FSEntry getEntry(String name) throws IOException{ //parse the directory and search for the file FSEntryIterator iterator=iterator(); while(iterator.hasNext()) { FSEntry entry = iterator.next(); if(entry.getName().equals(name)) return entry; } return null; } |
protected Rectangle modelToView(int position, Shape a, Position.Bias bias) | public Shape modelToView(int position, Shape a, Position.Bias bias) | protected Rectangle modelToView(int position, Shape a, Position.Bias bias) throws BadLocationException { return ((PlainView) view).modelToView(position, a, bias).getBounds(); } |
if (view == null) return null; | protected Rectangle modelToView(int position, Shape a, Position.Bias bias) throws BadLocationException { return ((PlainView) view).modelToView(position, a, bias).getBounds(); } | |
textComponent = null; | public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); textComponent = null; uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); } | |
textComponent = null; | public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); textComponent = null; uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); } | |
g.setColor(Color.black); | if (c.isEnabled()) g.setColor(MetalLookAndFeel.getBlack()); else g.setColor(MetalLookAndFeel.getControlDisabled()); | public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: work out whether/how the icon changes with different component // states (and also different metal themes) Color savedColor = g.getColor(); g.setColor(Color.black); for (int i = 0; i < 5; i++) g.drawLine(x + i, y + i, x... |
if (c > Byte.MAX_VALUE) | if (c > 0x7f) | protected CoderResult encodeLoop (CharBuffer in, ByteBuffer out) { // TODO: Optimize this in the case in.hasArray() / out.hasArray() while (in.hasRemaining ()) { char c = in.get (); if (c > Byte.MAX_VALUE) { in.position (in.position () - 1); return Code... |
if (highlighter != null && textComponent.getSelectionStart() != textComponent.getSelectionEnd()) | if (highlighter != null) { Color oldColor = g.getColor(); | protected void paintSafely(Graphics g) { Caret caret = textComponent.getCaret(); Highlighter highlighter = textComponent.getHighlighter(); if (textComponent.isOpaque()) paintBackground(g); if (highlighter != null && textComponent.getSelectionStart() != textComponent.getSelectionEnd()) h... |
g.setColor(oldColor); } | protected void paintSafely(Graphics g) { Caret caret = textComponent.getCaret(); Highlighter highlighter = textComponent.getHighlighter(); if (textComponent.isOpaque()) paintBackground(g); if (highlighter != null && textComponent.getSelectionStart() != textComponent.getSelectionEnd()) h... | |
view.setParent(rootView); | protected final void setView(View view) { rootView.setView(view); view.setParent(rootView); textComponent.revalidate(); textComponent.repaint(); } | |
public static void main(String[] args) { | public static void main(String[] args) throws SyntaxErrorException { | public static void main(String[] args) { ParsedArguments cmdLine = HELP_INFO.parse(args); String key = ARG_KEY.getValue(cmdLine); String value = ARG_VALUE.getValue(cmdLine); System.getProperties().setProperty(key, value); } |
jComponent.setLayout(new SwingContainerLayout(this)); | public SwingPanelPeer(SwingToolkit toolkit, Panel panel) { super(toolkit, panel, new SwingPanel(panel)); final SwingPanel jPanel = (SwingPanel) jComponent; SwingToolkit.add(panel, jPanel); SwingToolkit.copyAwtProperties(panel, jPanel); } | |
fireIntervalAdded(this, list.size(), list.size()); | fireIntervalAdded(this, list.size() - 1, list.size()); | public void addElement(Object object) { list.add(object); fireIntervalAdded(this, list.size(), list.size()); } |
list.clear(); fireIntervalAdded(this, 0, listSize - 1); | fireIntervalAdded(this, 0, listSize); | public void removeAllElements() { int listSize = getSize(); list.clear(); fireIntervalAdded(this, 0, listSize - 1); } |
bad.minor = Minor.Any; | public static InvalidPolicy extract(Any any) { try { return ((InvalidPolicyHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("InvalidPolicy expected"); bad.initCause(cex); throw bad; } } | |
int location = e.getKeyLocation(); | protected void displayInfo(KeyEvent e, String s){ String charString, keyCodeString, modString, tmpString,isString,locString; char c = e.getKeyChar(); int keyCode = e.getKeyCode(); int modifiers = e.getModifiers(); int location = e.getKeyLocation(); if (Character.isISOCon... | |
switch (location) { case KeyEvent.KEY_LOCATION_LEFT: locString = "location = " + location + " (LEFT)"; break; case KeyEvent.KEY_LOCATION_NUMPAD: locString = "location = " + location + " (NUM_PAD)"; break; case KeyEvent.KEY_LOCATION_RIGHT: locString = "location = " + location + " (RIGHT)"; break; case KeyEvent.KEY_LOCAT... | locString = "location = (UNKNOWN)"; | protected void displayInfo(KeyEvent e, String s){ String charString, keyCodeString, modString, tmpString,isString,locString; char c = e.getKeyChar(); int keyCode = e.getKeyCode(); int modifiers = e.getModifiers(); int location = e.getKeyLocation(); if (Character.isISOCon... |
dispatchThread.interrupt (); | ((ClasspathToolkit) Toolkit.getDefaultToolkit()).wakeNativeQueue(); setShutdown(true); | protected void pop() throws EmptyStackException { if (prev == null) throw new EmptyStackException(); /* The order is important here, we must get the prev lock first, or deadlock could occur as callers usually get here following prev's next pointer, and thus obtain prev's lock before trying to... |
this.notifyAll(); | protected void pop() throws EmptyStackException { if (prev == null) throw new EmptyStackException(); /* The order is important here, we must get the prev lock first, or deadlock could occur as callers usually get here following prev's next pointer, and thus obtain prev's lock before trying to... | |
updateChildRequirements(axis); updateRequirements(axis); | int totalAscent = (int) (span * getAlignment(axis)); int totalDescent = span - totalAscent; | protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requ... |
SizeRequirements.calculateAlignedPositions(span, requirements[axis], childReqs[axis], offsets, spans); | int count = getViewCount(); for (int i = 0; i < count; i++) { View v = getView(i); float align = v.getAlignment(axis); int viewSpan; if (v.getResizeWeight(axis) > 0) { int min = (int) v.getMinimumSpan(axis); int max = (int) v.getMaximumSpan(axis); if (align == 0.0F) viewSpan = Math.max(Math.min(max, totalDescent), min... | protected void baselineLayout(int span, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(span, requ... |
updateChildRequirements(axis); | if (sr == null) sr = new SizeRequirements(); sr.alignment = 0.5F; | protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; ... |
SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); | int totalAscentMin = 0; int totalAscentPref = 0; int totalAscentMax = 0; int totalDescentMin = 0; int totalDescentPref = 0; int totalDescentMax = 0; | protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; ... |
float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < childReqs[axis].length; i++) | int count = getViewCount(); for (int i = 0; i < count; i++) | protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; ... |
float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment; float myMinRight = childReqs[axis][i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment; float myPrefRight = c... | View v = getView(i); float align = v.getAlignment(axis); int span = (int) v.getPreferredSpan(axis); int ascent = (int) (align * span); int descent = span - ascent; totalAscentPref = Math.max(ascent, totalAscentPref); totalDescentPref = Math.max(descent, totalDescentPref); if (v.getResizeWeight(axis) > 0) { span = (i... | protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; ... |
int minSize = (int) (minLeft + minRight); int prefSize = (int) (prefLeft + prefRight); int maxSize = (int) (maxLeft + maxRight); float align = prefLeft / (prefRight + prefLeft); if (Float.isNaN(align)) align = 0; | protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; ... | |
res.alignment = align; res.maximum = maxSize; res.preferred = prefSize; res.minimum = minSize; return res; | sr.preferred = (int) Math.min((long) totalAscentPref + (long) totalDescentPref, Integer.MAX_VALUE); if (sr.preferred > 0) sr.alignment = (float) totalAscentPref / sr.preferred; if (sr.alignment == 0) { sr.minimum = totalDescentMin; sr.maximum = totalDescentMax; } else if (sr.alignment == 1.0F) { sr.minimum = total... | protected SizeRequirements baselineRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; float prefLeft = 0; ... |
updateChildRequirements(axis); | SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred =... |
SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); | float min = 0; float pref = 0; float max = 0; | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred =... |
long minimum = 0; long preferred = 0; long maximum = 0; for (int i = 0; i < children.length; i++) | int n = getViewCount(); for (int i = 0; i < n; i++) | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred =... |
minimum += childReqs[axis][i].minimum; preferred += childReqs[axis][i].preferred; maximum += childReqs[axis][i].maximum; | View child = getView(i); min += child.getMinimumSpan(axis); pref += child.getPreferredSpan(axis); max += child.getMaximumSpan(axis); | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred =... |
if (minimum > Integer.MAX_VALUE) minimum = Integer.MAX_VALUE; if (preferred > Integer.MAX_VALUE) preferred = Integer.MAX_VALUE; if (maximum > Integer.MAX_VALUE) maximum = Integer.MAX_VALUE; | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred =... | |
result.minimum = (int) minimum; result.preferred = (int) preferred; result.maximum = (int) maximum; result.alignment = 0.5F; return result; | res.minimum = (int) min; res.preferred = (int) pref; res.maximum = (int) max; res.alignment = 0.5F; return res; | protected SizeRequirements calculateMajorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements result = sr; if (result == null) result = new SizeRequirements(); long minimum = 0; long preferred =... |
updateChildRequirements(axis); | protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; f... | |
float minLeft = 0; float minRight = 0; float prefLeft = 0; float prefRight = 0; float maxLeft = 0; float maxRight = 0; for (int i = 0; i < childReqs[axis].length; i++) | res.minimum = 0; res.preferred = 0; res.maximum = 0; res.alignment = 0.5F; int n = getViewCount(); for (int i = 0; i < n; i++) | protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; f... |
float myMinLeft = childReqs[axis][i].minimum * childReqs[axis][i].alignment; float myMinRight = childReqs[axis][i].minimum - myMinLeft; minLeft = Math.max(myMinLeft, minLeft); minRight = Math.max(myMinRight, minRight); float myPrefLeft = childReqs[axis][i].preferred * childReqs[axis][i].alignment; float myPrefRight = c... | View child = getView(i); res.minimum = Math.max((int) child.getMinimumSpan(axis), res.minimum); res.preferred = Math.max((int) child.getPreferredSpan(axis), res.preferred); res.maximum = Math.max((int) child.getMaximumSpan(axis), res.maximum); | protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; f... |
int minSize = (int) (minLeft + minRight); int prefSize = (int) (prefLeft + prefRight); int maxSize = (int) (maxLeft + maxRight); float align = prefLeft / (prefRight + prefLeft); if (Float.isNaN(align)) align = 0; | protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; f... | |
res.alignment = align; res.maximum = maxSize; res.preferred = prefSize; res.minimum = minSize; | protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements sr) { updateChildRequirements(axis); SizeRequirements res = sr; if (res == null) res = new SizeRequirements(); float minLeft = 0; float minRight = 0; f... | |
if (! isAllocationValid()) layout(a.width, a.height); | protected void childAllocation(int index, Rectangle a) { if (! isAllocationValid()) layout(a.width, a.height); a.x += offsets[X_AXIS][index]; a.y += offsets[Y_AXIS][index]; a.width = spans[X_AXIS][index]; a.height = spans[Y_AXIS][index]; } | |
float align; if (axis == myAxis) align = 0.5F; else { | public float getAlignment(int axis) { float align; if (axis == myAxis) align = 0.5F; else { updateRequirements(axis); align = requirements[axis].alignment; } return align; } | |
align = requirements[axis].alignment; } return align; | return requirements[axis].alignment; | public float getAlignment(int axis) { float align; if (axis == myAxis) align = 0.5F; else { updateRequirements(axis); align = requirements[axis].alignment; } return align; } |
return span[Y_AXIS]; | return span[Y_AXIS] + getTopInset() - getBottomInset(); | public int getHeight() { return span[Y_AXIS]; } |
float max; if (axis == myAxis) max = getPreferredSpan(axis); | updateRequirements(axis); float margin; if (axis == X_AXIS) margin = getLeftInset() + getRightInset(); | public float getMaximumSpan(int axis) { float max; if (axis == myAxis) max = getPreferredSpan(axis); else max = Integer.MAX_VALUE; return max; } |
max = Integer.MAX_VALUE; return max; | margin = getTopInset() + getBottomInset(); return requirements[axis].maximum + margin; | public float getMaximumSpan(int axis) { float max; if (axis == myAxis) max = getPreferredSpan(axis); else max = Integer.MAX_VALUE; return max; } |
return requirements[axis].minimum; | float margin; if (axis == X_AXIS) margin = getLeftInset() + getRightInset(); else margin = getTopInset() + getBottomInset(); return requirements[axis].minimum + margin; | public float getMinimumSpan(int axis) { updateRequirements(axis); return requirements[axis].minimum; } |
return requirements[axis].preferred; | float margin; if (axis == X_AXIS) margin = getLeftInset() + getRightInset(); else margin = getTopInset() + getBottomInset(); return requirements[axis].preferred + margin; | public float getPreferredSpan(int axis) { updateRequirements(axis); return requirements[axis].preferred; } |
return span[X_AXIS]; | return span[X_AXIS] + getLeftInset() - getRightInset(); | public int getWidth() { return span[X_AXIS]; } |
result = x > r.x; | result = x > r.x + r.width; | protected boolean isAfter(int x, int y, Rectangle r) { boolean result = false; if (myAxis == X_AXIS) result = x > r.x; else result = y > r.y; return result; } |
result = y > r.y; | result = y > r.y + r.height; | protected boolean isAfter(int x, int y, Rectangle r) { boolean result = false; if (myAxis == X_AXIS) result = x > r.x; else result = y > r.y; return result; } |
updateChildRequirements(axis); updateRequirements(axis); | long sumPref = 0; int n = getViewCount(); for (int i = 0; i < n; i++) { View child = getView(i); spans[i] = (int) child.getPreferredSpan(axis); sumPref = spans[i]; } | protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targ... |
SizeRequirements.calculateTiledPositions(targetSpan, requirements[axis], childReqs[axis], offsets, spans); | long diff = targetSpan - sumPref; float factor = 0.0F; int[] diffs = null; if (diff != 0) { long total = 0; diffs = new int[n]; for (int i = 0; i < n; i++) { View child = getView(i); int span; if (diff < 0) { span = (int) child.getMinimumSpan(axis); diffs[i] = spans[i] - span; } else { span = (int) child.getMaximumSpan... | protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targ... |
float maxAdjust = Math.abs(total - sumPref); factor = diff / maxAdjust; factor = Math.min(factor, 1.0F); factor = Math.max(factor, -1.0F); } int totalOffs = 0; for (int i = 0; i < n; i++) { offsets[i] = totalOffs; if (diff != 0) { float adjust = factor * diffs[i]; spans[i] += Math.round(adjust); } totalOffs = (int) ... | protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateTiledPositions(targ... | |
updateChildRequirements(axis); updateRequirements(axis); SizeRequirements.calculateAlignedPositions(targetSpan, requirements[axis], childReqs[axis], offsets, spans); | int count = getViewCount(); for (int i = 0; i < count; i++) { View child = getView(i); int max = (int) child.getMaximumSpan(axis); if (max < targetSpan) { float align = child.getAlignment(axis); offsets[i] = (int) ((targetSpan - max) * align); spans[i] = max; } else { int min = (int) child.getMinimumSpan(axis); offse... | protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) { updateChildRequirements(axis); updateRequirements(axis); // Calculate the spans and offsets using the SizeRequirements uility // methods. SizeRequirements.calculateAlignedPositions(ta... |
layout(bounds.width, bounds.height); | setSize(bounds.width, bounds.height); | public Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException { // Make sure everything is allocated properly and then call super if (! isAllocationValid()) { Rectangle bounds = a.getBounds(); layout(bounds.width, bounds.height); } return super.model... |
Rectangle inside = getInsideAllocation(a); | Rectangle alloc; if (a instanceof Rectangle) alloc = (Rectangle) a; else alloc = a.getBounds(); | public void paint(Graphics g, Shape a) { Rectangle inside = getInsideAllocation(a); // TODO: Used for debugging. //g.drawRect(inside.x, inside.y, inside.width, inside.height); Rectangle copy = new Rectangle(inside); int count = getViewCount(); for (int i = 0; i < count; ++i) { copy.setB... |
Rectangle copy = new Rectangle(inside); | int x = alloc.x + getLeftInset(); int y = alloc.y + getTopInset(); Rectangle clip = g.getClipBounds(); Rectangle tmp = new Rectangle(); | public void paint(Graphics g, Shape a) { Rectangle inside = getInsideAllocation(a); // TODO: Used for debugging. //g.drawRect(inside.x, inside.y, inside.width, inside.height); Rectangle copy = new Rectangle(inside); int count = getViewCount(); for (int i = 0; i < count; ++i) { copy.setB... |
copy.setBounds(inside); childAllocation(i, copy); if (!copy.isEmpty() && g.hitClip(copy.x, copy.y, copy.width, copy.height)) paintChild(g, copy, i); | tmp.x = x + getOffset(X_AXIS, i); tmp.y = y + getOffset(Y_AXIS, i); tmp.width = getSpan(X_AXIS, i); tmp.height = getSpan(Y_AXIS, i); if (tmp.intersects(clip)) paintChild(g, tmp, i); | public void paint(Graphics g, Shape a) { Rectangle inside = getInsideAllocation(a); // TODO: Used for debugging. //g.drawRect(inside.x, inside.y, inside.width, inside.height); Rectangle copy = new Rectangle(inside); int count = getViewCount(); for (int i = 0; i < count; ++i) { copy.setB... |
requirementsValid[Y_AXIS] = false; } | public void preferenceChanged(View child, boolean width, boolean height) { if (width) layoutValid[X_AXIS] = false; if (height) layoutValid[Y_AXIS] = false; super.preferenceChanged(child, width, height); } | |
layoutChanged(X_AXIS); layoutChanged(Y_AXIS); | layoutValid[X_AXIS] = false; requirementsValid[X_AXIS] = false; layoutValid[Y_AXIS] = false; requirementsValid[Y_AXIS] = false; | public void replace(int offset, int length, View[] views) { int numViews = 0; if (views != null) numViews = views.length; // Resize and copy data for cache arrays. // The spansX cache. int oldSize = getViewCount(); int[] newSpansX = new int[oldSize - length + numViews]; System.arraycopy(spa... |
layout((int) width, (int) height); | layout((int) (width - getLeftInset() - getRightInset()), (int) (height - getTopInset() - getBottomInset())); | public void setSize(float width, float height) { layout((int) width, (int) height); } |
if (! layoutValid[axis]) | if (axis != Y_AXIS && axis != X_AXIS) throw new IllegalArgumentException("Illegal axis: " + axis); if (! requirementsValid[axis]) | private void updateRequirements(int axis) { if (! layoutValid[axis]) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequi... |
requirementsValid[axis] = true; | private void updateRequirements(int axis) { if (! layoutValid[axis]) { if (axis == myAxis) requirements[axis] = calculateMajorAxisRequirements(axis, requirements[axis]); else requirements[axis] = calculateMinorAxisRequi... | |
AttributedString(String str) { | public AttributedString(String str) { | AttributedString(String str){ sci = new StringCharacterIterator(str); attribs = new AttributeRange[0];} |
addAttribute(AttributedCharacterIterator.Attribute attrib, Object value) { | public void addAttribute(AttributedCharacterIterator.Attribute attrib, Object value) { | addAttribute(AttributedCharacterIterator.Attribute attrib, Object value){ addAttribute(attrib, value, 0, sci.getEndIndex());} |
addAttributes(Map attributes, int begin_index, int end_index) { | public void addAttributes(Map attributes, int begin_index, int end_index) { | addAttributes(Map attributes, int begin_index, int end_index){ if (attributes == null) throw new IllegalArgumentException("null attribute"); if ((begin_index < 0) || (end_index > sci.getEndIndex()) || (end_index < begin_index)) throw new IllegalArgumentException("bad range"); AttributeRange[] new_list = n... |
getIterator() { return(new AttributedStringIterator(sci, attribs, 0, sci.getEndIndex(), null)); } | public AttributedCharacterIterator getIterator() { return(new AttributedStringIterator(sci, attribs, 0, sci.getEndIndex(), null)); } | getIterator(){ return(new AttributedStringIterator(sci, attribs, 0, sci.getEndIndex(), null));} |
final int alignedObjectSize = alignInstanceFields(ftable, slotSize); objectSize = alignedObjectSize; | objectSize = alignInstanceFields(ftable, slotSize); | private static void createFields(VmType< ? > cls, FieldData[] fieldDatas, VmSharedStatics sharedStatics, VmIsolatedStatics isolatedStatics, int slotSize, int pragmaFlags) { final int fcount = fieldDatas.length; final VmField[] ftable = new VmField[fcount]; int objectSize =... |
final VmType cls = decodeClass(data, rejectNatives, clc, protectionDomain); return cls; | return decodeClass(data, rejectNatives, clc, protectionDomain); | public static final VmType defineClass(String className, ByteBuffer data, boolean rejectNatives, VmClassLoader clc, ProtectionDomain protectionDomain) { cl_init(); final VmType cls = decodeClass(data, rejectNatives, clc, protectionDomain); return cls; } |
set(index, new Integer(data)); | set(index, new VmConstInt(data)); | protected void setInt(int index, int data) { set(index, new Integer(data)); } |
set(index, new Float(data)); | set(index, new VmConstFloat(data)); | protected void setFloat(int index, float data) { set(index, new Float(data)); } |
set(index, new Long(data)); | set(index, new VmConstLong(data)); | protected void setLong(int index, long data) { set(index, new Long(data)); } |
set(index, new Double(data)); | set(index, new VmConstDouble(data)); | protected void setDouble(int index, double data) { set(index, new Double(data)); } |
return ((Integer) get(index)).intValue(); | return ((VmConstInt) get(index)).intValue(); | public int getInt(int index) { if (index == 0) return 0; else return ((Integer) get(index)).intValue(); } |
return ((Double) get(index)).doubleValue(); | return ((VmConstDouble) get(index)).doubleValue(); | public double getDouble(int index) { return ((Double) get(index)).doubleValue(); } |
return ((Float) get(index)).floatValue(); | return ((VmConstFloat) get(index)).floatValue(); | public float getFloat(int index) { return ((Float) get(index)).floatValue(); } |
return ((Long) get(index)).longValue(); | return ((VmConstLong) get(index)).longValue(); | public long getLong(int index) { return ((Long) get(index)).longValue(); } |
setBorder(null); | public PaneButton(Action a) { super(a); setMargin(new Insets(0, 0, 0, 0)); setBorder(null); } | |
enableActions(); | String propName = evt.getPropertyName(); if (propName.equals("closable")) { if (evt.getNewValue().equals(Boolean.TRUE)) closeButton.setVisible(true); else closeButton.setVisible(false); } else if (propName.equals("iconifiable")) { if (evt.getNewValue().equals(Boolean.TRUE)) iconButton.setVisible(true); else iconButton.... | public void propertyChange(PropertyChangeEvent evt) { // The title and frameIcon are taken care of during painting time. // The only other thing this will care about are the "is----izable" // properties. So we call enable actions to properly handle the // buttons and menu items for us. ... |
enableActions(); | Dimension size = c.getSize(); | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; | int width = size.width - insets.left - insets.right; int height = size.height - insets.top - insets.bottom; | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
int loc = width + insets.left; | int loc = width + insets.left - 1; int top = insets.top + 1; int buttonWidth = height - 2; int buttonHeight = height - 4; if (closeButton.isVisible()) { loc -= buttonWidth + 2; closeButton.setBounds(loc, top, buttonWidth, buttonHeight); } | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
Insets i = closeButton.getInsets(); Dimension prefs = new Dimension(iconSize + i.left + i.right, iconSize + i.top + i.bottom); int top = insets.top + (height - prefs.height) / 2; if (closeAction.isEnabled()) | if (maxButton.isVisible()) | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
loc -= prefs.width; closeButton.setVisible(true); closeButton.setBounds(loc, top, prefs.width, prefs.height); | loc -= buttonWidth + 2; maxButton.setBounds(loc, top, buttonWidth, buttonHeight); | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
else closeButton.setVisible(false); | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... | |
if (maximizeAction.isEnabled()) | if (iconButton.isVisible()) | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
loc -= prefs.width; maxButton.setVisible(true); maxButton.setBounds(loc, top, prefs.width, prefs.height); | loc -= buttonWidth + 2; iconButton.setBounds(loc, top, buttonWidth, buttonHeight); | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... |
else maxButton.setVisible(false); if (iconifyAction.isEnabled()) { loc -= prefs.width; iconButton.setVisible(true); iconButton.setBounds(loc, top, prefs.width, prefs.height); } else iconButton.setVisible(false); | public void layoutContainer(Container c) { enableActions(); Insets insets = c.getInsets(); int width = c.getBounds().width - insets.left - insets.right; int height = c.getBounds().height - insets.top - insets.bottom; // MenuBar is always present and located at the top left corner. D... | |
Insets frameInsets = frame.getInsets(); int height = 0; int width = 0; Dimension d; Component[] components = BasicInternalFrameTitlePane.this.getComponents(); for (int i = 0; i < components.length; i++) { d = components[i].getPreferredSize(); height = Math.max(height, d.height); width += d.width; } Insets insets =... | return new Dimension(22, 18); | public Dimension preferredLayoutSize(Container c) { Insets frameInsets = frame.getInsets(); // Height is the max of the preferredHeights of all components // inside the pane int height = 0; int width = 0; Dimension d; Component[] components = BasicInternalFrameTitlePane.this.ge... |
setOpaque(true); | public BasicInternalFrameTitlePane(JInternalFrame f) { frame = f; setLayout(createLayout()); title = new JLabel(); title.setHorizontalAlignment(SwingConstants.LEFT); title.setHorizontalTextPosition(SwingConstants.LEFT); title.setOpaque(false); setOpaque(true); setBackground(Color.LIGHT_GRAY);... | |
closeButton.setOpaque(false); | if (!frame.isClosable()) closeButton.setVisible(false); | protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); } |
iconButton.setOpaque(false); | if (!frame.isIconifiable()) iconButton.setVisible(false); | protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); } |
maxButton.setOpaque(false); | if (!frame.isMaximizable()) maxButton.setVisible(false); | protected void createButtons() { closeButton = new PaneButton(closeAction); closeButton.setOpaque(false); iconButton = new PaneButton(iconifyAction); iconButton.setOpaque(false); maxButton = new PaneButton(maximizeAction); maxButton.setOpaque(false); } |
if (closeButton != null) closeButton.setIcon(closeIcon); if (iconButton != null) iconButton.setIcon(iconIcon); if (maxButton != null) maxButton.setIcon(maxIcon); | protected void setButtonIcons() { if (closeButton != null) closeButton.setIcon(closeIcon); if (iconButton != null) iconButton.setIcon(iconIcon); if (maxButton != null) maxButton.setIcon(maxIcon); } | |
Object source = e.getSource(); if (source == panel ) tabPane.requestFocus(); else if (source == tabPane) tabPane.repaint(); | public void focusGained(FocusEvent e) { // FIXME: Implement. } | |
if (e.getOppositeComponent() == tabPane.getSelectedComponent()) tabPane.requestFocus(); else if (e.getSource() == tabPane) tabPane.repaint(); | public void focusLost(FocusEvent e) { // FIXME: Implement. } | |
public void mouseEntered(MouseEvent ev) | public void mouseEntered(MouseEvent e) | public void mouseEntered(MouseEvent ev) { int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); } |
int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); | Object s = e.getSource(); if (tabPane != e.getSource()) { redispatchEvent(e); e.setSource(s); } int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY()); | public void mouseEntered(MouseEvent ev) { int tabIndex = tabForCoordinate(tabPane, ev.getX(), ev.getY()); setRolloverTab(tabIndex); } |
public void mouseExited(MouseEvent ev) | public void mouseExited(MouseEvent e) | public void mouseExited(MouseEvent ev) { setRolloverTab(-1); } |
Object s = e.getSource(); if (tabPane != e.getSource()) { redispatchEvent(e); e.setSource(s); } | public void mouseExited(MouseEvent ev) { setRolloverTab(-1); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.