rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
if (peer != null) return peer.getGraphics().getFont(); | public Font getFont() { Font f = font; if (f != null) return f; Component p = parent; if (p != null) return p.getFont(); return null; } | |
if (parent != null && parent.valid) | if (parent != null && parent.isValid()) | public void invalidate() { valid = false; prefSize = null; minSize = null; if (parent != null && parent.valid) parent.invalidate(); } |
if(!isShowing()) { Component p = parent; if (p != null) p.repaint(0, getX(), getY(), width, height); } else | if (isShowing()) | public void repaint() { if(!isShowing()) { Component p = parent; if (p != null) p.repaint(0, getX(), getY(), width, height); } else repaint(0, 0, 0, width, height); } |
Rectangle parentBounds = parent.getBounds(); | public void reshape(int x, int y, int width, int height) { int oldx = this.x; int oldy = this.y; int oldwidth = this.width; int oldheight = this.height; if (this.x == x && this.y == y && this.width == width && this.height == height) return; invalidate (); this.x = x; this.y = y; ... | |
if (c == null && parent != null) c = parent.getBackground(); if (peer != null && c != null) peer.setBackground(c); | public void setBackground(Color c) { // return if the background is already set to that color. if ((c != null) && c.equals(background)) return; // If c is null, inherit from closest ancestor whose bg is set. if (c == null && parent != null) c = parent.getBackground(); if (peer != null && c != nul... | |
if (peer != null && c != null) peer.setBackground(c); | public void setBackground(Color c) { // return if the background is already set to that color. if ((c != null) && c.equals(background)) return; // If c is null, inherit from closest ancestor whose bg is set. if (c == null && parent != null) c = parent.getBackground(); if (peer != null && c != nul... | |
ValueListInterface valueListObj = (ValueListInterface) iter.next(); | ValueList valueListObj = (ValueList) iter.next(); | protected String basicXMLWriter ( Writer outputWriter, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ... |
protected void setValueListObj (ValueListInterface valueListObj) | protected void setValueListObj (ValueList valueListObj) | protected void setValueListObj (ValueListInterface valueListObj) { resetValueListObjects(); addValueListObj(valueListObj); } |
repaint(); | calculateVisibility(); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable internalId = openFrameCount; //...Create the GUI and put it in the window... //...Then set the w... |
calculateVisibility(); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable internalId = openFrameCount; //...Create the GUI and put it in the window... //...Then set the w... | |
repaint(); | calculateVisibility(); | public void internalFrameActivated(InternalFrameEvent e) {// displayMessage("Internal frame activated", e); activated = true; repaint(); } |
calculateVisibility(); | public void internalFrameClosed(InternalFrameEvent e) {// displayMessage("Internal frame closed", e); disconnectMe(); } | |
calculateVisibility(); | public void internalFrameClosing(InternalFrameEvent e) {// displayMessage("Internal frame closing", e); disconnectMe(); } | |
calculateVisibility(); | public void internalFrameDeactivated(InternalFrameEvent e) { activated = false;// displayMessage("Internal frame deactivated", e); } | |
repaint(); | calculateVisibility(); | public void internalFrameDeiconified(InternalFrameEvent e) {// displayMessage("Internal frame deiconified", e); repaint(); } |
calculateVisibility(); | public void internalFrameIconified(InternalFrameEvent e) {// displayMessage("Internal frame iconified", e); } | |
calculateVisibility(); | public void internalFrameOpened(InternalFrameEvent e) {// displayMessage("Internal frame opened", e); } | |
if (mif.isIcon()) mif.setIcon(false); | private void nextSession() { MyInternalFrame mif = getNextInternalFrame(); if (mif != null) { try { mif.setSelected(true); if (mif.isIcon()) mif.setIcon(false); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMess... | |
System.out.println(" index of session " + index + " num frames " + desktop.getAllFrames().length); | public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getSt... | |
frames[index].setTitle(frames[index].getTitle() + " " + d); | int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d); | public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getSt... |
frames[index].setTitle(frames[index].getTitle() + " " + d); | int id = ((MyInternalFrame)frames[index]).getInternalId(); frames[index].setTitle("#" + id + " " + d); | public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(frames[index].getTitle() + " " + d); } |
((MyInternalFrame)myFrameList.get(index)).setSelected(true); if (((MyInternalFrame)myFrameList.get(index)).isIcon()) ((MyInternalFrame)myFrameList.get(index)).setIcon(false); | MyInternalFrame mif = (MyInternalFrame)myFrameList.get(index); if (mif.isIcon()) { mif.setIcon(false); } mif.setSelected(true); | private void prevSession() { JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); if (miv == null) return; int index = desktop.getIndexOf(miv); if (index == -1) return; MyInternalFrame mix = (MyInternalFrame... |
if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic; | return getKeyStrokeText(ke,false); | public final static String getKeyStrokeText(KeyEvent ke) { if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic; } |
settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); | private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory // SESSIONS is declared as a string, so we just can use the keyword here. if... | |
else { settings.setProperty("emulator.settingsDirectory", System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator); System.out.println("User Home = " + System.getProperty("user.home")); } | private void checkLegacy() { // we check if the sessions file already exists in the directory // if it does exist we are working with an old install so we // need to set the settings directory to the users directory // SESSIONS is declared as a string, so we just can use the keyword here. if... | |
again = new FileInputStream(System.getProperty("user.home") + File.separator + ".tn5250j" + File.separator + settingsFile); | again = new FileInputStream(settingsDirectory() + settingsFile); | private void loadSettings() { FileInputStream in = null; FileInputStream again = null; settings = new Properties(); // here we will check for a system property is provided first. if (System.getProperties().containsKey("emulator.settingsDirectory")) { settings.setProperty("emul... |
FileOutputStream out = new FileOutputStream(settingsFile); | FileOutputStream out = new FileOutputStream(settingsDirectory() + settingsFile); | public void saveSettings() { try { FileOutputStream out = new FileOutputStream(settingsFile); settings.store(out,"----------------- tn5250j Global Settings --------------"); } catch (FileNotFoundException fnfe) {} catch (IOException ioe) {} } |
super(in); | this.in = in; | public ChunkedInputStream(InputStream in, Headers headers) { super(in); this.headers = headers; size = -1; count = 0; meta = true; } |
throw new IllegalArgumentException(); | throw new IllegalArgumentException(titleJustification + " is not a valid title justification."); | public void setTitleJustification(int titleJustification) { if ((titleJustification < DEFAULT_JUSTIFICATION) || (titleJustification > TRAILING)) throw new IllegalArgumentException(); // Swing borders are not JavaBeans, thus no need to fire an event. this.titleJustification = titleJustification; ... |
throw new IllegalArgumentException(); | throw new IllegalArgumentException(titlePosition + " is not a valid title position."); | public void setTitlePosition(int titlePosition) { if ((titlePosition < DEFAULT_POSITION) || (titlePosition > BELOW_BOTTOM)) throw new IllegalArgumentException(); // Swing borders are not JavaBeans, thus no need to fire an event. this.titlePosition = titlePosition; } |
if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); } | public void propertyChange(PropertyChangeEvent event) { // TODO: What should be done here, if anything? } | |
if (i-1 > 0) | if (i-1 >= 0) | Object getPreviousVisibleNode(Object node) { if (currentVisiblePath != null) { Object[] nodes = currentVisiblePath.getPath(); int i = 0; while (i < nodes.length && !node.equals(nodes[i])) i++; // return the next node if (i-1 > 0) return nodes[i-1]; ... |
updateCurrentVisiblePath(); | public int getRowCount(JTree tree) { if (currentVisiblePath != null) return currentVisiblePath.getPathCount(); return 0; } | |
if (treeModel != null) | if (currentVisiblePath != null && treeModel != null) | public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (currentVisiblePath == null) updateCurrentVisiblePath(); if (treeModel != null) { Object root = treeModel.getRoot(); paintRecursive(g, 0, 0, 0, tree, treeModel, root); if (hasControlIcons()) pain... |
if (tree.isVisible(new TreePath(getPathToRoot(child, 0)))) | int paintControlIcons(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object node) { int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle c... | |
tree, mod, mod.getChild(node, i)); | tree, mod, child); | int paintControlIcons(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object node) { int rowHeight = getRowHeight(); TreePath path = new TreePath(getPathToRoot(node, 0)); Icon icon = getCurrentControlIcon(path); Rectangle c... |
(!isRootVisible && !curr.equals(root))) | (!isRootVisible && !curr.equals(root)) && childVis) | int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; ... |
tree, mod, mod.getChild(curr, i)); | tree, mod, child); | int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; ... |
if (y0 != heightOfLine && !isLeaf && mod.getChildCount(curr) > 0) | if (y0 != heightOfLine && (mod.getChildCount(curr) > 0 && tree.isVisible(new TreePath(getPathToRoot(mod.getChild (curr, 0), 0))))) | int paintRecursive(Graphics g, int indentation, int descent, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = tree.getVisibleRect(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; ... |
selected, isExpanded, isLeaf, row, false); | selected, isExpanded, isLeaf, row, true); | protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf) { boolean selected = tree.isPathSelect... |
if ((bounds.width == 0 && bounds.height == 0) || (!isRootVisible() | if ((bounds.width == 0 && bounds.height == 0) || (!rootVisible | void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((boun... |
if (tree.isVisible(path) && tree.isExpanded(path)) | if ((tree.isVisible(path) && tree.isExpanded(path)) || treeModel.isLeaf(next)) | void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((boun... |
tree.setVisibleRowCount(getRowCount(tree)); | if (currentVisiblePath != null) tree.setVisibleRowCount(currentVisiblePath.getPathCount()); else tree.setVisibleRowCount(0); | void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((boun... |
tree.addSelectionRow(0); | selectPath(tree, new TreePath(currentVisiblePath.getPathComponent(0))); | void updateCurrentVisiblePath() { if (treeModel == null) return; Object next = treeModel.getRoot(); Rectangle bounds = getCellBounds(0, 0, next); // If root is not a valid size to be visible, or is // not visible and the tree is expanded, then the next node acts // as the root if ((boun... |
throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); | throw new BAD_OPERATION(Minor.Method, CompletionStatus.COMPLETED_MAYBE); | OutputStream super_invoke(String method, InputStream in, ResponseHandler rh) { OutputStream out = null; Integer call_method = (Integer) _NamingContextImplBase.methods.get(method); if (call_method == null) throw new BAD_OPERATION(0, CompletionStatus.COMPLETED_MAYBE); switch (call_method.intValue()) ... |
public boolean equals(Object obj) { if (!(obj instanceof ActivationDesc)) { return (false); } ActivationDesc that = (ActivationDesc)obj; if (this.groupid.equals(that.groupid) && this.classname.equals(that.classname) && this.location.equals(that.location) && this.data.equals(that.data) && this.restart == that.restart) ... | public boolean equals(Object obj) { if (obj instanceof ActivationDesc) { ActivationDesc that = (ActivationDesc) obj; return groupid.equals(that.groupid) && classname.equals(that.classname) && location.equals(that.location) && data.equals(that.data) && restart == that.restart; } else return false; } | public boolean equals(Object obj) { if (!(obj instanceof ActivationDesc)) { return (false); } ActivationDesc that = (ActivationDesc)obj; if (this.groupid.equals(that.groupid) && this.classname.equals(that.classname) && this.location.equals(that.location) && this.data.equals(that.data) && this.restart =... |
public String getClassName() { return (classname); } | public String getClassName() { return classname; } | public String getClassName() { return (classname);} |
public MarshalledObject getData() { return (data); } | public MarshalledObject getData() { return data; } | public MarshalledObject getData() { return (data);} |
public ActivationGroupID getGroupID() { return (groupid); } | public ActivationGroupID getGroupID() { return groupid; } | public ActivationGroupID getGroupID() { return (groupid);} |
public String getLocation() { return (location); } | public String getLocation() { return location; } | public String getLocation() { return (location);} |
public boolean getRestartMode() { return (restart); } | public boolean getRestartMode() { return restart; } | public boolean getRestartMode() { return (restart);} |
public int hashCode() { return (groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode()); } | public int hashCode() { return groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode(); } | public int hashCode() { return (groupid.hashCode() ^ classname.hashCode() ^ location.hashCode() ^ data.hashCode());} |
Rectangle alloc = c.isValid() ? c.getBounds() : new Rectangle(c.getPreferredSize()); | Rectangle alloc = new Rectangle(0, 0, getWidth(), getHeight()); | protected int calculateBreakPosition(int p0, int p1) { Container c = getContainer(); Rectangle alloc = c.isValid() ? c.getBounds() : new Rectangle(c.getPreferredSize()); updateMetrics(); try { getDocument().getText(p0, p1 - p0, getLineBuffer()); } catch... |
HTMLDocument document = new HTMLDocument(); | HTMLDocument document = new HTMLDocument(getStyleSheet()); | public Document createDefaultDocument() { HTMLDocument document = new HTMLDocument(); document.setParser(getParser()); return document; } |
set.removeAttributes(set); | protected void createInputAttributes(Element element, MutableAttributeSet set) { set.addAttributes(element.getAttributes()); // FIXME: Not fully implemented. } | |
styleSheet.importStyleSheet(getClass().getResource(DEFAULT_CSS)); } | public StyleSheet getStyleSheet() { if (styleSheet == null) styleSheet = new StyleSheet(); return styleSheet; } | |
try { loadRules(new BufferedReader(new InputStreamReader(url.openStream())), url); } catch (IOException ioe) { } | public void importStyleSheet(URL url) { try { // FIXME: Need to make sure url points to a valid CSS document. loadRules(new BufferedReader(new InputStreamReader(url.openStream())), url); } catch (IOException ioe) { // Do nothing here. } } | |
char shortName = 0; if (justName.length() == 1) shortName = justName.charAt(0); | boolean isPlainShort = justName.length() == 1; char shortName = justName.charAt(0); | private void handleLongOption(String real, int index) throws OptionException { String option = real.substring(index); String justName = option; int eq = option.indexOf('='); if (eq != - 1) justName = option.substring(0, eq); char shortName = 0; if (justName.length() == 1) shortName = just... |
if (shortName != 0 && opt.getShortName() == shortName) | if ((isPlainShort || opt.isJoined()) && opt.getShortName() == shortName) | private void handleLongOption(String real, int index) throws OptionException { String option = real.substring(index); String justName = option; int eq = option.indexOf('='); if (eq != - 1) justName = option.substring(0, eq); char shortName = 0; if (justName.length() == 1) shortName = just... |
for (int i = 1; i < option.length(); ++i) | for (int charIndex = 1; charIndex < option.length(); ++charIndex) | private void handleShortOptions(String option) throws OptionException { for (int i = 1; i < option.length(); ++i) { handleShortOption(option.charAt(i)); } } |
handleShortOption(option.charAt(i)); | char optChar = option.charAt(charIndex); Option found = null; for (int i = options.size() - 1; i >= 0; --i) { Option opt = (Option) options.get(i); if (optChar == opt.getShortName()) { found = opt; break; } } if (found == null) { String msg = MessageFormat.format(Messages.getString("Parser.UnrecDash"), new Object[] { "... | private void handleShortOptions(String option) throws OptionException { for (int i = 1; i < option.length(); ++i) { handleShortOption(option.charAt(i)); } } |
if (option.getShortName() != 'J') | if (! option.isJoined()) | public void printHelp(PrintStream out, boolean longOnly) { // Compute maximum lengths. int maxArgLen = 0; boolean shortOptionSeen = false; Iterator it; // The first pass only looks to see if we have a short option. it = options.iterator(); while (it.hasNext()) { Option option = (Opti... |
Unsafe.debug("loadFromBootClassArray"); | protected static void loadFromBootClassArray(VmType[] bootClasses) { int count = bootClasses.length; for (int i = 0; i < count; i++) { VmType vmClass = bootClasses[i]; String name = vmClass.name; if (vmClass.isPrimitive()) { if (name.equals("boolean")) { BooleanClass = (VmNormalClass) vmClass; } else... | |
(new Thread(conn)).start(); | (new RMIIncomingThread(conn, remoteHost)).start(); | public void run() { for (;serverThread != null;) { // if serverThread==null, then exit thread try {//System.out.println("Waiting for connection on " + serverPort); UnicastConnection conn = getServerConnection(); // use a thread pool to improve performance //ConnectionRunnerPool.dispatchConnection(conn);... |
Thread.currentThread().sleep(100); | Thread.sleep(100); | public void connect() { failIfConnected(); if (!isSignificant(this.user)) { connectSimple(); } else { if (this.embeddedSignon) connectEmbedded(); else connectSimulated(); Runnable runnable = new Runnable() { int tryConnection; public void run() ... |
Thread.currentThread().sleep(100); | Thread.sleep(100); | public void run() { if ((tryConnection++ < 30) && //If it is still not connected after 3 seconds, //stop with trying (session.isConnected() == false)) { try { Thread.currentThread().sleep(100); ... |
oout = conn.getObjectOutputStream(); | oout = conn.startObjectOutputStream(); | public void executeCall() throws Exception { byte returncode; ObjectInput oin; // signal the call when constructing try { DataOutputStream dout = conn.getDataOutputStream(); dout.write(MESSAGE_CALL); oout = conn.getObjectOutputStream(); objid.write(oout); oout.writeInt(opnum); oout.writeLong(ha... |
oin = getInputStream(); | oin = startInputStream(); | public void executeCall() throws Exception { byte returncode; ObjectInput oin; // signal the call when constructing try { DataOutputStream dout = conn.getDataOutputStream(); dout.write(MESSAGE_CALL); oout = conn.getObjectOutputStream(); objid.write(oout); oout.writeInt(opnum); oout.writeLong(ha... |
public static UID read(DataInput in) throws IOException { UID id = new UID(); id.unique = in.readInt(); id.time = in.readLong(); id.count = in.readShort(); return (id); } | public static UID read(DataInput in) throws IOException { UID uid = new UID(); uid.unique = in.readInt(); uid.time = in.readLong(); uid.count = in.readShort(); return (uid); } | public static UID read(DataInput in) throws IOException { UID id = new UID(); id.unique = in.readInt(); id.time = in.readLong(); id.count = in.readShort(); return (id);} |
rowSM.setSelectionMode(rowSM.SINGLE_SELECTION); | rowSM.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | private void jbInit() throws Exception { this.setTitle(LangTool.getString("spool.title")); this.setIconImage(GUIGraphicsUtils.getApplicationIcon().getImage()); this.getContentPane().add(createFilterPanel(), BorderLayout.NORTH); // get an instance of our table model stm = new SpoolTableModel(... |
public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { | public synchronized void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { | public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { ... |
synchronized (lock) { | public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { ... | |
lock.notifyAll(); } | public void drawImageBuffer(Graphics2D gg2d,int x, int y, int width, int height) { /** * @todo this is a hack and should be fixed at the root of the problem */ if (gg2d == null) { System.out.println(" we got a null graphic object "); return; } synchronized (lock) { ... | |
this.string = str; | public URI(String str) throws URISyntaxException { parseURI(str); } | |
this.string = (String) is.readObject(); try { parseURI(this.string); } catch (URISyntaxException x) { throw new RuntimeException(x); } | private void readObject(ObjectInputStream is) throws ClassNotFoundException, IOException { } | |
private void writeObject(ObjectOutputStream is) throws IOException | private void writeObject(ObjectOutputStream os) throws IOException | private void writeObject(ObjectOutputStream is) throws IOException { } |
if (string == null) string = toString(); os.writeObject(string); | private void writeObject(ObjectOutputStream is) throws IOException { } | |
data[offset+3] = (byte)((value >> 32) & 0xFF); | data[offset+3] = (byte)((value >> 24) & 0xFF); | public static void set32(byte[] data, int offset, long value) { data[offset] = (byte)(value & 0xFF); data[offset+1] = (byte)((value >> 8) & 0xFF); data[offset+2] = (byte)((value >> 16) & 0xFF); data[offset+3] = (byte)((value >> 32) & 0xFF); } |
public synchronized void setData(byte[] buf) { if (buf == null) throw new NullPointerException("Null buffer"); buffer = buf; | public void setData(byte[] buf) { setData(buf, 0, buf.length); | public synchronized void setData(byte[] buf) { // This form of setData requires setLength to be called separately // and subsequently. if (buf == null) throw new NullPointerException("Null buffer"); buffer = buf; } |
super(); | this.choice = choice; | public SwingChoicePeer(Choice choice) { super(); SwingToolkit.add(choice, this); SwingToolkit.copyAwtProperties(choice, this); final int cnt = choice.getItemCount(); for (int i = 0; i < cnt; i++) { addItem(choice.getItem(i), i); } } |
return (childValue == null || !(childValue instanceof Hashtable || childValue instanceof Vector || childValue.getClass() .isArray())); | return childValue == null || !(childValue instanceof Hashtable || childValue instanceof Vector || childValue.getClass().isArray()); | public boolean isLeaf() { return (childValue == null || !(childValue instanceof Hashtable || childValue instanceof Vector || childValue.getClass() .isArray())); } |
new RegisterGroupUsage(new RegisterEntry(X86Register.ESI, JvmType.INT), new RegisterEntry(X86Register.ESI, JvmType.REFERENCE), new RegisterEntry( X86Register.ESI, JvmType.FLOAT), false) }; | }; | protected RegisterGroupUsage[] initialize() { // The order of this array determines the cost of using the // register. // The cost of a register is lower when its index in this // array is higher. return new RegisterGroupUsage[] { new Reg... |
public X86RegisterPool() { | public X86RegisterPool(boolean lastFirst, int minimumRequestIndex) { this.lastFirst = lastFirst; this.minimumRequestIndex = minimumRequestIndex; | public X86RegisterPool() { this.registers = initialize(); this.regCount = registers.length; } |
this.lastRequestIndex = regCount; | public X86RegisterPool() { this.registers = initialize(); this.regCount = registers.length; } | |
this.lastRequestIndex = regCount; | public final void reset(X86Assembler os) { boolean inuse = false; for (int i = regCount - 1; i >= 0; i--) { if (!registers[i].isFree()) { os.log("Warning: register in use" + registers[i].getUsedRegister()); inuse = true; } ... | |
if (thumbRect.contains(e.getPoint())) thumbRollover = true; else thumbRollover = false; | public void mouseMoved(MouseEvent e) { // Not interested in where the mouse // is unless it is being dragged. } | |
return (value > scrollbar.getValue()); | return value > scrollbar.getValue(); | boolean shouldScroll(int direction) { int value; if (scrollbar.getOrientation() == HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (thumbRect.contains(currentMouseX, currentMouseY)) return false; if (direction == POSITI... |
return (value < scrollbar.getValue()); | return value < scrollbar.getValue(); | boolean shouldScroll(int direction) { int value; if (scrollbar.getOrientation() == HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (thumbRect.contains(currentMouseX, currentMouseY)) return false; if (direction == POSITI... |
case (JScrollBar.HORIZONTAL): | case JScrollBar.HORIZONTAL: | protected void installComponents() { int orientation = scrollbar.getOrientation(); switch (orientation) { case (JScrollBar.HORIZONTAL): incrButton = createIncreaseButton(EAST); decrButton = createDecreaseButton(WEST); break; default: incrButton = createIncreaseButton(... |
else scrollbar.setValue(scrollbar.getValue() - scrollbar.getBlockIncrement(direction)); | protected void scrollByBlock(int direction) { scrollbar.setValue(scrollbar.getValue() + scrollbar.getBlockIncrement(direction)); } | |
else scrollbar.setValue(scrollbar.getValue() - scrollbar.getUnitIncrement(direction)); | protected void scrollByUnit(int direction) { scrollbar.setValue(scrollbar.getValue() + scrollbar.getUnitIncrement(direction)); } | |
return ((max - min) / 2); | return (max - min) / 2; | int valueForXPosition(int xPos) { int min = scrollbar.getMinimum(); int max = scrollbar.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. ... |
value = ((xPos - trackRect.x) * (max - min) / len + min); | value = (xPos - trackRect.x) * (max - min) / len + min; | int valueForXPosition(int xPos) { int min = scrollbar.getMinimum(); int max = scrollbar.getMaximum(); int len = trackRect.width; int value; // If the length is 0, you shouldn't be able to even see where the slider is. // This really shouldn't ever happen, but just in case, we'll return the middle. ... |
return ((max - min) / 2); | return (max - min) / 2; | int valueForYPosition(int yPos) { int min = scrollbar.getMinimum(); int max = scrollbar.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the thumb is. // This really shouldn't ever happen, but just in case, we'll return the middle. ... |
value = ((yPos - trackRect.y) * (max - min) / len + min); | value = (yPos - trackRect.y) * (max - min) / len + min; | int valueForYPosition(int yPos) { int min = scrollbar.getMinimum(); int max = scrollbar.getMaximum(); int len = trackRect.height; int value; // If the length is 0, you shouldn't be able to even see where the thumb is. // This really shouldn't ever happen, but just in case, we'll return the middle. ... |
scrollListener.setDirection(POSITIVE_SCROLL); else scrollListener.setDirection(NEGATIVE_SCROLL); | scrollListener.setDirection(POSITIVE_SCROLL); else if (e.getSource() == decrButton) scrollListener.setDirection(NEGATIVE_SCROLL); scrollTimer.setDelay(100); | public void mousePressed(MouseEvent e) { scrollTimer.stop(); scrollListener.setScrollByBlock(false); if (e.getSource() == incrButton) scrollListener.setDirection(POSITIVE_SCROLL); else scrollListener.setDirection(NEGATIVE_SCROLL); scrollTimer.start(); } |
scrollTimer.setDelay(300); if (e.getSource() == incrButton) scrollByUnit(POSITIVE_SCROLL); else if (e.getSource() == decrButton) scrollByUnit(NEGATIVE_SCROLL); | public void mouseReleased(MouseEvent e) { scrollTimer.stop(); } | |
if (value == scrollbar.getValue()) return; | public void mousePressed(MouseEvent e) { currentMouseX = e.getX(); currentMouseY = e.getY(); int value; if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) value = valueForXPosition(currentMouseX); else value = valueForYPosition(currentMouseY); if (value == scrollbar.getVal... | |
scrollTimer.stop(); if (scrollbar.getValueIsAdjusting()) scrollbar.setValueIsAdjusting(false); | scrollListener.setScrollByBlock(false); scrollbar.setValueIsAdjusting(true); | public void mouseReleased(MouseEvent e) { trackHighlight = NO_HIGHLIGHT; scrollTimer.stop(); if (scrollbar.getValueIsAdjusting()) scrollbar.setValueIsAdjusting(false); scrollbar.repaint(); } |
{ thumbRect.x = trackRect.x; thumbRect.y = trackRect.y; if (scrollbar.getOrientation() == HORIZONTAL) | protected Rectangle getThumbBounds() { int max = scrollbar.getMaximum(); int min = scrollbar.getMinimum(); int value = scrollbar.getValue(); int extent = scrollbar.getVisibleAmount(); // System.err.println(this + ".getThumbBounds()"); if (max == min) { thumbRect.x = trackRect.x; thumbR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.