bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
getFont(){ if (font != null) return font; if (parent != null) return parent.getFont (); return null;}
|
getFont(){ if (font != null) return font; if (parent != null) return parent.getFont (); return null;}
| 6,667
|
getName(){ return(name);}
|
getName(){ return(name);}
| 6,668
|
getTreeLock(){ return(tree_lock);}
|
getTreeLock(){ return(tree_lock);}
| 6,669
|
postEvent(Event event){ // This is overridden by subclasses that support events. return false;}
|
postEvent(Event event){ // This is overridden by subclasses that support events. return false;}
| 6,670
|
setFont(Font font){ this.font = font;}
|
setFont(Font font){ this.font = font;}
| 6,671
|
setName(String name){ this.name = name; nameExplicitlySet = true;}
|
setName(String name){ this.name = name; nameExplicitlySet = true;}
| 6,672
|
setParent(MenuContainer parent){ this.parent = parent;}
|
setParent(MenuContainer parent){ this.parent = parent;}
| 6,673
|
setTreeLock(Object tree_lock){ this.tree_lock = tree_lock;}
|
setTreeLock(Object tree_lock){ this.tree_lock = tree_lock;}
| 6,674
|
toString(){ return this.getClass().getName() + "[" + paramString() + "]";}
|
toString(){ return this.getClass().getName() + "[" + paramString() + "]";}
| 6,675
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { return null; }
|
public Accessible getAccessibleChild(int value0) throws NotImplementedException { Component[] children = getMenuComponents(); int count = 0; Accessible found = null; for (int i = 0; i < children.length; i++) { if (children[i] instanceof Accessible) { if (count == index) { found = (Accessible) children[i]; break; } count++; } } return found; }
| 6,678
|
public int getAccessibleChildrenCount() throws NotImplementedException { return 0; }
|
public int getAccessibleChildrenCount() throws NotImplementedException { Component[] children = getMenuComponents(); int count = 0; for (int i = 0; i < children.length; i++) { if (children[i] instanceof Accessible) count++; } return count; }
| 6,679
|
public int getAccessibleSelectionCount() throws NotImplementedException { return 0; }
|
public int getAccessibleSelectionCount() throws NotImplementedException { int count = 0; MenuSelectionManager msm = MenuSelectionManager.defaultManager(); MenuElement[] me = msm.getSelectedPath(); if (me != null) { for (int i = 0; i < me.length; i++) { if (me[i] == JMenu.this) { if (i + 1 < me.length) { count = 1; break; } } } } return count; }
| 6,680
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { return false; }
|
public boolean isAccessibleChildSelected(int value0) throws NotImplementedException { boolean selected = false; MenuSelectionManager msm = MenuSelectionManager.defaultManager(); MenuElement[] me = msm.getSelectedPath(); if (me != null) { Accessible toBeFound = getAccessibleChild(index); for (int i = 0; i < me.length; i++) { if (me[i] == toBeFound) { selected = true; break; } } } return selected; }
| 6,681
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); int pixelWidth = 0; int pos = 0; int len = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX; }
|
public static final int drawTabbedText(Segment s, int x, int y, Graphics g, TabExpander e, int startOffset) { // This buffers the chars to be drawn. char[] buffer = s.array; // The current x and y pixel coordinates. int pixelX = x; int pixelY = y; // The font metrics of the current selected font. FontMetrics metrics = g.getFontMetrics(); int ascent = metrics.getAscent(); int pixelWidth = 0; int pos = s.offset; int len = 0; for (int offset = s.offset; offset < (s.offset + s.count); ++offset) { char c = buffer[offset]; if (c == '\t' || c == '\n') { if (len > 0) { g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); pixelX += pixelWidth; pixelWidth = 0; } pos = offset+1; len = 0; } switch (c) { case '\t': // In case we have a tab, we just 'jump' over the tab. // When we have no tab expander we just use the width of ' '. if (e != null) pixelX = (int) e.nextTabStop((float) pixelX, startOffset + offset - s.offset); else pixelX += metrics.charWidth(' '); break; case '\n': // In case we have a newline, we must jump to the next line. pixelY += metrics.getHeight(); pixelX = x; break; default: ++len; pixelWidth += metrics.charWidth(buffer[offset]); break; } } if (len > 0) g.drawChars(buffer, pos, len, pixelX, pixelY + ascent); return pixelX; }
| 6,683
|
public synchronized void addNotify() { if (peer != null) { // This choice of toolkit seems unsatisfying, but I'm not sure // what else to do. peer = getToolkit().createCheckboxMenuItem(this); } super.addNotify(); }
|
public synchronized void addNotify() { if (peer != null) { // This choice of toolkit seems unsatisfying, but I'm not sure // what else to do. peer = getToolkit().createCheckboxMenuItem(this); } super.addNotify(); }
| 6,684
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
|
void dispatchEventImpl(AWTEvent e) { if (e.id <= ItemEvent.ITEM_LAST && e.id >= ItemEvent.ITEM_FIRST && (item_listeners != null || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)) processEvent(e); else super.dispatchEventImpl(e); }
| 6,685
|
public Object[] getSelectedObjects() { if (state == false) return (null); Object[] obj = new Object[1]; obj[0] = getLabel(); return (obj); }
|
getSelectedObjects() { if (state == false) return (null); Object[] obj = new Object[1]; obj[0] = getLabel(); return (obj); }
| 6,686
|
public boolean getState() { return (state); }
|
public boolean getState() { return (state); }
| 6,687
|
public String paramString() { return ("label=" + getLabel() + ",state=" + state + "," + super.paramString()); }
|
public String paramString() { return ("label=" + getLabel() + ",state=" + state + "," + super.paramString()); }
| 6,688
|
protected void processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
|
processEvent(AWTEvent event) { if (event instanceof ItemEvent) processItemEvent((ItemEvent) event); else super.processEvent(event); }
| 6,689
|
protected void processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); }
|
processItemEvent(ItemEvent event) { if (item_listeners != null) item_listeners.itemStateChanged(event); }
| 6,690
|
public synchronized void removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); }
|
removeItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.remove(item_listeners, listener); }
| 6,691
|
private void doExecute() throws BuildException, ClassNotFoundException, IllegalAccessException, IOException { final VmArchitecture arch = getArchitecture(); final int slotSize = arch.getReferenceSize(); VmSystemClassLoader cl = new VmSystemClassLoader(classesURL, arch); final Vm vm = new Vm(arch, null, cl.getStatics(), false); vm.toString(); // Just to avoid compiler warnings VmType.initializeForBootImage(cl); long lastModified = 0; FileWriter fw = new FileWriter(destFile); PrintWriter out = new PrintWriter(fw); out.println("; " + destFile.getPath()); out.println("; THIS file has been generated automatically on " + new Date()); out.println(); for (Iterator j = classes.iterator(); j.hasNext();) { final ClassName cn = (ClassName) j.next(); final URL classUrl = cn.getURL(classesURL); lastModified = Math.max(lastModified, classUrl.openConnection().getLastModified()); out.println("; Constants for " + cn.getClassName()); if (cn.isStatic()) { Class cls = Class.forName(cn.getClassName()); Field fields[] = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; if (Modifier.isStatic(f.getModifiers()) && Modifier.isPublic(f.getModifiers())) { Object value = f.get(null); if (value instanceof Number) { String cname = cls.getName(); int idx = cname.lastIndexOf('.'); if (idx > 0) { cname = cname.substring(idx + 1); } String name = cname + "_" + f.getName(); out.println(name + " equ " + value); } } } out.println(); } else { out.println("; VmClass: " + cn.getClassName()); VmType vmClass = cl.loadClass(cn.getClassName(), true); vmClass.link(); String cname = vmClass.getName().replace('/', '.'); int idx = cname.lastIndexOf('.'); if (idx > 0) { cname = cname.substring(idx + 1); } int cnt = vmClass.getNoDeclaredFields(); for (int i = 0; i < cnt; i++) { final VmField f = vmClass.getDeclaredField(i); if (!f.isStatic()) { final VmInstanceField instF = (VmInstanceField) f; String name = cname + "_" + f.getName().toUpperCase() + "_OFFSET"; out.println(name + " equ " + (instF.getOffset() / slotSize)); } } // The size if (vmClass instanceof VmNormalClass) { final VmNormalClass cls = (VmNormalClass) vmClass; out.println(cname + "_SIZE equ " + cls.getObjectSize()); } // out.println(); } } out.flush(); fw.flush(); out.close(); fw.close(); destFile.setLastModified(lastModified); }
|
private void doExecute() throws BuildException, ClassNotFoundException, IllegalAccessException, IOException { final VmArchitecture arch = getArchitecture(); final int slotSize = arch.getReferenceSize(); VmSystemClassLoader cl = new VmSystemClassLoader(classesURL, arch); final Vm vm = new Vm("?", arch, null, cl.getStatics(), false); vm.toString(); // Just to avoid compiler warnings VmType.initializeForBootImage(cl); long lastModified = 0; FileWriter fw = new FileWriter(destFile); PrintWriter out = new PrintWriter(fw); out.println("; " + destFile.getPath()); out.println("; THIS file has been generated automatically on " + new Date()); out.println(); for (Iterator j = classes.iterator(); j.hasNext();) { final ClassName cn = (ClassName) j.next(); final URL classUrl = cn.getURL(classesURL); lastModified = Math.max(lastModified, classUrl.openConnection().getLastModified()); out.println("; Constants for " + cn.getClassName()); if (cn.isStatic()) { Class cls = Class.forName(cn.getClassName()); Field fields[] = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; if (Modifier.isStatic(f.getModifiers()) && Modifier.isPublic(f.getModifiers())) { Object value = f.get(null); if (value instanceof Number) { String cname = cls.getName(); int idx = cname.lastIndexOf('.'); if (idx > 0) { cname = cname.substring(idx + 1); } String name = cname + "_" + f.getName(); out.println(name + " equ " + value); } } } out.println(); } else { out.println("; VmClass: " + cn.getClassName()); VmType vmClass = cl.loadClass(cn.getClassName(), true); vmClass.link(); String cname = vmClass.getName().replace('/', '.'); int idx = cname.lastIndexOf('.'); if (idx > 0) { cname = cname.substring(idx + 1); } int cnt = vmClass.getNoDeclaredFields(); for (int i = 0; i < cnt; i++) { final VmField f = vmClass.getDeclaredField(i); if (!f.isStatic()) { final VmInstanceField instF = (VmInstanceField) f; String name = cname + "_" + f.getName().toUpperCase() + "_OFFSET"; out.println(name + " equ " + (instF.getOffset() / slotSize)); } } // The size if (vmClass instanceof VmNormalClass) { final VmNormalClass cls = (VmNormalClass) vmClass; out.println(cname + "_SIZE equ " + cls.getObjectSize()); } // out.println(); } } out.flush(); fw.flush(); out.close(); fw.close(); destFile.setLastModified(lastModified); }
| 6,692
|
public void actionPerformed(ActionEvent e) { doConnections(); }
|
public void actionPerformed(ActionEvent e) { doConnections(); }
| 6,694
|
public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); }
|
public void actionPerformed(ActionEvent e) { changeConnection(); getFocusForMe(); }
| 6,695
|
public void actionPerformed(ActionEvent e) { closeSession(); }
|
public void actionPerformed(ActionEvent e) { closeSession(); }
| 6,696
|
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x);// char ac = vt.getASCIIChar(x); char ac = vt.ebcdic2uni(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; JFrame parent = (JFrame)SwingUtilities.getRoot(this); result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; if (((String)hm.getSelectedValue()).length() > 7) k += ((String)hm.getSelectedValue()).charAt(9); else k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
|
private void showHexMap() { JPanel srp = new JPanel(); srp.setLayout(new BorderLayout()); DefaultListModel listModel = new DefaultListModel(); StringBuffer sb = new StringBuffer(); // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = vt.ebcdic2uni(x);// char ac = vt.getASCIIChar(x); char ac = vt.ebcdic2uni(x); if (!Character.isISOControl(ac)) { sb.setLength(0); if (Integer.toHexString(ac).length() == 1){ sb.append("0x0" + Integer.toHexString(ac).toUpperCase()); } else { sb.append("0x" + Integer.toHexString(ac).toUpperCase()); } sb.append(" - " + c); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); listModel.addElement(keyc.getSourceString()); } //Create the list and put it in a scroll pane JList hm = new JList(listModel); hm.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); hm.setSelectedIndex(0); JScrollPane listScrollPane = new JScrollPane(hm); listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); listScrollPane.setSize(40,100); srp.add(listScrollPane,BorderLayout.CENTER); Object[] message = new Object[1]; message[0] = srp; String[] options = {LangTool.getString("hm.optInsert"), LangTool.getString("hm.optCancel")}; int result = 0; JFrame parent = (JFrame)SwingUtilities.getRoot(this); result = JOptionPane.showOptionDialog( parent, // the parent that the dialog blocks message, // the dialog message array LangTool.getString("hm.title"), // the title of the dialog window JOptionPane.DEFAULT_OPTION, // option type JOptionPane.INFORMATION_MESSAGE, // message type null, // optional icon, use null to use the default icon options, // options string array, will be made into buttons// options[0] // option that should be made into a default button ); switch(result) { case 0: // Insert character String k = ""; if (((String)hm.getSelectedValue()).length() > 8) k += ((String)hm.getSelectedValue()).charAt(9); else k += ((String)hm.getSelectedValue()).charAt(7); screen.sendKeys(k); break; case 1: // Cancel// System.out.println("Cancel"); break; default: break; } }
| 6,697
|
StackTraceElement(String fileName, int lineNumber, String className, String methodName, boolean isNative) { this.fileName = fileName; this.lineNumber = lineNumber; this.className = className; this.methodName = methodName; this.isNative = isNative; }
|
StackTraceElement(String fileName, int lineNumber, String className, String methodName, boolean isNative) { this.fileName = fileName; this.lineNumber = lineNumber; this.declaringClass = className; this.methodName = methodName; this.isNative = isNative; }
| 6,698
|
public boolean equals(Object o) { if (! (o instanceof StackTraceElement)) return false; StackTraceElement e = (StackTraceElement) o; return equals(fileName, e.fileName) && lineNumber == e.lineNumber && equals(className, e.className) && equals(methodName, e.methodName); }
|
public boolean equals(Object o) { if (! (o instanceof StackTraceElement)) return false; StackTraceElement e = (StackTraceElement) o; return equals(fileName, e.fileName) && lineNumber == e.lineNumber && equals(declaringClass, e.declaringClass) && equals(methodName, e.methodName); }
| 6,699
|
public String getClassName() { return className; }
|
public String getClassName() { return declaringClass; }
| 6,700
|
public int hashCode() { return hashCode(fileName) ^ lineNumber ^ hashCode(className) ^ hashCode(methodName); }
|
public int hashCode() { return hashCode(fileName) ^ lineNumber ^ hashCode(declaringClass) ^ hashCode(methodName); }
| 6,701
|
public String toString() { StringBuffer sb = new StringBuffer(); if (className != null) { sb.append(className); if (methodName != null) sb.append('.'); } if (methodName != null) sb.append(methodName); sb.append(" ("); if (fileName != null) sb.append(fileName); else sb.append(isNative ? "Native Method" : "Unknown Source"); if (lineNumber >= 0) sb.append(':').append(lineNumber); sb.append(')'); return sb.toString(); }
|
public String toString() { StringBuffer sb = new StringBuffer(); if (declaringClass != null) { sb.append(className); if (methodName != null) sb.append('.'); } if (methodName != null) sb.append(methodName); sb.append(" ("); if (fileName != null) sb.append(fileName); else sb.append(isNative ? "Native Method" : "Unknown Source"); if (lineNumber >= 0) sb.append(':').append(lineNumber); sb.append(')'); return sb.toString(); }
| 6,702
|
public String toString() { StringBuffer sb = new StringBuffer(); if (className != null) { sb.append(className); if (methodName != null) sb.append('.'); } if (methodName != null) sb.append(methodName); sb.append(" ("); if (fileName != null) sb.append(fileName); else sb.append(isNative ? "Native Method" : "Unknown Source"); if (lineNumber >= 0) sb.append(':').append(lineNumber); sb.append(')'); return sb.toString(); }
|
public String toString() { StringBuffer sb = new StringBuffer(); if (className != null) { sb.append(declaringClass); if (methodName != null) sb.append('.'); } if (methodName != null) sb.append(methodName); sb.append(" ("); if (fileName != null) sb.append(fileName); else sb.append(isNative ? "Native Method" : "Unknown Source"); if (lineNumber >= 0) sb.append(':').append(lineNumber); sb.append(')'); return sb.toString(); }
| 6,703
|
public int read() throws IOException { byte buf[] = new byte [1]; int bytes_read = read(buf, 0, 1); if (bytes_read == -1) return -1; return buf[0] & 0xFF; }
|
public int read() throws IOException { byte buf[] = new byte [1]; int bytes_read = read(buf, 0, 1); if (bytes_read == -1) return -1; return buf[0] & 0xFF; }
| 6,705
|
public void write(int b) throws IOException { byte buf[] = { (byte) b }; write(buf, 0, 1); }
|
public void write(int b) throws IOException { byte buf[] = { (byte) b }; write(buf, 0, 1); }
| 6,706
|
protected synchronized void accept(SocketImpl impl) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
protected synchronized void accept(SocketImpl impl) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 6,707
|
protected int available() throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
protected int available() throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 6,708
|
protected synchronized void bind(InetAddress addr, int port) throws IOException { // @vm-specific no natives throw new SocketException("Not implemented"); }
|
protected synchronized void bind(InetAddress addr, int port) throws IOException { // @vm-specific no natives throw new SocketException("Not implemented"); }
| 6,709
|
protected void close() throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
protected void close() throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 6,710
|
protected synchronized void connect(String host, int port) throws IOException { connect(InetAddress.getByName(host), port); }
|
protected synchronized void connect(String hostname, int port) throws IOException { connect(InetAddress.getByName(host), port); }
| 6,711
|
protected synchronized void connect(String host, int port) throws IOException { connect(InetAddress.getByName(host), port); }
|
protected synchronized void connect(String host, int port) throws IOException { connect(InetAddress.getByName(hostname), port); }
| 6,712
|
public Object getOption(int optID) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
public Object getOption(int optID) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 6,713
|
protected synchronized void listen(int queuelen) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
protected synchronized void listen(int queuelen) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 6,714
|
public void sendUrgentData(int data) { throw new InternalError ("PlainSocketImpl::sendUrgentData not implemented"); }
|
public void sendUrgentData(int data) throws IOException { throw new InternalError ("PlainSocketImpl::sendUrgentData not implemented"); }
| 6,715
|
public void sendUrgentData(int data) { throw new InternalError ("PlainSocketImpl::sendUrgentData not implemented"); }
|
public void sendUrgentData(int data) { impl.sendUrgentData(data); }
| 6,716
|
public void setOption(int optID, Object value) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
public void setOption(int optID, Object value) throws SocketException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 6,717
|
public void shutdownInput() { // @vm-specific no natives //TODO implement me throw new InternalError ("PlainSocketImpl::shutdownInput not implemented"); }
|
public void shutdownInput() throws IOException { // @vm-specific no natives //TODO implement me throw new InternalError ("PlainSocketImpl::shutdownInput not implemented"); }
| 6,718
|
public void shutdownInput() { // @vm-specific no natives //TODO implement me throw new InternalError ("PlainSocketImpl::shutdownInput not implemented"); }
|
public void shutdownInput() { // @vm-specific no natives //TODO implement me impl.shutdownInput(); }
| 6,719
|
public void shutdownOutput() throws IOException { // @vm-specific no natives //TODO implement me throw new InternalError ("PlainSocketImpl::shutdownOutput not implemented"); }
|
public void shutdownOutput() throws IOException { // @vm-specific no natives //TODO implement me impl.shutdownOutput(); }
| 6,720
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're in the initialization stage use super.add. Here we add the // rootPane as well as the title bar and other stuff. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp,constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JInternalFrame directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're in the initialization stage use super.add. Here we add the // rootPane as well as the title bar and other stuff. // Otherwise pass the add onto the content pane. if (isRootPaneCheckingEnabled()) getContentPane().add(comp, constraints, index); else super.addImpl(comp,constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JInternalFrame directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
| 6,722
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're in the initialization stage use super.add. Here we add the // rootPane as well as the title bar and other stuff. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp,constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JInternalFrame directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
|
protected void addImpl(Component comp, Object constraints, int index) { // If we're in the initialization stage use super.add. Here we add the // rootPane as well as the title bar and other stuff. // Otherwise pass the add onto the content pane. if (!initStageDone) super.addImpl(comp,constraints, index); else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JInternalFrame directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); } }
| 6,723
|
protected String paramString() { return "JInternalFrame"; }
|
protected String paramString() { return super.paramString(); }
| 6,724
|
public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); invalidate(); doLayout(); }
|
public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); invalidate(); doLayout(); }
| 6,725
|
public IRBasicBlock(int address) { this(address, -1, false); }
|
public IRBasicBlock(int address) { this(address, -1, false); }
| 6,728
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes/* if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); }*/ // 1. open this node, print its simple XML attributes if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = this.classXDFNodeName; // Setup. Sometimes the name of the node we are opening is different from // that specified in the classXDFNodeName (*sigh*) if (newNodeNameString != null) nodeNameString = newNodeNameString; // 0. To be valid XML, we always start an XML block with an // XML declaration (e.g. somehting like "<?xml standalone="no"?>"). // Here we deal with printing out XML Declaration && its attributes/* if ((XMLDeclAttribs !=null) &&(!XMLDeclAttribs.isEmpty())) { indent = ""; writeXMLDeclToOutputStream(outputstream, XMLDeclAttribs); }*/ // 1. open this node, print its simple XML attributes if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); String newindent = indent + sPrettyXDFOutputIndentation; // bump up the indentation // 2. Print out the axisIdRefs as child nodes Iterator iter = axisIdRefOrder.iterator(); while (iter.hasNext()) { String axisIdRef = (String) iter.next(); if (sPrettyXDFOutput) writeOut(outputstream, newindent); // indent node if desired writeOut(outputstream,"<" + indexNodeName + " axisIdRef=\""+axisIdRef+"\"/>"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); } // 3. Close this node if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"</" + nodeNameString + ">"); // print opening statement if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
| 6,729
|
public static long getFatOffset(BootSector bs, int fatNr) { long sectSize = bs.getBytesPerSector(); long sectsPerFat = bs.getSectorsPerFat(); long resSects = bs.getNrReservedSectors(); long offset = resSects * sectSize; if (fatNr > 0) { offset += (fatNr-1) * sectsPerFat * sectSize; } return offset; }
|
public static long getFatOffset(BootSector bs, int fatNr) { long sectSize = bs.getBytesPerSector(); long sectsPerFat = bs.getSectorsPerFat(); long resSects = bs.getNrReservedSectors(); long offset = resSects * sectSize; if (fatNr > 0) { offset += (fatNr-1) * sectsPerFat * sectSize; } return offset; }
| 6,730
|
public void updateDirty() { //LDC - 12/02/2003 - check if we must repaint it if (drawing == false) return; //LDC - 18/02/2003 - only update the screen when the window is showing if (this.gui.isShowing()) { Rectangle r = new Rectangle(dirty); // update the image updateImage(r); } // update dirty to show that we have already painted that region of the // screen so do not do it again.// int height = (int)(tArea.getHeight() - dirty.height);// if (height > 0)// dirty.setBounds(dirty.x,dirty.height,dirty.width,(int)(tArea.getHeight() - dirty.height)); //LDC - 12/02/2003 - set drawing to false drawing = false; }
|
public void updateDirty() { //LDC - 12/02/2003 - check if we must repaint it if (drawing == false) return; //LDC - 18/02/2003 - only update the screen when the window is showing if (this.gui.isShowing()) { Rectangle r = new Rectangle(dirty); // update the image updateImage(r); } // update dirty to show that we have already painted that region of the // screen so do not do it again.// int height = (int)(tArea.getHeight() - dirty.height);// if (height > 0)// dirty.setBounds(dirty.x,dirty.height,dirty.width,(int)(tArea.getHeight() - dirty.height)); //LDC - 12/02/2003 - set drawing to false drawing = false; }
| 6,731
|
protected void blockOpen(HTML.Tag t, MutableAttributeSet attr) { printBuffer(); DefaultStyledDocument.ElementSpec element; attr.addAttribute(StyleConstants.NameAttribute, t); element = new DefaultStyledDocument.ElementSpec(attr, DefaultStyledDocument.ElementSpec.StartTagType); parseBuffer.addElement(element); printBuffer(); }
|
protected void blockOpen(HTML.Tag t, MutableAttributeSet attr) { printBuffer(); DefaultStyledDocument.ElementSpec element; attr.addAttribute(StyleConstants.NameAttribute, t); element = new DefaultStyledDocument.ElementSpec(attr, DefaultStyledDocument.ElementSpec.StartTagType); parseBuffer.addElement(element); printBuffer(); }
| 6,732
|
protected AbstractElement createDefaultRoot() { AttributeContext ctx = getAttributeContext(); // Create html element. AttributeSet atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.HTML); BranchElement html = (BranchElement) createBranchElement(null, atts); // Create body element. atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.BODY); BranchElement body = (BranchElement) createBranchElement(html, atts); html.replace(0, 0, new Element[] { body }); // Create p element. atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.P); BranchElement p = (BranchElement) createBranchElement(body, atts); body.replace(0, 0, new Element[] { p }); // Create an empty leaf element. atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.CONTENT); Element leaf = createLeafElement(p, atts, 0, 1); p.replace(0, 0, new Element[]{ leaf }); return html; }
|
protected AbstractElement createDefaultRoot() { AbstractDocument.AttributeContext ctx = getAttributeContext(); // Create html element. AttributeSet atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.HTML); BranchElement html = (BranchElement) createBranchElement(null, atts); // Create body element. atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.BODY); BranchElement body = (BranchElement) createBranchElement(html, atts); html.replace(0, 0, new Element[] { body }); // Create p element. atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.P); BranchElement p = (BranchElement) createBranchElement(body, atts); body.replace(0, 0, new Element[] { p }); // Create an empty leaf element. atts = ctx.getEmptySet(); atts = ctx.addAttribute(atts, StyleConstants.NameAttribute, HTML.Tag.CONTENT); Element leaf = createLeafElement(p, atts, 0, 1); p.replace(0, 0, new Element[]{ leaf }); return html; }
| 6,733
|
private void updateSelection(boolean controlPressed) { // Update the rows int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); } // Update the columns int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col); } }
|
private void updateSelection(boolean controlPressed) { // Update the rows int lo_row = table.rowAtPoint(begin); int hi_row = table.rowAtPoint(curr); ListSelectionModel rowModel = table.getSelectionModel(); if (lo_row != -1 && hi_row != -1) { if (controlPressed && rowModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) rowModel.addSelectionInterval(lo_row, hi_row); else rowModel.setSelectionInterval(lo_row, hi_row); // Update the columns int lo_col = table.columnAtPoint(begin); int hi_col = table.columnAtPoint(curr); ListSelectionModel colModel = table.getColumnModel(). getSelectionModel(); if (lo_col != -1 && hi_col != -1) { if (controlPressed && colModel.getSelectionMode() != ListSelectionModel.SINGLE_SELECTION) colModel.addSelectionInterval(lo_col, hi_col); else colModel.setSelectionInterval(lo_col, hi_col);
| 6,735
|
protected void installKeyboardActions() { }
|
protected void installKeyboardActions() { }
| 6,736
|
public void installUI(JComponent comp) { table = (JTable)comp; focusListener = createFocusListener(); keyListener = createKeyListener(); mouseInputListener = createMouseInputListener(); installDefaults(); installKeyboardActions(); installListeners(); }
|
public void installUI(JComponent comp) { table = (JTable)comp; focusListener = createFocusListener(); mouseInputListener = createMouseInputListener(); installDefaults(); installKeyboardActions(); installListeners(); }
| 6,737
|
protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //open the code writeOut(outputstream, "<" + classXDFNodeName); writeOut(outputstream, " count=\"" + getCount() + "\""); writeOut(outputstream, ">"); //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); String moreIndent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, moreIndent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, moreIndent); } } //close the node if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + classXDFNodeName + ">"); }
|
protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //open the code writeOut(outputstream, "<" + classXDFNodeName); writeOut(outputstream, " count=\""); writeOutAttribute(outputstream, getCount().toString()); writeOut(outputstream, "\""); writeOut(outputstream, ">"); //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); String moreIndent = indent + Specification.getInstance().getPrettyXDFOutputIndentation(); for (int i = 0; i <stop; i++) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, moreIndent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, moreIndent); } } //close the node if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + classXDFNodeName + ">"); }
| 6,738
|
public static void main(String[] args) throws NameNotFoundException { Help.Info info = HELP_INFO; // defaults to print own help ParsedArguments cmdLine = HELP_INFO.parse(args); if (PARAM_COMMAND.isSet(cmdLine)) try { String cmd = ARG_COMMAND.getValue(cmdLine); Class clazz = null; try { final Shell shell = ShellUtils.getShellManager().getCurrentShell(); clazz = shell.getAliasManager().getAliasClass(cmd); } catch (NoSuchAliasException ex) { clazz = Class.forName(cmd); } Field clInfo = clazz.getField(Help.INFO_FIELD_NAME); info = (Help.Info)clInfo.get(null); // static access } catch (ClassNotFoundException ex) { System.err.println("Class not found"); } catch (NoSuchFieldException ex) { System.err.println("Class does not provide requested information"); } catch (ClassCastException ex) { System.err.println("Embedded information is in wrong format"); } catch (IllegalAccessException ex) { System.err.println("Embedded information is not public"); } catch (SecurityException ex) { System.err.println("Access to class restricted"); } info.help(); }
|
public static void main(String[] args) throws NameNotFoundException, HelpException { Help.Info info = HELP_INFO; // defaults to print own help ParsedArguments cmdLine = HELP_INFO.parse(args); if (PARAM_COMMAND.isSet(cmdLine)) try { String cmd = ARG_COMMAND.getValue(cmdLine); Class clazz = null; try { final Shell shell = ShellUtils.getShellManager().getCurrentShell(); clazz = shell.getAliasManager().getAliasClass(cmd); } catch (NoSuchAliasException ex) { clazz = Class.forName(cmd); } Field clInfo = clazz.getField(Help.INFO_FIELD_NAME); info = (Help.Info)clInfo.get(null); // static access } catch (ClassNotFoundException ex) { System.err.println("Class not found"); } catch (NoSuchFieldException ex) { System.err.println("Class does not provide requested information"); } catch (ClassCastException ex) { System.err.println("Embedded information is in wrong format"); } catch (IllegalAccessException ex) { System.err.println("Embedded information is not public"); } catch (SecurityException ex) { System.err.println("Access to class restricted"); } info.help(); }
| 6,739
|
public void writeADD(GPR dstReg, int imm32) { testSize(dstReg, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 0); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 0); write32(imm32); } }
|
public void writeADD(GPR dstReg, int imm32) { testSize(dstReg, BITS32 | BITS64); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 0); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 0); write32(imm32); } }
| 6,740
|
public final void writeAND(GPR dstReg, int imm32) { testSize(dstReg, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 4); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 4); write32(imm32); } }
|
public final void writeAND(GPR dstReg, int imm32) { testSize(dstReg, BITS32 | BITS64); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 4); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 4); write32(imm32); } }
| 6,741
|
public void writeCMP(GPR reg1, int disp, GPR reg2) { testSize(reg1, mode.getSize()); testSize(reg2, mode.getSize()); write1bOpcodeModRM(0x39, reg2.getSize(), reg1, disp, reg2.getNr()); }
|
public void writeCMP(GPR reg1, int disp, GPR reg2) { testSize(reg1, mode.getSize()); testSize(reg2, mode.getSize()); write1bOpcodeModRM(0x39, reg2.getSize(), reg1, disp, reg2.getNr()); }
| 6,742
|
public final void writeCMP_Const(GPR reg, int imm32) { testSize(reg, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, reg.getSize(), reg, 7); write8(imm32); } else { write1bOpcodeModRR(0x81, reg.getSize(), reg, 7); write32(imm32); } }
|
public final void writeCMP_Const(GPR reg, int imm32) { testSize(reg, BITS32 | BITS64); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, reg.getSize(), reg, 7); write8(imm32); } else { write1bOpcodeModRR(0x81, reg.getSize(), reg, 7); write32(imm32); } }
| 6,743
|
public final void writeDEC(GPR dstReg) { testSize(dstReg, mode.getSize()); if (code32) { write8(0x48 + dstReg.getNr()); } else { write1bOpcodeModRR(0xFF, dstReg.getSize(), dstReg, 1); } }
|
public final void writeDEC(GPR dstReg) { testSize(dstReg, BITS32 | BITS64); if (code32) { write8(0x48 + dstReg.getNr()); } else { write1bOpcodeModRR(0xFF, dstReg.getSize(), dstReg, 1); } }
| 6,744
|
public final void writeINC(GPR dstReg) { testSize(dstReg, mode.getSize()); if (code32) { write8(0x40 + dstReg.getNr()); } else { write1bOpcodeModRR(0xFF, dstReg.getSize(), dstReg, 0); } }
|
public final void writeINC(GPR dstReg) { testSize(dstReg, BITS32 | BITS64); if (code32) { write8(0x40 + dstReg.getNr()); } else { write1bOpcodeModRR(0xFF, dstReg.getSize(), dstReg, 0); } }
| 6,745
|
public final void writeMOV(int operandSize, GPR dstReg, int dstDisp, GPR srcReg) { testSize(dstReg, mode.getSize()); testSize(srcReg, mode.getSize()); testDst(dstReg, dstDisp); final int opcode; switch (operandSize) { case X86Constants.BITS8: opcode = 0x88; break; case X86Constants.BITS16: opcode = 0x89; write8(OSIZE_PREFIX); break; case X86Constants.BITS32: case X86Constants.BITS64: opcode = 0x89; break; default: throw new IllegalArgumentException("Invalid operandSize " + operandSize); } write1bOpcodeModRM(opcode, operandSize, dstReg, dstDisp, srcReg.getNr()); }
|
public final void writeMOV(int operandSize, GPR dstReg, int dstDisp, GPR srcReg) { testSize(dstReg, mode.getSize()); testSize(srcReg, mode.getSize()); testDst(dstReg, dstDisp); final int opcode; switch (operandSize) { case X86Constants.BITS8: opcode = 0x88; break; case X86Constants.BITS16: opcode = 0x89; write8(OSIZE_PREFIX); break; case X86Constants.BITS32: case X86Constants.BITS64: opcode = 0x89; break; default: throw new IllegalArgumentException("Invalid operandSize " + operandSize); } write1bOpcodeModRM(opcode, operandSize, dstReg, dstDisp, srcReg.getNr()); }
| 6,746
|
public final void writeMOV_Const(GPR dstReg, int imm32) { testSize(dstReg, mode.getSize()); testSize(dstReg, BITS32 | BITS64); if (dstReg.getSize() == BITS32) { write1bOpcodeReg(0xB8, dstReg); write32(imm32); } else { writeMOV_Const(dstReg, (long) imm32); } }
|
public final void writeMOV_Const(GPR dstReg, int imm32) { testSize(dstReg, BITS32 | BITS64); if (dstReg.getSize() == BITS32) { write1bOpcodeReg(0xB8, dstReg); write32(imm32); } else { writeMOV_Const(dstReg, (long) imm32); } }
| 6,747
|
public final void writeNEG(GPR dstReg) { testSize(dstReg, mode.getSize()); write1bOpcodeModRR(0xf7, dstReg.getSize(), dstReg, 3); }
|
public final void writeNEG(GPR dstReg) { testSize(dstReg, BITS32 | BITS64); write1bOpcodeModRR(0xf7, dstReg.getSize(), dstReg, 3); }
| 6,748
|
public void writeOR(GPR dstReg, int imm32) { testSize(dstReg, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 1); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 1); write32(imm32); } }
|
public void writeOR(GPR dstReg, int imm32) { testSize(dstReg, BITS32 | BITS64); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 1); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 1); write32(imm32); } }
| 6,749
|
public final void writePOP(GPR dstReg) { testSize(dstReg, mode.getSize()); write1bOpcodeReg(0x58, dstReg); }
|
public final void writePOP(GPR dstReg) { testSize(dstReg, BITS32 | BITS64); write1bOpcodeReg(0x58, dstReg); }
| 6,750
|
public final void writeSHR(GPR dstReg, int imm8) { testSize(dstReg, mode.getSize()); write1bOpcodeModRR(0xc1, dstReg.getSize(), dstReg, 5); write8(imm8); }
|
public final void writeSHR(GPR dstReg, int imm8) { testSize(dstReg, BITS32 | BITS64); write1bOpcodeModRR(0xc1, dstReg.getSize(), dstReg, 5); write8(imm8); }
| 6,751
|
public final void writeSHR_CL(GPR dstReg) { testSize(dstReg, mode.getSize()); write1bOpcodeModRR(0xd3, dstReg.getSize(), dstReg, 5); }
|
public final void writeSHR_CL(GPR dstReg) { testSize(dstReg, BITS32 | BITS64); write1bOpcodeModRR(0xd3, dstReg.getSize(), dstReg, 5); }
| 6,752
|
public final void writeSUB(GPR reg, int imm32) { testSize(reg, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, reg.getSize(), reg, 5); write8(imm32); } else { write1bOpcodeModRR(0x81, reg.getSize(), reg, 5); write32(imm32); } }
|
public final void writeSUB(GPR reg, int imm32) { testSize(reg, BITS32 | BITS64); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, reg.getSize(), reg, 5); write8(imm32); } else { write1bOpcodeModRR(0x81, reg.getSize(), reg, 5); write32(imm32); } }
| 6,753
|
public final void writeTEST(GPR reg, int imm32) { testSize(reg, mode.getSize()); write1bOpcodeModRR(0xF7, reg.getSize(), reg, 0); write32(imm32); }
|
public final void writeTEST(GPR reg, int imm32) { testSize(reg, BITS32 | BITS64); write1bOpcodeModRR(0xF7, reg.getSize(), reg, 0); write32(imm32); }
| 6,754
|
public void writeXOR(GPR dstReg, int imm32) { testSize(dstReg, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 6); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 6); write32(imm32); } }
|
public void writeXOR(GPR dstReg, int imm32) { testSize(dstReg, BITS32 | BITS64); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 6); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 6); write32(imm32); } }
| 6,755
|
public static int vmMain() throws PragmaUninterruptible, PragmaLoadStatics { //return 15; try { Unsafe.debug("Starting JNode\n"); final long start = VmSystem.currentKernelMillis(); Unsafe.debug("VmSystem.initialize\n"); VmSystem.initialize(); // Load the plugins from the initjar BootLog.info("Loading initjar plugins"); final InitJarProcessor proc = new InitJarProcessor(VmSystem.getInitJar()); proc.loadPlugins(pluginRegistry); BootLog.info("Starting PluginManager"); final PluginManager piMgr = new DefaultPluginManager(pluginRegistry); piMgr.startSystemPlugins(); final ClassLoader loader = pluginRegistry.getPluginsClassLoader(); final String mainClassName = proc.getMainClassName(); final Runnable main; if (mainClassName != null) { final Class mainClass = loader.loadClass(mainClassName); main = (Runnable) mainClass.newInstance(); } else { BootLog.warn("No Main-Class found"); main = null; } final long end = VmSystem.currentKernelMillis(); System.out.println("JNode initialization finished in " + (end - start) + "ms."); if (main != null) { main.run(); } } catch (Throwable ex) { BootLog.error("Error in bootstrap", ex); sleepForever(); return -2; } Unsafe.debug("System has finished"); return 0; }
|
public static int vmMain() throws PragmaUninterruptible, PragmaLoadStatics { //return 15; try { Unsafe.debug("Starting JNode\n"); final long start = VmSystem.currentKernelMillis(); Unsafe.debug("VmSystem.initialize\n"); VmSystem.initialize(); // Load the plugins from the initjar BootLog.info("Loading initjar plugins"); final InitJarProcessor proc = new InitJarProcessor(VmSystem.getInitJar()); List descriptors = proc.loadPlugins(pluginRegistry); BootLog.info("Starting PluginManager"); final PluginManager piMgr = new DefaultPluginManager(pluginRegistry); piMgr.startSystemPlugins(); final ClassLoader loader = pluginRegistry.getPluginsClassLoader(); final String mainClassName = proc.getMainClassName(); final Runnable main; if (mainClassName != null) { final Class mainClass = loader.loadClass(mainClassName); main = (Runnable) mainClass.newInstance(); } else { BootLog.warn("No Main-Class found"); main = null; } final long end = VmSystem.currentKernelMillis(); System.out.println("JNode initialization finished in " + (end - start) + "ms."); if (main != null) { main.run(); } } catch (Throwable ex) { BootLog.error("Error in bootstrap", ex); sleepForever(); return -2; } Unsafe.debug("System has finished"); return 0; }
| 6,756
|
public static int vmMain() throws PragmaUninterruptible, PragmaLoadStatics { //return 15; try { Unsafe.debug("Starting JNode\n"); final long start = VmSystem.currentKernelMillis(); Unsafe.debug("VmSystem.initialize\n"); VmSystem.initialize(); // Load the plugins from the initjar BootLog.info("Loading initjar plugins"); final InitJarProcessor proc = new InitJarProcessor(VmSystem.getInitJar()); proc.loadPlugins(pluginRegistry); BootLog.info("Starting PluginManager"); final PluginManager piMgr = new DefaultPluginManager(pluginRegistry); piMgr.startSystemPlugins(); final ClassLoader loader = pluginRegistry.getPluginsClassLoader(); final String mainClassName = proc.getMainClassName(); final Runnable main; if (mainClassName != null) { final Class mainClass = loader.loadClass(mainClassName); main = (Runnable) mainClass.newInstance(); } else { BootLog.warn("No Main-Class found"); main = null; } final long end = VmSystem.currentKernelMillis(); System.out.println("JNode initialization finished in " + (end - start) + "ms."); if (main != null) { main.run(); } } catch (Throwable ex) { BootLog.error("Error in bootstrap", ex); sleepForever(); return -2; } Unsafe.debug("System has finished"); return 0; }
|
public static int vmMain() throws PragmaUninterruptible, PragmaLoadStatics { //return 15; try { Unsafe.debug("Starting JNode\n"); final long start = VmSystem.currentKernelMillis(); Unsafe.debug("VmSystem.initialize\n"); VmSystem.initialize(); // Load the plugins from the initjar BootLog.info("Loading initjar plugins"); final InitJarProcessor proc = new InitJarProcessor(VmSystem.getInitJar()); proc.loadPlugins(pluginRegistry); BootLog.info("Starting PluginManager"); final PluginManager piMgr = new DefaultPluginManager(pluginRegistry); piMgr.startSystemPlugins(descriptors); final ClassLoader loader = pluginRegistry.getPluginsClassLoader(); final String mainClassName = proc.getMainClassName(); final Runnable main; if (mainClassName != null) { final Class mainClass = loader.loadClass(mainClassName); main = (Runnable) mainClass.newInstance(); } else { BootLog.warn("No Main-Class found"); main = null; } final long end = VmSystem.currentKernelMillis(); System.out.println("JNode initialization finished in " + (end - start) + "ms."); if (main != null) { main.run(); } } catch (Throwable ex) { BootLog.error("Error in bootstrap", ex); sleepForever(); return -2; } Unsafe.debug("System has finished"); return 0; }
| 6,757
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = classXDFNodeName; // 1. open this node, print its simple XML attributes if (sPrettyXDFOutput) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement //writeOut the body of DataFormat writeOut(outputstream, "<" + specificDataFormatName); // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } //writeout end of the boby writeOut(outputstream, "/>"); //writeout closing node writeOut(outputstream, "</" + nodeNameString+ ">"); if (sPrettyXDFOutput) writeOut(outputstream, Constants.NEW_LINE); }
|
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { String nodeNameString = classXDFNodeName; // 1. open this node, print its simple XML attributes if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired writeOut(outputstream,"<" + nodeNameString + ">"); // print opening statement //writeOut the body of DataFormat writeOut(outputstream, "<" + specificDataFormatName); // gather info about XMLAttributes in this object/node Hashtable xmlInfo = getXMLInfo(); // 2. Print out string object XML attributes EXCEPT for the one that // matches PCDATAAttribute. ArrayList attribs = (ArrayList) xmlInfo.get("attribList"); synchronized(attribs) { int stop = attribs.size(); for (int i = 0; i < stop; i++) { Hashtable item = (Hashtable) attribs.get(i); writeOut(outputstream, " "+ item.get("name") + "=\"" + item.get("value") + "\""); } } //writeout end of the boby writeOut(outputstream, "/>"); //writeout closing node writeOut(outputstream, "</" + nodeNameString+ ">"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
| 6,758
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalToolBarUI(); return instance; }
|
public static ComponentUI createUI(JComponent component) { if (instance == null) instance = new MetalToolBarUI(); return instance; }
| 6,759
|
public SwingCanvasPeer(Canvas canvas) { SwingToolkit.add(canvas, this); SwingToolkit.copyAwtProperties(canvas, this); }
|
public SwingCanvasPeer(Canvas canvas) { SwingToolkit.add(canvas, this); SwingToolkit.copyAwtProperties(canvas, this); }
| 6,760
|
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { // Menu item is considered to be highlighted when it is selected. // But we don't want to paint the background of JCheckBoxMenuItems ButtonModel mod = menuItem.getModel(); if ((menuItem.isSelected() && checkIcon == null) || (mod != null && mod.isArmed()) && (menuItem.getParent() instanceof MenuElement)) { if (menuItem.isContentAreaFilled()) { g.setColor(selectionBackground); g.fillRect(0, 0, menuItem.getWidth(), menuItem.getHeight()); } } }
|
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { // Menu item is considered to be highlighted when it is selected. // But we don't want to paint the background of JCheckBoxMenuItems ButtonModel mod = menuItem.getModel(); if ((menuItem.isSelected() && checkIcon == null) || (mod != null && mod.isArmed()) && (menuItem.getParent() instanceof MenuElement)) { if (menuItem.isContentAreaFilled()) { g.setColor(selectionBackground); g.fillRect(0, 0, menuItem.getWidth(), menuItem.getHeight()); } } }
| 6,761
|
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { // Menu item is considered to be highlighted when it is selected. // But we don't want to paint the background of JCheckBoxMenuItems ButtonModel mod = menuItem.getModel(); if ((menuItem.isSelected() && checkIcon == null) || (mod != null && mod.isArmed()) && (menuItem.getParent() instanceof MenuElement)) { if (menuItem.isContentAreaFilled()) { g.setColor(selectionBackground); g.fillRect(0, 0, menuItem.getWidth(), menuItem.getHeight()); } } }
|
protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { // Menu item is considered to be highlighted when it is selected. // But we don't want to paint the background of JCheckBoxMenuItems ButtonModel mod = menuItem.getModel(); if ((menuItem.isSelected() && checkIcon == null) || (mod != null && mod.isArmed()) && (menuItem.getParent() instanceof MenuElement)) { if (menuItem.isContentAreaFilled()) { g.setColor(selectionBackground); g.fillRect(0, 0, menuItem.getWidth(), menuItem.getHeight());
| 6,762
|
protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) { JMenuItem m = (JMenuItem) c; Rectangle tr = new Rectangle(); // text rectangle Rectangle ir = new Rectangle(); // icon rectangle Rectangle vr = new Rectangle(); // view rectangle Rectangle br = new Rectangle(); // border rectangle Rectangle ar = new Rectangle(); // accelerator rectangle Rectangle cr = new Rectangle(); // checkIcon rectangle int vertAlign = m.getVerticalAlignment(); int horAlign = m.getHorizontalAlignment(); int vertTextPos = m.getVerticalTextPosition(); int horTextPos = m.getHorizontalTextPosition(); Font f = m.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); SwingUtilities.calculateInnerArea(m, br); SwingUtilities.calculateInsetArea(br, m.getInsets(), vr); paintBackground(g, m, m.getBackground()); /* * MenuItems insets are equal to menuItems margin, space between text and * menuItems border. We need to paint insets region as well. */ Insets insets = m.getInsets(); br.x -= insets.left; br.y -= insets.top; br.width += insets.right + insets.left; br.height += insets.top + insets.bottom; // If this menu item is a JCheckBoxMenuItem then paint check icon if (checkIcon != null) { SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign, horAlign, vertTextPos, horTextPos, vr, cr, tr, defaultTextIconGap); checkIcon.paintIcon(m, g, cr.x, cr.y); // We need to calculate position of the menu text and position of // user menu icon if there exists one relative to the check icon. // So we need to adjust view rectangle s.t. its starting point is at // checkIcon.width + defaultTextIconGap. vr.x = cr.x + cr.width + defaultTextIconGap; } // if this is a submenu, then paint arrow icon to indicate it. if (arrowIcon != null && (c instanceof JMenu)) { if (!((JMenu) c).isTopLevelMenu()) { int width = arrowIcon.getIconWidth(); int height = arrowIcon.getIconHeight(); int offset = (vr.height - height) / 2; arrowIcon.paintIcon(m, g, vr.width - width, vr.y + offset); } } // paint text and user menu icon if it exists Icon i = m.getIcon(); SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), i, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, tr, defaultTextIconGap); if (i != null) i.paintIcon(c, g, ir.x, ir.y); paintText(g, m, tr, m.getText()); // paint accelerator String acceleratorText = ""; if (m.getAccelerator() != null) { acceleratorText = getAcceleratorText(m.getAccelerator()); fm = g.getFontMetrics(acceleratorFont); ar.width = fm.stringWidth(acceleratorText); ar.x = br.width - ar.width; vr.x = br.width - ar.width - defaultTextIconGap; SwingUtilities.layoutCompoundLabel(m, fm, acceleratorText, null, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, ar, defaultTextIconGap); paintAccelerator(g, m, ar, acceleratorText); } }
|
protected void paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap) { JMenuItem m = (JMenuItem) c; Rectangle tr = new Rectangle(); // text rectangle Rectangle ir = new Rectangle(); // icon rectangle Rectangle vr = new Rectangle(); // view rectangle Rectangle br = new Rectangle(); // border rectangle Rectangle ar = new Rectangle(); // accelerator rectangle Rectangle cr = new Rectangle(); // checkIcon rectangle int vertAlign = m.getVerticalAlignment(); int horAlign = m.getHorizontalAlignment(); int vertTextPos = m.getVerticalTextPosition(); int horTextPos = m.getHorizontalTextPosition(); Font f = m.getFont(); g.setFont(f); FontMetrics fm = g.getFontMetrics(f); SwingUtilities.calculateInnerArea(m, br); SwingUtilities.calculateInsetArea(br, m.getInsets(), vr); paintBackground(g, m, background); /* * MenuItems insets are equal to menuItems margin, space between text and * menuItems border. We need to paint insets region as well. */ Insets insets = m.getInsets(); br.x -= insets.left; br.y -= insets.top; br.width += insets.right + insets.left; br.height += insets.top + insets.bottom; // If this menu item is a JCheckBoxMenuItem then paint check icon if (checkIcon != null) { SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign, horAlign, vertTextPos, horTextPos, vr, cr, tr, defaultTextIconGap); checkIcon.paintIcon(m, g, cr.x, cr.y); // We need to calculate position of the menu text and position of // user menu icon if there exists one relative to the check icon. // So we need to adjust view rectangle s.t. its starting point is at // checkIcon.width + defaultTextIconGap. vr.x = cr.x + cr.width + defaultTextIconGap; } // if this is a submenu, then paint arrow icon to indicate it. if (arrowIcon != null && (c instanceof JMenu)) { if (!((JMenu) c).isTopLevelMenu()) { int width = arrowIcon.getIconWidth(); int height = arrowIcon.getIconHeight(); int offset = (vr.height - height) / 2; arrowIcon.paintIcon(m, g, vr.width - width, vr.y + offset); } } // paint text and user menu icon if it exists Icon i = m.getIcon(); SwingUtilities.layoutCompoundLabel(c, fm, m.getText(), i, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, tr, defaultTextIconGap); if (i != null) i.paintIcon(c, g, ir.x, ir.y); paintText(g, m, tr, m.getText()); // paint accelerator String acceleratorText = ""; if (m.getAccelerator() != null) { acceleratorText = getAcceleratorText(m.getAccelerator()); fm = g.getFontMetrics(acceleratorFont); ar.width = fm.stringWidth(acceleratorText); ar.x = br.width - ar.width; vr.x = br.width - ar.width - defaultTextIconGap; SwingUtilities.layoutCompoundLabel(m, fm, acceleratorText, null, vertAlign, horAlign, vertTextPos, horTextPos, vr, ir, ar, defaultTextIconGap); paintAccelerator(g, m, ar, acceleratorText); } }
| 6,763
|
public void actionPerformed(ActionEvent event) { JEditorPane editor = getEditor(event); StyledDocument doc = getStyledDocument(editor); Element el = doc.getCharacterElement(editor.getSelectionStart()); boolean isBold = StyleConstants.isBold(el.getAttributes()); SimpleAttributeSet atts = new SimpleAttributeSet(); StyleConstants.setItalic(atts, ! isBold); setCharacterAttributes(editor, atts, false); }
|
public void actionPerformed(ActionEvent event) { JEditorPane editor = getEditor(event); StyledDocument doc = getStyledDocument(editor); Element el = doc.getCharacterElement(editor.getSelectionStart()); boolean isBold = StyleConstants.isBold(el.getAttributes()); SimpleAttributeSet atts = new SimpleAttributeSet(); StyleConstants.setBold(atts, ! isBold); setCharacterAttributes(editor, atts, false); }
| 6,764
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
| 6,765
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
| 6,766
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
| 6,767
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
|
protected final void setCharacterAttributes(JEditorPane editor, AttributeSet atts, boolean replace) { Document doc = editor.getDocument(); if (doc instanceof StyledDocument) { StyledDocument styleDoc = (StyledDocument) editor.getDocument(); EditorKit kit = editor.getEditorKit(); if (!(kit instanceof StyledEditorKit)) { StyledEditorKit styleKit = (StyledEditorKit) kit; int start = editor.getSelectionStart(); int end = editor.getSelectionEnd(); int dot = editor.getCaret().getDot(); if (start == dot && end == dot) { // If there is no selection, then we only update the // input attributes. MutableAttributeSet inputAttributes = styleKit.getInputAttributes(); inputAttributes.addAttributes(atts); } else styleDoc.setCharacterAttributes(start, end, atts, replace); } else throw new AssertionError("The EditorKit for StyledTextActions " + "is expected to be a StyledEditorKit"); } else throw new AssertionError("The Document for StyledTextActions is " + "expected to be a StyledDocument."); }
| 6,768
|
boolean addEdit(UndoableEdit anEdit);
|
boolean addEdit(UndoableEdit edit);
| 6,769
|
boolean replaceEdit(UndoableEdit anEdit);
|
boolean replaceEdit(UndoableEdit edit);
| 6,770
|
public int getIndexOfChild(Object parent, Object child) { return 0; // TODO }
|
public int getIndexOfChild(Object parent, Object child) { for (int i = 0; i < getChildCount(parent); i++) { if (getChild(parent, i).equals(child)) return i; } return -1; // TODO }
| 6,771
|
public Component componentForPoint(Component source, Point sourcePoint) { // Convert sourcePoint to screen coordinates. Point sourcePointOnScreen = sourcePoint; SwingUtilities.convertPointToScreen(sourcePointOnScreen, source); Point compPointOnScreen; Component resultComp = null; // For each menu element on the selected path, express its location // in terms of screen coordinates and check if there is any // menu element on the selected path that contains given source point. for (int i = 0; i < selectedPath.size(); i++) { Component comp = ((Component) selectedPath.get(i)); Dimension size = comp.getSize(); // convert location of this menu item to screen coordinates compPointOnScreen = comp.getLocationOnScreen(); if (compPointOnScreen.x <= sourcePointOnScreen.x && sourcePointOnScreen.x < compPointOnScreen.x + size.width && compPointOnScreen.y <= sourcePointOnScreen.y && sourcePointOnScreen.y < compPointOnScreen.y + size.height) { Point p = sourcePointOnScreen; SwingUtilities.convertPointFromScreen(p, comp); resultComp = SwingUtilities.getDeepestComponentAt(comp, p.x, p.y); break; } } return resultComp; }
|
public Component componentForPoint(Component source, Point sourcePoint) { // Convert sourcePoint to screen coordinates. Point sourcePointOnScreen = sourcePoint; if (source.isShowing()) SwingUtilities.convertPointToScreen(sourcePointOnScreen, source); Point compPointOnScreen; Component resultComp = null; // For each menu element on the selected path, express its location // in terms of screen coordinates and check if there is any // menu element on the selected path that contains given source point. for (int i = 0; i < selectedPath.size(); i++) { Component comp = ((Component) selectedPath.get(i)); Dimension size = comp.getSize(); // convert location of this menu item to screen coordinates compPointOnScreen = comp.getLocationOnScreen(); if (compPointOnScreen.x <= sourcePointOnScreen.x && sourcePointOnScreen.x < compPointOnScreen.x + size.width && compPointOnScreen.y <= sourcePointOnScreen.y && sourcePointOnScreen.y < compPointOnScreen.y + size.height) { Point p = sourcePointOnScreen; SwingUtilities.convertPointFromScreen(p, comp); resultComp = SwingUtilities.getDeepestComponentAt(comp, p.x, p.y); break; } } return resultComp; }
| 6,772
|
public Component componentForPoint(Component source, Point sourcePoint) { // Convert sourcePoint to screen coordinates. Point sourcePointOnScreen = sourcePoint; SwingUtilities.convertPointToScreen(sourcePointOnScreen, source); Point compPointOnScreen; Component resultComp = null; // For each menu element on the selected path, express its location // in terms of screen coordinates and check if there is any // menu element on the selected path that contains given source point. for (int i = 0; i < selectedPath.size(); i++) { Component comp = ((Component) selectedPath.get(i)); Dimension size = comp.getSize(); // convert location of this menu item to screen coordinates compPointOnScreen = comp.getLocationOnScreen(); if (compPointOnScreen.x <= sourcePointOnScreen.x && sourcePointOnScreen.x < compPointOnScreen.x + size.width && compPointOnScreen.y <= sourcePointOnScreen.y && sourcePointOnScreen.y < compPointOnScreen.y + size.height) { Point p = sourcePointOnScreen; SwingUtilities.convertPointFromScreen(p, comp); resultComp = SwingUtilities.getDeepestComponentAt(comp, p.x, p.y); break; } } return resultComp; }
|
public Component componentForPoint(Component source, Point sourcePoint) { // Convert sourcePoint to screen coordinates. Point sourcePointOnScreen = sourcePoint; SwingUtilities.convertPointToScreen(sourcePointOnScreen, source); Point compPointOnScreen; Component resultComp = null; // For each menu element on the selected path, express its location // in terms of screen coordinates and check if there is any // menu element on the selected path that contains given source point. for (int i = 0; i < selectedPath.size(); i++) { Component comp = ((Component) selectedPath.get(i)); Dimension size = comp.getSize(); // convert location of this menu item to screen coordinates compPointOnScreen = comp.getLocationOnScreen(); if (compPointOnScreen.x <= sourcePointOnScreen.x && sourcePointOnScreen.x < compPointOnScreen.x + size.width && compPointOnScreen.y <= sourcePointOnScreen.y && sourcePointOnScreen.y < compPointOnScreen.y + size.height) { Point p = sourcePointOnScreen; if (comp.isShowing()) SwingUtilities.convertPointFromScreen(p, comp); resultComp = SwingUtilities.getDeepestComponentAt(comp, p.x, p.y); break; } } return resultComp; }
| 6,773
|
public final void setAttribute(int i) { colSep = false; underLine = false; nonDisplay = false; isChanged = attr == i ? false : true; attr = i; if(i == 0) return; switch(i) { case 32: // green normal fg = s.colorGreen; bg = s.colorBg; break; case 33: // green/revers fg = s.colorBg; bg = s.colorGreen; break; case 34: // white normal fg = s.colorWhite; bg = s.colorBg; break; case 35: // white/reverse fg = s.colorBg; bg = s.colorWhite; break; case 36: // green/underline fg = s.colorGreen; bg = s.colorBg; underLine = true; break; case 37: // green/reverse/underline fg = s.colorBg; bg = s.colorGreen; underLine = true; break; case 38: // white/underline fg = s.colorWhite; bg = s.colorBg; underLine = true; break; case 39: nonDisplay = true; break; case 40: case 42: // red/normal fg = s.colorRed; bg = s.colorBg; break; case 41: case 43: // red/reverse fg = s.colorBg; bg = s.colorRed; break; case 44: case 46: // red/underline fg = s.colorRed; bg = s.colorBg; underLine = true; break; case 45: // red/reverse/underline fg = s.colorBg; bg = s.colorRed; underLine = true; break; case 47: nonDisplay = true; break; case 48: fg = s.colorTurq; bg = s.colorBg; colSep = true; break; case 49: fg = s.colorBg; bg = s.colorTurq; colSep = true; break; case 50: fg = s.colorYellow; bg = s.colorBg; colSep = true; break; case 51: fg = s.colorBg; bg = s.colorYellow; colSep = true; break; case 52: fg = s.colorTurq; bg = s.colorBg; colSep = true; underLine = true; break; case 53: fg = s.colorBg; bg = s.colorTurq; colSep = true; underLine = true; break; case 54: fg = s.colorYellow; bg = s.colorBg; colSep = true; underLine = true; break; case 55: nonDisplay = true; break; case 56: // pink fg = s.colorPink; bg = s.colorBg; break; case 57: // pink/reverse fg = s.colorBg; bg = s.colorPink; break; case 58: // blue/reverse fg = s.colorBlue; bg = s.colorBg; break; case 59: // blue fg = s.colorBg; bg = s.colorBlue; break; case 60: // pink/underline fg = s.colorPink; bg = s.colorBg; underLine = true; break; case 61: // pink/reverse/underline fg = s.colorBg; bg = s.colorPink; underLine = true; break; case 62: // blue/underline fg = s.colorBlue; bg = s.colorBg; underLine = true; break; case 63: nonDisplay = true; break; default: fg = s.colorYellow; break; } }
|
public final void setAttribute(int i) { colSep = false; underLine = false; nonDisplay = false; isChanged = attr == i ? false : true; attr = i; if(i == 0) return; switch(i) { case 32: // green normal fg = s.colorGreen; bg = s.colorBg; break; case 33: // green/revers fg = s.colorBg; bg = s.colorGreen; break; case 34: // white normal fg = s.colorWhite; bg = s.colorBg; break; case 35: // white/reverse fg = s.colorBg; bg = s.colorWhite; break; case 36: // green/underline fg = s.colorGreen; bg = s.colorBg; underLine = true; break; case 37: // green/reverse/underline fg = s.colorBg; bg = s.colorGreen; underLine = true; break; case 38: // white/underline fg = s.colorWhite; bg = s.colorBg; underLine = true; break; case 39: nonDisplay = true; break; case 40: case 42: // red/normal fg = s.colorRed; bg = s.colorBg; break; case 41: case 43: // red/reverse fg = s.colorBg; bg = s.colorRed; break; case 44: case 46: // red/underline fg = s.colorRed; bg = s.colorBg; underLine = true; break; case 45: // red/reverse/underline fg = s.colorBg; bg = s.colorRed; underLine = true; break; case 47: nonDisplay = true; break; case 48: fg = s.colorTurq; bg = s.colorBg; break; case 49: fg = s.colorBg; bg = s.colorTurq; break; case 50: fg = s.colorYellow; bg = s.colorBg; break; case 51: fg = s.colorBg; bg = s.colorYellow; break; case 52: fg = s.colorTurq; bg = s.colorBg; underLine = true; break; case 53: fg = s.colorBg; bg = s.colorTurq; underLine = true; break; case 54: fg = s.colorYellow; bg = s.colorBg; underLine = true; break; case 55: nonDisplay = true; break; case 56: // pink fg = s.colorPink; bg = s.colorBg; break; case 57: // pink/reverse fg = s.colorBg; bg = s.colorPink; break; case 58: // blue/reverse fg = s.colorBlue; bg = s.colorBg; break; case 59: // blue fg = s.colorBg; bg = s.colorBlue; break; case 60: // pink/underline fg = s.colorPink; bg = s.colorBg; underLine = true; break; case 61: // pink/reverse/underline fg = s.colorBg; bg = s.colorPink; underLine = true; break; case 62: // blue/underline fg = s.colorBlue; bg = s.colorBg; underLine = true; break; case 63: nonDisplay = true; break; default: fg = s.colorYellow; break; } }
| 6,774
|
final public void render(Surface surface, Shape clip, AffineTransform tx, String str, int x, int y, Color color) { if (str == null || str.length() == 0) { System.err.println("empty string!"); return; } BDFMetrics fm = (BDFMetrics)bdfFont.getFontMetrics(); int charsCount = str.length(); if ((bdfFont != null) && (charsCount > 0)) { int offset = 0; char[] chars = str.toCharArray(); for(int i=0;i<charsCount;i++) { int base = fm.getDescent(); BDFGlyph glyph = bdfFont.getGlyph(chars[i]); if(glyph==null) { continue; } int fHeight= glyph.getBbx().height; int[] fData = glyph.getData(); int scan = fData.length/fHeight; for(int k=0;k<fHeight;k++) { for(int j=0;j<scan;j++) { int fPixel = fData[(k*scan)+j]; if(fPixel!=0) { int r = color.getRed(); //(color & 0x00FF0000) >> 16; int g = color.getGreen(); //(color & 0x0000FF00) >> 8; int b = color.getBlue(); //(color & 0x000000FF); r = ((r * fPixel)>>bdfFont.getDepth()) & 0xFF; g = ((g * fPixel)>>bdfFont.getDepth()) & 0xFF; b = ((b * fPixel)>>bdfFont.getDepth()) & 0xFF; fPixel = (((r << 16)+ (g << 8) + b )| 0xFF000000); int px = x+offset+j; int py = y+(bdfFont.getBoundingBox().height+base-fHeight)+k-glyph.getBbx().y; surface.setRGBPixel(px, py, fPixel); } } } offset+=glyph.getDWidth().width-glyph.getBbx().x; } } }
|
final public void render(Surface surface, Shape clip, AffineTransform tx, String str, int x, int y, Color color) { if (str == null || str.length() == 0) { System.err.println("empty string!"); return; } BDFMetrics fm = (BDFMetrics)bdfFont.getFontMetrics(); int charsCount = str.length(); if ((bdfFont != null) && (charsCount > 0)) { int offset = 0; final char[] chars = str.toCharArray(); final int bdfFontDepth = bdfFont.getDepth(); for(int i=0;i<charsCount;i++) { int base = fm.getDescent(); BDFGlyph glyph = bdfFont.getGlyph(chars[i]); if(glyph==null) { continue; } int fHeight= glyph.getBbx().height; int[] fData = glyph.getData(); int scan = fData.length/fHeight; for(int k=0;k<fHeight;k++) { for(int j=0;j<scan;j++) { int fPixel = fData[(k*scan)+j]; if(fPixel!=0) { int r = color.getRed(); //(color & 0x00FF0000) >> 16; int g = color.getGreen(); //(color & 0x0000FF00) >> 8; int b = color.getBlue(); //(color & 0x000000FF); r = ((r * fPixel)>>bdfFont.getDepth()) & 0xFF; g = ((g * fPixel)>>bdfFont.getDepth()) & 0xFF; b = ((b * fPixel)>>bdfFont.getDepth()) & 0xFF; fPixel = (((r << 16)+ (g << 8) + b )| 0xFF000000); int px = x+offset+j; int py = y+(bdfFont.getBoundingBox().height+base-fHeight)+k-glyph.getBbx().y; surface.setRGBPixel(px, py, fPixel); } } } offset+=glyph.getDWidth().width-glyph.getBbx().x; } } }
| 6,775
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.