rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
VMCompiler.enable(); | public static void enable() { } | |
if (!(sigSpi instanceof Cloneable)) throw new CloneNotSupportedException(); | public Object clone() throws CloneNotSupportedException { if (!(sigSpi instanceof Cloneable)) throw new CloneNotSupportedException(); Signature result = new DummySignature ((SignatureSpi) sigSpi.clone(), this.getAlgorithm()); result.provider = this.getProvider(); return result; } | |
if (layerNum.intValue() == layer.intValue()) | int layerInt = layerNum.intValue(); if (layerInt == layer.intValue()) | private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer... |
return ret; | break; } else if (layerInt > layer.intValue()) { ret[1] = ret[0]; break; | private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer... |
throw new IllegalArgumentException (); | return ret; | private int[] layerToRange (Integer layer) { int[] ret = new int[2]; ret[1] = getComponents ().length; Iterator i = layers.entrySet ().iterator (); while (i.hasNext()) { Map.Entry pair = (Map.Entry) i.next(); Integer layerNum = (Integer) pair.getKey (); Integer layerSz = (Integer... |
mapper.removeKeyStroke((String)functions.getSelectedValue()); | mapper.removeKeyStroke(k); | private void removeIt() { if (!macros && !special) { mapper.removeKeyStroke(mnemonicData[functions.getSelectedIndex()]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[functions.getSelectedIndex()])); } else { if (macros) { mapper.... |
valueClass = getFormattedTextField().getValue().getClass(); | { JFormattedTextField jft = getFormattedTextField(); if (jft != null) valueClass = jft.getValue().getClass(); } | public Object stringToValue(String string) throws ParseException { Object value = string; Class valueClass = getValueClass(); if (valueClass == null) valueClass = getFormattedTextField().getValue().getClass(); if (valueClass != null) try { Constructor constr = valueClass.getC... |
return super.clone(); | return new MacAdapter((IMac) mac.clone(), new HashMap(attributes)); | public Object clone() throws CloneNotSupportedException { return super.clone(); } |
lm.addElement(macrosList[x]); | macrosVector.add(macrosList[x]); | private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString... |
scriptDir("scripts",macrosVector); loadListModel(lm,macrosVector,null,0); | private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString... | |
function = ((KeyDescription)functions.getSelectedValue()).toString(); | if (functions.getSelectedValue() instanceof Macro) { function = ((Macro)functions.getSelectedValue()).toString(); } else function = ((KeyDescription)functions.getSelectedValue()).toString(); | private void mapIt() { Object[] message = new Object[1]; JPanel kgp = new JPanel(); final KeyGetter kg = new KeyGetter(); kg.setForeground(Color.blue); message[0] = kgp; String function; if (functions.getSelectedValue() instanceof String) function = (String)functions.g... |
mapper.removeKeyStroke((String)functions.getSelectedValue()); | Object o = functions.getSelectedValue(); String name; if (o instanceof Macro) { name = ((Macro)o).getFullName(); } else { name = (String)o; } mapper.removeKeyStroke(name); | private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { ... |
(String)functions.getSelectedValue())); | name)); | private void removeIt() { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); mapper.removeKeyStroke(mnemonicData[index]); strokeDesc.setText(mapper.getKeyStrokeDesc( mnemonicData[index])); } else { ... |
System.out.println((String)lm.getElementAt(index)); strokeDesc.setText(mapper.getKeyStrokeDesc((String)lm.getElementAt(index))); | Object o = lm.getElementAt(index); if (o instanceof String) { System.out.println((String)o); strokeDesc.setText(mapper.getKeyStrokeDesc((String)o)); } else if (o instanceof Macro) { Macro m = (Macro)o; strokeDesc.setText(mapper.getKeyStrokeDesc(m.getFullName())); } | private void setKeyDescription(int index) { // This try and catch is to fix a problem in JDK1.4-betas try { if (!macros && !special) { KeyDescription kd = (KeyDescription)lm.getElementAt(index); strokeDesc.setText(mapper.getKeyStrokeDesc(mnemonicData[kd.getIndex()])); ... |
System.out.println((String)functions.getSelectedValue()); | Object o = functions.getSelectedValue(); String macro; if (o instanceof Macro) macro = ((Macro)o).getFullName(); else macro = (String)o; System.out.println(macro); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); ... |
mapper.setKeyStroke((String)functions.getSelectedValue(),ke,isAltGr); | mapper.setKeyStroke(macro,ke,isAltGr); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); ... |
mapper.setKeyStroke((String)functions.getSelectedValue(),ke); | mapper.setKeyStroke(macro,ke); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); ... |
(String)functions.getSelectedValue())); | macro)); | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { int index = ((KeyDescription)functions.getSelectedValue()).getIndex(); if (isLinux) mapper.setKeyStroke(mnemonicData[index],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[index],ke); ... |
public DataFormat getDatatype() | public String getDatatype() | public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); } |
return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); | return (String) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); | public DataFormat getDatatype() { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).getAttribValue(); } |
attribHash.put("axisDatatype",new XMLAttribute(new StringDataFormat(), Constants.STRING_TYPE)); | attribHash.put("axisDatatype",new XMLAttribute(null, Constants.STRING_TYPE)); | private void init() { classXDFNodeName = "axis"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"valueList"); attribOrder.add(0,"axisIdRef"); attribOrder.add(0,"axisId"); attribOrder.add(0,"align"); //not sure what it is??? attribOrder.a... |
public DataFormat setDatatype(DataFormat datatype) | public String setDatatype(String strDatatype) | public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(datatype); } |
return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(datatype); | if (Utility.isValidDatatype(strDatatype)) return (String) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(strDatatype); else return null; | public DataFormat setDatatype(DataFormat datatype) { return (DataFormat) ((XMLAttribute) attribHash.get("axisDatatype")).setAttribValue(datatype); } |
public QName(String namespaceURI, String localPart, String prefix) | public QName(String namespaceURI, String localPart) | public QName(String namespaceURI, String localPart, String prefix) { if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PR... |
if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PREFIX; } this.namespaceURI = namespaceURI; this.localPart = localPart; this.prefix = prefix; StringBuffer buf = new StringBuffe... | this(namespaceURI, localPart, null); | public QName(String namespaceURI, String localPart, String prefix) { if (namespaceURI == null) { namespaceURI = XMLConstants.NULL_NS_URI; } if (localPart == null) { throw new IllegalArgumentException(); } if (prefix == null) { prefix = XMLConstants.DEFAULT_NS_PR... |
int numberFileCopyed = 0; | int numberFileCopied = 0; | private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.m... |
numberFileCopyed += cp.copy(); | numberFileCopied += cp.copy(); | private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.m... |
return numberFileCopyed; | return numberFileCopied; | private int copyDir() throws Exception { final File dstDir = new File(_fileDst.getAbsoluteFile() + File.separator);//+_fileSrc.getName()+File.separator); final File[] subFile = _fileSrc.listFiles(); int numberFileCopyed = 0; if (!dstDir.exists()) { if (!dstDir.m... |
int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copied"); | int nbCopiedFile = cpCommand.copy(); System.out.println(nbCopiedFile + " file(s) copied"); | public static void main(String[] args) throws Exception { CpCommand cpCommand = new CpCommand(args); int nbCopyedFile = cpCommand.copy(); System.out.println(nbCopyedFile + " file(s) copied"); } |
if (providers == null) | if (providers != null) | public static Enumeration getSaslClientFactories() { Vector result = new Vector(); HashSet names = new HashSet(); Provider[] providers = Security.getProviders(); Iterator it; if (providers == null) { Provider p; String key; for (int i = 0; i < providers.length; i++) ... |
if (providers == null) | if (providers != null) | public static Enumeration getSaslServerFactories() { Vector result = new Vector(); HashSet names = new HashSet(); Provider[] providers = Security.getProviders(); Iterator it; if (providers == null) { Provider p; String key; for (int i = 0; i < providers.length; i++) ... |
public void connect(Remote remote, Remote remote1) | public void connect(Remote a_target, Remote a_source) | public void connect(Remote remote, Remote remote1) throws RemoteException { throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); } |
throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); | ORB orb = null; POA poa = null; boolean ok = false; try { if (a_source instanceof Servant) { Servant s = (Servant) a_source; orb = s._orb(); poa = s._poa(); ok = true; | public void connect(Remote remote, Remote remote1) throws RemoteException { throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); } |
if (!ok && a_source instanceof ObjectImpl) { ObjectImpl o = (ObjectImpl) a_source; orb = o._orb(); ok = true; try { if (orb instanceof ORB_1_4) { ORB_1_4 xorb = (ORB_1_4) orb; Delegate d = o._get_delegate(); if (d instanceof LocalDelegate) { LocalDelegate l = (LocalDelegate) d; poa = l.poa; } else if (d instanceof Si... | public void connect(Remote remote, Remote remote1) throws RemoteException { throw new Error("Not implemented for PortableRemoteObjectDelegateImpl"); } | |
PortableServer.exportObject(obj); | if (obj instanceof Stub) Util.registerTarget(StubDelegateImpl.getTieFromStub((Stub) obj), obj); else if (obj instanceof Tie) { Tie t = (Tie) obj; Util.registerTarget(t, null); } | public void exportObject(Remote obj) throws RemoteException { PortableServer.exportObject(obj); } |
if (narrowFrom == null) | else if (narrowFrom == null) | public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (... |
Class fromClass = narrowFrom.getClass(); Object result = null; | String interf = narrowTo.getName(); String stubClassName; stubClassName = getStubClassName(interf); | public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (... |
if (narrowTo.isAssignableFrom(fromClass)) result = narrowFrom; else | narrowTo = Util.loadClass(stubClassName, null, narrowTo.getClassLoader()); } catch (ClassNotFoundException e) | public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (... |
System.out.println("We still haven't implement this case: narrow " + narrowFrom + " of type " + fromClass + " to " + narrowTo); Class[] cs = fromClass.getInterfaces(); for (int i = 0; i < cs.length; i++) System.out.println(cs[i]); Exception e1 = new Exception(); try { throw e1; } catch(Exception ee) { ee.printStackTrac... | ClassCastException cex = new ClassCastException("Class not found: " + stubClassName); cex.initCause(e); throw cex; | public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (... |
result = null; | ClassCastException cex = new ClassCastException("Cannot instantiate " + narrowTo.getName()); cex.initCause(e); throw cex; | public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (... |
if (result == null) throw new ClassCastException("Can't narrow from " + fromClass + " to " + narrowTo); return result; | if (narrowed instanceof ObjectImpl) { ObjectImpl target = (ObjectImpl) narrowed; target._set_delegate(((ObjectImpl) narrowFrom)._get_delegate()); } else if (narrowed instanceof Tie && narrowFrom instanceof Remote) { ((Tie) narrowed).setTarget((Remote) narrowFrom); } else throw new ClassCastException("Narrowing of " ... | public Object narrow(Object narrowFrom, Class narrowTo) throws ClassCastException { if (narrowTo == null) throw new ClassCastException("Can't narrow to null class"); if (narrowFrom == null) return null; Class fromClass = narrowFrom.getClass(); Object result = null; try { if (... |
public Remote toStub(Remote obj) | public Remote toStub(Remote ObjImpl) | public Remote toStub(Remote obj) throws NoSuchObjectException { return PortableServer.toStub(obj); } |
return PortableServer.toStub(obj); | String icn = ObjImpl.getClass().getName(); if (!icn.endsWith("Impl")) throw new BAD_PARAM("Invalid class name '" + icn + "', must end with 'Impl'"); String sn = "_" + icn.substring(0, icn.length() - "Impl".length()) + "_Stub"; Class stubClass; Object o_stub; try { stubClass = RMIClassLoader.loadClass(sn); o_stub = s... | public Remote toStub(Remote obj) throws NoSuchObjectException { return PortableServer.toStub(obj); } |
PortableServer.unexportObject(obj); | Util.unexportObject(obj); | public void unexportObject(Remote obj) throws NoSuchObjectException { PortableServer.unexportObject(obj); } |
scroll(bar, delta); | scroll(bar, wheel > 0 ? delta : -delta); | public void mouseWheelMoved(MouseWheelEvent e) { if (scrollpane.getViewport().getComponentCount() == 0) return; Component target = scrollpane.getViewport().getComponent(0); JScrollBar bar = scrollpane.getVerticalScrollBar(); Scrollable scrollable = (target instanceof Scrollable) ? (Scr... |
Border vpBorder = p.getViewportBorder(); if (vpBorder == null || vpBorder instanceof UIResource) { vpBorder = UIManager.getBorder("ScrollPane.viewportBorder"); p.setViewportBorder(vpBorder); } | protected void installDefaults(JScrollPane p) { scrollpane = p; LookAndFeel.installColorsAndFont(p, "ScrollPane.background", "ScrollPane.foreground", "ScrollPane.font"); LookAndFeel.installBorder(p, "ScrollPane.border"); p.setOpaque(... | |
Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { Rectangle r = scrollpane.getViewportBorderBounds(); vpBorder.paintBorder(scrollpane, g, r.x, r.y, r.width, r.height); } | public void paint(Graphics g, JComponent c) { // do nothing; the normal painting-of-children algorithm, along with // ScrollPaneLayout, does all the relevant work. } | |
p.setForeground(null); p.setBackground(null); p.setFont(null); p.setBorder(null); scrollpane = null; | LookAndFeel.uninstallBorder(p); Border vpBorder = p.getViewportBorder(); if (vpBorder != null && vpBorder instanceof UIResource) p.setViewportBorder(null); | protected void uninstallDefaults(JScrollPane p) { p.setForeground(null); p.setBackground(null); p.setFont(null); p.setBorder(null); scrollpane = null; } |
handleEvent(e); | public void mouseClicked(MouseEvent e) { } | |
handleEvent(e); | public void mouseDragged(MouseEvent e) { } | |
handleEvent(e); | public void mouseEntered(MouseEvent e) { } | |
handleEvent(e); | public void mouseExited(MouseEvent e) { } | |
handleEvent(e); | public void mouseMoved(MouseEvent e) { } | |
handleEvent(e); | public void mousePressed(MouseEvent e) { } | |
handleEvent(e); | public void mouseReleased(MouseEvent e) { } | |
Container rootContainer = (Container) SwingUtilities.getRoot(invoker); rootContainer.removeComponentListener(topWindowListener); | RootPaneContainer rootContainer = (RootPaneContainer) SwingUtilities .getRoot(invoker); ((Container) rootContainer).removeComponentListener(topWindowListener); boolean topLevelMenu = (popupMenu.getInvoker() instanceof JMenu) && ((JMenu) popupMenu.getInvoker()) .isTopLevelMenu(); if (topLevelMenu || ! (popupMenu.ge... | public void popupMenuWillBecomeInvisible(PopupMenuEvent event) { // remove listener that listens to component events fired // by the top - level window that this popup belongs to. Component invoker = popupMenu.getInvoker(); Container rootContainer = (Container) SwingUtilities.getRoot(invoker... |
Container rootContainer = (Container) SwingUtilities.getRoot(invoker); rootContainer.addComponentListener(topWindowListener); | RootPaneContainer rootContainer = (RootPaneContainer) SwingUtilities .getRoot(invoker); ((Container) rootContainer).addComponentListener(topWindowListener); if (mouseInputListener == null) { Container glassPane = (Container) rootContainer.getGlassPane(); glassPane.setVisible(true); mouseInputListener = new MouseInpu... | public void popupMenuWillBecomeVisible(PopupMenuEvent event) { // Adds topWindowListener to top-level window to listener to // ComponentEvents fired by it. We need to cancel this popup menu // if topWindow to which this popup belongs was resized or moved. Component invoker = popupMenu.getInv... |
mouseInputListener = new MouseInputHandler(); | public BasicPopupMenuUI() { popupMenuListener = new PopupMenuHandler(); mouseInputListener = new MouseInputHandler(); topWindowListener = new TopWindowListener(); } | |
popupMenu.addMouseListener(mouseInputListener); popupMenu.addMouseMotionListener(mouseInputListener); | protected void installListeners() { popupMenu.addMouseListener(mouseInputListener); popupMenu.addMouseMotionListener(mouseInputListener); popupMenu.addPopupMenuListener(popupMenuListener); } | |
popupMenu.removeMouseListener(mouseInputListener); popupMenu.removeMouseMotionListener(mouseInputListener); | protected void uninstallListeners() { popupMenu.removeMouseListener(mouseInputListener); popupMenu.removeMouseMotionListener(mouseInputListener); popupMenu.removePopupMenuListener(popupMenuListener); } | |
menu = m; this.ui = ui; | public ChangeHandler(JMenu m, BasicMenuUI ui) { // Not used. } | |
MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); | if (menuItem.isEnabled()) { MenuSelectionManager manager = e.getMenuSelectionManager(); MenuElement path[] = e.getPath(); Point p = e.getPoint(); if(p.x >= 0 && p.x < menuItem.getWidth() && p.y >= 0 && p.y < menuItem.getHeight()) { JMenu menu = (JMenu) menuItem; MenuElement[] selectedPath = manager.getSelectedPath(); ... | public void menuDragMouseDragged(MenuDragMouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); } |
MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); | public void menuDragMouseEntered(MenuDragMouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.setSelectedPath(e.getPath()); } | |
throws NotImplementedException | public void menuKeyTyped(MenuKeyEvent e) { // TODO: What should be done here, if anything? } | |
MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.processMouseEvent(e); | public void mouseClicked(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); manager.processMouseEvent(e); } | |
if (! menu.isTopLevelMenu() || popupVisible()) | if (menu.isEnabled()) | public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. ... |
MenuSelectionManager manager = MenuSelectionManager.defaultManager(); | MenuSelectionManager manager = MenuSelectionManager.defaultManager(); MenuElement[] selectedPath = manager.getSelectedPath(); if (! menu.isTopLevelMenu()) { if(! (selectedPath.length > 0 && selectedPath[selectedPath.length - 1] == menu.getPopupMenu())) { if(menu.getDelay() == 0) { MenuElement[] path = getPath(); Menu... | public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. ... |
manager.processMouseEvent(e); | setupPostTimer(menu); } } } else { if(selectedPath.length > 0 && selectedPath[0] == menu.getParent()) { MenuElement[] newPath = new MenuElement[3]; newPath[0] = (MenuElement) menu.getParent(); newPath[1] = menu; newPath[2] = menu.getPopupMenu(); manager.setSelectedPath(newPath); } } | public void mouseEntered(MouseEvent e) { /* When mouse enters menu item, it should be considered selected if (i) if this menu is a submenu in some other menu (ii) or if this menu is in a menu bar and some other menu in a menu bar was just selected and has its popup menu visible. ... |
manager.processMouseEvent(e); | if (menu.isEnabled()) { | public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()... |
if (menu.getPopupMenu().isVisible()) | if (menu.isSelected()) | public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()... |
int x = 0; int y = menu.getHeight(); | Container cnt = menu.getParent(); if (cnt != null && cnt instanceof JMenuBar) { MenuElement[] me = new MenuElement[2]; me[0] = (MenuElement) cnt; me[1] = menu; manager.setSelectedPath(me); } } } | public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()... |
manager.setSelectedPath(getPath()); | MenuElement[] selectedPath = manager.getSelectedPath(); if (selectedPath.length > 0 && selectedPath[selectedPath.length - 1] != menu.getPopupMenu()) { if(menu.isTopLevelMenu() || menu.getDelay() == 0) { MenuElement[] newPath = new MenuElement[selectedPath.length + 1]; System.arraycopy(selectedPath, 0, newPath, 0, selec... | public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()... |
JMenuBar mb = (JMenuBar) menu.getParent(); mb.getSelectionModel().setSelectedIndex(mb.getComponentIndex(menu)); } | public void mousePressed(MouseEvent e) { MenuSelectionManager manager = MenuSelectionManager.defaultManager(); JMenu menu = (JMenu) menuItem; manager.processMouseEvent(e); // Menu should be displayed when the menu is pressed only if // it is top-level menu if (menu.isTopLevelMenu()... | |
((JMenu) menuItem).setDelay(200); | protected void installDefaults() { LookAndFeel.installBorder(menuItem, "Menu.border"); LookAndFeel.installColorsAndFont(menuItem, "Menu.background", "Menu.foreground", "Menu.font"); menuItem.setMargin(UIManager.getInsets("Menu.margin")); acceleratorFont = UIManager.get... | |
throws NotImplementedException | protected void installKeyboardActions() throws NotImplementedException { // FIXME: Need to implement } | |
super.installKeyboardActions(); | protected void installKeyboardActions() throws NotImplementedException { // FIXME: Need to implement } | |
((JMenu) menuItem).addMouseListener(mouseInputListener); ((JMenu) menuItem).addMouseMotionListener(mouseInputListener); | super.installListeners(); | protected void installListeners() { ((JMenu) menuItem).addMouseListener(mouseInputListener); ((JMenu) menuItem).addMouseMotionListener(mouseInputListener); ((JMenu) menuItem).addMenuListener(menuListener); ((JMenu) menuItem).addMenuDragMouseListener(menuDragMouseListener); } |
((JMenu) menuItem).addMenuDragMouseListener(menuDragMouseListener); | protected void installListeners() { ((JMenu) menuItem).addMouseListener(mouseInputListener); ((JMenu) menuItem).addMouseMotionListener(mouseInputListener); ((JMenu) menuItem).addMenuListener(menuListener); ((JMenu) menuItem).addMenuDragMouseListener(menuDragMouseListener); } | |
Timer timer = new Timer(menu.getDelay(), new SelectMenuAction()); timer.setRepeats(false); timer.start(); | protected void setupPostTimer(JMenu menu) { // TODO: Implement this properly. } | |
throws NotImplementedException | protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Need to implement } | |
super.installKeyboardActions(); | protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Need to implement } | |
((JMenu) menuItem).removeMouseListener(mouseInputListener); | super.uninstallListeners(); | protected void uninstallListeners() { ((JMenu) menuItem).removeMouseListener(mouseInputListener); ((JMenu) menuItem).removeMenuListener(menuListener); ((JMenu) menuItem).removePropertyChangeListener(propertyChangeListener); } |
((JMenu) menuItem).removePropertyChangeListener(propertyChangeListener); | protected void uninstallListeners() { ((JMenu) menuItem).removeMouseListener(mouseInputListener); ((JMenu) menuItem).removeMenuListener(menuListener); ((JMenu) menuItem).removePropertyChangeListener(propertyChangeListener); } | |
static String absolutize(String base, String href) | public static String absolutize(String base, String href) throws MalformedURLException | static String absolutize(String base, String href) { if (href == null) return null; int ci = href.indexOf(':'); if (ci > 1 && isLowercaseAscii(href.substring(0, ci))) { // href is absolute already return href; } if (base == null) base = ""; else { int i = ... |
if (ci > 1 && isLowercaseAscii(href.substring(0, ci))) | if (ci > 1 && isURLScheme(href.substring(0, ci))) | static String absolutize(String base, String href) { if (href == null) return null; int ci = href.indexOf(':'); if (ci > 1 && isLowercaseAscii(href.substring(0, ci))) { // href is absolute already return href; } if (base == null) base = ""; else { int i = ... |
if (href.startsWith("/")) { if (base.startsWith("file:")) return "file: int i = base.indexOf(": if (i != -1) { i = base.indexOf('/', i + 3); if (i != -1) base = base.substring(0, i); } } else { while (href.startsWith("..")) { int i = base.lastIndexOf('/', base.length() - 2); if (i != -1) base = base.substring(0, i + 1)... | return new URL(new URL(base), href).toString(); | static String absolutize(String base, String href) { if (href == null) return null; int ci = href.indexOf(':'); if (ci > 1 && isLowercaseAscii(href.substring(0, ci))) { // href is absolute already return href; } if (base == null) base = ""; else { int i = ... |
private InputStream resolve(String url) | static InputStream resolve(String url) | private InputStream resolve(String url) throws IOException { try { return new URL(url).openStream(); } catch (MalformedURLException e) { return null; } } |
catch (IOException e) { IOException e2 = new IOException("error resolving " + url); e2.initCause(e); throw e2; } | private InputStream resolve(String url) throws IOException { try { return new URL(url).openStream(); } catch (MalformedURLException e) { return null; } } | |
} catch (MalformedURLException e) { RuntimeException e2 = new RuntimeException("unsupported URL: " + systemId); e2.initCause(e); throw e2; } | XIncludeFilter(XMLStreamReader reader, String systemId, boolean namespaceAware, boolean validating, boolean expandERefs) { super(reader); this.systemId = XMLParser.absolutize(null, systemId); this.namespaceAware = namespaceAware; this.validating = validating; this.expan... | |
d.width = d.width + rect.width + defaultAcceleratorLabelGap; | d.width += rect.width + defaultAcceleratorLabelGap; | protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap) { JMenuItem m = (JMenuItem) c; Dimension d = BasicGraphicsUtils.getPreferredButtonSize(m, ... |
if (mnemonicIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, mnemonicIndex, textRect.x, textRect.y + fm.getAscent()); else BasicGraphicsUtils.drawString(g, text, 0, textRect.x, textRect.y + fm.getAscent()); | if (mnemonicIndex != -1) BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, mnemonicIndex, textRect.x, textRect.y + fm.getAscent()); else BasicGraphicsUtils.drawString(g, text, 0, textRect.x, textRect.y + fm.getAscent()); } | protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { Font f = menuItem.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); if (text != null && !text.equals("")) { if (menuItem.isEnabled()) { // Menu item ... |
} | protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { Font f = menuItem.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); if (text != null && !text.equals("")) { if (menuItem.isEnabled()) { // Menu item ... | |
try { | public void run() { try { synchronized (queueLock) { try { queueLock.wait(initialDelay); } catch (InterruptedException e) { // Ignored } if (!runnin... | |
running = false; } | public void run() { try { synchronized (queueLock) { try { queueLock.wait(initialDelay); } catch (InterruptedException e) { // Ignored } if (!runnin... | |
} | public void run() { try { synchronized (queueLock) { try { queueLock.wait(initialDelay); } catch (InterruptedException e) { // Ignored } if (!runnin... | |
synchronized (queueLock) { | void queueEvent() { synchronized (queueLock) { queue++; if (queue == 1) SwingUtilities.invokeLater(drainer); } } | |
} | void queueEvent() { synchronized (queueLock) { queue++; if (queue == 1) SwingUtilities.invokeLater(drainer); } } | |
if (waker != null) return; | if (!running) { running = true; | public void start() { synchronized (queueLock) { if (waker != null) return; waker = new Waker(); waker.start(); } } |
} | public void start() { synchronized (queueLock) { if (waker != null) return; waker = new Waker(); waker.start(); } } | |
if (waker != null) | public void stop() { synchronized (queueLock) { running = false; queue = 0; if (waker != null) queueLock.notifyAll(); waker = null; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.