bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
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; } }
10,739
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; }
10,740
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); }
10,741
public String getClassName() { return className; }
public String getClassName() { return declaringClass; }
10,742
public int hashCode() { return hashCode(fileName) ^ lineNumber ^ hashCode(className) ^ hashCode(methodName); }
public int hashCode() { return hashCode(fileName) ^ lineNumber ^ hashCode(declaringClass) ^ hashCode(methodName); }
10,743
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(); }
10,744
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(); }
10,745
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; }
10,747
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); }
10,748
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"); }
10,749
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"); }
10,750
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"); }
10,751
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"); }
10,752
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); }
10,753
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); }
10,754
protected synchronized InputStream getInputStream() throws IOException { if (in == null) in = new SocketInputStream(); return in; }
protected synchronized InputStream getInputStream() throws IOException { if (in == null) in = new SocketInputStream(); return in; }
10,755
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"); }
10,756
protected synchronized OutputStream getOutputStream() throws IOException { if (out == null) out = new SocketOutputStream(); return out; }
protected synchronized OutputStream getOutputStream() throws IOException { if (out == null) out = new SocketOutputStream(); return out; }
10,757
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"); }
10,758
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"); }
10,759
public void sendUrgentData(int data) { throw new InternalError ("PlainSocketImpl::sendUrgentData not implemented"); }
public void sendUrgentData(int data) { impl.sendUrgentData(data); }
10,760
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"); }
10,761
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"); }
10,762
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(); }
10,763
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(); }
10,764
protected void propertyChange(PropertyChangeEvent event) { // Does nothing by default. }
if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } protectedif (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } voidif (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } propertyChange(PropertyChangeEventif (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } event)if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } {if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } //if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } Doesif (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } nothingif (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } byif (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } default.if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } if (event.getPropertyName().equals("editable")) { if (textComponent.isEditable()) textComponent.setBackground(background); else textComponent.setBackground(inactiveBackground); } }
10,765
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); } }
10,766
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); } }
10,767
protected String paramString() { return "JInternalFrame"; }
protected String paramString() { return super.paramString(); }
10,768
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(); }
10,769
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
10,770
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
10,771
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); } else super.setLayout(manager); }
public void setLayout(LayoutManager manager) { // Check if we're in initialization stage. If so, call super.setLayout // otherwise, valid calls go to the content pane. if (initStageDone) { if (isRootPaneCheckingEnabled()) throw new Error("Cannot set layout. Use getContentPane().setLayout()" + " instead."); getContentPane().setLayout(manager); else super.setLayout(manager); }
10,772
public IRBasicBlock(int address) { this(address, -1, false); }
public IRBasicBlock(int address) { this(address, -1, false); }
10,775
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); }
10,776
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; }
10,777
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; }
10,778
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; }
10,779
public BlockElement (Element parent, AttributeSet a) { super (parent, a); }
public BlockElement (Element parent, AttributeSet a) { super(parent, a); }
10,780
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(); }
10,781
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; }
10,782
public void mouseClicked(MouseEvent e) { }
public void mouseClicked(MouseEvent e) { }
10,783
public void mouseDragged(MouseEvent e) { curr = new Point(e.getX(), e.getY()); updateSelection(e.isControlDown()); }
public void mouseDragged(MouseEvent e) { curr = new Point(e.getX(), e.getY()); updateSelection(e.isControlDown()); }
10,784
public void mouseDragged(MouseEvent e) { curr = new Point(e.getX(), e.getY()); updateSelection(e.isControlDown()); }
public void mouseDragged(MouseEvent e) { curr = new Point(e.getX(), e.getY()); updateSelection(e.isControlDown()); }
10,785
public void mouseEntered(MouseEvent e) { }
public void mouseEntered(MouseEvent e) { }
10,786
public void mousePressed(MouseEvent e) { begin = new Point(e.getX(), e.getY()); curr = new Point(e.getX(), e.getY()); //if control is pressed and the cell is already selected, deselect it if (e.isControlDown() && table. isCellSelected(table.rowAtPoint(begin),table.columnAtPoint(begin))) { table.getSelectionModel(). removeSelectionInterval(table.rowAtPoint(begin), table.rowAtPoint(begin)); table.getColumnModel().getSelectionModel(). removeSelectionInterval(table.columnAtPoint(begin), table.columnAtPoint(begin)); } else updateSelection(e.isControlDown()); }
public void mousePressed(MouseEvent e) { begin = new Point(e.getX(), e.getY()); curr = new Point(e.getX(), e.getY()); //if control is pressed and the cell is already selected, deselect it if (e.isControlDown() && table. isCellSelected(table.rowAtPoint(begin),table.columnAtPoint(begin))) { table.getSelectionModel(). removeSelectionInterval(table.rowAtPoint(begin), table.rowAtPoint(begin)); table.getColumnModel().getSelectionModel(). removeSelectionInterval(table.columnAtPoint(begin), table.columnAtPoint(begin)); } else updateSelection(e.isControlDown()); }
10,787
public void mousePressed(MouseEvent e) { begin = new Point(e.getX(), e.getY()); curr = new Point(e.getX(), e.getY()); //if control is pressed and the cell is already selected, deselect it if (e.isControlDown() && table. isCellSelected(table.rowAtPoint(begin),table.columnAtPoint(begin))) { table.getSelectionModel(). removeSelectionInterval(table.rowAtPoint(begin), table.rowAtPoint(begin)); table.getColumnModel().getSelectionModel(). removeSelectionInterval(table.columnAtPoint(begin), table.columnAtPoint(begin)); } else updateSelection(e.isControlDown()); }
public void mousePressed(MouseEvent e) { begin = new Point(e.getX(), e.getY()); curr = new Point(e.getX(), e.getY()); //if control is pressed and the cell is already selected, deselect it if (e.isControlDown() && table. isCellSelected(table.rowAtPoint(begin),table.columnAtPoint(begin))) { table.getSelectionModel(). removeSelectionInterval(table.rowAtPoint(begin), table.rowAtPoint(begin)); table.getColumnModel().getSelectionModel(). removeSelectionInterval(table.columnAtPoint(begin), table.columnAtPoint(begin)); } else updateSelection(e.isControlDown()); }
10,788
public void mouseReleased(MouseEvent e) { begin = null; curr = null; }
public void mouseReleased(MouseEvent e) { begin = null; curr = null; }
10,790
public void mouseReleased(MouseEvent e) { begin = null; curr = null; }
public void mouseReleased(MouseEvent e) { begin = null; curr = null; }
10,791
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); } }
10,792
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); } }
10,793
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); } }
10,794
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); } }
10,795
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); } }
10,796
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); }
10,797
protected FocusListener createFocusListener() { return new FocusHandler(); }
protected FocusListener createFocusListener() { return new FocusHandler(); }
10,798
protected MouseInputListener createMouseInputListener() { return new MouseInputHandler(); }
protected MouseInputListener createMouseInputListener() { return new MouseInputHandler(); }
10,799
public Dimension getMaximumSize(JComponent comp) { return getPreferredSize(comp); }
public Dimension getMaximumSize(JComponent comp) { return getPreferredSize(comp); }
10,800
public Dimension getMinimumSize(JComponent comp) { return getPreferredSize(comp); }
public Dimension getMinimumSize(JComponent comp) { return getPreferredSize(comp); }
10,801
public Dimension getPreferredSize(JComponent comp) { int width = table.getColumnModel().getTotalColumnWidth(); int height = table.getRowCount() * table.getRowHeight(); return new Dimension(width, height); }
public Dimension getPreferredSize(JComponent comp) { int width = table.getColumnModel().getTotalColumnWidth(); int height = table.getRowCount() * table.getRowHeight(); return new Dimension(width, height); }
10,802
public Dimension getPreferredSize(JComponent comp) { int width = table.getColumnModel().getTotalColumnWidth(); int height = table.getRowCount() * table.getRowHeight(); return new Dimension(width, height); }
public Dimension getPreferredSize(JComponent comp) { int width = table.getColumnModel().getTotalColumnWidth(); int height = table.getRowCount() * table.getRowHeight(); return new Dimension(width, height); }
10,803
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); table.setFont(defaults.getFont("Table.font")); table.setGridColor(defaults.getColor("Table.gridColor")); table.setForeground(defaults.getColor("Table.foreground")); table.setBackground(defaults.getColor("Table.background")); table.setSelectionForeground(defaults.getColor("Table.selectionForeground")); table.setSelectionBackground(defaults.getColor("Table.selectionBackground")); table.setOpaque(true); highlightCellBorder = defaults.getBorder("Table.focusCellHighlightBorder"); cellBorder = BorderFactory.createEmptyBorder(1, 1, 1, 1); }
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); table.setFont(defaults.getFont("Table.font")); table.setGridColor(defaults.getColor("Table.gridColor")); table.setForeground(defaults.getColor("Table.foreground")); table.setBackground(defaults.getColor("Table.background")); table.setSelectionForeground(defaults.getColor("Table.selectionForeground")); table.setSelectionBackground(defaults.getColor("Table.selectionBackground")); table.setOpaque(true); highlightCellBorder = defaults.getBorder("Table.focusCellHighlightBorder"); cellBorder = BorderFactory.createEmptyBorder(1, 1, 1, 1); }
10,804
protected void installKeyboardActions() { }
protected void installKeyboardActions() { }
10,805
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(); }
10,806
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); // Set correct border on cell renderer. // Only the lead selection cell gets a border if (comp instanceof JComponent) { if (table.getSelectionModel().getLeadSelectionIndex() == r && table.getColumnModel().getSelectionModel(). getLeadSelectionIndex() == c) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } comp.paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } }
publicvoidpaint(Graphicsgfx,JComponentignored){intncols=table.getColumnCount();intnrows=table.getRowCount();if(nrows==0||ncols==0)return;Rectangleclip=gfx.getClipBounds();TableColumnModelcols=table.getColumnModel();intheight=table.getRowHeight();intx0=0,y0=0;intx=x0;inty=y0;Dimensiongap=table.getIntercellSpacing();intymax=clip.y+clip.height;intxmax=clip.x+clip.width;//paintthecellcontentsfor(intc=0;c<ncols&&x<xmax;++c){y=y0;TableColumncol=cols.getColumn(c);intwidth=col.getWidth();intmodelCol=col.getModelIndex();for(intr=0;r<nrows&&y<ymax;++r){Rectanglebounds=newRectangle(x,y,width,height);if(bounds.intersects(clip)){TableCellRendererrend=table.getCellRenderer(r,c);Componentcomp=table.prepareRenderer(rend,r,c);gfx.translate(x,y);comp.setBounds(newRectangle(0,0,width,height));//Setcorrectborderoncellrenderer.//Onlytheleadselectioncellgetsaborderif(compinstanceofJComponent){if(table.getSelectionModel().getLeadSelectionIndex()==r&&table.getColumnModel().getSelectionModel().getLeadSelectionIndex()==c)((JComponent)comp).setBorder(highlightCellBorder);else((JComponent)comp).setBorder(cellBorder);}comp.paint(gfx);gfx.translate(-x,-y);}y+=height;if(gap!=null)y+=gap.height;}x+=width;if(gap!=null)x+=gap.width;}//tightenupthexandymaxboundsymax=y;xmax=x;Colorgrid=table.getGridColor();//paintverticalgridlinesif(grid!=null&&table.getShowVerticalLines()){x=x0;Colorsave=gfx.getColor();gfx.setColor(grid);booleanpaintedLine=false;for(intc=0;c<ncols&&x<xmax;++c){x+=cols.getColumn(c).getWidth();;if(gap!=null)x+=gap.width;gfx.drawLine(x,y0,x,ymax);paintedLine=true;}gfx.setColor(save);}//painthorizontalgridlinesif(grid!=null&&table.getShowHorizontalLines()){y=y0;Colorsave=gfx.getColor();gfx.setColor(grid);booleanpaintedLine=false;for(intr=0;r<nrows&&y<ymax;++r){y+=height;if(gap!=null)y+=gap.height;gfx.drawLine(x0,y,xmax,y);paintedLine=true;}gfx.setColor(save);}}
10,807
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 + ">"); }
10,808
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 { 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(); }
10,809
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, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 0); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 0); write32(imm32); } }
10,810
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, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 4); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 4); write32(imm32); } }
10,811
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()); }
10,812
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, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, reg.getSize(), reg, 7); write8(imm32); } else { write1bOpcodeModRR(0x81, reg.getSize(), reg, 7); write32(imm32); } }
10,813
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, mode.getSize()); if (code32) { write8(0x48 + dstReg.getNr()); } else { write1bOpcodeModRR(0xFF, dstReg.getSize(), dstReg, 1); } }
10,814
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, mode.getSize()); if (code32) { write8(0x40 + dstReg.getNr()); } else { write1bOpcodeModRR(0xFF, dstReg.getSize(), dstReg, 0); } }
10,815
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()); }
10,816
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, mode.getSize()); testSize(dstReg, BITS32 | BITS64); if (dstReg.getSize() == BITS32) { write1bOpcodeReg(0xB8, dstReg); write32(imm32); } else { writeMOV_Const(dstReg, (long) imm32); } }
10,817
public final void writeNEG(GPR dstReg) { testSize(dstReg, mode.getSize()); write1bOpcodeModRR(0xf7, dstReg.getSize(), dstReg, 3); }
public final void writeNEG(GPR dstReg) { testSize(dstReg, mode.getSize()); write1bOpcodeModRR(0xf7, dstReg.getSize(), dstReg, 3); }
10,818
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, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 1); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 1); write32(imm32); } }
10,819
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); }
10,820
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, mode.getSize()); write1bOpcodeModRR(0xc1, dstReg.getSize(), dstReg, 5); write8(imm8); }
10,821
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, mode.getSize()); write1bOpcodeModRR(0xd3, dstReg.getSize(), dstReg, 5); }
10,822
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, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, reg.getSize(), reg, 5); write8(imm32); } else { write1bOpcodeModRR(0x81, reg.getSize(), reg, 5); write32(imm32); } }
10,823
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, mode.getSize()); write1bOpcodeModRR(0xF7, reg.getSize(), reg, 0); write32(imm32); }
10,824
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, mode.getSize()); if (X86Utils.isByte(imm32)) { write1bOpcodeModRR(0x83, dstReg.getSize(), dstReg, 6); write8(imm32); } else { write1bOpcodeModRR(0x81, dstReg.getSize(), dstReg, 6); write32(imm32); } }
10,825
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(); 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; }
10,826
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(); 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; }
10,827
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); }
10,828
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); }
10,829
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; }
10,830
public Dimension getPreferredScrollableViewportSize() { //If the layout orientation is not VERTICAL, then this will //return the value from getPreferredSize. The current ListUI is //expected to override getPreferredSize to return an appropriate value. if (getLayoutOrientation() != VERTICAL) return getPreferredSize(); if (fixedCellHeight != -1 && fixedCellWidth != -1) return new Dimension(fixedCellWidth, getModel().getSize() * fixedCellHeight); int prefWidth, prefHeight; if (fixedCellWidth != -1) prefWidth = fixedCellWidth; else { prefWidth = 0; int size = getModel().getSize(); for (int i = 0; i < size; i++) if (getCellBounds(i, i).width > prefWidth) prefWidth = getCellBounds(i, i).width; } if (getModel().getSize() == 0 && fixedCellWidth == -1) return new Dimension(256, 16 * getVisibleRowCount()); else if (getModel().getSize() == 0) return new Dimension (fixedCellWidth, 16 * getVisibleRowCount()); if (fixedCellHeight != -1) prefHeight = fixedCellHeight; else { prefHeight = getVisibleRowCount() * getCellBounds (getFirstVisibleIndex(), getFirstVisibleIndex()).height; } return new Dimension (prefWidth, prefHeight); }
public Dimension getPreferredScrollableViewportSize() { //If the layout orientation is not VERTICAL, then this will //return the value from getPreferredSize. The current ListUI is //expected to override getPreferredSize to return an appropriate value. if (getLayoutOrientation() != VERTICAL) return getPreferredSize(); if (fixedCellHeight != -1 && fixedCellWidth != -1) return new Dimension(fixedCellWidth, getModel().getSize() * fixedCellHeight); int prefWidth, prefHeight; if (fixedCellWidth != -1) prefWidth = fixedCellWidth; else { prefWidth = 0; int size = getModel().getSize(); for (int i = 0; i < size; i++) if (getCellBounds(i, i).width > prefWidth) prefWidth = getCellBounds(i, i).width; } if (getModel().getSize() == 0 && fixedCellWidth == -1) return new Dimension(256, 16 * getVisibleRowCount()); else if (getModel().getSize() == 0) return new Dimension (fixedCellWidth, 16 * getVisibleRowCount()); if (fixedCellHeight != -1) prefHeight = fixedCellHeight; else { prefHeight = getVisibleRowCount() * getCellBounds (getFirstVisibleIndex(), getFirstVisibleIndex()).height; } return new Dimension (prefWidth, prefHeight); }
10,831
public Dimension getPreferredScrollableViewportSize() { //If the layout orientation is not VERTICAL, then this will //return the value from getPreferredSize. The current ListUI is //expected to override getPreferredSize to return an appropriate value. if (getLayoutOrientation() != VERTICAL) return getPreferredSize(); if (fixedCellHeight != -1 && fixedCellWidth != -1) return new Dimension(fixedCellWidth, getModel().getSize() * fixedCellHeight); int prefWidth, prefHeight; if (fixedCellWidth != -1) prefWidth = fixedCellWidth; else { prefWidth = 0; int size = getModel().getSize(); for (int i = 0; i < size; i++) if (getCellBounds(i, i).width > prefWidth) prefWidth = getCellBounds(i, i).width; } if (getModel().getSize() == 0 && fixedCellWidth == -1) return new Dimension(256, 16 * getVisibleRowCount()); else if (getModel().getSize() == 0) return new Dimension (fixedCellWidth, 16 * getVisibleRowCount()); if (fixedCellHeight != -1) prefHeight = fixedCellHeight; else { prefHeight = getVisibleRowCount() * getCellBounds (getFirstVisibleIndex(), getFirstVisibleIndex()).height; } return new Dimension (prefWidth, prefHeight); }
public Dimension getPreferredScrollableViewportSize() { //If the layout orientation is not VERTICAL, then this will //return the value from getPreferredSize. The current ListUI is //expected to override getPreferredSize to return an appropriate value. if (getLayoutOrientation() != VERTICAL) return getPreferredSize(); if (fixedCellHeight != -1 && fixedCellWidth != -1) return new Dimension(fixedCellWidth, getModel().getSize() * fixedCellHeight); int prefWidth, prefHeight; if (fixedCellWidth != -1) prefWidth = fixedCellWidth; else { prefWidth = 0; int size = getModel().getSize(); for (int i = 0; i < size; i++) if (getCellBounds(i, i).width > prefWidth) prefWidth = getCellBounds(i, i).width; } if (getModel().getSize() == 0 && fixedCellWidth == -1) return new Dimension(256, 16 * getVisibleRowCount()); else if (getModel().getSize() == 0) return new Dimension (fixedCellWidth, 16 * getVisibleRowCount()); if (fixedCellHeight != -1) prefHeight = fixedCellHeight; else { prefHeight = getVisibleRowCount() * getCellBounds (getFirstVisibleIndex(), getFirstVisibleIndex()).height; } return new Dimension (prefWidth, prefHeight); }
10,832
public Dimension getPreferredScrollableViewportSize() { //If the layout orientation is not VERTICAL, then this will //return the value from getPreferredSize. The current ListUI is //expected to override getPreferredSize to return an appropriate value. if (getLayoutOrientation() != VERTICAL) return getPreferredSize(); if (fixedCellHeight != -1 && fixedCellWidth != -1) return new Dimension(fixedCellWidth, getModel().getSize() * fixedCellHeight); int prefWidth, prefHeight; if (fixedCellWidth != -1) prefWidth = fixedCellWidth; else { prefWidth = 0; int size = getModel().getSize(); for (int i = 0; i < size; i++) if (getCellBounds(i, i).width > prefWidth) prefWidth = getCellBounds(i, i).width; } if (getModel().getSize() == 0 && fixedCellWidth == -1) return new Dimension(256, 16 * getVisibleRowCount()); else if (getModel().getSize() == 0) return new Dimension (fixedCellWidth, 16 * getVisibleRowCount()); if (fixedCellHeight != -1) prefHeight = fixedCellHeight; else { prefHeight = getVisibleRowCount() * getCellBounds (getFirstVisibleIndex(), getFirstVisibleIndex()).height; } return new Dimension (prefWidth, prefHeight); }
public Dimension getPreferredScrollableViewportSize() { //If the layout orientation is not VERTICAL, then this will //return the value from getPreferredSize. The current ListUI is //expected to override getPreferredSize to return an appropriate value. if (getLayoutOrientation() != VERTICAL) return getPreferredSize(); if (fixedCellHeight != -1 && fixedCellWidth != -1) return new Dimension(fixedCellWidth, getModel().getSize() * fixedCellHeight); int prefWidth, prefHeight; if (fixedCellWidth != -1) prefWidth = fixedCellWidth; else { prefWidth = 0; int size = getModel().getSize(); for (int i = 0; i < size; i++) if (getCellBounds(i, i).width > prefWidth) prefWidth = getCellBounds(i, i).width; } if (getModel().getSize() == 0 && fixedCellWidth == -1) return new Dimension(256, 16 * getVisibleRowCount()); else if (getModel().getSize() == 0) return new Dimension (fixedCellWidth, 16 * getVisibleRowCount()); if (fixedCellHeight != -1) prefHeight = fixedCellHeight; else { prefHeight = getVisibleRowCount() * getCellBounds (getFirstVisibleIndex(), getFirstVisibleIndex()).height; } return new Dimension (prefWidth, prefHeight); }
10,833
public SwingCanvasPeer(Canvas canvas) { SwingToolkit.add(canvas, this); SwingToolkit.copyAwtProperties(canvas, this); }
public SwingCanvasPeer(Canvas canvas) { SwingToolkit.add(canvas, this); SwingToolkit.copyAwtProperties(canvas, this); }
10,834
public boolean canDetermineObscurity() { return false; }
public boolean canDetermineObscurity() { return false; }
10,835
public void coalescePaintEvent(PaintEvent e) { System.err.println(e); }
public void coalescePaintEvent(PaintEvent e) { System.err.println(e); }
10,836
public void createBuffers(int x, BufferCapabilities bufferCapabilities) { }
public void createBuffers(int x, BufferCapabilities bufferCapabilities) { }
10,837
public void destroyBuffers() { }
public void destroyBuffers() { }
10,838
public void dispose() { }
public void dispose() { }
10,839
public void flip(BufferCapabilities.FlipContents flipContents) { }
public void flip(BufferCapabilities.FlipContents flipContents) { }
10,840
public Image getBackBuffer() { return null; }
public Image getBackBuffer() { return null; }
10,841
public void handleEvent(AWTEvent e) { //System.err.println(e); }
public void handleEvent(AWTEvent e) { //System.err.println(e); }
10,842