rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
return ok; | return ! cancelled; | public final boolean isValid () { return ok; } |
if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTabbedPaneUI instance; if (o == null) { instance = new MetalTabbedPaneUI(); instances.put(component, instance); } else instance = (MetalTabbedPaneUI) o; return instance; | return new MetalTabbedPaneUI(); | public static ComponentUI createUI(JComponent component) { if (instances == null) instances = new HashMap(); Object o = instances.get(component); MetalTabbedPaneUI instance; if (o == null) { instance = new MetalTabbedPaneUI(); instances.put(component, instance); } else instanc... |
return null; | throw new IllegalArgumentException("Invalid 'condition' argument: " + condition); | public final InputMap getInputMap(int condition) { enableEvents(AWTEvent.KEY_EVENT_MASK); switch (condition) { case WHEN_FOCUSED: if (inputMap_whenFocused == null) inputMap_whenFocused = new InputMap(); return inputMap_whenFocused; case WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: ... |
try { g.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); g.translate(bounds.x, bounds.y); translated = true; children[i].paint(g); } finally { if (translated) g.translate(-bounds.x, -bounds.y); g.setClip(oldClip); } | Graphics g2 = g.create(bounds.x, bounds.y, bounds.width, bounds.height); children[i].paint(g2); g2.dispose(); | private void paintChildrenOptimized(Graphics g) { Shape originalClip = g.getClip(); Rectangle inner = SwingUtilities.calculateInnerArea(this, rectCache); g.clipRect(inner.x, inner.y, inner.width, inner.height); Component[] children = getComponents(); // paintingTile becomes true just before we start p... |
Image buffer = rm.getOffscreenBuffer(this, root.getWidth(), | Image buffer = rm.getVolatileOffscreenBuffer(this, root.getWidth(), | private void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Component root = getRoot(this); Image buffer = rm.getOffscreenBuffer(this, root.getWidth(), root.getHeight()); //Rectangle ... |
if (buffer == null) buffer = rm.getOffscreenBuffer(this, root.getWidth(), root.getHeight()); | private void paintDoubleBuffered(Rectangle r) { RepaintManager rm = RepaintManager.currentManager(this); // Paint on the offscreen buffer. Component root = getRoot(this); Image buffer = rm.getOffscreenBuffer(this, root.getWidth(), root.getHeight()); //Rectangle ... | |
public DebugGraphics(Graphics graphics) { | public DebugGraphics() { | public DebugGraphics(Graphics graphics) { // TODO } // DebugGraphics() |
userInfo = unquote(rawUserInfo); host = unquote(rawHost); | private void parseURI(String str) throws URISyntaxException { Pattern pattern = Pattern.compile(URI_REGEXP); Matcher matcher = pattern.matcher(str); if (matcher.matches()) { scheme = getURIGroup(matcher, SCHEME_GROUP); rawSchemeSpecificPart = getURIGroup(matcher, SCHEME_SPEC_PART_GROUP); rawAuthority =... | |
public DOMResult() { } | public DOMResult() { this(null, null, null); } | public DOMResult() { } // DOMResult() |
public void setSystemId(String systemID) { this.systemId = systemID; } | public void setSystemId(String systemId) { this.systemId = systemId; } | public void setSystemId(String systemID) { this.systemId = systemID; } // systemID() |
updateUI(); | public void setModel(TreeModel model) { if (treeModel == model) return; // add treeModelListener to the new model if (treeModelListener == null) treeModelListener = createTreeModelListener(); if (model != null) // as setModel(null) is allowed model.addTreeModelListener(treeModelListener); ... | |
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, | static void fillMetalPattern(Component c, Graphics g, int x, int y, int w, int h, | static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else ... |
int xOff = 0; for (int mY = y; mY < (y + h); mY++) | if (g instanceof Graphics2D) fillMetalPattern2D((Graphics2D) g, x, y, w, h, light, dark); else | static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else ... |
if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); | int xOff = 0; for (int mY = y; mY < (y + h); mY++) { if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); | static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else ... |
for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); | for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } xOff++; if (xOff > 3) xOff = 0; | static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else ... |
xOff++; if (xOff > 3) xOff = 0; } | } | static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else ... |
tree.setRootVisible(true); | public void installUI(JComponent c) { prepareForUIInstall(); super.installUI(c); tree = (JTree) c; installDefaults(); installComponents(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); tree.s... | |
Rectangle clip = g.getClipBounds(); | Rectangle clip = tree.getVisibleRect(); | int paintControlIcons(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object node) { int h = descent; int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrent... |
sb.append(offset >= 0 ? '+' : '-'); | private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((Simpl... | |
offset = Math.abs(offset) / (1000 * 60); int hours = offset / 60; int minutes = offset % 60; | offset = offset / (1000 * 60); int hours = Math.abs(offset) / 60; int minutes = Math.abs(offset) % 60; | private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((Simpl... |
sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); | if (minutes != 0 || hours != 0) { sb.append(offset >= 0 ? '+' : '-'); sb.append((char) ('0' + hours / 10)); sb.append((char) ('0' + hours % 10)); | private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((Simpl... |
sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); | sb.append((char) ('0' + minutes / 10)); sb.append((char) ('0' + minutes % 10)); } | private String getDefaultDisplayName(boolean dst) { int offset = getRawOffset(); if (dst && this instanceof SimpleTimeZone) { // ugly, but this is a design failure of the API: // getDisplayName takes a dst parameter even though // TimeZone knows nothing about daylight saving offsets. offset += ((Simpl... |
private void addColorToQueue(Color c) | void addColorToQueue(Color c) | private void addColorToQueue(Color c) { if (--start == -1) start = numRows * numCols - 1; colors[start] = c; } |
Thread[] result = new Thread[threadsCount()]; Enumeration e = threads.elements(); for (int n = 0; e.hasMoreElements(); n++) result[n] = (Thread) e.nextElement(); return result; | return (Thread[])threads.toArray(new Thread[threads.size()]); | public Thread[] threads() { Thread[] result = new Thread[threadsCount()]; Enumeration e = threads.elements(); for (int n = 0; e.hasMoreElements(); n++) result[n] = (Thread) e.nextElement(); return result; } |
int native_fd) | VMChannel channel) | public SinkChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; } |
this.native_fd = native_fd; | vmch = channel; | public SinkChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; } |
throw new Error ("Not implemented"); | vmch.close(); | protected final void implCloseSelectableChannel() throws IOException { throw new Error ("Not implemented"); } |
throw new Error ("Not implemented"); | vmch.setBlocking(blocking); | protected final void implConfigureBlocking (boolean blocking) throws IOException { throw new Error ("Not implemented"); } |
throw new Error ("Not implemented"); | return vmch.write(dst); | public final int write (ByteBuffer dst) throws IOException { throw new Error ("Not implemented"); } |
int native_fd) | VMChannel channel) | public SourceChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; } |
this.native_fd = native_fd; | vmch = channel; | public SourceChannelImpl (SelectorProvider selectorProvider, int native_fd) { super (selectorProvider); this.native_fd = native_fd; } |
throw new Error ("Not implemented"); | vmch.setBlocking(blocking); | protected void implConfigureBlocking (boolean blocking) throws IOException { throw new Error ("Not implemented"); } |
throw new Error ("Not implemented"); | return vmch.read(src); | public final int read (ByteBuffer src) throws IOException { throw new Error ("Not implemented"); } |
VMPipe.init (this, provider); | VMChannel[] pipe = VMPipe.pipe(); sink = new SinkChannelImpl(provider, pipe[0]); source = new SourceChannelImpl(provider, pipe[1]); | public PipeImpl (SelectorProvider provider) throws IOException { super(); VMPipe.init (this, provider); } |
public boolean implies(Permission perm) { PermissionCollection pc = getPermissions(); if (pc == null) return (false); return (pc.implies(perm)); | public boolean implies(Permission permission) { if (staticBinding) return (perms == null ? false : perms.implies(permission)); return Policy.getCurrentPolicy().implies(this, permission); | public boolean implies(Permission perm) { PermissionCollection pc = getPermissions(); if (pc == null) return (false); return (pc.implies(perm)); } |
StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); | StringBuffer sb = new StringBuffer("ProtectionDomain (").append(linesep); | public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + ... |
sb.append("CodeSource:null" + linesep); | sb.append("CodeSource:null"); else sb.append(code_source); sb.append(linesep); if (classloader == null) sb.append("ClassLoader:null"); else sb.append(classloader); sb.append(linesep); sb.append("Principals:"); if (principals != null && principals.length > 0) { sb.append("["); Principal pal; for (int i = 0; i < princi... | public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + ... |
sb.append(code_source + linesep); | public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + ... | |
sb.append(linesep + ")" + linesep); | public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + ... | |
return sb.toString(); | return sb.append(linesep).append(")").append(linesep).toString(); | public String toString() { String linesep = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(""); sb.append("ProtectionDomain (" + linesep); if (code_source == null) sb.append("CodeSource:null" + linesep); else sb.append(code_source + ... |
socket.bound = true; | protected final void implAccept(Socket socket) throws IOException { if (isClosed()) throw new SocketException("ServerSocket is closed"); // The Sun spec says that if we have an associated channel and // it is in non-blocking mode, we throw an IllegalBlockingModeException. // However, in our implemen... | |
tabPane.setOpaque(true); | tabPane.setOpaque(false); | protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); tabPane.setFont(defaults.getFont("TabbedPane.font")); tabPane.setForeground(defaults.getColor("TabbedPane.foreground")); tabPane.setBackground(defaults.getColor("TabbedPane.background")); tabPane.setOpaque(tru... |
public final Set aliases() { if (aliases == null) { | public final Set aliases () { if (aliases == null) | public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.u... |
} | public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.u... | |
if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); | HashSet aliasSet = new HashSet (n); | public final Set aliases() { if (aliases == null) { return Collections.EMPTY_SET; } // should we cache the aliasSet instead? int n = aliases.length; if (n == 0) { return Collections.EMPTY_SET; } HashSet aliasSet = new HashSet(n); for (int i = 0; i < n; ++i) aliasSet.add(aliases[i]); return Collections.u... |
public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); | public final CharBuffer decode (ByteBuffer bb) { try { synchronized (Charset.class) { if (cachedDecoder == null) { cachedDecoder = newDecoder () .onMalformedInput (CodingErrorAction.REPLACE) .onUnmappableCharacter (CodingErrorAction.REPLACE); } return cachedDecoder.decode (bb); } | public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); } decoder.reset(); retu... |
decoder.reset(); return decoder.decode(bb); } catch (CharacterCodingException e) { throw new AssertionError(e); | catch (CharacterCodingException e) { throw new AssertionError (e); | public CharBuffer decode(ByteBuffer bb) { try { CharsetDecoder decoder = (CharsetDecoder) cachedDecoder.get(); if (decoder == null) { decoder = newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedDecoder.set(decoder); } decoder.reset(); retu... |
public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); | public final ByteBuffer encode (CharBuffer cb) { try { synchronized (Charset.class) { if (cachedEncoder == null) { cachedEncoder = newEncoder () .onMalformedInput (CodingErrorAction.REPLACE) .onUnmappableCharacter (CodingErrorAction.REPLACE); | public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); } return encoder.en... |
return encoder.encode(cb); } catch (CharacterCodingException e) { throw new AssertionError(e); | return cachedEncoder.encode (cb); } } catch (CharacterCodingException e) { throw new AssertionError (e); | public final ByteBuffer encode(CharBuffer cb) { try { CharsetEncoder encoder = (CharsetEncoder) cachedEncoder.get(); if (encoder == null) { encoder = newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); cachedEncoder.set(encoder); } return encoder.en... |
public final boolean isRegistered(String name) { return !name.startsWith("x-") && !name.startsWith("X-"); | public final boolean isRegistered () { return (!canonicalName.startsWith ("x-") && !canonicalName.startsWith ("X-")); | public final boolean isRegistered(String name) { return !name.startsWith("x-") && !name.startsWith("X-"); } |
private static final CharsetProvider provider() { return (CharsetProvider)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return Provider.provider(); }}); | private static final CharsetProvider provider () { return Provider.provider (); | private static final CharsetProvider provider() { return (CharsetProvider)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return Provider.provider(); }}); } |
super (charsetName); | super (); this.charsetName = charsetName; | public IllegalCharsetNameException (String charsetName) { super (charsetName); } |
super (charsetName); | super (); this.charsetName = charsetName; | public UnsupportedCharsetException (String charsetName) { super (charsetName); } |
if (stingy && (numRepeats >= min)) { | if ((stingy && (numRepeats >= min)) || alwaysEmpty) { | boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input aft... |
while (--posIndex >= min) { | int indexCount = posIndex - min; if (indexCount <= 0) { indexCount = 1; } while (indexCount-- > 0) { --posIndex; | boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input aft... |
mymatch.empty = (mymatch.index == origin); | boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input aft... | |
empty = other.empty; | void assignFrom(REMatch other) { start = other.start; end = other.end; index = other.index; // need to deep clone? next = other.next; } | |
res.put("gnu.java.io.encoding_scheme_alias.US-ASCII", "ISO8859-1"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16LE", "UTF16LE"); res.put("gnu.java.io.encoding_scheme_alias.UTF-16BE", "UTF16BE"); | public static void insertSystemProperties(Properties res) { final Vm vm = Vm.getVm(); final VmArchitecture arch = vm.getArch(); // Java properties res.put("java.version", "1.1.0"); res.put("java.vendor", "JNode.org"); res.put("java.vendor.url", "http://jnode.org"); r... | |
throw new DomEx(DomEx.NAMESPACE_ERR, "xmlns is reserved", null, 0); | throw new DomDOMException(DOMException.NAMESPACE_ERR, "xmlns is reserved", null, 0); | public Document createDocument(String namespaceURI, String rootName, DocumentType doctype) { Document doc = new DomDocument(this); Element root = null; if (rootName != null) { root = doc.createElementNS(namespaceURI, rootName); ... |
throw new WrongAdapter(); | { String object; if (the_Object == null) object = "null passed"; else if (the_Object instanceof gnuServantObject) { gnuServantObject gs = (gnuServantObject) the_Object; object = "Wrong owner POA " + gs.poa.the_name(); } else object = "Unknown " + the_Object.getClass().getName(); throw new WrongAdapter(object + " for '... | public Servant reference_to_servant(org.omg.CORBA.Object the_Object) throws ObjectNotActive, WrongPolicy, WrongAdapter { if (applies(ServantRetentionPolicyValue.RETAIN)) { AOM.Obj ref = aom.findObject(the_Object); if (ref == nul... |
String tmp; tmp = Security.getProperty("keystore.type"); | String tmp = Security.getProperty("keystore.type"); | public static final String getDefaultType() { String tmp; //Security reads every property in java.security so it //will return this property if it exists. tmp = Security.getProperty("keystore.type"); if (tmp == null) tmp = "jks"; return tmp; } |
String classname = p[i].getProperty("KeyStore." + type); if (classname != null) return getInstance(classname, type, p[i]); | try { return getInstance(type, p[i]); } catch (KeyStoreException ignore) { } | public static KeyStore getInstance(String type) throws KeyStoreException { Provider[] p = Security.getProviders(); for (int i = 0; i < p.length; i++) { String classname = p[i].getProperty("KeyStore." + type); if (classname != null) return getInstance(classname, type, p[i]); } throw new KeyStoreE... |
return getView().getSize(); | { Component view = getView(); if (view != null) return view.getPreferredSize(); else return new Dimension(); } | public Dimension getViewSize() { if (isViewSizeSet) return viewSize; else return getView().getSize(); } |
private synchronized static ConnectionRunner getConnectionRunner() | private static synchronized ConnectionRunner getConnectionRunner() | private synchronized static ConnectionRunner getConnectionRunner() { if(freelist.size() == 0){ if(size < max_size){ ++size; ConnectionRunner a = new ConnectionRunner(group, new Integer(size).toString()); a.start(); freelist.add(a); }else while(freelist.size() == 0) try{ ConnectionRunnerPool.class.... |
if (parent != null && parent.isDisplayable()) fireDummyEvent(); | addNotify(){ if (menuBar != null) menuBar.addNotify(); if (peer == null) peer = getToolkit ().createFrame (this); // We now know there's a Frame (us) with a live peer, so we can start the // fundamental queue and dispatch thread, by inserting a dummy event. if (parent != null && parent.isDisplayable()) fi... | |
fireDummyEvent(); | public void removeNotify(){ if (menuBar != null) menuBar.removeNotify(); super.removeNotify(); // By now we've been disconnected from the peer, and the peer set to // null. This is formally the same as saying "we just became // un-displayable", so we wake up the event queue with a dummy event to // see if it'... | |
tabInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabInsets"); | tabInsets = UIManager.getInsets("TabbedPane.tabInsets"); | protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); ligh... |
tabAreaInsets = UIManager.getInsets("TabbedPane.tabbedPaneTabAreaInsets"); | tabAreaInsets = UIManager.getInsets("TabbedPane.tabAreaInsets"); | protected void installDefaults() { LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); tabPane.setOpaque(false); highlight = UIManager.getColor("TabbedPane.highlight"); ligh... |
setEditable(true); | public JTextComponent() { Keymap defkeymap = getKeymap(DEFAULT_KEYMAP); boolean creatingKeymap = false; if (defkeymap == null) { defkeymap = addKeymap(DEFAULT_KEYMAP, null); defkeymap.setDefaultAction(new DefaultEditorKit.DefaultKeyTypedAction()); creatingKeymap = true; } ... | |
return 0; | if (orientation == SwingConstants.HORIZONTAL) return visible.width; else if (orientation == SwingConstants.VERTICAL) return visible.height; else throw new IllegalArgumentException("orientation must be either " + "javax.swing.SwingConstants.VERTICAL " + "or " + "javax.swing.SwingConstants.HORIZONTAL" ); | public int getScrollableBlockIncrement(Rectangle visible, int orientation, int direction) { return 0; } |
return 0; | if (orientation == SwingConstants.HORIZONTAL) return visible.width / 10; else if (orientation == SwingConstants.VERTICAL) return visible.height / 10; else throw new IllegalArgumentException("orientation must be either " + "javax.swing.SwingConstants.VERTICAL " + "or " + "javax.swing.SwingConstants.HORIZONTAL" ); | public int getScrollableUnitIncrement(Rectangle visible, int orientation, int direction) { return 0; } |
caretBlinkTimer.update(); | public void setCaret(Caret newCaret) { if (caret != null) caret.deinstall(this); Caret oldCaret = caret; caret = newCaret; if (caret != null) caret.install(this); firePropertyChange("caret", oldCaret, newCaret); } | |
if (newValue == true) caretBlinkTimer.start(); else { caretBlinkTimer.stop(); caret.setVisible(false); } | public void setEditable(boolean newValue) { if (editable == newValue) return; boolean oldValue = editable; editable = newValue; firePropertyChange("editable", oldValue, newValue); } | |
if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTORY + f1; if (f2.charAt(0) != File.separatorChar) f2 = CURRENT_DIRECTORY + f2; | if (f2.equals(ALL_FILES)) return false; try { f1 = new File(f1).getCanonicalPath(); f2 = new File(f2).getCanonicalPath(); } catch (IOException ioe) { return false; } | public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTOR... |
if (f2.charAt(f2.length() - 1) == File.separatorChar) { if (! f1.equals(f2.substring(0, f2.length() - 1))) return false; } else if (!f1.equals(f2)) | if (!f1.equals(f2)) | public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTOR... |
if (readPerm && ! fp.readPerm) | if (fp.readPerm && ! readPerm) | public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTOR... |
if (writePerm && ! fp.writePerm) | if (fp.writePerm && ! writePerm) | public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTOR... |
if (executePerm && ! fp.executePerm) | if (fp.executePerm && ! executePerm) | public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTOR... |
if (deletePerm && ! fp.deletePerm) | if (fp.deletePerm && ! deletePerm) | public boolean implies(Permission p) { if (! (p instanceof FilePermission)) return false; String f1 = getName(); if (f1.equals(ALL_FILES)) return true; FilePermission fp = (FilePermission) p; String f2 = fp.getName(); if (f1.charAt(0) != File.separatorChar) f1 = CURRENT_DIRECTOR... |
c.setOpaque(true); | public void installUI(JComponent c) { c.setOpaque(true); c.setBackground(UIManager.getColor("control")); super.installUI(c); } | |
editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); ce... | cancelEditing(tree); | public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor i... |
editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cell... | stopEditing(tree); | public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { ... |
} | public void mousePressed(MouseEvent e) { Point click = e.getPoint(); TreePath path = getClosestPathForLocation(tree, click.x, click.y); if (path != null) { Rectangle bounds = getPathBounds(tree, path); int row = getRowForPath(tree, path); boolean cntlClick = isLoc... | |
tree.cancelEditing(); | tree.stopEditing(); | public void actionPerformed(ActionEvent e) { TreePath lead = tree.getLeadSelectionPath(); if (e.getActionCommand().equals("selectPreviousChangeLead") || e.getActionCommand().equals("selectPreviousExtendSelection") || e.getActionCommand().equals("selectPrevious") || e.getActio... |
tree.cancelEditing(); | tree.stopEditing(); | public void valueChanged(TreeSelectionEvent event) { if (tree.isEditing()) tree.cancelEditing(); } |
if (isEditing(tree)) completeEditing(false, true, false); | completeEditing(false, false, false); finish(); | public void cancelEditing(JTree tree) { if (isEditing(tree)) completeEditing(false, true, false); } |
tree.requestFocusInWindow(false); | protected void installDefaults() { LookAndFeel.installColorsAndFont(tree, "Tree.background", "Tree.foreground", "Tree.font"); tree.setOpaque(true); rightChildIndent = UIManager.getInt("Tree.rightChildIndent"); leftChildIndent = UIManager.getInt("Tree.leftChildIndent");... | |
if (editingComponent != null && editingPath != null && isEditing(tree) && node.equals(editingPath.getLastPathComponent())) { rendererPane.paintComponent(g, editingComponent.getParent(), null, bounds); } else { | protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasI... | |
} | protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelected(path); boolean hasI... | |
int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } | maxHeight = 0; validCachedPreferredSize = false; | protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); Tr... |
if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) | if (ed != null && (event == EDIT || ed.shouldSelectCell(event)) && ed.isCellEditable(event)) | protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); Tr... |
Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); | Object value = editingPath.getLastPathComponent(); | protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); Tr... |
editingComponent = ed.getTreeCellEditorComponent(tree, val, true, | editingComponent = ed.getTreeCellEditorComponent(tree, value, true, | protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); Tr... |
editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); validCachedPreferredSize = false; | protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); Tr... | |
((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); | tree.removeAll(); Component container = editingComponent.getParent(); container.setBounds(bounds); tree.add(container); editingComponent.requestFocus(); | protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); Tr... |
completeEditing(true, false, false); | { completeEditing(false, false, true); finish(); } | public boolean stopEditing(JTree tree) { if (isEditing(tree)) completeEditing(true, false, false); return !isEditing(tree); } |
updateCurrentVisiblePath(); | protected void updateCachedPreferredSize() { int maxWidth = 0; boolean isLeaf = false; if (currentVisiblePath != null) { Object[] path = currentVisiblePath.getPath(); for (int i = 0; i < path.length; i++) { TreePath curr = new TreePath(getPathToRoot(path[i], 0)); ... | |
public void openFrame(JInternalFrame frame); | void openFrame(JInternalFrame frame); | public void openFrame(JInternalFrame frame); |
public void setBoundsForFrame(JComponent frame, int x, int y, | void setBoundsForFrame(JComponent frame, int x, int y, | public void setBoundsForFrame(JComponent frame, int x, int y, int width, int height); |
updateSelection(); | updateSelection(e.isControlDown()); | public void mouseDragged(MouseEvent e) { curr = new Point(e.getX(), e.getY()); updateSelection(); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.