rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if (helper instanceof BoxedValueHelper)
if ((value_tag & vf_MULTIPLE_IDS) != 0) write_string_array(output, (String[]) ids); else if ((value_tag & vf_ID) != 0) write_string(output, (String) ids); if (USE_CHUNKING)
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
((BoxedValueHelper) helper).write_value(outObj, value);
output.write_long(0x55555555); chunkSizeLocation = rout.getPosition() - INT_SIZE;
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
if (value instanceof CustomMarshal)
chunkSizeLocation = -1; writeValue(outObj, value, helper); if (USE_CHUNKING)
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex);
int chunkSize = rout.getPosition() - chunkSizeLocation - INT_SIZE; int current = rout.getPosition(); rout.seek(chunkSizeLocation); output.write_long(chunkSize); rout.seek(current); output.write_long(-1);
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
else if (value instanceof Streamable) { ((Streamable) value)._write(outObj);
finally { if (runtime != null) runtime.target = null;
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
else { boolean ok = false; try { Class helperClass = Class.forName(ObjectCreator.toHelperName(id)); Method write = helperClass.getMethod("write", new Class[] { org.omg.CORBA.portable.OutputStream.class, value.getClass() } ); write.invoke(null, new Object[] { outObj, value }); ok = true;
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
catch (Exception ex) { ok = false; } if (!ok) throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue" + " or CustomValue." ); } if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m....
private static void write_instance(OutputStream output, Serializable value, String id, Object helper ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use /...
value [ i ] = input.read_wstring();
value [ i ] = input.read_string();
public static String[] read(InputStream input) { String[] value = new String[ input.read_long() ]; for (int i = 0; i < value.length; i++) value [ i ] = input.read_wstring(); return value; }
if (msg == null) { return ; }
protected void writeOut ( OutputStream outputstream, String msg ) { try { outputstream.write(msg.getBytes()); } catch (IOException e) { Log.error("Error: couldnt open OutputStream for writing"); } }
bad.minor = Minor.Any;
public static InvalidTypeForEncoding extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (InvalidTypeForEncoding) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("Invali...
SimpleAttributeSet s = new SimpleAttributeSet(); s.tab = (Hashtable) tab.clone(); return s;
SimpleAttributeSet attr = null; try { attr = (SimpleAttributeSet) super.clone(); attr.tab = (Hashtable) tab.clone(); } catch (CloneNotSupportedException ex) { assert false; } return attr;
public Object clone() { SimpleAttributeSet s = new SimpleAttributeSet(); s.tab = (Hashtable) tab.clone(); return s; }
if (e.getPropertyName().equals(JScrollBar.MODEL_CHANGED_PROPERTY))
if (e.getPropertyName().equals("model"))
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JScrollBar.MODEL_CHANGED_PROPERTY)) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.g...
else if (e.getPropertyName().equals(JScrollBar.ORIENTATION_CHANGED_PROPERTY))
else if (e.getPropertyName().equals("orientation"))
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals(JScrollBar.MODEL_CHANGED_PROPERTY)) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.g...
MyFileChooser pcFileChooser = new MyFileChooser(workingDir);
TN5250jFileChooser pcFileChooser = new TN5250jFileChooser(workingDir);
private void getPCFile() { String workingDir = System.getProperty("user.dir"); MyFileChooser pcFileChooser = new MyFileChooser(workingDir); // set the file filters for the file chooser filter = getFilterByDescription(); pcFileChooser.addChoosableFileFilter(filter); int ret = pcFileChoos...
protected Option(String longName, String description)
protected Option(char shortName, String description)
protected Option(String longName, String description) { this.longName = longName; this.description = description; }
this.longName = longName;
if (shortName == 0) throw new IllegalArgumentException("short name must not be \\0"); this.shortName = shortName;
protected Option(String longName, String description) { this.longName = longName; this.description = description; }
if (addToHeapList) { firstHeap.append(heap); } return heap; }
if (addToHeapList) { heapList.append(heap); } return heap; }
private VmAbstractHeap allocHeap(int size, boolean addToHeapList) { //Unsafe.debug("allocHeap"); final Address start = helper.allocateBlock(size); //final Address start = MemoryBlockManager.allocateBlock(size); if (start == null) { return null; } final Address end = Address.add(start, size); final int slotSiz...
vmClass.initialize(); final int alignedSize = ObjectLayout.objectAlign(size);
vmClass.initialize();
protected Object allocObject(VmClassType vmClass, int size) { // Make sure the class is initialized vmClass.initialize(); final int alignedSize = ObjectLayout.objectAlign(size); //final Monitor mon = heapMonitor; VmAbstractHeap heap = currentHeap; Object result = null; int oomCount = 0; if (gcActive) { ...
VmAbstractHeap heap = currentHeap; Object result = null; int oomCount = 0;
final int alignedSize = ObjectLayout.objectAlign(size);
protected Object allocObject(VmClassType vmClass, int size) { // Make sure the class is initialized vmClass.initialize(); final int alignedSize = ObjectLayout.objectAlign(size); //final Monitor mon = heapMonitor; VmAbstractHeap heap = currentHeap; Object result = null; int oomCount = 0; if (gcActive) { ...
if (gcActive) { Unsafe.debug("Using GC Heap sz"); Unsafe.debug(alignedSize); result = gcHeap.alloc(vmClass, alignedSize); if (result == null) { helper.die("Out of GC heap memory."); } } else { final Monitor m = heapMonitor; if (m != null) { m.enter(); } try { while (result == null) { if (heap == null) { int newHeap...
VmAbstractHeap heap = currentHeap; Object result = null; int oomCount = 0; final Monitor m = heapMonitor; if (m != null) { m.enter(); } try { if (gcActive) { Unsafe.debug("Using GC Heap type"); Unsafe.debug(vmClass.getName()); result = gcHeap.alloc(vmClass, alignedSize); if (result == null) { helper.die("Out of GC he...
protected Object allocObject(VmClassType vmClass, int size) { // Make sure the class is initialized vmClass.initialize(); final int alignedSize = ObjectLayout.objectAlign(size); //final Monitor mon = heapMonitor; VmAbstractHeap heap = currentHeap; Object result = null; int oomCount = 0; if (gcActive) { ...
long size = bootHeap.getFreeSize(); VmAbstractHeap h = firstHeap; while (h != null) { size += h.getFreeSize(); h = h.getNext(); } size += MemoryBlockManager.getFreeMemory(); return size; }
long size = bootHeap.getFreeSize(); VmAbstractHeap h = firstNormalHeap; while (h != null) { size += h.getFreeSize(); h = h.getNext(); } size += MemoryBlockManager.getFreeMemory(); return size; }
public long getFreeMemory() { long size = bootHeap.getFreeSize(); VmAbstractHeap h = firstHeap; while (h != null) { size += h.getFreeSize(); h = h.getNext(); } //size += (Unsafe.addressToLong(heapEnd) - Unsafe.addressToLong(nextHeapPtr)); size += MemoryBlockManager.getFreeMemory(); return size; }
long size = bootHeap.getSize(); VmAbstractHeap h = firstHeap; while (h != null) { size += h.getSize(); h = h.getNext(); } size += MemoryBlockManager.getFreeMemory(); return size; }
long size = bootHeap.getSize(); VmAbstractHeap h = firstNormalHeap; while (h != null) { size += h.getSize(); h = h.getNext(); } size += MemoryBlockManager.getFreeMemory(); return size; }
public long getTotalMemory() { long size = bootHeap.getSize(); VmAbstractHeap h = firstHeap; while (h != null) { size += h.getSize(); h = h.getNext(); } //size += (Unsafe.addressToLong(heapEnd) - Unsafe.addressToLong(nextHeapPtr)); size += MemoryBlockManager.getFreeMemory(); return size; }
Address ptr = helper.allocateBlock(DEFAULT_HEAP_SIZE); firstHeap.initialize(ptr, Address.add(ptr, DEFAULT_HEAP_SIZE), slotSize); gcHeap = allocHeap(DEFAULT_HEAP_SIZE, false); }
Address ptr = helper.allocateBlock(DEFAULT_HEAP_SIZE); firstNormalHeap.initialize(ptr, Address.add(ptr, DEFAULT_HEAP_SIZE), slotSize); gcHeap = allocHeap(DEFAULT_HEAP_SIZE, false); gcHeap.append(firstNormalHeap); heapList = gcHeap; }
protected void initialize() { // Set the basic fields final VmArchitecture arch = Unsafe.getCurrentProcessor().getArchitecture(); final int slotSize = arch.getReferenceSize(); // Initialize the boot heap. bootHeap.initialize(helper.getBootHeapStart(), helper.getBootHeapEnd(), slotSize); // Initialize the first n...
long addrL = helper.addressToLong(ptr); if ((addrL & (ObjectLayout.OBJECT_ALIGN - 1)) != 0) { return false; } if (bootHeap.isObject(ptr)) { return true; } VmAbstractHeap heap = firstHeap; while (heap != null) { if (heap.isObject(ptr)) { return true; } heap = heap.getNext(); } return false; }
long addrL = helper.addressToLong(ptr); if ((addrL & (ObjectLayout.OBJECT_ALIGN - 1)) != 0) { return false; } if (bootHeap.isObject(ptr)) { return true; } VmAbstractHeap heap = heapList; while (heap != null) { if (heap.isObject(ptr)) { return true; } heap = heap.getNext(); } return false; }
public final boolean isObject(Address ptr) { long addrL = helper.addressToLong(ptr); if ((addrL & (ObjectLayout.OBJECT_ALIGN - 1)) != 0) { // The object is not at an object aligned boundary return false; } if (bootHeap.isObject(ptr)) { return true; } VmAbstractHeap heap = firstHeap; while (heap != null) {...
this.currentHeap = this.firstHeap; triggerSize = (int)Math.min(Integer.MAX_VALUE, getFreeMemory() * GC_TRIGGER_PERCENTAGE);
this.currentHeap = this.firstNormalHeap; triggerSize = (int) Math.min(Integer.MAX_VALUE, getFreeMemory() * GC_TRIGGER_PERCENTAGE);
final void resetCurrentHeap() { this.currentHeap = this.firstHeap; // Recalculate the trigger size triggerSize = (int)Math.min(Integer.MAX_VALUE, getFreeMemory() * GC_TRIGGER_PERCENTAGE); }
if (dialog == null || f == null) { return; }
public synchronized void updateProgress(int prog) { progress = prog; repaint(); // wait for it to be painted to ensure progress is updated // continuously try { wait(); } catch(InterruptedException ie) { System.out.println(" updateProgress " + ie.getMessage() ); ...
public FatLfnDirEntry(AbstractDirectory dir, byte[] src, int offset) { super(dir, src, offset);
public FatLfnDirEntry(AbstractDirectory dir) { super(dir);
public FatLfnDirEntry(AbstractDirectory dir, byte[] src, int offset) { super(dir, src, offset); }
if (!cnt.isConstant()) { L1AHelper.requestRegister(ec, X86Register.ECX); cnt.loadTo(ec, X86Register.ECX);
if (!cnt.isConstant() && !cnt.uses(ECX)) { addr.spillIfUsing(ec, ECX); L1AHelper.requestRegister(ec, ECX); cnt.loadTo(ec, ECX);
public void emitMagic(EmitterContext ec, VmMethod method, boolean isstatic, X86BytecodeVisitor bcv) { //final int type = getClass(method); final MagicMethod mcode = MagicMethod.get(method); final VirtualStack vstack = ec.getVStack(); final X86Assembler os = ec.getStream(); final I...
vstack.push(L1AHelper.requestWordRegister(ec, JvmType.INT, resultr));
vstack.push(result);
public void emitMagic(EmitterContext ec, VmMethod method, boolean isstatic, X86BytecodeVisitor bcv) { //final int type = getClass(method); final MagicMethod mcode = MagicMethod.get(method); final VirtualStack vstack = ec.getVStack(); final X86Assembler os = ec.getStream(); final I...
fout = new DataOutputStream(new FileOutputStream(fileName));
try { fout = new DataOutputStream(new FileOutputStream(fileName)); } catch (Exception e) { System.out.println("create file " + e.getMessage()); }
public void createFileInstance(String fileName) throws FileNotFoundException { fout = new DataOutputStream(new FileOutputStream(fileName)); }
row = 0; sb = new StringBuffer(); formats = null;
public void createFileInstance(String fileName) throws FileNotFoundException { fout = new DataOutputStream(new FileOutputStream(fileName)); }
System.out.println("header " + ioe.getMessage());
public void writeHeader(String fileName, String host, ArrayList ffd, char decChar) { final byte[] bof = {0x09,0x08,0x06,0x00,0x00,0x00,0x10,0x00,0x00,0x00}; final byte[] dimension = {0x00,0x02,0x0A,0x00,0x00,0x00,0x64,0x00, 0x00,0x00,0x64,0x00...
else { if (isRootPaneCheckingEnabled()) throw new Error("Do not use add() on JWindow directly. Use " + "getContentPane().add() instead"); getContentPane().add(comp, constraints, index); }
protected void addImpl(Component comp, Object constraints, int index) { super.addImpl(comp, constraints, index); }
initStageDone = true;
protected void windowInit() { super.setLayout(new BorderLayout(1, 1)); getRootPane(); // will do set/create }
if ((fcw1 & 0x88) == 0x88) {
if (fcw1 == 0x88) {
public void setFCWs(int fcw1, int fcw2) { this.fcw1 = fcw1; this.fcw2 = fcw2; if ((fcw1 & 0x88) == 0x88) { cursorProg = fcw2; } }
if (isSelected)
if (isSelected && hasFocus) { setBackground(table.getBackground()); setForeground(table.getSelectionForeground()); } else if (table.isRowSelected(row))
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value != null) { i...
if (filechooser.isTraversable(f))
if (filechooser.isTraversable(f) && filechooser.getFileSelectionMode() == JFileChooser.FILES_ONLY)
public void actionPerformed(ActionEvent e) { Object obj = filelist.getSelectedValue(); if (obj != null) { File f = filechooser.getFileSystemView().createFileObject(obj .toString()); if (filechooser.isTraversable(f)) filechooser....
FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont()); SwingUtilities.layoutCompoundLabel(tip, fm, tip.getTipText(), null,
fm = g.getFontMetrics(tip.getFont()); SwingUtilities.layoutCompoundLabel(tip, fm, text, null,
public Dimension getPreferredSize(JComponent c) { JToolTip tip = (JToolTip) c; Rectangle vr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); Insets insets = tip.getInsets(); FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont()); SwingUtilities.layoutCo...
FontMetrics fm = tip.getToolkit().getFontMetrics(tip.getFont()); SwingUtilities.layoutCompoundLabel(tip, fm, tip.getTipText(), null,
FontMetrics fm = t.getFontMetrics(tip.getFont()); int ascent = fm.getAscent(); SwingUtilities.layoutCompoundLabel(tip, fm, text, null,
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetric...
g.drawString(text, vr.x, vr.y + fm.getAscent());
g.drawString(text, vr.x, vr.y + ascent); if (accText != null) { g.setColor(accFore); int textWidth = fm.stringWidth(text + " "); fm = t.getFontMetrics(accFont); int width = fm.stringWidth(accText); g.drawString(accText, textWidth, vr.y + ascent); }
public void paint(Graphics g, JComponent c) { JToolTip tip = (JToolTip) c; String text = tip.getTipText(); if (text == null) return; Rectangle vr = new Rectangle(); vr = SwingUtilities.calculateInnerArea(tip, vr); Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); FontMetric...
L1AHelper.releaseRegister(eContext, helper.AAX); L1AHelper.releaseRegister(eContext, tmpr);
if (os.isCode32()) { helper.writeGetStaticsEntry(curInstrLabel, tmpr, resolvedType); } else { helper.writeGetStaticsEntry64(curInstrLabel, (GPR64)tmpr, resolvedType); }
public final void visit_checkcast(VmConstClass classRef) { // Resolve classRef classRef.resolve(loader); final VmType<?> resolvedType = classRef.getResolvedVmClass(); final Label curInstrLabel = getCurInstrLabel(); if (resolvedType.isInterface() || resolvedType.isArray()) { // ClassRef is an interface or ...
os.writePUSH(tmpr); L1AHelper.releaseRegister(eContext, helper.AAX); L1AHelper.releaseRegister(eContext, tmpr);
public final void visit_checkcast(VmConstClass classRef) { // Resolve classRef classRef.resolve(loader); final VmType<?> resolvedType = classRef.getResolvedVmClass(); final Label curInstrLabel = getCurInstrLabel(); if (resolvedType.isInterface() || resolvedType.isArray()) { // ClassRef is an interface or ...
public Container getFocusCycleRootAncestor()
public final Container getFocusCycleRootAncestor()
public Container getFocusCycleRootAncestor() { // as defined. return null; }
public String getWarningString()
public final String getWarningString()
public String getWarningString() { // as defined. return null; }
public boolean isFocusCycleRoot()
public final boolean isFocusCycleRoot()
public boolean isFocusCycleRoot() { return true; }
super();
public ThreadDeath() { super(); }
public ARPHeader(SocketBuffer skbuf) throws SocketException { hwtype = skbuf.get16(0); ptype = skbuf.get16(2); op = skbuf.get16(6); if ((hwtype == 1) && (ptype == EthernetConstants.ETH_P_IP)) { srcHWAddress = new EthernetAddress(skbuf, 8); srcPAddress = new IPv4Address(skbuf, 14); targetHWAddress = new EthernetAddres...
public ARPHeader( HardwareAddress srcHWAddress, ProtocolAddress srcPAddress, HardwareAddress targetHWAddress, ProtocolAddress targetPAddress, int op, int hwtype, int ptype) { this.srcHWAddress = srcHWAddress; this.srcPAddress = srcPAddress; this.targetHWAddress = targetHWAddress; this.targetPAddress = targetPAddress; ...
public ARPHeader(SocketBuffer skbuf) throws SocketException { hwtype = skbuf.get16(0); ptype = skbuf.get16(2); //int hwsize = skbuf.get(4); //int psize = skbuf.get(5); op = skbuf.get16(6); if ((hwtype == 1) && (ptype == EthernetConstants.ETH_P_IP)) { srcHWAddress = new EthernetAddress(skbuf, 8); srcPAddress...
public InvalidLayerException(String message) { super(message);
public InvalidLayerException() { super();
public InvalidLayerException(String message) { super(message); }
System.out.println(" key is available " + !exists);
private boolean isAvailable(KeyEvent ke) { boolean exists = true; if (isLinux) { exists = mapper.isKeyStrokeDefined(ke,isAltGr); } else { exists = mapper.isKeyStrokeDefined(ke); } System.out.println(" key is available " + !exists); if (exists) { Object[] ar...
DataFlavor() {
public DataFlavor() {
DataFlavor(){ mimeType = null; representationClass = null; humanPresentableName = null;}
return(super.clone());
return super.clone();
public Object clone () throws CloneNotSupportedException{ try { return(super.clone()); } catch(Exception e) { return(null); }}
return(null);
return null; }
public Object clone () throws CloneNotSupportedException{ try { return(super.clone()); } catch(Exception e) { return(null); }}
}
public Object clone () throws CloneNotSupportedException{ try { return(super.clone()); } catch(Exception e) { return(null); }}
equals(DataFlavor flavor) {
public boolean equals(DataFlavor flavor) {
equals(DataFlavor flavor){ if (flavor == null) return(false); if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return(false); if (!this.representationClass.equals(flavor.representationClass)) return(false); return(true);}
return(false);
return false;
equals(DataFlavor flavor){ if (flavor == null) return(false); if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return(false); if (!this.representationClass.equals(flavor.representationClass)) return(false); return(true);}
if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return(false);
if (! this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return false;
equals(DataFlavor flavor){ if (flavor == null) return(false); if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return(false); if (!this.representationClass.equals(flavor.representationClass)) return(false); return(true);}
if (!this.representationClass.equals(flavor.representationClass)) return(false);
if (! this.representationClass.equals(flavor.representationClass)) return false;
equals(DataFlavor flavor){ if (flavor == null) return(false); if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return(false); if (!this.representationClass.equals(flavor.representationClass)) return(false); return(true);}
return(true); }
return true; }
equals(DataFlavor flavor){ if (flavor == null) return(false); if (!this.mimeType.toLowerCase().equals(flavor.mimeType.toLowerCase())) return(false); if (!this.representationClass.equals(flavor.representationClass)) return(false); return(true);}
getDefaultRepresentationClass() { return(java.io.InputStream.class); }
public final Class getDefaultRepresentationClass() { return java.io.InputStream.class; }
getDefaultRepresentationClass(){ return(java.io.InputStream.class);}
getDefaultRepresentationClassAsString() { return(getDefaultRepresentationClass().getName()); }
public final String getDefaultRepresentationClassAsString() { return getDefaultRepresentationClass().getName(); }
getDefaultRepresentationClassAsString(){ return(getDefaultRepresentationClass().getName());}
getHumanPresentableName() {
public String getHumanPresentableName() {
getHumanPresentableName(){ return(humanPresentableName);}
getMimeType() {
public String getMimeType() {
getMimeType(){ return(mimeType);}
getParameter(String paramName, String mimeString) { int idx = mimeString.indexOf(paramName + "="); if (idx == -1) return(null); String value = mimeString.substring(idx + paramName.length() + 1); idx = value.indexOf(" "); if (idx == -1) return(value); else return(value.substring(0, idx)); }
private static String getParameter(String paramName, String mimeString) { int idx = mimeString.indexOf(paramName + "="); if (idx == -1) return(null); String value = mimeString.substring(idx + paramName.length() + 1); idx = value.indexOf(" "); if (idx == -1) return(value); else return(value.substring(0, idx)); }
getParameter(String paramName, String mimeString){ int idx = mimeString.indexOf(paramName + "="); if (idx == -1) return(null); String value = mimeString.substring(idx + paramName.length() + 1); idx = value.indexOf(" "); if (idx == -1) return(value); else return(value.substring(0, idx));}
getPrimaryType() {
public String getPrimaryType() {
getPrimaryType(){ int idx = mimeType.indexOf("/"); if (idx == -1) return(mimeType); return(mimeType.substring(0, idx));}
return((Reader)transferable.getTransferData(this));
return (Reader)transferable.getTransferData(this);
public Reader getReaderForText(Transferable transferable) throws UnsupportedFlavorException, IOException{ if (!transferable.isDataFlavorSupported(this)) throw new UnsupportedFlavorException(this); if (Reader.class.isAssignableFrom(representationClass)) return((Reader)transferable.getTransferData(th...
return(new StringReader((String)transferable.getTransferData(this)));
return new StringReader((String)transferable.getTransferData(this));
public Reader getReaderForText(Transferable transferable) throws UnsupportedFlavorException, IOException{ if (!transferable.isDataFlavorSupported(this)) throw new UnsupportedFlavorException(this); if (Reader.class.isAssignableFrom(representationClass)) return((Reader)transferable.getTransferData(th...
return(new InputStreamReader(in, encoding));
return new InputStreamReader(in, encoding);
public Reader getReaderForText(Transferable transferable) throws UnsupportedFlavorException, IOException{ if (!transferable.isDataFlavorSupported(this)) throw new UnsupportedFlavorException(this); if (Reader.class.isAssignableFrom(representationClass)) return((Reader)transferable.getTransferData(th...
getRepresentationClass() {
public Class getRepresentationClass() {
getRepresentationClass(){ return(representationClass);}
getRepresentationClassFromMime(String mimeString, ClassLoader classLoader) { String classname = getParameter("class", mimeString); if (classname != null)
private static Class getRepresentationClassFromMime(String mimeString, ClassLoader classLoader)
getRepresentationClassFromMime(String mimeString, ClassLoader classLoader){ String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException(...
try
String classname = getParameter("class", mimeString); if (classname != null)
getRepresentationClassFromMime(String mimeString, ClassLoader classLoader){ String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException(...
return tryToLoadClass(classname, classLoader);
try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException("classname: " + e.getMessage()); }
getRepresentationClassFromMime(String mimeString, ClassLoader classLoader){ String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException(...
catch(Exception e) { throw new IllegalArgumentException("classname: " + e.getMessage()); }
else return java.io.InputStream.class;
getRepresentationClassFromMime(String mimeString, ClassLoader classLoader){ String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException(...
else { return java.io.InputStream.class; } }
getRepresentationClassFromMime(String mimeString, ClassLoader classLoader){ String classname = getParameter("class", mimeString); if (classname != null) { try { return tryToLoadClass(classname, classLoader); } catch(Exception e) { throw new IllegalArgumentException(...
getSubType() {
public String getSubType() {
getSubType(){ int start = mimeType.indexOf("/"); if (start == -1) return ""; int end = mimeType.indexOf(";", start + 1); if (end == -1) return mimeType.substring(start + 1); else return mimeType.substring(start + 1, end);}
getTextPlainUnicodeFlavor() { return(plainTextFlavor); }
public static final DataFlavor getTextPlainUnicodeFlavor() { return plainTextFlavor; }
getTextPlainUnicodeFlavor(){ return(plainTextFlavor);}
hashCode() { return(mimeType.toLowerCase().hashCode()^representationClass.hashCode()); }
public int hashCode() { return mimeType.toLowerCase().hashCode() ^ representationClass.hashCode(); }
hashCode(){ return(mimeType.toLowerCase().hashCode()^representationClass.hashCode());}
isFlavorJavaFileListType() { if (this.mimeType.equals(javaFileListFlavor.mimeType) && this.representationClass.equals(javaFileListFlavor.representationClass)) return(true);
public boolean isFlavorJavaFileListType() { if (mimeType.equals(javaFileListFlavor.mimeType) && representationClass.equals(javaFileListFlavor.representationClass)) return true;
isFlavorJavaFileListType(){ if (this.mimeType.equals(javaFileListFlavor.mimeType) && this.representationClass.equals(javaFileListFlavor.representationClass)) return(true); return(false);}
return(false); }
return false ; }
isFlavorJavaFileListType(){ if (this.mimeType.equals(javaFileListFlavor.mimeType) && this.representationClass.equals(javaFileListFlavor.representationClass)) return(true); return(false);}
isFlavorRemoteObjectType() {
public boolean isFlavorRemoteObjectType() {
isFlavorRemoteObjectType(){ return(mimeType.startsWith(javaRemoteObjectMimeType));}
isFlavorSerializedObjectType() {
public boolean isFlavorSerializedObjectType() {
isFlavorSerializedObjectType(){ // FIXME: What is the diff between this and isMimeTypeSerializedObject? return(mimeType.startsWith(javaSerializedObjectMimeType));}
isMimeTypeEqual(String mimeType) {
public boolean isMimeTypeEqual(String mimeType) {
isMimeTypeEqual(String mimeType){ String mime = getMimeType(); int i = mime.indexOf(";"); if (i != -1) mime = mime.substring(0, i); i = mimeType.indexOf(";"); if (i != -1) mimeType = mimeType.substring(0, i); return mime.equals(mimeType);}
isMimeTypeSerializedObject() { return(mimeType.startsWith(javaSerializedObjectMimeType)); }
public boolean isMimeTypeSerializedObject() { return mimeType.startsWith(javaSerializedObjectMimeType); }
isMimeTypeSerializedObject(){ return(mimeType.startsWith(javaSerializedObjectMimeType));}
isRepresentationClassInputStream() { return(representationClass.getName().equals("java.io.InputStream")); }
public boolean isRepresentationClassInputStream() { return representationClass.getName().equals("java.io.InputStream"); }
isRepresentationClassInputStream(){ return(representationClass.getName().equals("java.io.InputStream"));}
isRepresentationClassRemote() {
public boolean isRepresentationClassRemote() {
isRepresentationClassRemote(){ return Remote.class.isAssignableFrom (representationClass);}
isRepresentationClassSerializable() {
public boolean isRepresentationClassSerializable() {
isRepresentationClassSerializable(){ Class[] interfaces = representationClass.getInterfaces(); int i = 0; while (i < interfaces.length) { if (interfaces[i].getName().equals("java.io.Serializable")) return(true); ++i; } return(false);}
return(true);
return true;
isRepresentationClassSerializable(){ Class[] interfaces = representationClass.getInterfaces(); int i = 0; while (i < interfaces.length) { if (interfaces[i].getName().equals("java.io.Serializable")) return(true); ++i; } return(false);}
return(false); }
return false; }
isRepresentationClassSerializable(){ Class[] interfaces = representationClass.getInterfaces(); int i = 0; while (i < interfaces.length) { if (interfaces[i].getName().equals("java.io.Serializable")) return(true); ++i; } return(false);}
match(DataFlavor dataFlavor) {
public boolean match(DataFlavor dataFlavor) {
match(DataFlavor dataFlavor){ // XXX - How is this different from equals? return(equals(dataFlavor));}
return(equals(dataFlavor)); }
return equals(dataFlavor); }
match(DataFlavor dataFlavor){ // XXX - How is this different from equals? return(equals(dataFlavor));}
normalizeMimeType(String type) { return(type); }
protected String normalizeMimeType(String type) { return type; }
normalizeMimeType(String type){ return(type);}
normalizeMimeTypeParameter(String name, String value) { return(name + "=" + value); }
protected String normalizeMimeTypeParameter(String name, String value) { return name + "=" + value; }
normalizeMimeTypeParameter(String name, String value){ return(name + "=" + value);}
readExternal(ObjectInput stream) throws IOException, ClassNotFoundException {
public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException {
readExternal(ObjectInput stream) throws IOException, ClassNotFoundException{ // FIXME: Implement me}
{ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass;
{ for(int i = 0; i < availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) return df; if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding ...
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df;...
if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df; }
if (r != null) return df; } }
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df;...
if ((InputStream.class.isAssignableFrom(c)) && ("text".equals(df.getPrimaryType()))) { String encoding = availableFlavors[i].getParameter("charset"); if (encoding == null) encoding = "us-ascii"; Reader r = null; try { r = new InputStreamReader (new ByteArrayInputStream(new byte[0]), encoding); } catch(UnsupportedEncod...
return null; }
selectBestTextFlavor(DataFlavor[] availableFlavors){ for(int i=0; i<availableFlavors.length; i++) { DataFlavor df = availableFlavors[i]; Class c = df.representationClass; // A Reader or String is good. if ((Reader.class.isAssignableFrom(c)) || (String.class.isAssignableFrom(c))) { return df;...
setHumanPresentableName(String humanPresentableName) {
public void setHumanPresentableName(String humanPresentableName) {
setHumanPresentableName(String humanPresentableName){ this.humanPresentableName = humanPresentableName;}
toString() { return(getClass().getName()
public String toString() { return (getClass().getName()
toString(){ return(getClass().getName() + "[representationClass=" + getRepresentationClass().getName() + ",mimeType=" + getMimeType() + ",humanPresentableName=" + getHumanPresentableName() + "]");}
tryToLoadClass(String className, ClassLoader classLoader)
protected static final Class tryToLoadClass(String className, ClassLoader classLoader)
tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException{ try { return(Class.forName(className)); } catch(Exception e) { ; } // Commented out for Java 1.1 /* try { return(className.getClass().getClassLoader().findClass(className)); } catch(Excepti...
writeExternal(ObjectOutput stream) throws IOException {
public void writeExternal(ObjectOutput stream) throws IOException {
writeExternal(ObjectOutput stream) throws IOException{ // FIXME: Implement me}
if (attributePlace && s.getShowHex()) {
if (attributePlace && s.isShowHex()) {
public final void drawChar(Graphics2D g) { if (attributePlace && s.getShowHex()) { Font f = g.getFont(); Font k = f.deriveFont(f.getSize2D()/2); g.setFont(k); g.setColor(s.colorHexAttr); char[] a = Integer.toHexString(attr).toCharArray(); g.drawChars(a, 0, 1, x, y...