rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
protected void modifyUsedDirsCount(int group, int diff) throws IOException {
|
protected void modifyUsedDirsCount(int group, int diff) {
|
protected void modifyUsedDirsCount(int group, int diff) throws IOException { GroupDescriptor gdesc = groupDescriptors[group]; synchronized(gdesc) { gdesc.setUsedDirsCount( gdesc.getUsedDirsCount()+diff ); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f03619e78366bc28dfe50fc7787472318ca41010/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java
|
timedWrite(nr, data);
|
getApi().write(nr*blockSize, data, 0, blockSize);
|
public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if(isReadOnly()) throw new ReadOnlyFileSystemException("Filesystem is mounted read-only!"); Block block; Integer key=new Integer((int)nr); //check if the block is in the cache synchronized(blockCache) { if(blockCache.containsKey(key)) { block = (Block)blockCache.get(key); //update the data in the cache block.setData(data); if(forceWrite || SYNC_WRITE) { //write the block to disk //api.write(nr*blockSize, data, 0, blockSize); timedWrite(nr, data); block.setDirty(false); log.debug("writing block "+nr+" to disk"); } else block.setDirty(true); } else { //If the block was not in the cache, I see no reason to put it //in the cache when it is written. //It is simply written to disk. //api.write(nr*blockSize, data, 0, blockSize); timedWrite(nr, data); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f03619e78366bc28dfe50fc7787472318ca41010/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java
|
timedWrite(nr, data);
|
getApi().write(nr*blockSize, data, 0, blockSize);
|
public void writeBlock(long nr, byte[] data, boolean forceWrite) throws IOException { if(isReadOnly()) throw new ReadOnlyFileSystemException("Filesystem is mounted read-only!"); Block block; Integer key=new Integer((int)nr); //check if the block is in the cache synchronized(blockCache) { if(blockCache.containsKey(key)) { block = (Block)blockCache.get(key); //update the data in the cache block.setData(data); if(forceWrite || SYNC_WRITE) { //write the block to disk //api.write(nr*blockSize, data, 0, blockSize); timedWrite(nr, data); block.setDirty(false); log.debug("writing block "+nr+" to disk"); } else block.setDirty(true); } else { //If the block was not in the cache, I see no reason to put it //in the cache when it is written. //It is simply written to disk. //api.write(nr*blockSize, data, 0, blockSize); timedWrite(nr, data); } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/f03619e78366bc28dfe50fc7787472318ca41010/Ext2FileSystem.java/buggy/fs/src/fs/org/jnode/fs/ext2/Ext2FileSystem.java
|
bad.minor = Minor.Any;
|
public static NamingContext extract(Any a) { try { return ((NamingContextHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION("Naming context expected"); bad.initCause(ex); throw bad; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/NamingContextHelper.java/buggy/core/src/classpath/org/org/omg/CosNaming/NamingContextHelper.java
|
|
public KeyException(String msg)
|
public KeyException()
|
public KeyException(String msg) { super(msg); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/KeyException.java/clean/core/src/classpath/java/java/security/KeyException.java
|
super(msg);
|
public KeyException(String msg) { super(msg); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/KeyException.java/clean/core/src/classpath/java/java/security/KeyException.java
|
|
public String getFamily () { return peer.getFamily (this); }
|
public String getFamily() { return peer.getFamily(this); }
|
public String getFamily (){ return peer.getFamily (this);}
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c0997df57feec0722568b1f1cc390b475c418086/Font.java/buggy/core/src/classpath/java/java/awt/Font.java
|
public Button() {
|
Button() {
|
public Button() { this(null); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
public Button() { this(null); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public synchronized void addActionListener(ActionListener listener) {
|
addActionListener(ActionListener listener) {
|
public synchronized void addActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.add(action_listeners, listener); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
public synchronized void addActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.add(action_listeners, listener); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public void addNotify() {
|
addNotify() {
|
public void addNotify() { if (peer == null) peer = getToolkit().createButton(this); super.addNotify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
peer = getToolkit().createButton(this);
|
peer = getToolkit ().createButton (this);
|
public void addNotify() { if (peer == null) peer = getToolkit().createButton(this); super.addNotify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
public void addNotify() { if (peer == null) peer = getToolkit().createButton(this); super.addNotify(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
|
dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0))
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ActionEvent.ACTION_LAST && e.id >= ActionEvent.ACTION_FIRST && (action_listeners != null || (eventMask & AWTEvent.ACTION_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public String getActionCommand() { return (actionCommand); }
|
getActionCommand() { return(actionCommand); }
|
public String getActionCommand() { return (actionCommand); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public synchronized ActionListener[] getActionListeners() { return (ActionListener[]) AWTEventMulticaster.getListeners(action_listeners, ActionListener.class);
|
public synchronized ActionListener[] getActionListeners() { return (ActionListener[]) AWTEventMulticaster.getListeners(action_listeners, ActionListener.class);
|
public synchronized ActionListener[] getActionListeners() { return (ActionListener[]) AWTEventMulticaster.getListeners(action_listeners, ActionListener.class); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public String getLabel() { return (label); }
|
getLabel() { return(label); }
|
public String getLabel() { return (label); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public EventListener[] getListeners(Class listenerType) {
|
public EventListener[] getListeners(Class listenerType) {
|
public EventListener[] getListeners(Class listenerType) { if (listenerType == ActionListener.class) return getActionListeners(); return (EventListener[]) Array.newInstance(listenerType, 0); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
protected String paramString() { return ("label=" + getLabel() + ",actionCommand=" + getActionCommand() + "," + super.paramString()); }
|
paramString() { return ("label=" + getLabel() + ",actionCommand=" + getActionCommand() + "," + super.paramString()); }
|
protected String paramString() { return ("label=" + getLabel() + ",actionCommand=" + getActionCommand() + "," + super.paramString()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
protected void processActionEvent(ActionEvent event) {
|
processActionEvent(ActionEvent event) {
|
protected void processActionEvent(ActionEvent event) { if (action_listeners != null) action_listeners.actionPerformed(event); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
protected void processActionEvent(ActionEvent event) { if (action_listeners != null) action_listeners.actionPerformed(event); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
protected void processEvent(AWTEvent event) {
|
processEvent(AWTEvent event) {
|
protected void processEvent(AWTEvent event) { if (event instanceof ActionEvent) processActionEvent((ActionEvent) event); else super.processEvent(event); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
processActionEvent((ActionEvent) event);
|
processActionEvent((ActionEvent)event);
|
protected void processEvent(AWTEvent event) { if (event instanceof ActionEvent) processActionEvent((ActionEvent) event); else super.processEvent(event); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
protected void processEvent(AWTEvent event) { if (event instanceof ActionEvent) processActionEvent((ActionEvent) event); else super.processEvent(event); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public synchronized void removeActionListener(ActionListener listener) {
|
removeActionListener(ActionListener listener) {
|
public synchronized void removeActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.remove(action_listeners, listener); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
public synchronized void removeActionListener(ActionListener listener) { action_listeners = AWTEventMulticaster.remove(action_listeners, listener); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public void setActionCommand(String actionCommand) {
|
setActionCommand(String actionCommand) {
|
public void setActionCommand(String actionCommand) { this.actionCommand = actionCommand == null ? label : actionCommand; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
}
|
public void setActionCommand(String actionCommand) { this.actionCommand = actionCommand == null ? label : actionCommand; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
public synchronized void setLabel(String label) {
|
setLabel(String label) {
|
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
if (peer != null) {
|
actionCommand = label; if (peer != null) {
|
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
bp.setLabel(label); }
|
bp.setLabel (label);
|
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
}
|
public synchronized void setLabel(String label) { this.label = label; if (peer != null) { ButtonPeer bp = (ButtonPeer) peer; bp.setLabel(label); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/b5af1a0dd02ba16d1f4f4556ab34fa51c2db060d/Button.java/buggy/core/src/classpath/java/java/awt/Button.java
|
|
return getDataCube().getDimension();
|
return getAxes().size();
|
public int getDimension() { return getDataCube().getDimension(); }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/clean/src/gov/nasa/gsfc/adc/xdf/Array.java
|
if (isRemoveSuccess) { getDataCube().decrementDimension(axisObj);
|
if (isRemoveSuccess) { getDataCube().reset();
|
public boolean removeAxis (AxisInterface axisObj) { boolean isRemoveSuccess = removeFromList(axisObj, getAxes(), AXISLIST_XML_ATTRIBUTE_NAME); if (isRemoveSuccess) { //remove successful getDataCube().decrementDimension(axisObj); //decrease the dimension by 1 updateChildLocators(axisObj, "remove"); } return isRemoveSuccess; }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/clean/src/gov/nasa/gsfc/adc/xdf/Array.java
|
public void setAxisList(List axisList) {
|
public void setAxisList (List axisList) {
|
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((Axis) iter.next()); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/clean/src/gov/nasa/gsfc/adc/xdf/Array.java
|
for (int i=0;i<oldAxisList.size();i++) removeAxis(i++);
|
int lastindex = oldAxisList.size()-1; for (int i = lastindex; i >= 0; i--) { removeAxis(i); }
|
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((Axis) iter.next()); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/clean/src/gov/nasa/gsfc/adc/xdf/Array.java
|
addAxis((Axis) iter.next());
|
addAxis((AxisInterface) iter.next());
|
public void setAxisList(List axisList) { // remove the existing axes List oldAxisList = getAxes(); for (int i=0;i<oldAxisList.size();i++) removeAxis(i++); //add new axes if (axisList != null && axisList.size() > 0) { Iterator iter = axisList.iterator(); while (iter.hasNext()) addAxis((Axis) iter.next()); } }
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/3266f401876bff8226e268cfbabeb96a9a320789/Array.java/clean/src/gov/nasa/gsfc/adc/xdf/Array.java
|
getBorder().paintBorder(this, graphics, 0, 0,
|
Border border = getBorder(); if (paintBorder && border != null) border.paintBorder(this, graphics, 0, 0,
|
protected void paintBorder(Graphics graphics) { getBorder().paintBorder(this, graphics, 0, 0, getWidth(), getHeight()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c5671ff077399b85034dffa0f9635da50cef54a9/JProgressBar.java/clean/core/src/classpath/javax/javax/swing/JProgressBar.java
|
log.debug("Source : " +((EthernetHeader)buf.getLinkLayerHeader()).getSource().toString()); log.debug("Destination : " + ((EthernetHeader)buf.getLinkLayerHeader()).getDestination().toString());
|
public void transmit(SocketBuffer buf, HardwareAddress destination, long timeout) throws InterruptedException, TimeoutException { log.debug(flags.getName() + " : Init transmit with TIMEOUT=" + timeout); // Set the source address hwAddress.writeTo(buf, 6); log.debug("Source : " +((EthernetHeader)buf.getLinkLayerHeader()).getSource().toString()); log.debug("Destination : " + ((EthernetHeader)buf.getLinkLayerHeader()).getDestination().toString()); buffers.transmit(buf); log.debug(flags.getName() + " : End transmit"); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/c7aa63aa768991e0ed504ea4399c4266b899b5f7/EEPRO100Core.java/buggy/net/src/driver/org/jnode/driver/net/eepro100/EEPRO100Core.java
|
|
setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY)));
|
{ setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); super.registerKeyboardAction(action, accelerator, JComponent.WHEN_IN_FOCUSED_WINDOW); }
|
protected void configurePropertiesFromAction(Action action) { super.configurePropertiesFromAction(action); if (! (this instanceof JMenu) && action != null) setAccelerator((KeyStroke) (action.getValue(Action.ACCELERATOR_KEY))); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
return accessibleContext;
|
return accessibleContext;
|
public AccessibleContext getAccessibleContext() { if (accessibleContext == null) accessibleContext = new AccessibleJMenuItem(); return accessibleContext; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
model.setArmed(true);
|
model.setArmed(true);
|
public void menuSelectionChanged(boolean changed) { Component parent = this.getParent(); if (changed) { model.setArmed(true); if (parent != null && parent instanceof JPopupMenu) ((JPopupMenu) parent).setSelected(this); } else { model.setArmed(false); if (parent != null && parent instanceof JPopupMenu) ((JPopupMenu) parent).getSelectionModel().clearSelection(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
model.setArmed(false);
|
model.setArmed(false);
|
public void menuSelectionChanged(boolean changed) { Component parent = this.getParent(); if (changed) { model.setArmed(true); if (parent != null && parent instanceof JPopupMenu) ((JPopupMenu) parent).setSelected(this); } else { model.setArmed(false); if (parent != null && parent instanceof JPopupMenu) ((JPopupMenu) parent).getSelectionModel().clearSelection(); } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
model.setRollover(true);
|
model.setRollover(true);
|
public void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager) { // Fire MenuDragMouseEvents if mouse is being dragged. boolean dragged = (event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0; if (dragged) processMenuDragMouseEvent(createMenuDragMouseEvent(event, path, manager)); switch (event.getID()) { case MouseEvent.MOUSE_CLICKED: break; case MouseEvent.MOUSE_ENTERED: if (isRolloverEnabled()) model.setRollover(true); break; case MouseEvent.MOUSE_EXITED: if (isRolloverEnabled()) model.setRollover(false); // for JMenu last element on the path is its popupMenu. // JMenu shouldn't me disarmed. if (! (path[path.length - 1] instanceof JPopupMenu) && ! dragged) setArmed(false); break; case MouseEvent.MOUSE_PRESSED: if ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0) { model.setArmed(true); model.setPressed(true); } break; case MouseEvent.MOUSE_RELEASED: break; case MouseEvent.MOUSE_MOVED: break; case MouseEvent.MOUSE_DRAGGED: break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
model.setRollover(false);
|
model.setRollover(false);
|
public void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager) { // Fire MenuDragMouseEvents if mouse is being dragged. boolean dragged = (event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0; if (dragged) processMenuDragMouseEvent(createMenuDragMouseEvent(event, path, manager)); switch (event.getID()) { case MouseEvent.MOUSE_CLICKED: break; case MouseEvent.MOUSE_ENTERED: if (isRolloverEnabled()) model.setRollover(true); break; case MouseEvent.MOUSE_EXITED: if (isRolloverEnabled()) model.setRollover(false); // for JMenu last element on the path is its popupMenu. // JMenu shouldn't me disarmed. if (! (path[path.length - 1] instanceof JPopupMenu) && ! dragged) setArmed(false); break; case MouseEvent.MOUSE_PRESSED: if ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0) { model.setArmed(true); model.setPressed(true); } break; case MouseEvent.MOUSE_RELEASED: break; case MouseEvent.MOUSE_MOVED: break; case MouseEvent.MOUSE_DRAGGED: break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
{ model.setArmed(true); model.setPressed(true); }
|
{ model.setArmed(true); model.setPressed(true); }
|
public void processMouseEvent(MouseEvent event, MenuElement[] path, MenuSelectionManager manager) { // Fire MenuDragMouseEvents if mouse is being dragged. boolean dragged = (event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0; if (dragged) processMenuDragMouseEvent(createMenuDragMouseEvent(event, path, manager)); switch (event.getID()) { case MouseEvent.MOUSE_CLICKED: break; case MouseEvent.MOUSE_ENTERED: if (isRolloverEnabled()) model.setRollover(true); break; case MouseEvent.MOUSE_EXITED: if (isRolloverEnabled()) model.setRollover(false); // for JMenu last element on the path is its popupMenu. // JMenu shouldn't me disarmed. if (! (path[path.length - 1] instanceof JPopupMenu) && ! dragged) setArmed(false); break; case MouseEvent.MOUSE_PRESSED: if ((event.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0) { model.setArmed(true); model.setPressed(true); } break; case MouseEvent.MOUSE_RELEASED: break; case MouseEvent.MOUSE_MOVED: break; case MouseEvent.MOUSE_DRAGGED: break; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
private void readObject(ObjectInputStream stream)
|
private void readObject(ObjectInputStream stream)
|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
super.setUI(ui);
|
super.setUI(ui);
|
public void setUI(MenuItemUI ui) { super.setUI(ui); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
invalidate();
|
invalidate();
|
public void updateUI() { MenuItemUI mi = ((MenuItemUI) UIManager.getUI(this)); setUI(mi); invalidate(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/5edad632205aa44aca51004923ae52d754cced11/JMenuItem.java/buggy/core/src/classpath/javax/javax/swing/JMenuItem.java
|
startOffset = -1; endOffset = -1;
|
public BranchElement(Element parent, AttributeSet attributes) { super(parent, attributes); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
|
int end = 0; if (getElementCount() == 0) end = getLength();
|
if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); }
|
public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
end = children[children.length - 1].getEndOffset(); return end;
|
endOffset = children[children.length - 1].getEndOffset(); return endOffset;
|
public int getEndOffset() { int end = 0; if (getElementCount() == 0) end = getLength(); // FIXME: That ain't correct, fix it. else end = children[children.length - 1].getEndOffset(); return end; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
int start = 0; if (getElementCount() == 0) start = 0;
|
if (children.length == 0) { if (startOffset == -1) throw new NullPointerException("BranchElement has no children."); }
|
public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
start = children[0].getStartOffset(); return start;
|
startOffset = children[0].getStartOffset(); return startOffset;
|
public int getStartOffset() { int start = 0; if (getElementCount() == 0) start = 0; // FIXME: That ain't correct, fix it. else start = children[0].getStartOffset(); return start; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
{
|
int len = content.length(); startDelta = 0; if (start > len) startDelta = start - len; endDelta = 0; if (end > len) endDelta = end - len;
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); }
|
startPos = createPosition(start - startDelta); endPos = createPosition(end - endDelta);
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
}
|
public LeafElement(Element parent, AttributeSet attributes, int start, int end) { super(parent, attributes); { try { if (parent != null) { startPos = parent.getDocument().createPosition(start); endPos = parent.getDocument().createPosition(end); } else { startPos = createPosition(start); endPos = createPosition(end); } } catch (BadLocationException ex) { AssertionError as; as = new AssertionError("BadLocationException thrown " + "here. start=" + start + ", end=" + end + ", length=" + getLength()); as.initCause(ex); throw as; } } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
|
return endPos.getOffset();
|
return endPos.getOffset() + endDelta;
|
public int getEndOffset() { return endPos.getOffset(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
return startPos.getOffset();
|
return startPos.getOffset() + startDelta;
|
public int getStartOffset() { return startPos.getOffset(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e8834e60eedea5a65712de1e0c0fa2d875e22b9c/AbstractDocument.java/clean/core/src/classpath/javax/javax/swing/text/AbstractDocument.java
|
String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCase("backingstore")) myScrollMode = BACKINGSTORE_SCROLL_MODE; else myScrollMode = BLIT_SCROLL_MODE; setScrollMode(myScrollMode);
|
setScrollMode(defaultScrollMode);
|
public JViewport() { setOpaque(true); String scrollModeProp = System.getProperty("gnu.javax.swing.JViewport.scrollMode", "BLIT"); int myScrollMode; if (scrollModeProp.equalsIgnoreCase("simple")) myScrollMode = SIMPLE_SCROLL_MODE; else if (scrollModeProp.equalsIgnoreCase("backingstore")) myScrollMode = BACKINGSTORE_SCROLL_MODE; else myScrollMode = BLIT_SCROLL_MODE; setScrollMode(myScrollMode); updateUI(); setLayout(createLayoutManager()); lastPaintPosition = new Point(); cachedBlitFrom = new Point(); cachedBlitTo = new Point(); cachedBlitSize = new Dimension(); cachedBlitPaint = new Rectangle(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/39b6fa6b2c83d98e97f872ed8ae18d9f4803884d/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
return new Insets(0,0,0,0);
|
return new Insets(0, 0, 0, 0);
|
public final Insets getInsets() { return new Insets(0,0,0,0); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/39b6fa6b2c83d98e97f872ed8ae18d9f4803884d/JViewport.java/clean/core/src/classpath/javax/javax/swing/JViewport.java
|
bad.minor = Minor.ClassCast;
|
public static ServantLocator narrow(org.omg.CORBA.Object obj) { try { return (ServantLocator) obj; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); throw bad; } }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServantLocatorHelper.java/clean/core/src/classpath/org/org/omg/PortableServer/ServantLocatorHelper.java
|
|
throw new MARSHAL();
|
MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m;
|
public static ServantLocator read(InputStream input) { throw new MARSHAL(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServantLocatorHelper.java/clean/core/src/classpath/org/org/omg/PortableServer/ServantLocatorHelper.java
|
throw new MARSHAL();
|
MARSHAL m = new MARSHAL("Inappropriate"); m.minor = Minor.Inappropriate; throw m;
|
public static void write(OutputStream output, ServantLocator value) { throw new MARSHAL(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/44e3ea509d80974dab547c4d1cf8c070d32bac86/ServantLocatorHelper.java/clean/core/src/classpath/org/org/omg/PortableServer/ServantLocatorHelper.java
|
attribHash.put("datatype", new XMLAttribute(null, Constants.OBJECT_TYPE));
|
attribHash.put("datatype", new XMLAttribute(null, Constants.STRING_TYPE));
|
private void init() { classXDFNodeName = "parameter"; // order matters! these are in *reverse* order of their // occurence in the XDF DTD attribOrder.add(0,"noteList"); attribOrder.add(0,"valueList"); attribOrder.add(0,"units"); attribOrder.add(0,"datatype"); attribOrder.add(0,"paramIdRef"); attribOrder.add(0,"paramId"); attribOrder.add(0,"description"); attribOrder.add(0,"name"); //set up the attribute hashtable key with the default initial value attribHash.put("noteList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("valueList", new XMLAttribute(Collections.synchronizedList(new ArrayList()), Constants.LIST_TYPE)); attribHash.put("units", new XMLAttribute(null, Constants.OBJECT_TYPE)); attribHash.put("datatype", new XMLAttribute(null, Constants.OBJECT_TYPE)); attribHash.put("paramIdRef", new XMLAttribute(null, Constants.STRING_TYPE)); //double check k.z. attribHash.put("paramId", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("description", new XMLAttribute(null, Constants.STRING_TYPE)); attribHash.put("name", new XMLAttribute(null, Constants.STRING_TYPE)); };
|
4483 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/4483/6f5fbb98cf3899b28300b017463e22450732c433/Parameter.java/clean/src/gov/nasa/gsfc/adc/xdf/Parameter.java
|
public DoubleItem(int kind, int offsetToFP, Register lsb, Register msb, double value) { super(kind, offsetToFP, lsb, msb); this.value = value;
|
DoubleItem(ItemFactory factory) { super(factory);
|
public DoubleItem(int kind, int offsetToFP, Register lsb, Register msb, double value) { super(kind, offsetToFP, lsb, msb); this.value = value; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e304bedac9ab86f88bdb27ffd782a9777505c449/DoubleItem.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java
|
return createConst(getValue());
|
return factory.createDConst(getValue());
|
protected DoubleWordItem cloneConstant() { return createConst(getValue()); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/e304bedac9ab86f88bdb27ffd782a9777505c449/DoubleItem.java/buggy/core/src/core/org/jnode/vm/x86/compiler/l1a/DoubleItem.java
|
public static ComponentUI createUI(JComponent c) {
|
public static ComponentUI createUI(JComponent c) {
|
public static ComponentUI createUI(JComponent c) { return new BasicCheckBoxUI(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/BasicCheckBoxUI.java/buggy/core/src/classpath/javax/javax/swing/plaf/basic/BasicCheckBoxUI.java
|
setPropertiesFromAttributes();
|
valid = false;
|
public LabelView(Element element) { super(element); setPropertiesFromAttributes(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
setPropertiesFromAttributes();
|
valid = false; super.changedUpdate(e, a, vf);
|
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { setPropertiesFromAttributes(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
if (! valid) setPropertiesFromAttributes();
|
public Color getBackground() { return background; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
if (! valid) setPropertiesFromAttributes();
|
public Font getFont() { return font; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
return getContainer().getGraphics().getFontMetrics(font);
|
if (! valid) setPropertiesFromAttributes(); Container c = getContainer(); FontMetrics fm; if (c != null) fm = c.getFontMetrics(font); else fm = Toolkit.getDefaultToolkit().getFontMetrics(font); return fm;
|
protected FontMetrics getFontMetrics() { return getContainer().getGraphics().getFontMetrics(font); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
if (! valid) setPropertiesFromAttributes();
|
public Color getForeground() { return foreground; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
if (! valid) setPropertiesFromAttributes();
|
public boolean isStrikeThrough() { return strikeThrough; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
if (! valid) setPropertiesFromAttributes();
|
public boolean isSubscript() { return subscript; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
if (! valid) setPropertiesFromAttributes();
|
public boolean isSuperscript() { return superscript; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
if (! valid) setPropertiesFromAttributes();
|
public boolean isUnderline() { return underline; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
|
Element el = getElement(); AttributeSet atts = el.getAttributes(); background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts);
|
AttributeSet atts = getAttributes(); setStrikeThrough(StyleConstants.isStrikeThrough(atts)); setSubscript(StyleConstants.isSubscript(atts)); setSuperscript(StyleConstants.isSuperscript(atts)); setUnderline(StyleConstants.isUnderline(atts));
|
protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component instead, which is what we get // when background == null anyway. background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts); // Determine the font. String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size);
|
Document d = getDocument(); if (d instanceof StyledDocument) { StyledDocument doc = (StyledDocument) d; font = doc.getFont(atts); if (atts.isDefined(StyleConstants.Background)) background = doc.getBackground(atts); else background = null; foreground = doc.getForeground(atts); } valid = true;
|
protected void setPropertiesFromAttributes() { Element el = getElement(); AttributeSet atts = el.getAttributes(); // We cannot use StyleConstants.getBackground() here, because that returns // BLACK as default (when background == null). What we need is the // background setting of the text component instead, which is what we get // when background == null anyway. background = (Color) atts.getAttribute(StyleConstants.Background); foreground = StyleConstants.getForeground(atts); strikeThrough = StyleConstants.isStrikeThrough(atts); subscript = StyleConstants.isSubscript(atts); superscript = StyleConstants.isSuperscript(atts); underline = StyleConstants.isUnderline(atts); // Determine the font. String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; font = new Font(family, style, size); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/ff4d557efcee4a2c3a25a9cac2252bc626fb10fe/LabelView.java/clean/core/src/classpath/javax/javax/swing/text/LabelView.java
|
{
|
{
|
public AttributeSet getAttributes() { return getElement().getAttributes(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
|
}
|
}
|
public AttributeSet getAttributes() { return getElement().getAttributes(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/3826e72d9ebe31a854c4d01d6c8f1ec65a8d80fe/View.java/buggy/core/src/classpath/javax/javax/swing/text/View.java
|
public BasicPasswordFieldUI() { }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/963ae61676e8c35a9e0998e0b7de1f942db82a26/BasicPasswordFieldUI.java/clean/core/src/classpath/javax/javax/swing/plaf/basic/BasicPasswordFieldUI.java
|
||
public final void restoreScreen() throws IOException { int which = 0; ScreenPlanes planes = screen52.planes; try { log.debug("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows, cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0; y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) {// screen52.screen[y].setCharAndAttr(screen52.screen[y]// .getChar(), b, true); planes.setScreenCharAndAttr(y, planes.getChar(y), b, true); la = b; } else { //LDC - 12/02/2003 - Check to see if it is an displayable // character. If not, // do not convert the character. // The characters on screen are in unicode char ch = (char) b; if (isDataEBCDIC(b)) ch = ebcdic2uni(b);// screen52.screen[y].setCharAndAttr(// //getASCIIChar(b),// ch, la, false); planes.setScreenCharAndAttr(y, ch, la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff; log.debug("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt) { sf.setMDT(); screen52.getScreenFields().setMasterMDT(); } if (log.isDebugEnabled()) { log.debug("/nRestored "); log.debug(sf.toString()); } x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true, screen52.getRow(pos), screen52 .getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { log.warn("error restoring screen " + which + " with " + e.getMessage()); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/9211cfab1f37086bbce829089c9aac4ad469fc4e/tnvt.java/clean/tn5250j/src/org/tn5250j/framework/tn5250/tnvt.java
|
||
while (fLen-- > 0) { planes.setScreenFieldAttr(fPos++,ffw1); }
|
public final void restoreScreen() throws IOException { int which = 0; ScreenPlanes planes = screen52.planes; try { log.debug("Restore "); bk.getNextByte(); bk.getNextByte(); int rows = bk.getNextByte() & 0xff; int cols = bk.getNextByte() & 0xff; int pos = bk.getNextByte() << 8 & 0xff00; pos |= bk.getNextByte() & 0xff; int hPos = bk.getNextByte() << 8 & 0xff00; hPos |= bk.getNextByte() & 0xff; if (rows != screen52.getRows()) screen52.setRowsCols(rows, cols); screen52.clearAll(); // initialize what we currenty have int b = 32; int la = 32; int len = rows * cols; for (int y = 0; y < len; y++) { b = bk.getNextByte(); if (isAttribute(b)) {// screen52.screen[y].setCharAndAttr(screen52.screen[y]// .getChar(), b, true); planes.setScreenCharAndAttr(y, planes.getChar(y), b, true); la = b; } else { //LDC - 12/02/2003 - Check to see if it is an displayable // character. If not, // do not convert the character. // The characters on screen are in unicode char ch = (char) b; if (isDataEBCDIC(b)) ch = ebcdic2uni(b);// screen52.screen[y].setCharAndAttr(// //getASCIIChar(b),// ch, la, false); planes.setScreenCharAndAttr(y, ch, la, false); } } int numFields = bk.getNextByte() << 8 & 0xff00; numFields |= bk.getNextByte() & 0xff; log.debug("number of fields " + numFields); if (numFields > 0) { int x = 0; int attr = 0; int fPos = 0; int fLen = 0; int ffw1 = 0; int ffw2 = 0; int fcw1 = 0; int fcw2 = 0; boolean mdt = false; ScreenField sf = null; while (x < numFields) { attr = bk.getNextByte(); fPos = bk.getNextByte() << 8 & 0xff00; fPos |= bk.getNextByte() & 0xff; if (bk.getNextByte() == 1) mdt = true; else mdt = false; fLen = bk.getNextByte() << 8 & 0xff00; fLen |= bk.getNextByte() & 0xff; ffw1 = bk.getNextByte(); ffw2 = bk.getNextByte(); fcw1 = bk.getNextByte(); fcw2 = bk.getNextByte(); sf = screen52.getScreenFields().setField(attr, screen52.getRow(fPos), screen52.getCol(fPos), fLen, ffw1, ffw2, fcw1, fcw2); if (mdt) { sf.setMDT(); screen52.getScreenFields().setMasterMDT(); } if (log.isDebugEnabled()) { log.debug("/nRestored "); log.debug(sf.toString()); } x++; } } screen52.restoreScreen(); // display the screen screen52.setPendingInsert(true, screen52.getRow(pos), screen52 .getCol(pos)); screen52.goto_XY(pos); screen52.isInField(); if (screen52.isUsingGuiInterface()) screen52.drawFields(); } catch (Exception e) { log.warn("error restoring screen " + which + " with " + e.getMessage()); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/9211cfab1f37086bbce829089c9aac4ad469fc4e/tnvt.java/clean/tn5250j/src/org/tn5250j/framework/tn5250/tnvt.java
|
|
float span = 0;
|
public float getPreferredSpan(int axis) { if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException(); // make sure we have the metrics updateMetrics(); float span = 0; Element el = getElement(); switch (axis) { case X_AXIS: span = determineMaxLineLength(); case Y_AXIS: default: span = metrics.getHeight() * el.getElementCount(); break; } return span; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
|
public float getPreferredSpan(int axis) { if (axis != X_AXIS && axis != Y_AXIS) throw new IllegalArgumentException(); // make sure we have the metrics updateMetrics(); float span = 0; Element el = getElement(); switch (axis) { case X_AXIS: span = determineMaxLineLength(); case Y_AXIS: default: span = metrics.getHeight() * el.getElementCount(); break; } return span; }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
||
int line = getElement().getElementIndex(changes.getOffset());
|
int line = el.getElementIndex(changes.getOffset()); if (changes.getType() == DocumentEvent.EventType.REMOVE && el.getElement(line) == longestLine) { maxLineLength = -1; if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, false); }
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
||
determineMaxLineLength();
|
if (determineMaxLineLength() != alloc.width) preferenceChanged(this, true, removed.length != newElements.length);
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
boolean widthChanged = oldMaxLineLength != maxLineLength; boolean heightChanged = removed.length != newElements.length; if (widthChanged || heightChanged) preferenceChanged(this, widthChanged, heightChanged);
|
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ex); throw ae; } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
|
int lineClicked = (int) (y - rec.y) / metrics.getHeight(); if (lineClicked >= root.getElementCount()) return getEndOffset() - 1;
|
int lineClicked = Math.min(Math.max((int) (y - rec.y) / metrics.getHeight(), 0), root.getElementCount() - 1);
|
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position int lineClicked = (int) (y - rec.y) / metrics.getHeight(); if (lineClicked >= root.getElementCount()) return getEndOffset() - 1; Element line = root.getElement(lineClicked); Segment s = getLineBuffer(); int start = line.getStartOffset(); // We don't want the \n at the end of the line. int end = line.getEndOffset() - 1; try { doc.getText(start, end - start, s); } catch (BadLocationException ble) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ble); throw ae; } int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start); return Math.max (0, pos); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { Rectangle rec = a.getBounds(); Document doc = getDocument(); Element root = doc.getDefaultRootElement(); // PlainView doesn't support line-wrapping so we can find out which // Element was clicked on just by the y-position int lineClicked = (int) (y - rec.y) / metrics.getHeight(); if (lineClicked >= root.getElementCount()) return getEndOffset() - 1; Element line = root.getElement(lineClicked); Segment s = getLineBuffer(); int start = line.getStartOffset(); // We don't want the \n at the end of the line. int end = line.getEndOffset() - 1; try { doc.getText(start, end - start, s); } catch (BadLocationException ble) { AssertionError ae = new AssertionError("Unexpected bad location"); ae.initCause(ble); throw ae; } int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start); return Math.max (0, pos); }
|
1056 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1056/70a2876c99036463feada99a37295405c146f49b/PlainView.java/buggy/core/src/classpath/javax/javax/swing/text/PlainView.java
|
||
if (SwingUtilities.isRightMouseButton(e)) { return; }
|
private void jbInit() throws Exception { this.setLayout(borderLayout1);// this.setOpaque(false);// setDoubleBuffered(true); s.setOpaque(false); s.setDoubleBuffered(false); session.setGUI((SessionGUI)this);// screen = new Screen5250(this,sesConfig); screen = session.getScreen(); this.addComponentListener(this); if (bi == null) { checkOffScreenImage(); } setRubberBand(new TNRubberBand(this)); keyHandler = KeyboardHandler.getKeyboardHandlerInstance(session); if (!sesConfig.isPropertyExists("width") || !sesConfig.isPropertyExists("height")) // set the initialize size this.setSize(bi.getPreferredSize()); else { this.setSize(sesConfig.getIntegerProperty("width"), sesConfig.getIntegerProperty("height")); } addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { /** @todo check for popup trigger on linux * */// if (e.isPopupTrigger()) { // using SwingUtilities because popuptrigger does not work on linux if (SwingUtilities.isRightMouseButton(e)) { actionPopup(e); } } public void mouseReleased(MouseEvent e) {// System.out.println("Mouse Released"); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { int pos = bi.getPosFromView(e.getX(), e.getY()); if (log.isDebugEnabled()) { log.debug((screen.getRow(pos)) + "," + (screen.getCol(pos))); log.debug(e.getX() + "," + e.getY() + "," + bi.columnWidth + "," + bi.rowHeight); } boolean moved = screen.moveCursor(e, pos); // this is a note to not execute this code here when we // implement the remain after edit function option. if (moved) { if (rubberband.isAreaSelected()) { rubberband.reset(); } screen.repaintScreen(); } getFocusForMe(); } } }); scroller = new SessionScroller().getScrollerInstance((SessionGUI)this); if (!sesConfig.getStringProperty("mouseWheel").equals("Yes")) scroller.removeMouseWheelListener((SessionGUI)this); log.debug("Initializing macros"); macros = new Macronizer(); Macronizer.init(); keyPad.addActionListener(this); if (sesConfig.getStringProperty("keypad").equals("Yes")) keyPad.setVisible(true); else keyPad.setVisible(false); // Warning do not change the the order of the adding of keypad and // the screen. This will cause resizing problems because it will // resize the screen first and during the resize we need to calculate // the bouding area based on the height of the keyPad. // See resizeMe() and getDrawingBounds() this.add(keyPad,BorderLayout.SOUTH); this.add(s,BorderLayout.CENTER); this.requestFocus(); jumpEvent = new SessionJumpEvent(this); // check if double click sends enter if (sesConfig.getStringProperty("doubleClick").equals("Yes")) doubleClick = true; else doubleClick = false;// DropTargetAdapter dta = new DropTargetAdapter() {// public void drop(DropTargetDropEvent dtde) {// Transferable tr = dtde.getTransferable();// dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);// DataFlavor[] dfs = dtde.getCurrentDataFlavors();// if(tr.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {// try {// log.debug("dtde drop it2 ");//// java.util.List fileList =// (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor);// // implementation for when we are able to process a list// // of files.// // Iterator iterator = fileList.iterator();// // if (iterator.hasNext()) {// // File file = (File)iterator.next();// // }// java.io.File file = (java.io.File)fileList.get(0);// System.out.println(file.toString());// dtde.dropComplete(true);// doTransfer(file);// return;// }// catch (UnsupportedFlavorException ufe) {// log.info("importData: unsupported data flavor");// }// catch (java.io.IOException ieo) {// log.warn("importData: I/O exception");// }// catch (Exception ex) {// log.warn(""+ex.getMessage());// }// finally {// dtde.dropComplete(false);// }// }// }// };// DropTarget dt = new DropTarget((JPanel)this,dta);//// setDropTarget(dt); }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/446c691d87b77c1be3b434626845a4988e42aea7/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
|
|
if (SwingUtilities.isRightMouseButton(e)) { return; }
|
public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 & doubleClick) { screen.sendKeys("[enter]"); } else { int pos = bi.getPosFromView(e.getX(), e.getY()); if (log.isDebugEnabled()) { log.debug((screen.getRow(pos)) + "," + (screen.getCol(pos))); log.debug(e.getX() + "," + e.getY() + "," + bi.columnWidth + "," + bi.rowHeight); } boolean moved = screen.moveCursor(e, pos); // this is a note to not execute this code here when we // implement the remain after edit function option. if (moved) { if (rubberband.isAreaSelected()) { rubberband.reset(); } screen.repaintScreen(); } getFocusForMe(); } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/446c691d87b77c1be3b434626845a4988e42aea7/Gui5250.java/clean/tn5250j/src/org/tn5250j/Gui5250.java
|
|
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try {// waitingForInput = false; byte[] abyte0 = readIncoming(); loadStream(abyte0, 0); } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true;// vt.disconnect(); } catch (IOException ioe) {// System.out.println(ioe.getMessage());// invited = true; if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage());// invited = true; if (me.isInterrupted()) done = true; } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/DataStreamProducer.java/clean/tn5250j/src/org/tn5250j/DataStreamProducer.java
|
||
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try {// waitingForInput = false; byte[] abyte0 = readIncoming(); loadStream(abyte0, 0); } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true;// vt.disconnect(); } catch (IOException ioe) {// System.out.println(ioe.getMessage());// invited = true; if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage());// invited = true; if (me.isInterrupted()) done = true; } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/DataStreamProducer.java/clean/tn5250j/src/org/tn5250j/DataStreamProducer.java
|
||
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try {// waitingForInput = false; byte[] abyte0 = readIncoming(); loadStream(abyte0, 0); } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true;// vt.disconnect(); } catch (IOException ioe) {// System.out.println(ioe.getMessage());// invited = true; if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage());// invited = true; if (me.isInterrupted()) done = true; } } }
|
1179 /local/tlutelli/issta_data/temp/all_java0context/java/2006_temp/2006/1179/99debc0e39981c309029bd7389a7d7c50837d87b/DataStreamProducer.java/clean/tn5250j/src/org/tn5250j/DataStreamProducer.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.