rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
for (int i=0;i<v.size();i++) | for (int i = 0;i < buttons.size(); i++) | AbstractButton FindButton(ButtonModel m) { for (int i=0;i<v.size();i++) { AbstractButton a = (AbstractButton) v.get(i); if (a.getModel()== m) { return a; } } return null; } |
AbstractButton a = (AbstractButton) v.get(i); if (a.getModel()== m) { | AbstractButton a = (AbstractButton) buttons.get(i); if (a.getModel() == m) | AbstractButton FindButton(ButtonModel m) { for (int i=0;i<v.size();i++) { AbstractButton a = (AbstractButton) v.get(i); if (a.getModel()== m) { return a; } } return null; } |
} | AbstractButton FindButton(ButtonModel m) { for (int i=0;i<v.size();i++) { AbstractButton a = (AbstractButton) v.get(i); if (a.getModel()== m) { return a; } } return null; } | |
return v.size(); | return buttons.size(); | public int getButtonCount() { return v.size(); } |
public Enumeration getElements() { return v.elements(); } | public Enumeration getElements() { return buttons.elements(); } | public Enumeration getElements() { return v.elements(); } |
return (m == sel); | return m == sel; | public boolean isSelected(ButtonModel m) { return (m == sel); } |
v.removeElement(b); | buttons.removeElement(b); | public void remove(AbstractButton b) { b.getModel().setGroup(null); v.removeElement(b); } |
System.out.println("REPAINT-REQUIST: " + but.text); | System.out.println("REPAINT-REQUEST: " + but.text); | public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel="+sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = Fin... |
{ | public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel="+sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = Fin... | |
} | public void setSelected(ButtonModel m, boolean b) { if ((m == sel) && (b == true)) { // clicked on sam item twice. System.out.println("PRESSED TWICE:" + m + ", sel="+sel); return; } if (sel != null) { System.out.println("DESELECTING: " + sel); sel.setSelected(!b); AbstractButton but = Fin... | |
if (tsiAddress == null) { | if (tsiAddress.isZero()) { | protected final Address getTSIAddress() { if (tsiAddress == null) { tsiAddress = ObjectReference.fromObject(this).toAddress(); } return tsiAddress; } |
final void lock(ProcessorLock otherLock) { if (otherLock == null) { queueLock.lock(); } else { ProcessorLock.lock(queueLock, otherLock); } | final void lock() { queueLock.lock(); | final void lock(ProcessorLock otherLock) { if (otherLock == null) { queueLock.lock(); } else { ProcessorLock.lock(queueLock, otherLock); } } |
final void unlock(ProcessorLock otherLock) { if (otherLock != null) { otherLock.unlock(); } | final void unlock() { | final void unlock(ProcessorLock otherLock) { if (otherLock != null) { otherLock.unlock(); } queueLock.unlock(); } |
final void addToReadyQueue(VmThread thread, boolean ignorePriority) { | final void addToReadyQueue(VmThread thread, boolean ignorePriority, String caller) { | final void addToReadyQueue(VmThread thread, boolean ignorePriority) { try { // Get access to queues queueLock.lock(); if (thread.isRunning() || thread.isYielding()) { readyQueue.enqueue(thread, ignorePriority); } else { Unsafe ... |
readyQueue.enqueue(thread, ignorePriority); | sleepQueue.remove(thread); readyQueue.add(thread, ignorePriority, caller); | final void addToReadyQueue(VmThread thread, boolean ignorePriority) { try { // Get access to queues queueLock.lock(); if (thread.isRunning() || thread.isYielding()) { readyQueue.enqueue(thread, ignorePriority); } else { Unsafe ... |
wakeupQueue.dump(false, null); | sleepQueue.dump(false, null); | final void dump() { try { // Get access to queues queueLock.lock(); readyQueue.dump(false, null); wakeupQueue.dump(false, null); } finally { // Release access to queues queueLock.unlock(); } } |
final void setYieldingState() { | final void setYieldingState() throws UninterruptiblePragma { | final void setYieldingState() { if (threadState == RUNNING) { threadState = YIELDING; } } |
return (char) (ch + lower[readChar(ch) >> 7]); | return (char) (lower[0][readCodePoint((int)ch) >>> 7] + ch); | public static char toLowerCase(char ch) { // Signedness doesn't matter, as result is cast back to char. return (char) (ch + lower[readChar(ch) >> 7]); } |
if (comboBox.isEnabled()) | if (SwingUtilities.isLeftMouseButton(e) && comboBox.isEnabled()) { delegateFocus(e); | public void mousePressed(MouseEvent e) { if (comboBox.isEnabled()) togglePopup(); } |
} | public void mousePressed(MouseEvent e) { if (comboBox.isEnabled()) togglePopup(); } | |
Component src = (Component) e.getSource(); int x = e.getX(); int y = e.getY(); Component releasedComponent = SwingUtilities.getDeepestComponentAt(src, x, y); | Component component = (Component) e.getSource(); Dimension size = component.getSize(); Rectangle bounds = new Rectangle(0, 0, size.width - 1, size.height - 1); | public void mouseReleased(MouseEvent e) { // Get component over which mouse was released Component src = (Component) e.getSource(); int x = e.getX(); int y = e.getY(); Component releasedComponent = SwingUtilities.getDeepestComponentAt(src, ... |
if (! (releasedComponent instanceof JComboBox)) | if (! bounds.contains(e.getPoint())) | public void mouseReleased(MouseEvent e) { // Get component over which mouse was released Component src = (Component) e.getSource(); int x = e.getX(); int y = e.getY(); Component releasedComponent = SwingUtilities.getDeepestComponentAt(src, ... |
MouseEvent convEvent = convertMouseEvent(e); Point point = convEvent.getPoint(); Rectangle visRect = new Rectangle(); list.computeVisibleRect(visRect); if (visRect.contains(point)) { updateListBoxSelectionForEvent(convEvent, false); | public void mouseReleased(MouseEvent e) { // Get component over which mouse was released Component src = (Component) e.getSource(); int x = e.getX(); int y = e.getY(); Component releasedComponent = SwingUtilities.getDeepestComponentAt(src, ... | |
if (isAutoScrolling) stopAutoScrolling(); | } | public void mouseReleased(MouseEvent e) { // Get component over which mouse was released Component src = (Component) e.getSource(); int x = e.getX(); int y = e.getY(); Component releasedComponent = SwingUtilities.getDeepestComponentAt(src, ... |
hasEntered = false; stopAutoScrolling(); | public void mouseReleased(MouseEvent e) { // Get component over which mouse was released Component src = (Component) e.getSource(); int x = e.getX(); int y = e.getY(); Component releasedComponent = SwingUtilities.getDeepestComponentAt(src, ... | |
if (BasicComboPopup.this.isVisible()) { int cbHeight = (int) comboBox.getPreferredSize().getHeight(); int popupHeight = BasicComboPopup.this.getSize().height; if (e.getY() > cbHeight && ! (e.getY() - cbHeight >= popupHeight)) | if (isVisible()) | public void mouseDragged(MouseEvent e) { // convert point of the drag event relative to combo box list component // figure out over which list cell the mouse is currently being dragged // and highlight the cell. The list model is changed but the change has // no effect on combo box's data mo... |
int index = list.locationToIndex(new Point(e.getX(), (int) (e.getY() - cbHeight))); int firstVisibleIndex = list.getFirstVisibleIndex(); if (firstVisibleIndex != 0) index += firstVisibleIndex + 1; list.setSelectedIndex(index); } else { boolean movingUP = e.getY() < cbHeight; boolean movingDown = e.getY() ... | MouseEvent convEvent = convertMouseEvent(e); Rectangle visRect = new Rectangle(); list.computeVisibleRect(visRect); if (convEvent.getPoint().y >= visRect.y && (convEvent.getPoint().y <= visRect.y + visRect.height - 1)) | public void mouseDragged(MouseEvent e) { // convert point of the drag event relative to combo box list component // figure out over which list cell the mouse is currently being dragged // and highlight the cell. The list model is changed but the change has // no effect on combo box's data mo... |
scrollDirection = SCROLL_UP; startAutoScrolling(SCROLL_UP); | hasEntered = true; if (isAutoScrolling) stopAutoScrolling(); Point point = convEvent.getPoint(); if (visRect.contains(point)) { valueIsAdjusting = true; updateListBoxSelectionForEvent(convEvent, false); valueIsAdjusting = false; } | public void mouseDragged(MouseEvent e) { // convert point of the drag event relative to combo box list component // figure out over which list cell the mouse is currently being dragged // and highlight the cell. The list model is changed but the change has // no effect on combo box's data mo... |
else if (movingDown) | else if (hasEntered) | public void mouseDragged(MouseEvent e) { // convert point of the drag event relative to combo box list component // figure out over which list cell the mouse is currently being dragged // and highlight the cell. The list model is changed but the change has // no effect on combo box's data mo... |
scrollDirection = SCROLL_DOWN; startAutoScrolling(SCROLL_DOWN); | int dir = convEvent.getPoint().y < visRect.y ? SCROLL_UP : SCROLL_DOWN; if (isAutoScrolling && scrollDirection != dir) { stopAutoScrolling(); startAutoScrolling(dir); | public void mouseDragged(MouseEvent e) { // convert point of the drag event relative to combo box list component // figure out over which list cell the mouse is currently being dragged // and highlight the cell. The list model is changed but the change has // no effect on combo box's data mo... |
else if (!isAutoScrolling) startAutoScrolling(dir); } else if (e.getPoint().y < 0) { hasEntered = true; startAutoScrolling(SCROLL_UP); | public void mouseDragged(MouseEvent e) { // convert point of the drag event relative to combo box list component // figure out over which list cell the mouse is currently being dragged // and highlight the cell. The list model is changed but the change has // no effect on combo box's data mo... | |
if (e.getStateChange() == ItemEvent.SELECTED && ! valueIsAdjusting) { valueIsAdjusting = true; syncListSelection(); valueIsAdjusting = false; list.ensureIndexIsVisible(comboBox.getSelectedIndex()); } | public void itemStateChanged(ItemEvent e) { // TODO: What should be done here? } | |
int index = list.locationToIndex(anEvent.getPoint()); if (index >= 0) comboBox.setSelectedIndex(index); | comboBox.setSelectedIndex(list.getSelectedIndex()); | public void mouseReleased(MouseEvent anEvent) { int index = list.locationToIndex(anEvent.getPoint()); // Check for valid index. if (index >= 0) comboBox.setSelectedIndex(index); hide(); } |
valueIsAdjusting = false; } | public void mouseMoved(MouseEvent anEvent) { updateListBoxSelectionForEvent(anEvent, false); } | |
list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); | list.setCellRenderer(comboBox.getRenderer()); if (isVisible()) hide(); | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("renderer")) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals("dataModel")) { list.setModel((ComboBoxModel) e.getNewValue(... |
if (e.getPropertyName().equals("dataModel")) | if (e.getPropertyName().equals("model")) | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("renderer")) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals("dataModel")) { list.setModel((ComboBoxModel) e.getNewValue(... |
list.setModel((ComboBoxModel) e.getNewValue()); revalidate(); repaint(); | ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue(); uninstallComboBoxModelListeners(oldModel); ComboBoxModel newModel = (ComboBoxModel) e.getNewValue(); list.setModel(newModel); installComboBoxModelListeners(newModel); if (comboBox.getItemCount() > 0) comboBox.setSelectedIndex(0); if (isVisible()) hide(); | public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("renderer")) { list.setCellRenderer((ListCellRenderer) e.getNewValue()); revalidate(); repaint(); } if (e.getPropertyName().equals("dataModel")) { list.setModel((ComboBoxModel) e.getNewValue(... |
configurePopup(); setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled()); | installKeyboardActions(); | public BasicComboPopup(JComboBox comboBox) { this.comboBox = comboBox; installComboBoxListeners(); configurePopup(); setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled()); } |
list.setModel(comboBox.getModel()); list.setVisibleRowCount(comboBox.getMaximumRowCount()); | list.setFont(comboBox.getFont()); list.setForeground(comboBox.getForeground()); list.setBackground(comboBox.getBackground()); Color sfg = UIManager.getColor("ComboBox.selectionForeground"); list.setSelectionForeground(sfg); Color sbg = UIManager.getColor("ComboBox.selectionBackground"); list.setSelectionBackground(sbg)... | protected void configureList() { list.setModel(comboBox.getModel()); list.setVisibleRowCount(comboBox.getMaximumRowCount()); list.setFocusable(false); installListListeners(); } |
syncListSelection(); list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); | protected void configureList() { list.setModel(comboBox.getModel()); list.setVisibleRowCount(comboBox.getMaximumRowCount()); list.setFocusable(false); installListListeners(); } | |
this.list = createList(); ((JLabel) list.getCellRenderer()).setHorizontalAlignment(SwingConstants.LEFT); configureList(); scroller = createScroller(); configureScroller(); super.add(scroller); | setOpaque(false); add(scroller); setFocusable(false); | protected void configurePopup() { setBorder(BorderFactory.createLineBorder(Color.BLACK)); // initialize list that will be used to display combo box's items this.list = createList(); ((JLabel) list.getCellRenderer()).setHorizontalAlignment(SwingConstants.LEFT); configureList(); // initialize scrolle... |
scroller.getViewport().setView(list); scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); | scroller.setFocusable(false); scroller.getVerticalScrollBar().setFocusable(false); | protected void configureScroller() { scroller.setBorder(null); scroller.getViewport().setView(list); scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } |
return null; | Point point = SwingUtilities.convertPoint((Component) e.getSource(), e.getPoint(), list); MouseEvent newEvent= new MouseEvent((Component) e.getSource(), e.getID(), e.getWhen(), e.getModifiers(), point.x, point.y, e.getModifiers(), e.isPopupTrigger()); return newEvent; | protected MouseEvent convertMouseEvent(MouseEvent e) { return null; } |
l.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); | protected JList createList() { JList l = new JList(comboBox.getModel()); l.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); return l; } | |
return new JScrollPane(); | return new JScrollPane(list, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); | protected JScrollPane createScroller() { return new JScrollPane(); } |
if (comboBox.isEditable()) comboBox.getEditor().getEditorComponent().requestFocus(); else comboBox.requestFocus(); | protected void delegateFocus(MouseEvent e) { // FIXME: Need to implement } | |
return totalHeight; | return totalHeight == 0 ? 100 : totalHeight; | protected int getPopupHeightForRowCount(int maxRowCount) { int totalHeight = 0; ListCellRenderer rend = list.getCellRenderer(); if (comboBox.getItemCount() < maxRowCount) maxRowCount = comboBox.getItemCount(); for (int i = 0; i < maxRowCount; i++) { Component comp = rend.getListCellRendererComp... |
super.setVisible(false); | MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager(); javax.swing.MenuElement[] menuElements = menuSelectionManager.getSelectedPath(); for (int i = 0; i < menuElements.length; i++) { if (menuElements[i] == this) { menuSelectionManager.clearSelectedPath(); break; } } comboBox.repaint(); | public void hide() { super.setVisible(false); } |
mouseListener = createMouseListener(); comboBox.addMouseListener(mouseListener); mouseMotionListener = createMouseMotionListener(); comboBox.addMouseMotionListener(mouseMotionListener); | protected void installComboBoxListeners() { // mouse listener that listens to mouse event in combo box mouseListener = createMouseListener(); comboBox.addMouseListener(mouseListener); // mouse listener that listens to mouse dragging events in the combo box mouseMotionListener = createMouseMotionListen... | |
installComboBoxModelListeners(comboBox.getModel()); | protected void installComboBoxListeners() { // mouse listener that listens to mouse event in combo box mouseListener = createMouseListener(); comboBox.addMouseListener(mouseListener); // mouse listener that listens to mouse dragging events in the combo box mouseMotionListener = createMouseMotionListen... | |
Rectangle cbBounds = comboBox.getBounds(); | Dimension size = comboBox.getSize(); size.height = getPopupHeightForRowCount(comboBox.getMaximumRowCount()); Insets i = getInsets(); size.width -= i.left + i.right; Rectangle bounds = computePopupBounds(0, comboBox.getBounds().height, size.width, size.height); | public void show() { Rectangle cbBounds = comboBox.getBounds(); // popup should have same width as the comboBox and should be hight anough // to display number of rows equal to 'maximumRowCount' property int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount()); scroller.setPreferredS... |
int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount()); | scroller.setMaximumSize(bounds.getSize()); scroller.setPreferredSize(bounds.getSize()); scroller.setMinimumSize(bounds.getSize()); list.invalidate(); | public void show() { Rectangle cbBounds = comboBox.getBounds(); // popup should have same width as the comboBox and should be hight anough // to display number of rows equal to 'maximumRowCount' property int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount()); scroller.setPreferredS... |
scroller.setPreferredSize(new Dimension(cbBounds.width, popupHeight)); pack(); | syncListSelection(); | public void show() { Rectangle cbBounds = comboBox.getBounds(); // popup should have same width as the comboBox and should be hight anough // to display number of rows equal to 'maximumRowCount' property int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount()); scroller.setPreferredS... |
if (comboBox.getSelectedIndex() != -1) list.setSelectedIndex(comboBox.getSelectedIndex()); JScrollBar scrollbar = scroller.getVerticalScrollBar(); int selectedIndex = comboBox.getSelectedIndex(); if (selectedIndex > comboBox.getMaximumRowCount()) scrollbar.setValue(getPopupHeightForRowCount(selectedIndex)); super.s... | list.ensureIndexIsVisible(list.getSelectedIndex()); setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled()); show(comboBox, bounds.x, bounds.y); | public void show() { Rectangle cbBounds = comboBox.getBounds(); // popup should have same width as the comboBox and should be hight anough // to display number of rows equal to 'maximumRowCount' property int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount()); scroller.setPreferredS... |
if (BasicComboPopup.this.isVisible()) | if (isVisible()) | protected void togglePopup() { if (BasicComboPopup.this.isVisible()) hide(); else show(); } |
comboBox.removeMouseListener(mouseListener); mouseListener = null; comboBox.removeMouseMotionListener(mouseMotionListener); mouseMotionListener = null; | private void uninstallComboBoxListeners() { comboBox.removeMouseListener(mouseListener); mouseListener = null; comboBox.removeMouseMotionListener(mouseMotionListener); mouseMotionListener = null; comboBox.removeItemListener(itemListener); itemListener = null; comboBox.removePropertyChangeListene... | |
uninstallListListeners(); | private void uninstallListeners() { uninstallListListeners(); uninstallComboBoxListeners(); uninstallComboBoxModelListeners(comboBox.getModel()); } | |
int index = list.locationToIndex(anEvent.getPoint()); if (index >= 0) | Point point = anEvent.getPoint(); if (list != null) { int index = list.locationToIndex(point); if (index == -1) { if (point.y < 0) index = 0; else index = comboBox.getModel().getSize() - 1; } if (list.getSelectedIndex() != index) { | protected void updateListBoxSelectionForEvent(MouseEvent anEvent, boolean shouldScroll) { // TODO: We need to handle the shouldScroll parameter somehow. int index = list.locationToIndex(anEvent.getPoint()); // Check for valid index. if (index >= 0) list... |
if (shouldScroll) list.ensureIndexIsVisible(index); } } | protected void updateListBoxSelectionForEvent(MouseEvent anEvent, boolean shouldScroll) { // TODO: We need to handle the shouldScroll parameter somehow. int index = list.locationToIndex(anEvent.getPoint()); // Check for valid index. if (index >= 0) list... | |
public boolean contains(Point p) { return width > 0 && height > 0 && p.x >= x && p.x < x + width && p.y >= y && p.y < y + height; | public boolean contains(Point p) { return contains (p.x, p.y); | public boolean contains(Point p) { return width > 0 && height > 0 && p.x >= x && p.x < x + width && p.y >= y && p.y < y + height; } |
if (location == null) throw new NullPointerException (); if (context == null) throw new IllegalArgumentException (); if (dropAction != DnDConstants.ACTION_NONE && dropAction != DnDConstants.ACTION_COPY && dropAction != DnDConstants.ACTION_MOVE && dropAction != DnDConstants.ACTION_COPY_OR_MOVE && dropAction != DnDCons... | public DropTargetDragEvent (DropTargetContext context, Point location, int dropAction, int srcActions) { super (context); this.dropAction = dropAction; this.srcActions = srcActions; this.location = location; } | |
context.acceptDrag (dragOperation); | public void acceptDrag (int dragOperation) { // FIXME: implement this } | |
return null; | return context.getCurrentDataFlavors (); | public DataFlavor[] getCurrentDataFlavors () { // FIXME: implement this return null; } |
return null; | return context.getCurrentDataFlavorsAsList (); | public List getCurrentDataFlavorsAsList () { // FIXME: implement this return null; } |
return true; | return context.isDataFlavorSupported (df); | public boolean isDataFlavorSupported (DataFlavor df) { // FIXME: implement this return true; } |
context.rejectDrag (); | public void rejectDrag () { // FIXME: implement this } | |
final int getValue() | int getValue() | final int getValue() { return (primary << 16) + (secondary << 8) + tertiary; } |
public static final int primaryOrder(int order) | public static int primaryOrder(int order) | public static final int primaryOrder(int order) { // From the JDK 1.2 spec. return order >>> 16; } |
public static final short secondaryOrder(int order) | public static short secondaryOrder(int order) | public static final short secondaryOrder(int order) { // From the JDK 1.2 spec. return (short) ((order >>> 8) & 255); } |
public static final short tertiaryOrder(int order) | public static short tertiaryOrder(int order) | public static final short tertiaryOrder(int order) { // From the JDK 1.2 spec. return (short) (order & 255); } |
public FormatMismatch(String why) | public FormatMismatch() | public FormatMismatch(String why) { super(why); } |
super(why); | public FormatMismatch(String why) { super(why); } | |
public static AudioInputStream getAudioInputStream(InputStream is) throws UnsupportedAudioFileException, IOException | public static AudioInputStream getAudioInputStream(AudioFormat.Encoding targ, AudioInputStream ais) | public static AudioInputStream getAudioInputStream(InputStream is) throws UnsupportedAudioFileException, IOException { Iterator i = ServiceFactory.lookupProviders(AudioFileReader.class); while (i.hasNext()) { AudioFileReader reader = (AudioFileReader) i.next(); try { r... |
Iterator i = ServiceFactory.lookupProviders(AudioFileReader.class); | HashSet result = new HashSet(); Iterator i = ServiceFactory.lookupProviders(FormatConversionProvider.class); | public static AudioInputStream getAudioInputStream(InputStream is) throws UnsupportedAudioFileException, IOException { Iterator i = ServiceFactory.lookupProviders(AudioFileReader.class); while (i.hasNext()) { AudioFileReader reader = (AudioFileReader) i.next(); try { r... |
AudioFileReader reader = (AudioFileReader) i.next(); try { return reader.getAudioInputStream(is); } catch (UnsupportedAudioFileException _) { } | FormatConversionProvider prov = (FormatConversionProvider) i.next(); if (! prov.isConversionSupported(targ, ais.getFormat())) continue; return prov.getAudioInputStream(targ, ais); | public static AudioInputStream getAudioInputStream(InputStream is) throws UnsupportedAudioFileException, IOException { Iterator i = ServiceFactory.lookupProviders(AudioFileReader.class); while (i.hasNext()) { AudioFileReader reader = (AudioFileReader) i.next(); try { r... |
throw new UnsupportedAudioFileException("input stream type not recognized"); } | throw new IllegalArgumentException("encoding not supported for stream"); } | public static AudioInputStream getAudioInputStream(InputStream is) throws UnsupportedAudioFileException, IOException { Iterator i = ServiceFactory.lookupProviders(AudioFileReader.class); while (i.hasNext()) { AudioFileReader reader = (AudioFileReader) i.next(); try { r... |
for (int i = 0; i < selection.size (); i++) | for (int i = 0; i < selectedPath.size(); i++) | boolean isComponentPartOfCurrentMenu (Component c) { MenuElement[] subElements; for (int i = 0; i < selection.size (); i++) { subElements = ((MenuElement) selection.get (i)).getSubElements (); for (int j = 0; j < subElements.length; j++) { if ((subElements[j].getComponent... |
subElements = ((MenuElement) selection.get (i)).getSubElements (); | subElements = ((MenuElement) selectedPath.get(i)).getSubElements(); | boolean isComponentPartOfCurrentMenu (Component c) { MenuElement[] subElements; for (int i = 0; i < selection.size (); i++) { subElements = ((MenuElement) selection.get (i)).getSubElements (); for (int j = 0; j < subElements.length; j++) { if ((subElements[j].getComponent... |
else { position(limit()); limit(capacity()); } | public LongBuffer compact () { if (position () > 0) { int count = limit () - position (); bb.shiftDown(offset, offset + 8 * position(), 8 * count); position (count); limit (capacity ()); } return this; } | |
public Location(byte tag, Class clazz, Method meth, int index) throws JdwpException | public Location(VMMethod method, long index) | public Location(byte tag, Class clazz, Method meth, int index) throws JdwpException { this.tag = tag; this.crti = (ClassReferenceTypeId) VMIdManager.getDefault().getReferenceTypeId(clazz); this.mid = VMIdManager.getDefault().getObjectId(meth); this.index = index; } |
this.tag = tag; this.crti = (ClassReferenceTypeId) VMIdManager.getDefault().getReferenceTypeId(clazz); this.mid = VMIdManager.getDefault().getObjectId(meth); | this.method = method; | public Location(byte tag, Class clazz, Method meth, int index) throws JdwpException { this.tag = tag; this.crti = (ClassReferenceTypeId) VMIdManager.getDefault().getReferenceTypeId(clazz); this.mid = VMIdManager.getDefault().getObjectId(meth); this.index = index; } |
os.writeByte(tag); crti.write(os); mid.write(os); os.writeInt(index); | VMIdManager idm = VMIdManager.getDefault(); ClassReferenceTypeId crti = (ClassReferenceTypeId) idm.getReferenceTypeId(method.getDeclaringClass()); crti.writeTagged(os); method.writeId(os); os.writeLong(index); | public void write(DataOutputStream os) throws IOException { os.writeByte(tag); crti.write(os); mid.write(os); os.writeInt(index); } |
setText(getText() + toAppend); | try { getDocument().insertString(getText().length(), toAppend, null); } catch (BadLocationException exception) { throw new RuntimeException("Unexpected exception occurred.", exception); } | public void append(String toAppend) { setText(getText() + toAppend); } |
return wrapping; | return lineWrap; | public boolean getLineWrap() { return wrapping; } |
return wrapping ? true : super.getScrollableTracksViewportWidth(); | return lineWrap ? true : super.getScrollableTracksViewportWidth(); | public boolean getScrollableTracksViewportWidth() { return wrapping ? true : super.getScrollableTracksViewportWidth(); } |
if (wrapping == flag) | if (lineWrap == flag) | public void setLineWrap(boolean flag) { if (wrapping == flag) return; boolean oldValue = wrapping; wrapping = flag; firePropertyChange("lineWrap", oldValue, wrapping); } |
boolean oldValue = wrapping; wrapping = flag; firePropertyChange("lineWrap", oldValue, wrapping); | boolean oldValue = lineWrap; lineWrap = flag; firePropertyChange("lineWrap", oldValue, lineWrap); | public void setLineWrap(boolean flag) { if (wrapping == flag) return; boolean oldValue = wrapping; wrapping = flag; firePropertyChange("lineWrap", oldValue, wrapping); } |
catch (NumberFormatException exc) { System.err.println("couldn't parse: " + val); } } | public Length(String val) { value = val; int i = value.indexOf("px"); floatValue = 0.0F; if (i != -1) { String sub = value.substring(0, i); floatValue = Float.parseFloat(sub); } else { // TODO: Implement other length options. floatValue = Float.parseFloat(val... | |
public TreePath(Object element) | public TreePath(Object[] path) | public TreePath(Object element) { // Create Path path = new Object[1]; path[0] = element; } |
path = new Object[1]; path[0] = element; | this.path = new Object[path.length]; System.arraycopy(path, 0, this.path, 0, path.length); | public TreePath(Object element) { // Create Path path = new Object[1]; path[0] = element; } |
return null; | if (path.length == 1) return String.valueOf(path[0]); else return Arrays.asList(path).toString(); | public String toString() { return null; // TODO } |
public void read(cdrInput in) | public void read(AbstractCdrInput in) | public void read(cdrInput in) { service_context = ServiceContext.readSequence(in); request_id = in.read_ulong(); response_expected = in.read_boolean(); object_key = in.read_sequence(); operation = in.read_string(); requesting_principal = in.read_sequence(); in.setCodeSet(cxCodeSet.find(service_c... |
in.setCodeSet(cxCodeSet.find(service_context)); | in.setCodeSet(CodeSetServiceContext.find(service_context)); | public void read(cdrInput in) { service_context = ServiceContext.readSequence(in); request_id = in.read_ulong(); response_expected = in.read_boolean(); object_key = in.read_sequence(); operation = in.read_string(); requesting_principal = in.read_sequence(); in.setCodeSet(cxCodeSet.find(service_c... |
public void write(cdrOutput out) | public void write(AbstractCdrOutput out) | public void write(cdrOutput out) { ServiceContext.writeSequence(out, service_context); out.write_ulong(request_id); out.write_boolean(response_expected); out.write_sequence(object_key); out.write_string(operation); out.write_sequence(requesting_principal); out.setCodeSet(cxCodeSet.find(service_c... |
out.setCodeSet(cxCodeSet.find(service_context)); | out.setCodeSet(CodeSetServiceContext.find(service_context)); | public void write(cdrOutput out) { ServiceContext.writeSequence(out, service_context); out.write_ulong(request_id); out.write_boolean(response_expected); out.write_sequence(object_key); out.write_string(operation); out.write_sequence(requesting_principal); out.setCodeSet(cxCodeSet.find(service_c... |
if (magic != (GZIP_MAGIC >> 8)) throw new IOException("Error in GZIP header, first byte doesn't match"); magic = in.read(); if (magic != (GZIP_MAGIC & 0xff)) throw new IOException("Error in GZIP header, second byte doesn't match"); headCRC.update(magic); | headCRC.update(magic2); | private void readHeader() throws IOException { /* 1. Check the two magic bytes */ CRC32 headCRC = new CRC32(); int magic = in.read(); if (magic < 0) { eos = true; return; } headCRC.update(magic); if (magic != (GZIP_MAGIC >> 8)) throw new IOException("Error in GZIP header, first... |
static void installBorder(JComponent c, String defaultBorderName) | public static void installBorder(JComponent c, String defaultBorderName) | static void installBorder(JComponent c, String defaultBorderName) { //Convenience method for installing a component's default Border object on the specified component if either the border is currently null or already an instance of UIResource. } |
public static void installColorsAndFont(JComponent c, String defaultBgName, String defaultFgName, String defaultFontName) | public static void installColorsAndFont(JComponent component, String defaultBgName, String defaultFgName, String defaultFontName) | public static void installColorsAndFont(JComponent c, String defaultBgName, String defaultFgName, String defaultFontName) { //Convenience method for initializing a components foreground background and font properties with values from the current defaults table. } |
public abstract Dimension getMinimumSize(int len); | Dimension getMinimumSize(int len); | public abstract Dimension getMinimumSize(int len); |
public abstract Dimension getPreferredSize(int len); | Dimension getPreferredSize(int len); | public abstract Dimension getPreferredSize(int len); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.