rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public static double parseDouble(String str) { return new VMDouble(str).parse();
public static double parseDouble(String str) { return VMDouble.parseDouble(str);
public static double parseDouble(String str) { return new VMDouble(str).parse(); }
int getRunLimit (AttributedCharacterIterator.Attribute attrib);
int getRunLimit();
int getRunLimit (AttributedCharacterIterator.Attribute attrib);
int getRunStart (AttributedCharacterIterator.Attribute attrib);
int getRunStart();
int getRunStart (AttributedCharacterIterator.Attribute attrib);
e.printStackTrace();
log.warn("In constructor: "+e);
public Gui5250SplitFrame(My5250 m) { super(m); enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } }
public JSplitPane(int newOrientation)
public JSplitPane(int newOrientation, boolean newContinuousLayout, Component newLeftComponent, Component newRightComponent)
public JSplitPane(int newOrientation) { this(newOrientation, false, null, null); }
this(newOrientation, false, null, null);
if (newOrientation != HORIZONTAL_SPLIT && newOrientation != VERTICAL_SPLIT) throw new IllegalArgumentException("orientation is invalid."); orientation = newOrientation; continuousLayout = newContinuousLayout; setLeftComponent(newLeftComponent); setRightComponent(newRightComponent); updateUI();
public JSplitPane(int newOrientation) { this(newOrientation, false, null, null); }
if (config == null) { String conf = (String) AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return Security.getProperty ("login.configuration.provider"); } }); try { if (conf != null) config = (Configuration) Class.forName (conf).newInstance(); else config = new NullConfiguration(); } catch (Exception x) { config = new NullConfiguration(); } }
static Configuration getConfig() { return config; }
if (config == null) { String conf = (String) AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return Security.getProperty ("login.configuration.provider"); } }); try { if (conf != null) config = (Configuration) Class.forName (conf).newInstance(); else config = new NullConfiguration(); } catch (Exception x) { config = new NullConfiguration(); } } return config;
return getConfig();
public static synchronized Configuration getConfiguration() { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission (new AuthPermission ("getLoginConfiguration")); if (config == null) { String conf = (String) AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return Security.getProperty ("login.configuration.provider"); } }); try { if (conf != null) config = (Configuration) Class.forName (conf).newInstance(); else config = new NullConfiguration(); } catch (Exception x) { config = new NullConfiguration(); } } return config; }
public BooleanSeqHolder(boolean[] initial_value)
public BooleanSeqHolder()
public BooleanSeqHolder(boolean[] initial_value) { value = initial_value; typecode.setLength(value.length); }
value = initial_value; typecode.setLength(value.length);
public BooleanSeqHolder(boolean[] initial_value) { value = initial_value; typecode.setLength(value.length); }
attributes = StyleContext.this.addAttribute(attributes, ResolveAttribute, parent);
if (parent != null) { attributes = StyleContext.this.addAttribute (attributes, ResolveAttribute, parent); }
public void setResolveParent(AttributeSet parent) { attributes = StyleContext.this.addAttribute(attributes, ResolveAttribute, parent); fireStateChanged(); }
public SimpleAttributeSet(AttributeSet a)
public SimpleAttributeSet()
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
tab = new Hashtable(); if (a != null) addAttributes(a);
this(null);
public SimpleAttributeSet(AttributeSet a) { tab = new Hashtable(); if (a != null) addAttributes(a); }
return Color.BLACK;
return Color.WHITE;
public static Color getBackground(AttributeSet a) { if (a.isDefined(Background)) return (Color) a.getAttribute(Background); else return Color.BLACK; }
public JIFSFile(String name, FSEntry parent) { this(name); this.parent = parent; refresh();
public JIFSFile(String name) { this.name = name;
public JIFSFile(String name, FSEntry parent) { this(name); this.parent = parent; refresh(); }
public void store(int value) {
public void store(ObjectReference ref) {
public void store(int value) { }
static StringBuffer toString(int mod, StringBuffer r)
public static String toString(int mod)
static StringBuffer toString(int mod, StringBuffer r) { if (isPublic(mod)) r.append("public "); if (isProtected(mod)) r.append("protected "); if (isPrivate(mod)) r.append("private "); if (isAbstract(mod)) r.append("abstract "); if (isStatic(mod)) r.append("static "); if (isFinal(mod)) r.append("final "); if (isTransient(mod)) r.append("transient "); if (isVolatile(mod)) r.append("volatile "); if (isSynchronized(mod)) r.append("synchronized "); if (isNative(mod)) r.append("native "); if (isStrict(mod)) r.append("strictfp "); if (isInterface(mod)) r.append("interface "); // Trim trailing space. if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); return r; }
if (isPublic(mod)) r.append("public "); if (isProtected(mod)) r.append("protected "); if (isPrivate(mod)) r.append("private "); if (isAbstract(mod)) r.append("abstract "); if (isStatic(mod)) r.append("static "); if (isFinal(mod)) r.append("final "); if (isTransient(mod)) r.append("transient "); if (isVolatile(mod)) r.append("volatile "); if (isSynchronized(mod)) r.append("synchronized "); if (isNative(mod)) r.append("native "); if (isStrict(mod)) r.append("strictfp "); if (isInterface(mod)) r.append("interface "); if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); return r;
return toString(mod, new StringBuffer()).toString();
static StringBuffer toString(int mod, StringBuffer r) { if (isPublic(mod)) r.append("public "); if (isProtected(mod)) r.append("protected "); if (isPrivate(mod)) r.append("private "); if (isAbstract(mod)) r.append("abstract "); if (isStatic(mod)) r.append("static "); if (isFinal(mod)) r.append("final "); if (isTransient(mod)) r.append("transient "); if (isVolatile(mod)) r.append("volatile "); if (isSynchronized(mod)) r.append("synchronized "); if (isNative(mod)) r.append("native "); if (isStrict(mod)) r.append("strictfp "); if (isInterface(mod)) r.append("interface "); // Trim trailing space. if ((mod & ALL_FLAGS) != 0) r.setLength(r.length() - 1); return r; }
if (configurationResource == null || configurationResource == "") configurationResource = "TN5250JDefaults.props";
boolean loadDefaults = false; if (configurationResource == null || configurationResource == "") { loadDefaults = true; }
private void loadConfigurationResource() { sesProps = new Properties(); if (configurationResource == null || configurationResource == "") configurationResource = "TN5250JDefaults.props"; try {// FileInputStream in = new FileInputStream(((GlobalConfigure)ConfigureFactory.getInstance()).settingsDirectory()// + configurationResource); FileInputStream in = new FileInputStream(configurationResource); //InputStream in = getClass().getClassLoader().getResourceAsStream(propFileName); sesProps.load(in); } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + configurationResource); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
FileInputStream in = new FileInputStream(configurationResource); sesProps.load(in);
if (loadDefaults) { Properties schemaProps = new Properties(); java.net.URL file=null; ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) cl = ClassLoader.getSystemClassLoader(); file = cl.getResource("tn5250jSchemas.properties"); schemaProps.load(file.openStream()); String prefix = schemaProps.getProperty("schemaDefault"); sesProps.setProperty("colorBg",schemaProps.getProperty(prefix + ".colorBg")); sesProps.setProperty("colorRed",schemaProps.getProperty(prefix + ".colorRed")); sesProps.setProperty("colorTurq",schemaProps.getProperty(prefix + ".colorTurq")); sesProps.setProperty("colorCursor",schemaProps.getProperty(prefix + ".colorCursor")); sesProps.setProperty("colorGUIField",schemaProps.getProperty(prefix + ".colorGUIField")); sesProps.setProperty("colorWhite",schemaProps.getProperty(prefix + ".colorWhite")); sesProps.setProperty("colorYellow",schemaProps.getProperty(prefix + ".colorYellow")); sesProps.setProperty("colorGreen",schemaProps.getProperty(prefix + ".colorGreen")); sesProps.setProperty("colorPink",schemaProps.getProperty(prefix + ".colorPink")); sesProps.setProperty("colorBlue",schemaProps.getProperty(prefix + ".colorBlue")); sesProps.setProperty("colorSep",schemaProps.getProperty(prefix + ".colorSep")); sesProps.setProperty("colorHexAttr",schemaProps.getProperty(prefix + ".colorHexAttr")); } else { FileInputStream in = new FileInputStream(configurationResource); sesProps.load(in); }
private void loadConfigurationResource() { sesProps = new Properties(); if (configurationResource == null || configurationResource == "") configurationResource = "TN5250JDefaults.props"; try {// FileInputStream in = new FileInputStream(((GlobalConfigure)ConfigureFactory.getInstance()).settingsDirectory()// + configurationResource); FileInputStream in = new FileInputStream(configurationResource); //InputStream in = getClass().getClassLoader().getResourceAsStream(propFileName); sesProps.load(in); } catch (IOException ioe) { System.out.println("Information Message: Properties file is being " + "created for first time use: File name " + configurationResource); } catch (SecurityException se) { System.out.println(se.getMessage()); } }
else g.setColor(disabledColor);
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { g.setColor(unselectedColor); Segment segment = new Segment(); getDocument().getText(p0, p1 - p0, segment); return Utilities.drawTabbedText(segment, x, y, g, this, segment.offset); }
disabledColor = textComponent.getDisabledTextColor();
public void paint(Graphics g, Shape s) { // Ensure metrics are up-to-date. updateMetrics(); JTextComponent textComponent = (JTextComponent) getContainer(); g.setFont(textComponent.getFont()); selectedColor = textComponent.getSelectedTextColor(); unselectedColor = textComponent.getForeground(); Rectangle rect = s.getBounds(); // FIXME: Text may be scrolled. Document document = textComponent.getDocument(); Element root = document.getDefaultRootElement(); int y = rect.y; for (int i = 0; i < root.getElementCount(); i++) { drawLine(i, g, rect.x, y); y += metrics.getHeight(); } }
public int charWidth(char ch)
public int charWidth(int ch)
public int charWidth(char ch) { return 1; }
return 1;
char[] chars = Character.toChars(ch); return charsWidth(chars, 0, chars.length);
public int charWidth(char ch) { return 1; }
case MESSAGE_PING: DataOutputStream out = conn.getDataOutputStream(); out.writeByte(MESSAGE_PING_ACK); out.flush(); break;
public static void dispatch(UnicastConnection conn) throws Exception { switch (conn.getDataInputStream().readUnsignedByte()) { case MESSAGE_CALL: incomingMessageCall(conn); break; default: throw new Exception("bad method type"); }}
ObjectInputStream in = conn.getObjectInputStream();
ObjectInputStream in = conn.startObjectInputStream();
private static void incomingMessageCall(UnicastConnection conn) throws IOException { ObjectInputStream in = conn.getObjectInputStream(); ObjID objid = ObjID.read(in); int method = in.readInt(); long hash = in.readLong();//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash); // Use the objid to locate the relevant UnicastServerRef UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; // returnval is from Method.invoke(), so we must check the return class to see // if it's primitive type Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; returncode = RETURN_NACK; } } else { returnval = new NoSuchObjectException(""); returncode = RETURN_NACK; } conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK); ObjectOutputStream out = conn.getObjectOutputStream(); out.writeByte(returncode); (new UID()).write(out); if(returnval != null && returncls != null) ((RMIObjectOutputStream)out).writeValue(returnval, returncls); else if (!(returnval instanceof RMIVoidValue)) out.writeObject(returnval); out.flush();}
ObjectOutputStream out = conn.getObjectOutputStream();
ObjectOutputStream out = conn.startObjectOutputStream();
private static void incomingMessageCall(UnicastConnection conn) throws IOException { ObjectInputStream in = conn.getObjectInputStream(); ObjID objid = ObjID.read(in); int method = in.readInt(); long hash = in.readLong();//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash); // Use the objid to locate the relevant UnicastServerRef UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; // returnval is from Method.invoke(), so we must check the return class to see // if it's primitive type Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; returncode = RETURN_NACK; } } else { returnval = new NoSuchObjectException(""); returncode = RETURN_NACK; } conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK); ObjectOutputStream out = conn.getObjectOutputStream(); out.writeByte(returncode); (new UID()).write(out); if(returnval != null && returncls != null) ((RMIObjectOutputStream)out).writeValue(returnval, returncls); else if (!(returnval instanceof RMIVoidValue)) out.writeObject(returnval); out.flush();}
else if (!(returnval instanceof RMIVoidValue))
else if (!(returnval instanceof RMIVoidValue || returncls == Void.TYPE))
private static void incomingMessageCall(UnicastConnection conn) throws IOException { ObjectInputStream in = conn.getObjectInputStream(); ObjID objid = ObjID.read(in); int method = in.readInt(); long hash = in.readLong();//System.out.println("ObjID: " + objid + ", method: " + method + ", hash: " + hash); // Use the objid to locate the relevant UnicastServerRef UnicastServerRef uref = (UnicastServerRef)objects.get(objid); Object returnval; int returncode = RETURN_ACK; // returnval is from Method.invoke(), so we must check the return class to see // if it's primitive type Class returncls = null; if (uref != null) { try { // Dispatch the call to it. returnval = uref.incomingMessageCall(conn, method, hash); returncls = uref.getMethodReturnType(method, hash); } catch (Exception e) { returnval = e; returncode = RETURN_NACK; } } else { returnval = new NoSuchObjectException(""); returncode = RETURN_NACK; } conn.getDataOutputStream().writeByte(MESSAGE_CALL_ACK); ObjectOutputStream out = conn.getObjectOutputStream(); out.writeByte(returncode); (new UID()).write(out); if(returnval != null && returncls != null) ((RMIObjectOutputStream)out).writeValue(returnval, returncls); else if (!(returnval instanceof RMIVoidValue)) out.writeObject(returnval); out.flush();}
oin = new RMIObjectInputStream(din);
throw new IOException("no ObjectInputtream for reading more objects");
ObjectInputStream getObjectInputStream() throws IOException { if (oin == null) { oin = new RMIObjectInputStream(din); } return (oin);}
oout = new RMIObjectOutputStream(dout);
throw new IOException("no ObjectOutputStream for sending more objects");
ObjectOutputStream getObjectOutputStream() throws IOException { if (oout == null) { oout = new RMIObjectOutputStream(dout); } return (oout);}
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { }
public UID() { time = System.currentTimeMillis(); unique = machineId; if (time > last) { last = time; count = uidCounter = Short.MIN_VALUE; } else { synchronized (UID.class) { if (uidCounter == Short.MAX_VALUE) { try { Thread.sleep(2); } catch (InterruptedException e) { } uidCounter = Short.MIN_VALUE; time = last = System.currentTimeMillis(); } count = uidCounter++;
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
baseTime = newtime; nextCount = Short.MIN_VALUE;
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
count = nextCount++; unique = uniqueNr; time = baseTime;
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
}
public UID() { synchronized (lock) { if (nextCount == Short.MAX_VALUE) { long newtime; for (;;) { newtime = System.currentTimeMillis(); if (newtime - baseTime > 1000) { break; } try { Thread.sleep(1000); } catch (InterruptedException _) { } } baseTime = newtime; nextCount = Short.MIN_VALUE; } count = nextCount++; unique = uniqueNr; time = baseTime; }}
if (array == null) { Log.warn("in Structure.addArray(), Array passed in is null"); return null; }
public Array addArray(Array array) { if (array == null) { Log.warn("in Structure.addArray(), Array passed in is null"); return null; } getArrayList().add(array); return array; }
if (n == null) { Log.warn("in Structure.addNote(), the Note passed in is null"); return null; }
public Note addNote(Note n) { if (n == null) { Log.warn("in Structure.addNote(), the Note passed in is null"); return null; } getNoteList().add(n); return n; }
if (group !=null) { paramGroupOwnedHash.add(group); return group; } else { Log.warn("in Structure.addParamGroup(). ParameterGroup passed in is null"); return null; }
paramGroupOwnedHash.add(group); return group;
public ParameterGroup addParamGroup (ParameterGroup group) { if (group !=null) { //add the group to the groupOwnedHash paramGroupOwnedHash.add(group); return group; } else { Log.warn("in Structure.addParamGroup(). ParameterGroup passed in is null"); return null; } }
if (p == null) { Log.warn("in Structure.addParameter, Parameter passed in is null"); return null; }
public Parameter addParameter(Parameter p) { if (p == null) { Log.warn("in Structure.addParameter, Parameter passed in is null"); return null; } getParamList().add(p); return p; }
if (s == null) { Log.warn("in Structure.addStructure(), Structure passed in is null"); return null; }
public Structure addStructure(Structure s) { if (s == null) { Log.warn("in Structure.addStructure(), Structure passed in is null"); return null; } getStructList().add(s); return s; }
cloneObj.paramGroupOwnedHash.add(iter.next());
cloneObj.paramGroupOwnedHash.add(((Group)iter.next()).clone());
public Object clone() throws CloneNotSupportedException{ Structure cloneObj = (Structure) super.clone(); //deep copy of the paramGroupOwnedHash synchronized (this.paramGroupOwnedHash) { synchronized(cloneObj.paramGroupOwnedHash) { cloneObj.paramGroupOwnedHash = Collections.synchronizedSet(new HashSet(this.paramGroupOwnedHash.size())); Iterator iter = this.paramGroupOwnedHash.iterator(); while (iter.hasNext()) { cloneObj.paramGroupOwnedHash.add(iter.next()); } } } return cloneObj; }
if (group == null) { Log.warn("in Structure.removeParamGroup(). ParameterGroup passed in is null"); return false; }
public boolean removeParamGroup(ParameterGroup group) { if (group == null) { Log.warn("in Structure.removeParamGroup(). ParameterGroup passed in is null"); return false; } return paramGroupOwnedHash.remove(group); }
public Object clone () throws CloneNotSupportedException{
protected Object clone () throws CloneNotSupportedException{
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i)));
synchronized (this.attribOrder) { synchronized (cloneObj.attribOrder) { cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); }
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys();
}
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone());
synchronized (cloneObj.attribHash) { cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); }
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
return (Object) cloneObj;
return cloneObj;
public Object clone () throws CloneNotSupportedException{ //shallow copy for fields BaseObject cloneObj = (BaseObject) super.clone(); // Clone the fields cloneObj.attribOrder = Collections.synchronizedList(new ArrayList()); int stop = this.attribOrder.size(); for (int i = 0; i < stop; i++) { cloneObj.attribOrder.add(new String((String) this.attribOrder.get(i))); } // XMLAttributes Clone cloneObj.attribHash = new Hashtable(); Enumeration keys = this.attribHash.keys(); synchronized (this.attribHash) { for (int i = 0; i < stop; i++) { String key = (String) cloneObj.attribOrder.get(i); XMLAttribute XMLAttributeValue = (XMLAttribute) this.attribHash.get(key); cloneObj.attribHash.put(key, XMLAttributeValue.clone()); } }// cloneObj.classXDFNodeName = this.classXDFNodeName;// cloneObj.attribOrder = this.attribOrder;// cloneObj.groupMemberHash = Collections.synchronizedSet(new HashSet());// cloneObj.openGroupNodeHash = Collections.synchronizedSet(new HashSet()); /** This field stores object references to those group objects to which a given object belongs. */ return (Object) cloneObj; }
String charString, keyCodeString, modString, tmpString,isString;
String charString, keyCodeString, modString, tmpString,isString,locString;
protected void displayInfo(KeyEvent e, String s){ String charString, keyCodeString, modString, tmpString,isString; char c = e.getKeyChar(); int keyCode = e.getKeyCode(); int modifiers = e.getModifiers(); if (Character.isISOControl(c)) { charString = "key character = " + "(an unprintable control character)"; } else { charString = "key character = '" + c + "'"; } keyCodeString = "key code = " + keyCode + " (" + KeyEvent.getKeyText(keyCode) + ")"; if(keyCode == KeyEvent.VK_PREVIOUS_CANDIDATE) { keyCodeString += " previous candidate "; } if(keyCode == KeyEvent.VK_DEAD_ABOVEDOT || keyCode == KeyEvent.VK_DEAD_ABOVERING || keyCode == KeyEvent.VK_DEAD_ACUTE || keyCode == KeyEvent.VK_DEAD_BREVE || keyCode == KeyEvent.VK_DEAD_CIRCUMFLEX ) { keyCodeString += " dead key "; } modString = "modifiers = " + modifiers; tmpString = KeyEvent.getKeyModifiersText(modifiers); if (tmpString.length() > 0) { modString += " (" + tmpString + ")"; } else { modString += " (no modifiers)"; } isString = "isKeys = isActionKey (" + e.isActionKey() + ")" + " isAltDown (" + e.isAltDown() + ")" + " isAltGraphDown (" + e.isAltGraphDown() + ")" + " isAltGraphDownLinux (" + isAltGr + ")" + " isControlDown (" + e.isControlDown() + ")" + " isMetaDown (" + e.isMetaDown() + ")" + " isShiftDown (" + e.isShiftDown() + ")"; String newline = "\n"; System.out.println(s + newline + " " + charString + newline + " " + keyCodeString + newline + " " + modString + newline + " " + isString + newline); }
+ " " + locString + newline
protected void displayInfo(KeyEvent e, String s){ String charString, keyCodeString, modString, tmpString,isString; char c = e.getKeyChar(); int keyCode = e.getKeyCode(); int modifiers = e.getModifiers(); if (Character.isISOControl(c)) { charString = "key character = " + "(an unprintable control character)"; } else { charString = "key character = '" + c + "'"; } keyCodeString = "key code = " + keyCode + " (" + KeyEvent.getKeyText(keyCode) + ")"; if(keyCode == KeyEvent.VK_PREVIOUS_CANDIDATE) { keyCodeString += " previous candidate "; } if(keyCode == KeyEvent.VK_DEAD_ABOVEDOT || keyCode == KeyEvent.VK_DEAD_ABOVERING || keyCode == KeyEvent.VK_DEAD_ACUTE || keyCode == KeyEvent.VK_DEAD_BREVE || keyCode == KeyEvent.VK_DEAD_CIRCUMFLEX ) { keyCodeString += " dead key "; } modString = "modifiers = " + modifiers; tmpString = KeyEvent.getKeyModifiersText(modifiers); if (tmpString.length() > 0) { modString += " (" + tmpString + ")"; } else { modString += " (no modifiers)"; } isString = "isKeys = isActionKey (" + e.isActionKey() + ")" + " isAltDown (" + e.isAltDown() + ")" + " isAltGraphDown (" + e.isAltGraphDown() + ")" + " isAltGraphDownLinux (" + isAltGr + ")" + " isControlDown (" + e.isControlDown() + ")" + " isMetaDown (" + e.isMetaDown() + ")" + " isShiftDown (" + e.isShiftDown() + ")"; String newline = "\n"; System.out.println(s + newline + " " + charString + newline + " " + keyCodeString + newline + " " + modString + newline + " " + isString + newline); }
displayInfo(e,"Pressed ");
private void processVTKeyPressed(KeyEvent e){// displayInfo(e,"Pressed "); int keyCode = e.getKeyCode(); if (isLinux && keyCode == e.VK_ALT_GRAPH) { isAltGr = true; } // be careful with the control key if (keyCode == e.VK_UNDEFINED || keyCode == e.VK_CAPS_LOCK || keyCode == e.VK_SHIFT || keyCode == e.VK_ALT || keyCode == e.VK_ALT_GRAPH || keyCode == e.VK_CONTROL ) { return; } // be careful with the control key !!!!!! if (!e.isAltDown() || !e.isShiftDown() || !e.isControlDown() || keyCode != KeyEvent.VK_CONTROL && // be careful about removing this line !e.isActionKey()) {// if (keyCode == KeyEvent.VK_ESCAPE ||// keyCode == KeyEvent.VK_CONTROL ||// keyCode == KeyEvent.VK_BACK_SPACE) {// displayInfo(e,"Pressed added"); keyevent = e; dialog.setVisible(false); dialog.dispose();// } } }
displayInfo(e,"Released ");
private void processVTKeyReleased(KeyEvent e){// displayInfo(e,"Released "); if (isLinux && e.getKeyCode() == e.VK_ALT_GRAPH) { isAltGr = false; } int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e;// displayInfo(e,"Released added"); dialog.setVisible(false); dialog.dispose(); } }
displayInfo(e,"Typed ");
private void processVTKeyTyped(KeyEvent e){// displayInfo(e,"Typed "); int keycode = e.getKeyCode(); if (e.isAltDown() || e.isShiftDown() || e.isControlDown() || e.isActionKey() || keycode == KeyEvent.VK_CONTROL) { keyevent = e;// displayInfo(e,"Released added "); dialog.setVisible(false); dialog.dispose(); } }
char ac = codePage.getASCIIChar(x);
char ac = codePage.ebcdic2uni(x);
private void loadList(String which) { lm.clear(); lm.removeAllElements(); if (which.equals(LangTool.getString("key.labelKeys"))) { Vector lk = new Vector(mnemonicData.length); for (int x = 0; x < mnemonicData.length; x++) { lk.addElement(new KeyDescription(LangTool.getString("key."+mnemonicData[x]),x)); } Collections.sort(lk,new KeyDescriptionCompare()); for (int x = 0; x < mnemonicData.length; x++) { lm.addElement(lk.get(x)); } macros = false; special = false; } else { if (which.equals(LangTool.getString("key.labelMacros"))) { Vector macrosVector = new Vector(); if (macrosList != null) for (int x = 0; x < macrosList.length; x++) { macrosVector.add(macrosList[x]); } scriptDir("scripts",macrosVector); loadListModel(lm,macrosVector,null,0); macros = true; special = false; } else { // we will use a collator here so that we can take advantage of the locales Collator collator = Collator.getInstance(); CollationKey key = null; StringBuffer sb = new StringBuffer(); Set set = new TreeSet(); for (int x =0;x < 256; x++) { char c = codePage.ebcdic2uni(x); char ac = codePage.getASCIIChar(x); if (!Character.isISOControl(c)) { 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 + " - " + getUnicodeString(c)); key = collator.getCollationKey(sb.toString()); set.add(key); } } Iterator iterator = set.iterator(); while (iterator.hasNext()) { CollationKey keyc = (CollationKey)iterator.next(); lm.addElement(keyc.getSourceString()); } macros = false; special = true; } } if (!lm.isEmpty()) functions.setSelectedIndex(0); }
public JButton(String text)
public JButton()
public JButton(String text) { this(text, null); }
this(text, null);
this(null, null);
public JButton(String text) { this(text, null); }
public JComboBox()
public JComboBox(ComboBoxModel model)
public JComboBox() { this(new DefaultComboBoxModel()); }
this(new DefaultComboBoxModel());
setEditable(false); setEnabled(true); setMaximumRowCount(DEFAULT_MAXIMUM_ROW_COUNT); setModel(model); setActionCommand("comboBoxChanged"); lightWeightPopupEnabled = true; isEditable = false; updateUI();
public JComboBox() { this(new DefaultComboBoxModel()); }
if(dataModel instanceof MutableComboBoxModel) {
if (dataModel instanceof MutableComboBoxModel)
public void addItem(Object element) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).addElement(element); } else { throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel."); } }
} else { throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel."); }
else throw new RuntimeException("Unable to add the item because the data " + "model it is not an instance of " + "MutableComboBoxModel.");
public void addItem(Object element) { if(dataModel instanceof MutableComboBoxModel) { ((MutableComboBoxModel) dataModel).addElement(element); } else { throw new RuntimeException("Unable to add the item because the data model it is not an instance of MutableComboBoxModel."); } }
this.columns = columns;
if (columns != this.columns) { this.columns = columns; revalidate(); }
public void setColumns(int columns) { if (columns < 0) throw new IllegalArgumentException(); this.columns = columns; }
public JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue)
public JOptionPane()
public JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue) { this.message = message; if (! validMessageType(messageType)) throw new IllegalArgumentException("Message Type not legal value."); this.messageType = messageType; if (! validOptionType(optionType)) throw new IllegalArgumentException("Option Type not legal value."); this.optionType = optionType; this.icon = icon; this.options = options; this.initialValue = initialValue; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); updateUI(); invalidate(); repaint(); }
this.message = message; if (! validMessageType(messageType)) throw new IllegalArgumentException("Message Type not legal value."); this.messageType = messageType; if (! validOptionType(optionType)) throw new IllegalArgumentException("Option Type not legal value."); this.optionType = optionType; this.icon = icon; this.options = options; this.initialValue = initialValue; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); updateUI(); invalidate(); repaint();
this("JOptionPane message", PLAIN_MESSAGE, DEFAULT_OPTION, null, null, null);
public JOptionPane(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue) { this.message = message; if (! validMessageType(messageType)) throw new IllegalArgumentException("Message Type not legal value."); this.messageType = messageType; if (! validOptionType(optionType)) throw new IllegalArgumentException("Option Type not legal value."); this.optionType = optionType; this.icon = icon; this.options = options; this.initialValue = initialValue; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); updateUI(); invalidate(); repaint(); }
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) {
public final static void setKeyStroke(String which, KeyEvent ke) {
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) { if (ke == null) return; Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); if (keyVal.equals(which)) { mappedKeys.remove(ks); mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),keyVal); return; } } // if we got here it was a dead key and we need to add it. mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),which); }
isAltGr),keyVal);
ke.isAltGraphDown()),keyVal);
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) { if (ke == null) return; Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); if (keyVal.equals(which)) { mappedKeys.remove(ks); mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),keyVal); return; } } // if we got here it was a dead key and we need to add it. mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),which); }
isAltGr),which);
ke.isAltGraphDown()),which);
public final static void setKeyStroke(String which, KeyEvent ke, boolean isAltGr) { if (ke == null) return; Collection v = mappedKeys.values(); Set o = mappedKeys.keySet(); Iterator k = o.iterator(); Iterator i = v.iterator(); while (k.hasNext()) { KeyStroker ks = (KeyStroker)k.next(); String keyVal = (String)i.next(); if (keyVal.equals(which)) { mappedKeys.remove(ks); mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),keyVal); return; } } // if we got here it was a dead key and we need to add it. mappedKeys.put(new KeyStroker(ke.getKeyCode(), ke.isShiftDown(), ke.isControlDown(), ke.isAltDown(), isAltGr),which); }
public void installListeners(AbstractButton b)
protected void installListeners(AbstractButton b)
public void installListeners(AbstractButton b) { listener = createButtonListener(b); b.addChangeListener(listener); b.addPropertyChangeListener(listener); b.addFocusListener(listener); b.addMouseListener(listener); b.addMouseMotionListener(listener); }
public void uninstallListeners(AbstractButton b)
protected void uninstallListeners(AbstractButton b)
public void uninstallListeners(AbstractButton b) { b.removeChangeListener(listener); b.removePropertyChangeListener(listener); b.removeFocusListener(listener); b.removeMouseListener(listener); b.removeMouseMotionListener(listener); }
if (disabeldIcon == null && default_icon instanceof ImageIcon) disabeldIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon) default_icon).getImage()));
if (disabeldIcon == null && default_icon instanceof ImageIcon) { Image iconImage = ((ImageIcon) default_icon).getImage(); Image grayImage = GrayFilter.createDisabledImage(iconImage); disabeldIcon = new ImageIcon(grayImage); }
public Icon getDisabledIcon() { if (disabeldIcon == null && default_icon instanceof ImageIcon) disabeldIcon = new ImageIcon(GrayFilter.createDisabledImage(((ImageIcon) default_icon).getImage())); return disabeldIcon; }
public JScrollBar(int orientation)
public JScrollBar()
public JScrollBar(int orientation) { this(orientation, 0, 10, 0, 100); }
this(orientation, 0, 10, 0, 100);
this(SwingConstants.VERTICAL, 0, 10, 0, 100);
public JScrollBar(int orientation) { this(orientation, 0, 10, 0, 100); }
if (valueSpecialList.equals(valueSpecialList[i]))
if (strValueSpecial.equals(valueSpecialList[i]))
public static boolean isValidValueSpecial(String strValueSpecial) { if (strValueSpecial == null) return true; String[] valueSpecialList = Constants.VALUE_SPECIAL_LIST; int stop = valueSpecialList.length; for (int i = 0; i < stop; i++) { if (valueSpecialList.equals(valueSpecialList[i])) return true; } return false; }
sessionPane.remove(index); tabs--;
public void removeSessionView(SessionGUI targetSession) { if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < getContentPane().getComponentCount(); x++) { if (getContentPane().getComponent(x) instanceof SessionGUI) { getContentPane().remove(x); } } } else { int index = sessionPane.indexOfComponent(targetSession); log.info("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (tabs > 0 && index <= tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(focused,index); ((SessionGUI)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(focused,0); ((SessionGUI)sessionPane.getComponentAt(0)).requestFocus(); } } } }
if (tabs > 0 && index <= tabs) {
if (tabs > 0 && index < tabs) {
public void removeSessionView(SessionGUI targetSession) { if (hideTabBar && sessionPane.getTabCount() == 0) { for (int x=0; x < getContentPane().getComponentCount(); x++) { if (getContentPane().getComponent(x) instanceof SessionGUI) { getContentPane().remove(x); } } } else { int index = sessionPane.indexOfComponent(targetSession); log.info("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); int tabs = sessionPane.getTabCount(); sessionPane.remove(index); tabs--; if (tabs > 0 && index <= tabs) { sessionPane.setSelectedIndex(index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(focused,index); ((SessionGUI)sessionPane.getComponentAt(index)).requestFocus(); } else { if (tabs > 0) { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(focused,0); ((SessionGUI)sessionPane.getComponentAt(0)).requestFocus(); } } } }
model.setSelectedIndex(index);
model.setSelectedIndex(index); }
public void setSelectedIndex(int index) { checkIndex(index, -1, tabs.size()); if (index != getSelectedIndex()) { if (getSelectedIndex() != -1 && getSelectedComponent() != null) getSelectedComponent().hide(); if (index != -1 && getComponentAt(index) != null) getComponentAt(index).show(); model.setSelectedIndex(index); } }
}
public void setSelectedIndex(int index) { checkIndex(index, -1, tabs.size()); if (index != getSelectedIndex()) { if (getSelectedIndex() != -1 && getSelectedComponent() != null) getSelectedComponent().hide(); if (index != -1 && getComponentAt(index) != null) getComponentAt(index).show(); model.setSelectedIndex(index); } }
public void remove(int index)
public void remove(Component component)
public void remove(int index) { removeTabAt(index); }
removeTabAt(index);
int index = indexOfComponent(component); super.remove(component); component.show(); setComponentAt(index, null);
public void remove(int index) { removeTabAt(index); }
switch (abyte0[i]) {
if (i < abyte0.length) { switch(abyte0[i]) {
protected final boolean negotiate(byte abyte0[]) throws IOException { int i = 0; // from server negotiations if (abyte0[i] == IAC) { // -1 while (i < abyte0.length && abyte0[i++] == -1) // while(i < abyte0.length && (abyte0[i] == -1 || abyte0[i++] == // 0x20)) switch (abyte0[i++]) { // we will not worry about what it WONT do case WONT: // -4 default: break; case DO: //-3 switch (abyte0[i]) { case TERMINAL_TYPE: // 24 baosp.write(IAC); baosp.write(WILL); baosp.write(TERMINAL_TYPE); writeByte(baosp.toByteArray()); baosp.reset(); break; case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(WILL); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // 0 baosp.write(IAC); baosp.write(WILL); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; case TIMING_MARK: // 6 rfc860 // System.out.println("Timing Mark Received and notifying " // + // "the server that we will not do it"); baosp.write(IAC); baosp.write(WONT); baosp.write(TIMING_MARK); writeByte(baosp.toByteArray()); baosp.reset(); break; case NEW_ENVIRONMENT: // 39 rfc1572 if (devName == null && user == null) { baosp.write(IAC); baosp.write(WONT); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } else { baosp.write(IAC); baosp.write(WILL); baosp.write(NEW_ENVIRONMENT); writeByte(baosp.toByteArray()); baosp.reset(); } break; default: // every thing else we will not do at this time baosp.write(IAC); baosp.write(WONT); baosp.write(abyte0[i]); // either writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case WILL: switch (abyte0[i]) { case OPT_END_OF_RECORD: // 25 baosp.write(IAC); baosp.write(DO); baosp.write(OPT_END_OF_RECORD); writeByte(baosp.toByteArray()); baosp.reset(); break; case TRANSMIT_BINARY: // '\0' baosp.write(IAC); baosp.write(DO); baosp.write(TRANSMIT_BINARY); writeByte(baosp.toByteArray()); baosp.reset(); break; } i++; break; case SB: // -6 if (abyte0[i] == NEW_ENVIRONMENT && abyte0[i + 1] == 1) { negNewEnvironment(); while (++i < abyte0.length && abyte0[i + 1] != IAC) ; } if (abyte0[i] == TERMINAL_TYPE && abyte0[i + 1] == 1) { baosp.write(IAC); baosp.write(SB); baosp.write(TERMINAL_TYPE); baosp.write(QUAL_IS); if (!support132) baosp.write("IBM-3179-2".getBytes()); else baosp.write("IBM-3477-FC".getBytes()); baosp.write(IAC); baosp.write(SE); writeByte(baosp.toByteArray()); baosp.reset(); i++; } i++; break; } return true; } else { return false; } }
Class c = this.getClass().forName("org.tn5250j.transport.SSL.SSLImplementation");
Class c = Class.forName("org.tn5250j.transport.SSL.SSLImplementation");
public Socket createSocket(String destination, int port) { try { if (sslType.equals(SSLConstants.SSL_TYPE_NONE)) { System.out.println("Creating Socket"); // for jdk 1.4// return SocketFactory.getDefault().createSocket(destination,port); return new Socket(destination,port); } //Using SSL Socket SSLInterface o = null; try { Class c = this.getClass().forName("org.tn5250j.transport.SSL.SSLImplementation"); o = (SSLInterface)c.newInstance(); o.setSSLType(sslType); return o.createSSLSocket(destination,port); } catch (Exception e) { System.err.println(e); } } catch (Exception e) { System.err.println("SocketConnector: createSocket: " + e.getMessage()); } return null; }
public void goto_XY(int pos) { updateCursorLoc(); lastPos = pos; updateCursorLoc();
public void goto_XY(int row,int col) { goto_XY(((row - 1) * numCols) + (col-1));
public void goto_XY(int pos) {// setCursorOff(); updateCursorLoc(); lastPos = pos;// setCursorOn(); updateCursorLoc(); }
log.info("Received event: " + e.getClass().toString());
log.debug("Received event: " + e.getClass().toString());
public void handleEvent(Tn5250jEvent e) { log.info("Received event: " + e.getClass().toString()); if (e instanceof Tn5250jKeyEvents) { log.info("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes()); } eventList.add(e); synchronized (eventList) { eventList.notify(); } }
log.info("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes());
log.debug("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes());
public void handleEvent(Tn5250jEvent e) { log.info("Received event: " + e.getClass().toString()); if (e instanceof Tn5250jKeyEvents) { log.info("Keys: " + ((Tn5250jKeyEvents) e).getKeystrokes()); } eventList.add(e); synchronized (eventList) { eventList.notify(); } }
public void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag;
public void setPendingInsert(boolean flag, int icX, int icY) { pendingInsert = flag; if (pendingInsert) { homePos = getPos(icX,icY); } if (!isStatusErrorCode()) { goto_XY(icX,icY); }
public void setPendingInsert(boolean flag) { if (homePos != -1) pendingInsert = flag; }
if (!sf.isBypassField()) sf.setFieldId(++fieldIds);
sf.setFieldId(++fieldIds);
public ScreenField setField(int attr, int row, int col, int len, int ffw1, int ffw2, int fcw1, int fcw2) { ScreenField sf = null; screenFields[nextField] = new ScreenField(screen); screenFields[nextField].setField(attr,row,col,len,ffw1,ffw2,fcw1,fcw2); sf = screenFields[nextField++]; sizeFields++; // set the field id if it is not a bypass field // this is used for cursor progression if (!sf.isBypassField()) sf.setFieldId(++fieldIds); // check if the cursor progression field flag should be set.// if ((fcw1 & 0x88) == 0x88) if (fcw1 == 0x88) cpfExists = true; if (currentField != null) { currentField.next = sf; sf.prev = currentField; } currentField = sf; // check if the Modified Data Tag was set while creating the field if (!masterMDT) masterMDT = currentField.mdt; return currentField; }
if (vector.size() >= 5) {
if (vector.size() >= 10) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0);
public Object get() throws InterruptedException { synchronized (lock) { // wait until there is something to read while (isEmpty()) lock.wait(); // just something here to try. if (vector.size() >= 5) { vector.remove(0); vector.remove(0); vector.remove(0); vector.remove(0); } // we have the lock and state we're seeking return vector.remove(0); } }
System.out.println(fnfe.getMessage());
log.warn(fnfe.getMessage());
protected final void toggleDebug (CodePage cp) { if (codePage == null) codePage = cp; dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; codePage = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); }
System.out.println(ioe.getMessage());
log.warn(ioe.getMessage());
protected final void toggleDebug (CodePage cp) { if (codePage == null) codePage = cp; dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; codePage = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); }
System.out.println("Data Stream output is now " + dumpBytes);
log.info("Data Stream output is now " + dumpBytes);
protected final void toggleDebug (CodePage cp) { if (codePage == null) codePage = cp; dumpBytes = !dumpBytes; if (dumpBytes) { try { if (fw == null) { fw = new FileOutputStream("log.txt"); dw = new BufferedOutputStream(fw); } } catch (FileNotFoundException fnfe) { System.out.println(fnfe.getMessage()); } } else { try { if (dw != null) dw.close(); if (fw != null) fw.close(); dw = null; fw = null; codePage = null; } catch(IOException ioe) { System.out.println(ioe.getMessage()); } } System.out.println("Data Stream output is now " + dumpBytes); }
final VmType[] compSuperClasses = componentType.getSuperClassesArray(); final int compLength = compSuperClasses.length;
final VmType[] compSuperClasses; final int compLength; if (componentType.isPrimitive()) { compSuperClasses = null; compLength = 0; } else { compSuperClasses = componentType.getSuperClassesArray(); compLength = compSuperClasses.length; }
protected VmType<?>[] createSuperClassesArray(HashSet<VmInterfaceClass<?>> allInterfaces) { final VmType[] compSuperClasses = componentType.getSuperClassesArray(); final int compLength = compSuperClasses.length; final int length = compLength + 2 + allInterfaces.size(); final VmType<?>[] array = new VmType[length]; array[0] = this; array[1] = this.getSuperClass(); for (int i = 0; i < compLength; i++) { array[2 + i] = compSuperClasses[i].getArrayClass(false); } int index = compLength + 2; for (VmInterfaceClass intfClass : allInterfaces) { array[index++] = intfClass; } if (false) { System.out.println("SuperClassesArray for " + getName() + ": " + getSuperClassDepth()); for (int i = 0; i < length; i++) { System.out.println("[" + i + "]\t" + array[i].getName()); } } return array; }
VmNormalClass superClass,
String superClassName,
public VmClassType( String name, VmNormalClass superClass, VmClassLoader loader, int typeSize, ProtectionDomain protectionDomain) { super(name, superClass, loader, typeSize, protectionDomain); }
int typeSize, ProtectionDomain protectionDomain) { super(name, superClass, loader, typeSize, protectionDomain);
int accessFlags, ProtectionDomain protectionDomain) { super(name, superClassName, loader, accessFlags, protectionDomain);
public VmClassType( String name, VmNormalClass superClass, VmClassLoader loader, int typeSize, ProtectionDomain protectionDomain) { super(name, superClass, loader, typeSize, protectionDomain); }
final VmArrayClass getArrayClass(boolean link) {
final VmArrayClass getArrayClass(String arrayClassName) {
final VmArrayClass getArrayClass(boolean link) { if (arrayClass == null) { arrayClass = createArrayClass(link, null); } return arrayClass; }
arrayClass = createArrayClass(link, null);
arrayClass = createArrayClass(true, arrayClassName); } else { arrayClass.link();
final VmArrayClass getArrayClass(boolean link) { if (arrayClass == null) { arrayClass = createArrayClass(link, null); } return arrayClass; }
list.add(object); fireIntervalAdded(this, list.size() - 1, list.size());
if (list.size() == 0) { list.add(object); selectedItem = object; fireContentsChanged(this, -1, -1); } else { list.add(object); fireIntervalAdded(this, list.size() - 1, list.size() - 1); }
public void addElement(Object object) { list.add(object); fireIntervalAdded(this, list.size() - 1, list.size()); }
if (index < 0 || index >= list.size()) return null;
public Object getElementAt(int index) { return list.elementAt(index); }
list.clear(); int listSize = getSize(); fireIntervalAdded(this, 0, listSize);
selectedItem = null; int size = getSize(); if (size > 0) { list.clear(); fireIntervalRemoved(this, 0, size - 1); }
public void removeAllElements() { list.clear(); int listSize = getSize(); fireIntervalAdded(this, 0, listSize); }
if (selected == index) { if (selected > 0) selectedItem = getElementAt(selected - 1); else selectedItem = getElementAt(selected); }
public void removeElementAt(int index) { list.remove(index); fireIntervalRemoved(this, index, index); }
if(object == null || list.contains(object)) {
public void setSelectedItem(Object object) { // Updates the selected item only if the given object // is null or in the list (this is how the JDK behaves). if(object == null || list.contains(object)) { selectedItem = object; fireContentsChanged(this, -1, -1); } }
fireContentsChanged(this, -1, -1); }
if(object == null || list.contains(object)) fireContentsChanged(this, -1, -1);
public void setSelectedItem(Object object) { // Updates the selected item only if the given object // is null or in the list (this is how the JDK behaves). if(object == null || list.contains(object)) { selectedItem = object; fireContentsChanged(this, -1, -1); } }
public abstract MemoryResource claimChildResource(int offset, int size, boolean allowOverlaps)
public abstract MemoryResource claimChildResource(Extent size, int align)
public abstract MemoryResource claimChildResource(int offset, int size, boolean allowOverlaps) throws IndexOutOfBoundsException, ResourceNotFreeException;
public abstract void setByte(int memPtr, byte value, int count);
public abstract void setByte(int memPtr, byte value);
public abstract void setByte(int memPtr, byte value, int count);