rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public Area(Shape s)
public Area()
public Area(Shape s) { }
solids = new Vector(); holes = new Vector();
public Area(Shape s) { }
throw new Error("not implemented");
for (int i = 0; i < solids.size(); i++) ((Segment) solids.elementAt(i)).transformSegmentList(at); for (int i = 0; i < holes.size(); i++) ((Segment) holes.elementAt(i)).transformSegmentList(at); if ((at.getType() & AffineTransform.TYPE_FLIP) != 0) { setDirection(holes, false); setDirection(solids, true);
public void transform(AffineTransform at) { // XXX Implement. throw new Error("not implemented"); }
}
public void transform(AffineTransform at) { // XXX Implement. throw new Error("not implemented"); }
throw new Error("not implemented");
int n = 0; for (int i = 0; i < solids.size(); i++) if (((Segment) solids.elementAt(i)).contains(x, y)) n++; for (int i = 0; i < holes.size(); i++) if (((Segment) holes.elementAt(i)).contains(x, y)) n--; return (n != 0);
public boolean contains(double x, double y) { // XXX Implement. throw new Error("not implemented"); }
public boolean equals(Object obj) { if (obj instanceof UID) { UID uid = (UID)obj; if (this.unique == uid.unique && this.time == uid.time && this.count == uid.count) { return (true); } } return (false); }
public boolean equals(Object other) { if (other instanceof UID) { UID ui = (UID) other; return unique == ui.unique && time == ui.time && count == ui.count; } else return false; }
public boolean equals(Object obj) { if (obj instanceof UID) { UID uid = (UID)obj; if (this.unique == uid.unique && this.time == uid.time && this.count == uid.count) { return (true); } } return (false);}
public int hashCode() { return (unique); }
public int hashCode() { return (int) (unique ^ time ^ machineId); }
public int hashCode() { return (unique);}
sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus();
private void nextSession() { int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); if (index < sessionPane.getTabCount() - 1) { sessionPane.setSelectedIndex(++index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); } else { sessionPane.setSelectedIndex(0); sessionPane.setForegroundAt(0,Color.blue); sessionPane.setIconAt(0,focused); } }
sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus();
private void prevSession() { int index = sessionPane.getSelectedIndex(); sessionPane.setForegroundAt(index,Color.black); sessionPane.setIconAt(index,unfocused); if (index == 0) { sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1); sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue); sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused); } else { sessionPane.setSelectedIndex(--index); sessionPane.setForegroundAt(index,Color.blue); sessionPane.setIconAt(index,focused); } }
}
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); words = byteArrayToIntArray(magnitude, signum < 0 ? -1 : 0); BigInteger result = make(words, words.length); this.ival = result.ival; this.words = result.words; }
if (top == 0 && words == null) return 0;
public int signum() { int top = words == null ? ival : words[ival-1]; if (top == 0 && words == null) return 0; return top < 0 ? -1 : 1; }
magnitude = toByteArray();
magnitude = signum == 0 ? new byte[0] : toByteArray();
private void writeObject(ObjectOutputStream s) throws IOException, ClassNotFoundException { signum = signum(); magnitude = toByteArray(); s.defaultWriteObject(); }
public EmulatorAction(Session session, String name, KeyStroke ks, KeyMapper keyMap) {
public EmulatorAction(Session session, String name) {
public EmulatorAction(Session session, String name, KeyStroke ks, KeyMapper keyMap) { this(session,name); setKeyStroke(name, ks, keyMap); }
this(session,name); setKeyStroke(name, ks, keyMap);
super(name); this.session = session;
public EmulatorAction(Session session, String name, KeyStroke ks, KeyMapper keyMap) { this(session,name); setKeyStroke(name, ks, keyMap); }
final Collection devs = dm.getDevices();
final Collection devs = new ArrayList(dm.getDevices());
protected void startPlugin() throws PluginException { try { final DeviceManager dm = DeviceUtils.getDeviceManager(); dm.addListener(this); final Collection devs = dm.getDevices(); for (Iterator i = devs.iterator(); i.hasNext();) { addListeners((Device) i.next()); } } catch (NameNotFoundException ex) { throw new PluginException(ex); } }
} else if (readObj instanceof DelimitedXMLDataIOStyle || readObj instanceof TaggedXMLDataIOStyle ) { throw new SAXException("Cant parse delimited or tagged data from external file (yet)."); }
}
public Object action (SaxDocumentHandler handler, Attributes attrs) throws SAXException { // we only need to do these things for the first time we enter // a data node if (DataNodeLevel == 0) { // A little 'pre-handling' as href is a specialattribute // that will hold an (Href) object rather than string value Entity hrefObj = null; String hrefValue = getAttributesValueByName(attrs,"href"); if (hrefValue != null ) { // now we look up the href from the entity list gathered by // the parser and transfer relevant info to our Href object hrefObj = new Entity(); Hashtable hrefInfo = (Hashtable) UnParsedEntity.get(hrefValue);/*Log.errorln("Href Entity has following keys:");java.util.Set keys = hrefInfo.keySet();Iterator iter = keys.iterator();while (iter.hasNext()) { Log.errorln(" Key:"+iter.next().toString());}*/ if (UnParsedEntity.containsKey(hrefValue)) { hrefObj.setName((String) hrefInfo.get("name"));/* if (hrefInfo.containsKey("base")) hrefObj.setBase((String) hrefInfo.get("base"));*/ if (hrefInfo.containsKey("systemId")) hrefObj.setSystemId((String) hrefInfo.get("systemId")); if (hrefInfo.containsKey("publicId")) hrefObj.setPublicId((String) hrefInfo.get("publicId")); if (hrefInfo.containsKey("ndata")) hrefObj.setNdata((String) hrefInfo.get("ndata")); } else { // bizarre. It usually means that the unparsed entity handler // isnt working like it should Log.error("Error: UnParsedEntity list lacks entry for :"+hrefValue); Log.errorln(" ignoring request to read data."); } } // update the array dataCube with passed attributes CurrentArray.getDataCube().setAttributes(attrs); // Clean up. We override the string value of Href and set it as // the Href object , if we created it (yeh, sloppy). if (hrefObj != null) CurrentArray.getDataCube().setHref(hrefObj); // determine the size of the dataFormat (s) in our dataCube if (CurrentArray.hasFieldAxis()) { // if there is a field axis, then its set to the number of fields FieldAxis fieldAxis = CurrentArray.getFieldAxis(); MaxDataFormatIndex = (fieldAxis.getLength()-1); } else { // its homogeneous MaxDataFormatIndex = 0; } // reset to start of which dataformat type we currently are reading CurrentDataFormatIndex = 0; // reset to start of which IOCmd we currently are reading CurrentIOCmdIndex = 0; // reset the list of dataformats we are reading DataFormatList = CurrentArray.getDataFormatList(); NrofDataFormats = DataFormatList.length; IntRadix = new int [NrofDataFormats]; // CALCULATE CURRENTREADBYTES // set up some other global information bout the dataformats // that will help speed reading CurrentReadBytes = 0; for (int i=0; i < NrofDataFormats; i++) { CurrentReadBytes += DataFormatList[i].numOfBytes(); if (DataFormatList[i] instanceof IntegerDataFormat) { String type = ((IntegerDataFormat) DataFormatList[i]).getType(); if (type.equals(Constants.INTEGER_TYPE_DECIMAL)) IntRadix[i] = 10; else if (type.equals(Constants.INTEGER_TYPE_HEX)) IntRadix[i] = 16; else if (type.equals(Constants.INTEGER_TYPE_OCTAL)) IntRadix[i] = 8; else IntRadix[i] = 10; // default } else if (DataFormatList[i] instanceof BinaryIntegerDataFormat) { IntRadix[i] = 10; } } // DONT FORGET TO ADD IN THE SKIPCHAR bytes XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle(); if (readObj instanceof FormattedXMLDataIOStyle) { Iterator citer = ((FormattedXMLDataIOStyle) readObj).getFormatCommands().iterator(); while (citer.hasNext()) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) citer.next(); if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); CurrentReadBytes += bytes_to_skip.intValue(); } } } else if (readObj instanceof DelimitedXMLDataIOStyle || readObj instanceof TaggedXMLDataIOStyle ) { throw new SAXException("Cant parse delimited or tagged data from external file (yet)."); } if (CurrentReadBytes > MAXINPUTREADSIZE) { Log.errorln("This XDF file has single record that is too big (greater than "+MAXINPUTREADSIZE+" bytes in a record) to parse by this code"); System.exit(-1); } // now determine properread size CurrentInputReadSize = BASEINPUTREADSIZE * CurrentReadBytes; // make sure its not TOO big while (CurrentInputReadSize > MAXINPUTREADSIZE) { CurrentInputReadSize -= CurrentReadBytes; } } XMLDataIOStyle readObj = CurrentArray.getXMLDataIOStyle();// FastestAxis = (AxisInterface) CurrentArray.getAxes().get(0);// LastFastAxisCoordinate = 0; LastFieldAxisCoordinate = 0; if ( readObj instanceof TaggedXMLDataIOStyle) { TaggedLocatorObj = CurrentArray.createLocator(); } else { // A safety. We clear datablock when this is the first datanode we // have entered DATABLOCK is used in cases where we read in untagged data if (DataNodeLevel == 0) DATABLOCK = new StringBuffer (); } // tack in href data Entity href = CurrentArray.getDataCube().getHref(); if (href != null) // The first method is the 'old' way. // If you uncomment it be sure to uncomment line that looks like: // if (CurrentArray.getDataCube().getHref() != null) return; // in the end dataElementHandler // DATABLOCK.append(getHrefData(href, CurrentArray.getDataCube().getCompression())); loadHrefDataIntoCurrentArray(href, CurrentArray.getDataCube().getCompression()); // entered a datanode, raise the count // this (partially helps) declare we are now reading data, DataNodeLevel++; return readObj; }
Log.errorln("Cant understand class of data !(Double|Integer|String). Ignoring append.");
Log.errorln("Dont understand this class of data !(Double|Integer|String). Ignoring append.");
public Array appendArrayToArray ( Array arrayToAppendTo, Array arrayToAdd ) { if (arrayToAppendTo != null) { List origAxisList = arrayToAppendTo.getAxes(); List addAxisList = arrayToAdd.getAxes(); Hashtable correspondingAddAxis = new Hashtable(); Hashtable correspondingOrigAxis = new Hashtable(); // 1. determine the proper alignment of the axes between both arrays // Then cross-reference each in lookup Hashtables. Iterator iter = origAxisList.iterator(); while (iter.hasNext()) { AxisInterface origAxis = (AxisInterface) iter.next(); String align = origAxis.getAlign(); // search the list of the other array for a matching axis boolean gotAMatch = false; Iterator iter2 = addAxisList.iterator(); while (iter2.hasNext()) { AxisInterface addAxis = (AxisInterface) iter2.next(); String thisAlign = addAxis.getAlign(); if(thisAlign != null) { if(thisAlign.equals(align)) { correspondingAddAxis.put(origAxis.getAxisId(), addAxis); correspondingOrigAxis.put(addAxis.getAxisId(), origAxis); gotAMatch = true; break; } } else { Log.errorln("Cant align axes, axis missing defined align attribute. Aborting."); return arrayToAppendTo; } } // no match?? then alignments are mis-specified. if (!gotAMatch) { Log.errorln("Cant align axes, axis has align attribute that is mis-specified. Aborting."); return arrayToAppendTo; } } // 2. "Append" axis values to original axis. Because // there are 2 different ways to add in data we either // have a pre-existing axis value, in which case we dont // need to expand the existing axis, or there is no pre-existing // value so we tack it in. We need to figure out here if an // axis value already exists, and if it doesnt then we add it in. // Iterator iter3 = origAxisList.iterator(); while (iter3.hasNext()) { AxisInterface origAxis = (AxisInterface) iter3.next(); AxisInterface addAxis = (AxisInterface) correspondingAddAxis.get(origAxis.getAxisId()); if (addAxis instanceof Axis && origAxis instanceof Axis) { List valuesToAdd = ((Axis) addAxis).getAxisValues(); Iterator iter4 = valuesToAdd.iterator(); while (iter4.hasNext()) { Value value = (Value) iter4.next(); if (((Axis) origAxis).getIndexFromAxisValue(value) == -1) { ((Axis) origAxis).addAxisValue(value); } } } else if (addAxis instanceof FieldAxis && origAxis instanceof FieldAxis) { // both are fieldAxis Log.errorln("Dont know how to merge field Axis data. Aborting."); System.exit(-1); } else { // mixed class Axes?? (e.g. a fieldAxis id matches Axis id??!? Error!!) Log.errorln("Dont know how to merge data. Aborting."); System.exit(-1); } } // 3. Append data from one array to the other appropriately Locator origLocator = arrayToAppendTo.createLocator(); Locator addLocator = arrayToAdd.createLocator(); while (addLocator.hasNext()) { try { // retrieve the data Object data = arrayToAdd.getData(addLocator); // set up the origLocator List locatorAxisList = addLocator.getIterationOrder(); Iterator iter5 = locatorAxisList.iterator(); while (iter5.hasNext()) { Axis addAxis = (Axis) iter5.next(); Value thisAxisValue = addLocator.getAxisValue(addAxis); Axis thisAxis = (Axis) correspondingOrigAxis.get(addAxis.getAxisId()); try { origLocator.setAxisIndexByAxisValue(thisAxis, thisAxisValue); Log.debug(origLocator.getAxisIndex(thisAxis)+","); } catch (AxisLocationOutOfBoundsException e) { Log.errorln("Weird axis out of bounds error for append array."); } } // add in the data as appropriate. Log.debugln(") => ["+data.toString()+"]"); try { if (data instanceof Double) arrayToAppendTo.setData(origLocator, (Double) data); else if (data instanceof Integer) arrayToAppendTo.setData(origLocator, (Integer) data); else if (data instanceof String ) arrayToAppendTo.setData(origLocator, (String) data); else Log.errorln("Cant understand class of data !(Double|Integer|String). Ignoring append."); } catch (SetDataException e) { Log.errorln(e.getMessage()+". Ignoring append"); } } catch (NoDataException e) { // do nothing for NoDataValues?? Log.errorln(e.getMessage()); } addLocator.next(); // go to next location } } else Log.errorln("Cannot append to null array. Ignoring request."); return arrayToAppendTo; }
ActionEvent event = new ActionEvent(this, 0, getText());
ActionEvent event = new ActionEvent(this, 0, actionCommand == null ? getText() : actionCommand);
protected void fireActionPerformed() { ActionEvent event = new ActionEvent(this, 0, getText()); ActionListener[] listeners = getActionListeners(); for (int index = 0; index < listeners.length; ++index) listeners[index].actionPerformed(event); }
focusColor = getFocusColor(); selectColor = getSelectColor(); disabledTextColor = getDisabledTextColor();
public MetalButtonUI() { super(); }
public static void main(String[] args) throws NoSuchAliasException, NameNotFoundException {
public static void main(String[] args) throws NoSuchAliasException, NameNotFoundException, SyntaxErrorException {
public static void main(String[] args) throws NoSuchAliasException, NameNotFoundException { ParsedArguments cmdLine = HELP_INFO.parse(args); final Shell shell = ShellUtils.getShellManager().getCurrentShell(); final AliasManager aliasMgr = shell.getAliasManager(); if (cmdLine.size() == 0) { for (Iterator i = aliasMgr.aliasIterator(); i.hasNext();) { final String alias = (String) i.next(); System.out.println(alias + ":\t" + aliasMgr.getAliasClassName(alias)); } } else if (PARAM_REMOVE.isSet(cmdLine)) { // remove an alias aliasMgr.remove(ARG_ALIAS.getValue(cmdLine)); } else { // add an alias aliasMgr.add(ARG_ALIAS.getValue(cmdLine), ARG_CLASS.getValue(cmdLine)); } }
throw new InstantiationException(ex1.getTargetException());
final InstantiationException ie = new InstantiationException(); ie.initCause(ex1.getTargetException()); throw ie;
private DeviceToDriverMapper newMapperInstance(Class cls, ConfigurationElement element) throws InstantiationException, IllegalAccessException { try { final Constructor c = cls.getConstructor(new Class[] { ConfigurationElement.class }); try { return (DeviceToDriverMapper)c.newInstance(new Object[] { element }); } catch (InvocationTargetException ex1) { throw new InstantiationException(ex1.getTargetException()); } } catch (NoSuchMethodException ex) { return (DeviceToDriverMapper) cls.newInstance(); } }
if (view != null)
public void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { view.changedUpdate(ev, shape, vf); }
{
{ float span = 10;
public float getPreferredSpan(int axis) { if (view != null) return view.getPreferredSpan(axis); return Integer.MAX_VALUE; }
return view.getPreferredSpan(axis); return Integer.MAX_VALUE; }
span = view.getPreferredSpan(axis); return span; }
public float getPreferredSpan(int axis) { if (view != null) return view.getPreferredSpan(axis); return Integer.MAX_VALUE; }
if (view != null)
public void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { view.insertUpdate(ev, shape, vf); }
Rectangle b = s.getBounds(); view.setSize(b.width, b.height);
Rectangle b = s instanceof Rectangle ? (Rectangle) s : s.getBounds(); setSize(b.width, b.height);
public void paint(Graphics g, Shape s) { if (view != null) { Rectangle b = s.getBounds(); view.setSize(b.width, b.height); view.paint(g, s); } }
if (view != null)
public void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf) { view.removeUpdate(ev, shape, vf); }
public void setSize(float w, float h)
public synchronized void setSize(float w, float h)
public void setSize(float w, float h) { if (view != null) view.setSize(w, h); }
if (kit == null) kit = new DefaultEditorKit();
public EditorKit getEditorKit(JTextComponent t) { return kit; }
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
Dimension d = new Dimension(); Insets i = c.getInsets(); Document doc = textComponent.getDocument(); if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readLock(); try { d.width = (int) Math.min((long) rootView.getMaximumSpan(View.X_AXIS) + i.left + i.right, Integer.MAX_VALUE); d.height = (int) Math.min((long) rootView.getMaximumSpan(View.Y_AXIS) + i.top + i.bottom, Integer.MAX_VALUE); } finally { if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readUnlock(); } return d;
public Dimension getMaximumSize(JComponent c) { // Sun's implementation returns Integer.MAX_VALUE here, so do we. return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); }
return new Dimension(i.left + i.right, i.top + i.bottom);
d.width += i.left + i.right; d.height += i.top + i.bottom; return d;
public Dimension getMinimumSize(JComponent c) { Insets i = c.getInsets(); return new Dimension(i.left + i.right, i.top + i.bottom); }
return rootView.getNextVisualPositionFrom(pos, b, getVisibleEditorRect(),
int offset = -1; Document doc = textComponent.getDocument(); if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readLock(); try { Rectangle alloc = getVisibleEditorRect(); if (alloc != null) { rootView.setSize(alloc.width, alloc.height); offset = rootView.getNextVisualPositionFrom(pos, b, alloc,
public int getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet) throws BadLocationException { // A comment in the spec of NavigationFilter.getNextVisualPositionFrom() // suggests that this method should be implemented by forwarding the call // the root view. return rootView.getNextVisualPositionFrom(pos, b, getVisibleEditorRect(), direction, biasRet); }
} finally { if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readUnlock(); } return offset; }
public int getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet) throws BadLocationException { // A comment in the spec of NavigationFilter.getNextVisualPositionFrom() // suggests that this method should be implemented by forwarding the call // the root view. return rootView.getNextVisualPositionFrom(pos, b, getVisibleEditorRect(), direction, biasRet); }
float w = rootView.getPreferredSpan(View.X_AXIS); float h = rootView.getPreferredSpan(View.Y_AXIS);
else { rootView.setSize(Integer.MAX_VALUE, Integer.MAX_VALUE); } w = rootView.getPreferredSpan(View.X_AXIS); h = rootView.getPreferredSpan(View.Y_AXIS); } finally { if (doc instanceof AbstractDocument) ((AbstractDocument) doc).readUnlock(); }
public Dimension getPreferredSize(JComponent c) { Dimension d = c.getSize(); Insets i = c.getInsets(); if (d.width > (i.left + i.right) && d.height > (i.top + i.bottom)) { rootView.setSize(d.width - i.left - i.right, d.height - i.top - i.bottom); } float w = rootView.getPreferredSpan(View.X_AXIS); float h = rootView.getPreferredSpan(View.Y_AXIS); Dimension size = new Dimension((int) w + i.left + i.right, (int) h + i.top + i.bottom); return size; }
Insets insets = textComponent.getInsets();
Insets insets = textComponent.getInsets(cachedInsets);
protected Rectangle getVisibleEditorRect() { int width = textComponent.getWidth(); int height = textComponent.getHeight(); // Return null if the component has no valid size. if (width <= 0 || height <= 0) return null; Insets insets = textComponent.getInsets(); return new Rectangle(insets.left, insets.top, width - insets.left - insets.right, height - insets.top - insets.bottom); }
textComponent.setMargin(UIManager.getInsets(prefix + ".margin"));
protected void installDefaults() { String prefix = getPropertyPrefix(); // Install the standard properties. LookAndFeel.installColorsAndFont(textComponent, prefix + ".background", prefix + ".foreground", prefix + ".font"); LookAndFeel.installBorder(textComponent, prefix + ".border"); textComponent.setMargin(UIManager.getInsets(prefix + ".margin")); // Some additional text component only properties. Color color = textComponent.getCaretColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".caretForeground"); textComponent.setCaretColor(color); } // Fetch the colors for enabled/disabled text components. color = textComponent.getDisabledTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor(color); } color = textComponent.getSelectedTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionForeground"); textComponent.setSelectedTextColor(color); } color = textComponent.getSelectionColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionBackground"); textComponent.setSelectionColor(color); } Insets margin = textComponent.getMargin(); if (margin == null || margin instanceof UIResource) { margin = UIManager.getInsets(prefix + ".margin"); textComponent.setMargin(margin); } Caret caret = textComponent.getCaret(); if (caret == null || caret instanceof UIResource) { caret = createCaret(); textComponent.setCaret(caret); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null || highlighter instanceof UIResource) textComponent.setHighlighter(createHighlighter()); }
color = UIManager.getColor(prefix + ".inactiveBackground");
color = UIManager.getColor(prefix + ".inactiveForeground");
protected void installDefaults() { String prefix = getPropertyPrefix(); // Install the standard properties. LookAndFeel.installColorsAndFont(textComponent, prefix + ".background", prefix + ".foreground", prefix + ".font"); LookAndFeel.installBorder(textComponent, prefix + ".border"); textComponent.setMargin(UIManager.getInsets(prefix + ".margin")); // Some additional text component only properties. Color color = textComponent.getCaretColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".caretForeground"); textComponent.setCaretColor(color); } // Fetch the colors for enabled/disabled text components. color = textComponent.getDisabledTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor(color); } color = textComponent.getSelectedTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionForeground"); textComponent.setSelectedTextColor(color); } color = textComponent.getSelectionColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionBackground"); textComponent.setSelectionColor(color); } Insets margin = textComponent.getMargin(); if (margin == null || margin instanceof UIResource) { margin = UIManager.getInsets(prefix + ".margin"); textComponent.setMargin(margin); } Caret caret = textComponent.getCaret(); if (caret == null || caret instanceof UIResource) { caret = createCaret(); textComponent.setCaret(caret); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null || highlighter instanceof UIResource) textComponent.setHighlighter(createHighlighter()); }
Caret caret = textComponent.getCaret(); if (caret == null || caret instanceof UIResource) { caret = createCaret(); textComponent.setCaret(caret); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null || highlighter instanceof UIResource) textComponent.setHighlighter(createHighlighter());
protected void installDefaults() { String prefix = getPropertyPrefix(); // Install the standard properties. LookAndFeel.installColorsAndFont(textComponent, prefix + ".background", prefix + ".foreground", prefix + ".font"); LookAndFeel.installBorder(textComponent, prefix + ".border"); textComponent.setMargin(UIManager.getInsets(prefix + ".margin")); // Some additional text component only properties. Color color = textComponent.getCaretColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".caretForeground"); textComponent.setCaretColor(color); } // Fetch the colors for enabled/disabled text components. color = textComponent.getDisabledTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor(color); } color = textComponent.getSelectedTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionForeground"); textComponent.setSelectedTextColor(color); } color = textComponent.getSelectionColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".selectionBackground"); textComponent.setSelectionColor(color); } Insets margin = textComponent.getMargin(); if (margin == null || margin instanceof UIResource) { margin = UIManager.getInsets(prefix + ".margin"); textComponent.setMargin(margin); } Caret caret = textComponent.getCaret(); if (caret == null || caret instanceof UIResource) { caret = createCaret(); textComponent.setCaret(caret); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); } Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null || highlighter instanceof UIResource) textComponent.setHighlighter(createHighlighter()); }
textComponent.addFocusListener(focuslistener);
if (SystemProperties.getProperty("gnu.swing.text.no-xlike-clipboard") == null) { if (focusListener == null) focusListener = new FocusHandler(); textComponent.addFocusListener(focusListener); }
protected void installListeners() { textComponent.addFocusListener(focuslistener); }
textComponent.addPropertyChangeListener(updateHandler);
installFixedDefaults(); if (handler == null) handler = new Handler(); textComponent.addPropertyChangeListener(handler);
public void installUI(final JComponent c) { textComponent = (JTextComponent) c; installDefaults(); textComponent.addPropertyChangeListener(updateHandler); Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } else { doc.addDocumentListener(documentHandler); modelChanged(); } installListeners(); installKeyboardActions(); }
doc.addDocumentListener(documentHandler);
doc.addDocumentListener(handler);
public void installUI(final JComponent c) { textComponent = (JTextComponent) c; installDefaults(); textComponent.addPropertyChangeListener(updateHandler); Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } else { doc.addDocumentListener(documentHandler); modelChanged(); } installListeners(); installKeyboardActions(); }
if (textComponent.getCaretColor() instanceof UIResource) textComponent.setCaretColor(null); if (textComponent.getSelectionColor() instanceof UIResource) textComponent.setSelectionColor(null); if (textComponent.getDisabledTextColor() instanceof UIResource) textComponent.setDisabledTextColor(null); if (textComponent.getSelectedTextColor() instanceof UIResource) textComponent.setSelectedTextColor(null); LookAndFeel.uninstallBorder(textComponent); if (textComponent.getMargin() instanceof UIResource) textComponent.setMargin(null);
protected void uninstallDefaults() { // Do nothing here. }
textComponent.removeFocusListener(focuslistener); textComponent.getDocument().removeDocumentListener(documentHandler);
if (focusListener != null) textComponent.removeFocusListener(focusListener);
protected void uninstallListeners() { textComponent.removeFocusListener(focuslistener); textComponent.getDocument().removeDocumentListener(documentHandler); }
super.uninstallUI(component);
textComponent.removePropertyChangeListener(handler); textComponent.getDocument().removeDocumentListener(handler);
public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); textComponent = null; }
uninstallFixedDefaults();
public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); textComponent = null; }
writeOut(outputstream, valueListInfinite);
doValuePrint (outputstream, specialValue, valueListInfinite);
public void toXMLOutputStream (OutputStream outputstream, String indent) throws java.io.IOException { if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired // no need to have repeatable set to 'yes' would just waste space even if we used this functionality. writeOut(outputstream, "<valueList delimiter=\""+valueListDelimiter+"\" repeatable=\"no\""); if (valueListNoData != null) writeOut(outputstream, " noDataValue=\""+valueListNoData+"\""); if (valueListInfinite != null) writeOut(outputstream, " infiniteValue=\""+valueListInfinite+"\""); if (valueListInfiniteNegative != null) writeOut(outputstream, " infiniteNegaiveValue=\""+valueListInfiniteNegative+"\""); if (valueListNotANumber != null) writeOut(outputstream, " notANumberValue=\""+valueListNotANumber+"\""); if (valueListUnderflow != null) writeOut(outputstream, " underflowValue=\""+valueListUnderflow+"\""); if (valueListOverflow != null) writeOut(outputstream, " overflowValue=\""+valueListOverflow+"\""); writeOut(outputstream, ">"); Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = (Value) iter.next(); String specialValue = thisValue.getSpecial(); if(specialValue != null) { if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE)) { writeOut(outputstream, valueListInfinite); } else if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE_NEGATIVE)) { writeOut(outputstream, valueListInfiniteNegative); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NODATA)) { writeOut(outputstream, valueListNoData); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NOTANUMBER)) { writeOut(outputstream, valueListNotANumber); } else if(specialValue.equals(Constants.VALUE_SPECIAL_UNDERFLOW)) { writeOut(outputstream, valueListUnderflow); } else if(specialValue.equals(Constants.VALUE_SPECIAL_OVERFLOW)) { writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value."); } } else { writeOut(outputstream, thisValue.getValue()); } if (iter.hasNext()) writeOut(outputstream, valueListDelimiter); } writeOut(outputstream, "</valueList>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, valueListInfiniteNegative);
doValuePrint (outputstream, specialValue, valueListInfiniteNegative);
public void toXMLOutputStream (OutputStream outputstream, String indent) throws java.io.IOException { if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired // no need to have repeatable set to 'yes' would just waste space even if we used this functionality. writeOut(outputstream, "<valueList delimiter=\""+valueListDelimiter+"\" repeatable=\"no\""); if (valueListNoData != null) writeOut(outputstream, " noDataValue=\""+valueListNoData+"\""); if (valueListInfinite != null) writeOut(outputstream, " infiniteValue=\""+valueListInfinite+"\""); if (valueListInfiniteNegative != null) writeOut(outputstream, " infiniteNegaiveValue=\""+valueListInfiniteNegative+"\""); if (valueListNotANumber != null) writeOut(outputstream, " notANumberValue=\""+valueListNotANumber+"\""); if (valueListUnderflow != null) writeOut(outputstream, " underflowValue=\""+valueListUnderflow+"\""); if (valueListOverflow != null) writeOut(outputstream, " overflowValue=\""+valueListOverflow+"\""); writeOut(outputstream, ">"); Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = (Value) iter.next(); String specialValue = thisValue.getSpecial(); if(specialValue != null) { if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE)) { writeOut(outputstream, valueListInfinite); } else if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE_NEGATIVE)) { writeOut(outputstream, valueListInfiniteNegative); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NODATA)) { writeOut(outputstream, valueListNoData); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NOTANUMBER)) { writeOut(outputstream, valueListNotANumber); } else if(specialValue.equals(Constants.VALUE_SPECIAL_UNDERFLOW)) { writeOut(outputstream, valueListUnderflow); } else if(specialValue.equals(Constants.VALUE_SPECIAL_OVERFLOW)) { writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value."); } } else { writeOut(outputstream, thisValue.getValue()); } if (iter.hasNext()) writeOut(outputstream, valueListDelimiter); } writeOut(outputstream, "</valueList>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, valueListNoData);
doValuePrint (outputstream, specialValue, valueListNoData);
public void toXMLOutputStream (OutputStream outputstream, String indent) throws java.io.IOException { if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired // no need to have repeatable set to 'yes' would just waste space even if we used this functionality. writeOut(outputstream, "<valueList delimiter=\""+valueListDelimiter+"\" repeatable=\"no\""); if (valueListNoData != null) writeOut(outputstream, " noDataValue=\""+valueListNoData+"\""); if (valueListInfinite != null) writeOut(outputstream, " infiniteValue=\""+valueListInfinite+"\""); if (valueListInfiniteNegative != null) writeOut(outputstream, " infiniteNegaiveValue=\""+valueListInfiniteNegative+"\""); if (valueListNotANumber != null) writeOut(outputstream, " notANumberValue=\""+valueListNotANumber+"\""); if (valueListUnderflow != null) writeOut(outputstream, " underflowValue=\""+valueListUnderflow+"\""); if (valueListOverflow != null) writeOut(outputstream, " overflowValue=\""+valueListOverflow+"\""); writeOut(outputstream, ">"); Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = (Value) iter.next(); String specialValue = thisValue.getSpecial(); if(specialValue != null) { if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE)) { writeOut(outputstream, valueListInfinite); } else if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE_NEGATIVE)) { writeOut(outputstream, valueListInfiniteNegative); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NODATA)) { writeOut(outputstream, valueListNoData); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NOTANUMBER)) { writeOut(outputstream, valueListNotANumber); } else if(specialValue.equals(Constants.VALUE_SPECIAL_UNDERFLOW)) { writeOut(outputstream, valueListUnderflow); } else if(specialValue.equals(Constants.VALUE_SPECIAL_OVERFLOW)) { writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value."); } } else { writeOut(outputstream, thisValue.getValue()); } if (iter.hasNext()) writeOut(outputstream, valueListDelimiter); } writeOut(outputstream, "</valueList>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, valueListNotANumber);
doValuePrint (outputstream, specialValue, valueListNotANumber);
public void toXMLOutputStream (OutputStream outputstream, String indent) throws java.io.IOException { if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired // no need to have repeatable set to 'yes' would just waste space even if we used this functionality. writeOut(outputstream, "<valueList delimiter=\""+valueListDelimiter+"\" repeatable=\"no\""); if (valueListNoData != null) writeOut(outputstream, " noDataValue=\""+valueListNoData+"\""); if (valueListInfinite != null) writeOut(outputstream, " infiniteValue=\""+valueListInfinite+"\""); if (valueListInfiniteNegative != null) writeOut(outputstream, " infiniteNegaiveValue=\""+valueListInfiniteNegative+"\""); if (valueListNotANumber != null) writeOut(outputstream, " notANumberValue=\""+valueListNotANumber+"\""); if (valueListUnderflow != null) writeOut(outputstream, " underflowValue=\""+valueListUnderflow+"\""); if (valueListOverflow != null) writeOut(outputstream, " overflowValue=\""+valueListOverflow+"\""); writeOut(outputstream, ">"); Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = (Value) iter.next(); String specialValue = thisValue.getSpecial(); if(specialValue != null) { if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE)) { writeOut(outputstream, valueListInfinite); } else if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE_NEGATIVE)) { writeOut(outputstream, valueListInfiniteNegative); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NODATA)) { writeOut(outputstream, valueListNoData); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NOTANUMBER)) { writeOut(outputstream, valueListNotANumber); } else if(specialValue.equals(Constants.VALUE_SPECIAL_UNDERFLOW)) { writeOut(outputstream, valueListUnderflow); } else if(specialValue.equals(Constants.VALUE_SPECIAL_OVERFLOW)) { writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value."); } } else { writeOut(outputstream, thisValue.getValue()); } if (iter.hasNext()) writeOut(outputstream, valueListDelimiter); } writeOut(outputstream, "</valueList>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, valueListUnderflow);
doValuePrint (outputstream, specialValue, valueListUnderflow);
public void toXMLOutputStream (OutputStream outputstream, String indent) throws java.io.IOException { if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired // no need to have repeatable set to 'yes' would just waste space even if we used this functionality. writeOut(outputstream, "<valueList delimiter=\""+valueListDelimiter+"\" repeatable=\"no\""); if (valueListNoData != null) writeOut(outputstream, " noDataValue=\""+valueListNoData+"\""); if (valueListInfinite != null) writeOut(outputstream, " infiniteValue=\""+valueListInfinite+"\""); if (valueListInfiniteNegative != null) writeOut(outputstream, " infiniteNegaiveValue=\""+valueListInfiniteNegative+"\""); if (valueListNotANumber != null) writeOut(outputstream, " notANumberValue=\""+valueListNotANumber+"\""); if (valueListUnderflow != null) writeOut(outputstream, " underflowValue=\""+valueListUnderflow+"\""); if (valueListOverflow != null) writeOut(outputstream, " overflowValue=\""+valueListOverflow+"\""); writeOut(outputstream, ">"); Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = (Value) iter.next(); String specialValue = thisValue.getSpecial(); if(specialValue != null) { if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE)) { writeOut(outputstream, valueListInfinite); } else if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE_NEGATIVE)) { writeOut(outputstream, valueListInfiniteNegative); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NODATA)) { writeOut(outputstream, valueListNoData); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NOTANUMBER)) { writeOut(outputstream, valueListNotANumber); } else if(specialValue.equals(Constants.VALUE_SPECIAL_UNDERFLOW)) { writeOut(outputstream, valueListUnderflow); } else if(specialValue.equals(Constants.VALUE_SPECIAL_OVERFLOW)) { writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value."); } } else { writeOut(outputstream, thisValue.getValue()); } if (iter.hasNext()) writeOut(outputstream, valueListDelimiter); } writeOut(outputstream, "</valueList>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value.");
doValuePrint (outputstream, specialValue, valueListOverflow);
public void toXMLOutputStream (OutputStream outputstream, String indent) throws java.io.IOException { if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, indent); // indent node if desired // no need to have repeatable set to 'yes' would just waste space even if we used this functionality. writeOut(outputstream, "<valueList delimiter=\""+valueListDelimiter+"\" repeatable=\"no\""); if (valueListNoData != null) writeOut(outputstream, " noDataValue=\""+valueListNoData+"\""); if (valueListInfinite != null) writeOut(outputstream, " infiniteValue=\""+valueListInfinite+"\""); if (valueListInfiniteNegative != null) writeOut(outputstream, " infiniteNegaiveValue=\""+valueListInfiniteNegative+"\""); if (valueListNotANumber != null) writeOut(outputstream, " notANumberValue=\""+valueListNotANumber+"\""); if (valueListUnderflow != null) writeOut(outputstream, " underflowValue=\""+valueListUnderflow+"\""); if (valueListOverflow != null) writeOut(outputstream, " overflowValue=\""+valueListOverflow+"\""); writeOut(outputstream, ">"); Iterator iter = values.iterator(); while (iter.hasNext()) { Value thisValue = (Value) iter.next(); String specialValue = thisValue.getSpecial(); if(specialValue != null) { if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE)) { writeOut(outputstream, valueListInfinite); } else if(specialValue.equals(Constants.VALUE_SPECIAL_INFINITE_NEGATIVE)) { writeOut(outputstream, valueListInfiniteNegative); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NODATA)) { writeOut(outputstream, valueListNoData); } else if(specialValue.equals(Constants.VALUE_SPECIAL_NOTANUMBER)) { writeOut(outputstream, valueListNotANumber); } else if(specialValue.equals(Constants.VALUE_SPECIAL_UNDERFLOW)) { writeOut(outputstream, valueListUnderflow); } else if(specialValue.equals(Constants.VALUE_SPECIAL_OVERFLOW)) { writeOut(outputstream, valueListOverflow); } else { Log.errorln("Error: valueList doesnt have "+specialValue+" defined but value does. Ignoring value."); } } else { writeOut(outputstream, thisValue.getValue()); } if (iter.hasNext()) writeOut(outputstream, valueListDelimiter); } writeOut(outputstream, "</valueList>"); if (Specification.getInstance().isPrettyXDFOutput()) writeOut(outputstream, Constants.NEW_LINE); }
if (!sigId.equals(cert.getSigAlgOID()))
if (!sigId.toString().equals(cert.getSigAlgOID()))
public boolean match(Certificate certificate) { if (!(certificate instanceof X509Certificate)) return false; X509Certificate cert = (X509Certificate) certificate; if (this.cert != null) { try { byte[] e1 = this.cert.getEncoded(); byte[] e2 = cert.getEncoded(); if (!Arrays.equals(e1, e2)) return false; } catch (CertificateEncodingException cee) { return false; } } if (serialNo != null) { if (!serialNo.equals(cert.getSerialNumber())) return false; } if (certValid != null) { try { cert.checkValidity(certValid); } catch (CertificateException ce) { return false; } } if (issuer != null) { if (!issuer.equals(cert.getIssuerX500Principal())) return false; } if (subject != null) { if (!subject.equals(cert.getSubjectX500Principal())) return false; } if (sigId != null) { if (!sigId.equals(cert.getSigAlgOID())) return false; } if (subjectKeyId != null) { byte[] b = cert.getExtensionValue(SUBJECT_KEY_ID); if (!Arrays.equals(b, subjectKeyId)) return false; } if (authKeyId != null) { byte[] b = cert.getExtensionValue(AUTH_KEY_ID); if (!Arrays.equals(b, authKeyId)) return false; } if (keyUsage != null) { boolean[] b = cert.getKeyUsage(); if (!Arrays.equals(b, keyUsage)) return false; } if (basicConstraints >= 0) { if (cert.getBasicConstraints() != basicConstraints) return false; } if (keyPurposeSet != null) { List kp = null; try { kp = cert.getExtendedKeyUsage(); } catch (CertificateParsingException cpe) { return false; } if (kp == null) return false; for (Iterator it = keyPurposeSet.iterator(); it.hasNext(); ) { if (!kp.contains(it.next())) return false; } } if (altNames != null) { Collection an = null; try { an = cert.getSubjectAlternativeNames(); } catch (CertificateParsingException cpe) { return false; } if (an == null) return false; int match = 0; for (Iterator it = altNames.iterator(); it.hasNext(); ) { List l = (List) it.next(); Integer id = (Integer) l.get(0); String s = null; byte[] b = null; if (l.get(1) instanceof String) s = (String) l.get(1); else if (l.get(1) instanceof byte[]) b = (byte[]) l.get(1); else return false; for (Iterator it2 = an.iterator(); it2.hasNext(); ) { Object o = it2.next(); if (!(o instanceof List)) continue; List l2 = (List) o; if (l2.size() != 2) continue; if (!id.equals(l2.get(0))) continue; if (s != null && (l2.get(1) instanceof String) && s.equals(l2.get(1))) match++; else if (b != null && (l2.get(1) instanceof byte[]) && Arrays.equals(b, (byte[]) l2.get(1))) match++; } if (match == 0 || (matchAllNames && match != altNames.size())) return false; } } if (nameConstraints != null) { byte[] nc = cert.getExtensionValue(NAME_CONSTRAINTS_ID); if (!Arrays.equals(nameConstraints, nc)) return false; } // FIXME check policies. // FIXME check path-to-names. return true; }
if (e.getPropertyName().equals(AbstractAction.ENABLED_PROPERTY))
if (e.getPropertyName().equals("enabled"))
protected PropertyChangeListener createActionPropertyChangeListener(Action a) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals(AbstractAction.ENABLED_PROPERTY)) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); } }; }
if (e.getPropertyName().equals(AbstractAction.ENABLED_PROPERTY))
if (e.getPropertyName().equals("enabled"))
public void propertyChange(PropertyChangeEvent e) { Action act = (Action) (e.getSource()); if (e.getPropertyName().equals(AbstractAction.ENABLED_PROPERTY)) setEnabled(act.isEnabled()); else if (e.getPropertyName().equals(Action.NAME)) setText((String)(act.getValue(Action.NAME))); else if (e.getPropertyName().equals(Action.SMALL_ICON)) setIcon((Icon)(act.getValue(Action.SMALL_ICON))); else if (e.getPropertyName().equals(Action.SHORT_DESCRIPTION)) setToolTipText((String)(act.getValue(Action.SHORT_DESCRIPTION))); else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) if (act.getValue(Action.MNEMONIC_KEY) != null) setMnemonic(((Integer)(act.getValue(Action.MNEMONIC_KEY))).intValue()); else if (e.getPropertyName().equals(Action.ACTION_COMMAND_KEY)) setActionCommand((String)(act.getValue(Action.ACTION_COMMAND_KEY))); }
public void fireActionPerformed(ActionEvent e)
protected void fireActionPerformed(ActionEvent e)
public void fireActionPerformed(ActionEvent e) { e.setSource(this); ActionListener[] listeners = getActionListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].actionPerformed(e); }
public void fireItemStateChanged(ItemEvent e)
protected void fireItemStateChanged(ItemEvent e)
public void fireItemStateChanged(ItemEvent e) { e.setSource(this); ItemListener[] listeners = getItemListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].itemStateChanged(e); }
public void fireStateChanged()
protected void fireStateChanged()
public void fireStateChanged() { ChangeListener[] listeners = getChangeListeners(); for (int i = 0; i < listeners.length; i++) listeners[i].stateChanged(changeEvent); }
return "AbstractButton";
StringBuffer sb = new StringBuffer(); sb.append(super.paramString()); sb.append(",defaultIcon="); if (getIcon() != null) sb.append(getIcon()); sb.append(",disabledIcon="); if (getDisabledIcon() != null) sb.append(getDisabledIcon()); sb.append(",disabledSelectedIcon="); if (getDisabledSelectedIcon() != null) sb.append(getDisabledSelectedIcon()); sb.append(",margin="); if (getMargin() != null) sb.append(getMargin()); sb.append(",paintBorder=").append(isBorderPainted()); sb.append(",paintFocus=").append(isFocusPainted()); sb.append(",pressedIcon="); if (getPressedIcon() != null) sb.append(getPressedIcon()); sb.append(",rolloverEnabled=").append(isRolloverEnabled()); sb.append(",rolloverIcon="); if (getRolloverIcon() != null) sb.append(getRolloverIcon()); sb.append(",rolloverSelected="); if (getRolloverSelectedIcon() != null) sb.append(getRolloverSelectedIcon()); sb.append(",selectedIcon="); if (getSelectedIcon() != null) sb.append(getSelectedIcon()); sb.append(",text="); if (getText() != null) sb.append(getText()); return sb.toString();
protected String paramString() { return "AbstractButton"; }
if (!signedOn) { signedOn = true; signOnSave = screen52.getScreenAsChars(); System.out.println("Signon saved"); }
public void run () { while (keepTrucking) { try { bk = (Stream5250)dsq.get(); } catch (InterruptedException ie) { System.out.println(" vt thread interrupted and stopping "); keepTrucking = false; continue; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); invited = false; screen52.setCursorOff();// System.out.println("operation code: " + bk.getOpCode()); if (bk == null) continue; switch (bk.getOpCode()) { case 00:// System.out.println("No operation"); break; case 1:// System.out.println("Invite Operation"); parseIncoming();// screen52.setKeyboardLocked(false); pendingUnlock = true; cursorOn = true; setInvited(); break; case 2:// System.out.println("Output Only"); parseIncoming();// System.out.println(screen52.dirty); screen52.updateDirty(); // invited = true; break; case 3:// System.out.println("Put/Get Operation"); parseIncoming();// inviteIt =true; setInvited(); break; case 4:// System.out.println("Save Screen Operation"); parseIncoming(); break; case 5:// System.out.println("Restore Screen Operation"); parseIncoming(); break; case 6:// System.out.println("Read Immediate"); sendAidKey(0); break; case 7:// System.out.println("Reserved"); break; case 8:// System.out.println("Read Screen Operation"); try { readScreen(); } catch (IOException ex) { } break; case 9:// System.out.println("Reserved"); break; case 10:// System.out.println("Cancel Invite Operation"); cancelInvite(); break; case 11:// System.out.println("Turn on message light"); screen52.setMessageLightOn(); screen52.setCursorOn(); break; case 12:// System.out.println("Turn off Message light"); screen52.setMessageLightOff(); screen52.setCursorOn(); break; default: break; } if (screen52.isUsingGuiInterface()) screen52.drawFields();// if (screen52.screen[0][1].getChar() == '#' &&// screen52.screen[0][2].getChar() == '!')// execCmd();// else { if (screen52.isHotSpots()) { screen52.checkHotSpots(); } try {// SwingUtilities.invokeAndWait(// new Runnable () {// public void run() {// screen52.updateDirty();// }// }// ); screen52.updateDirty(); } catch (Exception exd ) { System.out.println(" tnvt.run: " + exd.getMessage()); exd.printStackTrace(); } if (pendingUnlock) screen52.setKeyboardLocked(false); if (cursorOn && !screen52.isKeyboardLocked()) { screen52.setCursorOn(); cursorOn = false; } // lets play nicely with the others on the playground// me.yield(); pthread.yield(); } }
if (view.isStikeThrough())
if (view.isStrikeThrough())
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; int width = Utilities.getTabbedTextWidth(txt, g.getFontMetrics(), bounds.x, tabEx, txt.offset); // Fill the background of the text run. Color background = view.getBackground(); if (background != null) { g.setColor(background); g.fillRect(bounds.x, bounds.y, width, height); } // Draw the actual text. g.setColor(view.getForeground()); g.setFont(view.getFont()); int ascent = g.getFontMetrics().getAscent(); if (view.isSuperscript()) // TODO: Adjust font for superscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent - height / 2, g, tabEx, txt.offset); else if (view.isSubscript()) // TODO: Adjust font for subscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent + height / 2, g, tabEx, txt.offset); else Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent, g, tabEx, txt.offset); if (view.isStikeThrough()) { int strikeHeight = (int) (getAscent(view) / 2); g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.height + width, bounds.y + strikeHeight); } if (view.isUnderline()) { int lineHeight = (int) getAscent(view); g.drawLine(bounds.x, bounds.y + lineHeight, bounds.height + width, bounds.y + lineHeight); } g.setColor(oldColor); }
int breakLocation = painter.getBoundedPosition(this, p0, pos, len);
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); GlyphPainter painter = getGlyphPainter(); int breakLocation = painter.getBoundedPosition(this, p0, pos, len); // Try to find a suitable line break. BreakIterator lineBreaker = BreakIterator.getLineInstance(); Segment txt = new Segment(); try { getDocument().getText(getStartOffset(), getEndOffset(), txt); } catch (BadLocationException ex) { AssertionError err = new AssertionError("BadLocationException must not " + "be thrown here."); err.initCause(ex); throw err; } lineBreaker.setText(txt); int goodBreakLocation = lineBreaker.previous(); if (goodBreakLocation != BreakIterator.DONE) breakLocation = goodBreakLocation; View brokenView = createFragment(p0, breakLocation); return brokenView; }
getDocument().getText(getStartOffset(), getEndOffset(), txt);
int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getText(start, length, txt);
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); GlyphPainter painter = getGlyphPainter(); int breakLocation = painter.getBoundedPosition(this, p0, pos, len); // Try to find a suitable line break. BreakIterator lineBreaker = BreakIterator.getLineInstance(); Segment txt = new Segment(); try { getDocument().getText(getStartOffset(), getEndOffset(), txt); } catch (BadLocationException ex) { AssertionError err = new AssertionError("BadLocationException must not " + "be thrown here."); err.initCause(ex); throw err; } lineBreaker.setText(txt); int goodBreakLocation = lineBreaker.previous(); if (goodBreakLocation != BreakIterator.DONE) breakLocation = goodBreakLocation; View brokenView = createFragment(p0, breakLocation); return brokenView; }
lineBreaker.setText(txt); int goodBreakLocation = lineBreaker.previous(); if (goodBreakLocation != BreakIterator.DONE) breakLocation = goodBreakLocation;
int breakLocation = Utilities.getBreakLocation(txt, getContainer().getFontMetrics(getFont()), (int) pos, (int) (pos + len), getTabExpander(), p0);
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); GlyphPainter painter = getGlyphPainter(); int breakLocation = painter.getBoundedPosition(this, p0, pos, len); // Try to find a suitable line break. BreakIterator lineBreaker = BreakIterator.getLineInstance(); Segment txt = new Segment(); try { getDocument().getText(getStartOffset(), getEndOffset(), txt); } catch (BadLocationException ex) { AssertionError err = new AssertionError("BadLocationException must not " + "be thrown here."); err.initCause(ex); throw err; } lineBreaker.setText(txt); int goodBreakLocation = lineBreaker.previous(); if (goodBreakLocation != BreakIterator.DONE) breakLocation = goodBreakLocation; View brokenView = createFragment(p0, breakLocation); return brokenView; }
getParent().preferenceChanged(this, true, true);
preferenceChanged(this, true, true);
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory vf) { getParent().preferenceChanged(this, true, true); }
getGlyphPainter().paint(this, g, a, el.getStartOffset(), el.getEndOffset());
getGlyphPainter().paint(this, g, a, getStartOffset(), getEndOffset());
public void paint(Graphics g, Shape a) { Element el = getElement(); checkPainter(); getGlyphPainter().paint(this, g, a, el.getStartOffset(), el.getEndOffset()); }
getParent().preferenceChanged(this, true, false);
preferenceChanged(this, true, false);
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory vf) { getParent().preferenceChanged(this, true, false); }
int max = (orientation == HORIZONTAL_SPLIT) ? getWidth() : getHeight();
int max = ((orientation == HORIZONTAL_SPLIT) ? getWidth() : getHeight()) - getDividerSize();
public void setDividerLocation(double proportionalLocation) { if (proportionalLocation > 1 || proportionalLocation < 0) throw new IllegalArgumentException ("proportion has to be between 0 and 1."); int max = (orientation == HORIZONTAL_SPLIT) ? getWidth() : getHeight(); setDividerLocation((int) (proportionalLocation * max)); }
editor = new JTextField();
public MetalComboBoxEditor() { super(); editor = new JTextField(); editor.setBorder(new MetalComboBoxEditorBorder()); }
_interpreter.set("session",session);
_interpreter.set("_session",session);
public void executeScript(Session session, String script) throws InterpreterDriver.InterpreterException { try { session.setMacroRunning(true); _interpreter.set("session",session); _interpreter.exec(script); session.setMacroRunning(false); } catch (PyException ex) { throw new InterpreterDriver.InterpreterException(ex); } }
_interpreter.set("session",s1);
_interpreter = new PythonInterpreter(); _interpreter.set("_session",s1);
public void executeScriptFile(Session session, String scriptFile) throws InterpreterDriver.InterpreterException { try { final Session s1 = session; final String s2 = scriptFile; s1.setMacroRunning(true); Runnable interpretIt = new Runnable() { public void run() { _interpreter.set("session",s1); _interpreter.execfile(s2); } }; // lets start interpreting it. Thread interpThread = new Thread(interpretIt); interpThread.setDaemon(true); interpThread.start(); } catch (PyException ex) { throw new InterpreterDriver.InterpreterException(ex); } catch (Exception ex2) { throw new InterpreterDriver.InterpreterException(ex2); } }
_interpreter.set("session",s1);
_interpreter = new PythonInterpreter(); _interpreter.set("_session",s1);
public void run() { _interpreter.set("session",s1); _interpreter.execfile(s2); }
System.out.println("getNewVariable(): " + variable);
public Variable getNewVariable() { count += 1; System.out.println("getNewVariable(): " + variable); Variable var = (Variable) variable.clone(); var.setSSAValue(count); stack.add(var); System.out.println("getNewVariable(): " + var); return var; }
System.out.println("getNewVariable(): " + var);
public Variable getNewVariable() { count += 1; System.out.println("getNewVariable(): " + variable); Variable var = (Variable) variable.clone(); var.setSSAValue(count); stack.add(var); System.out.println("getNewVariable(): " + var); return var; }
System.out.println("peek(): " + variable);
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
return null;
if (variable instanceof MethodArgument) { return variable; } else { return null; }
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
System.out.println("peek(): " + var);
public Variable peek() { System.out.println("peek(): " + variable); int n = stack.size(); // TODO don't know if this right, but it avoids exceptions for certain // rewritePhiParams calls if (n <= 0) { return null; } Variable var = (Variable) stack.get(n - 1); System.out.println("peek(): " + var); return var; }
System.out.println("pop(): " + var);
public Variable pop() { Variable var = (Variable) stack.remove(stack.size() - 1); System.out.println("pop(): " + var); return var; }
SwingUtilities.calculateInnerArea(b, vr);
if (b.isBorderPainted()) SwingUtilities.calculateInnerArea(b, vr); else vr = SwingUtilities.getLocalBounds(b);
public void paint(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; Rectangle tr = new Rectangle(); Rectangle ir = new Rectangle(); Rectangle vr = new Rectangle(); Font f = c.getFont(); g.setFont(f); SwingUtilities.calculateInnerArea(b, vr); String text = SwingUtilities.layoutCompoundLabel(c, g.getFontMetrics(f), b.getText(), currentIcon(b), b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), vr, ir, tr, b.getIconTextGap() + defaultTextShiftOffset); if ((b.getModel().isArmed() && b.getModel().isPressed()) || b.isSelected()) paintButtonPressed(g, b); else paintButtonNormal(g, vr, c); paintIcon(g, c, ir); if (text != null) paintText(g, b, tr, text); if (b.isFocusOwner()) paintFocus(g, b, vr, tr, ir); }
if (b.getFont() instanceof UIResource) b.setFont(null);
protected void uninstallDefaults(AbstractButton b) { b.setForeground(null); b.setBackground(null); b.setBorder(null); b.setIconTextGap(defaultTextIconGap); b.setMargin(null); }
paintHighlight(g, r1);
r0.width = r1.x + r1.width - 1; paintHighlight(g, r0);
public void paint(Graphics g, int p0, int p1, Shape bounds, JTextComponent c) { Rectangle r0 = null; Rectangle r1 = null; Rectangle rect = bounds.getBounds(); try { r0 = c.modelToView(p0); r1 = c.modelToView(p1); } catch (BadLocationException e) { // This should never occur. return; } if (r0 == null || r1 == null) return; if (color == null) g.setColor(c.getSelectionColor()); else g.setColor(color); // Check if only one line to highlight. if (r0.y == r1.y) { r0.width = r1.x - r0.x; paintHighlight(g, r0); return; } // First line, from p0 to end-of-line. r0.width = rect.x + rect.width - r0.x; paintHighlight(g, r0); // FIXME: All the full lines in between, if any (assumes that all lines // have the same height -- not a good assumption with JEditorPane/JTextPane). r0.y += r0.height; r0.x = rect.x; while (r0.y < r1.y) { paintHighlight(g, r0); r0.y += r0.height; } // Last line, from beginnin-of-line to p1. paintHighlight(g, r1); }
textComponent.getUI().damageRange(textComponent, p0, p1);
public Object addHighlight(int p0, int p1, Highlighter.HighlightPainter painter) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = new HighlightEntry(p0, p1, painter); highlights.add(entry); return entry; }
public void changeHighlight(Object tag, int p0, int p1)
public void changeHighlight(Object tag, int n0, int n1)
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
checkPositions(p0, p1);
int o0, o1; checkPositions(n0, n1);
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
entry.p0 = p0; entry.p1 = p1;
o0 = entry.p0; o1 = entry.p1; if (o0 == n0 && o1 == n1) return; entry.p0 = n0; entry.p1 = n1; TextUI ui = textComponent.getUI(); if (n0 == n1) ui.damageRange(textComponent, o0, o1); else if ((o1 > n0 && o1 <= n1) || (n1 > o0 && n1 <= o1)) { int fds, sds; int fde, sde; if(o0 < n0) { fds = o0; fde = n0; } else { fds = n0; fde = o0; } if (o1 < n1) { sds = o1; sde = n1; } else { sds = n1; sde = o1; } if (fde == sds) ui.damageRange(textComponent, fds, sde); else { if (fds != fde) ui.damageRange(textComponent, fds, fde); if (sds != sde) ui.damageRange(textComponent, sds, sde); } } else { ui.damageRange(textComponent, o0, o1); ui.damageRange(textComponent, n0, n1); }
public void changeHighlight(Object tag, int p0, int p1) throws BadLocationException { checkPositions(p0, p1); HighlightEntry entry = (HighlightEntry) tag; entry.p0 = p0; entry.p1 = p1; }
return null;
return (Highlighter.Highlight[]) highlights.toArray(new Highlighter.Highlight[highlights.size()]);
public Highlighter.Highlight[] getHighlights() { return null; }
if (highlights.size() == 0)
if (size == 0)
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
Shape bounds = textComponent.getBounds();
Insets insets = textComponent.getInsets(); Shape bounds = new Rectangle(insets.left, insets.top, textComponent.getWidth() - insets.left - insets.right, textComponent.getHeight() - insets.top - insets.bottom);
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
for (int index = 0; index < highlights.size(); ++index)
for (int index = 0; index < size; ++index)
public void paint(Graphics g) { // Check if there are any highlights. if (highlights.size() == 0) return; Shape bounds = textComponent.getBounds(); for (int index = 0; index < highlights.size(); ++index) { HighlightEntry entry = (HighlightEntry) highlights.get(index); entry.painter.paint(g, entry.p0, entry.p1, bounds, textComponent); } }
HighlightEntry entry = (HighlightEntry) tag; textComponent.getUI().damageRange(textComponent, entry.p0, entry.p1);
public void removeHighlight(Object tag) { highlights.remove(tag); }
if (sPrettyXDFOutput) {
if (Specification.getInstance().isPrettyXDFOutput()) {
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop);
nestedToXDF(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation(), which, stop);
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { //base condition if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } synchronized (formatCommandList) { int end = formatCommandList.size(); for (int i = 0; i < end; i++) { Object command = formatCommandList.get(i); ((XMLDataIOStyle) command).specificIOStyleToXDF(outputstream, indent); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } } } } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
if (sPrettyXDFOutput) {
if (Specification.getInstance().isPrettyXDFOutput()) {
protected void specificIOStyleToXDF( OutputStream outputstream,String indent) { //write out nodes in formatCommandList synchronized (formatCommandList) { int stop = formatCommandList.size(); for (int i = 0; i <stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } ((XMLDataIOStyle) formatCommandList.get(i)).specificIOStyleToXDF(outputstream, indent); } } }
bad.minor = Minor.Any;
public static TaggedComponent extract(Any any) { try { return ((TaggedComponentHolder) any.extract_Streamable()).value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("TaggedComponent expected"); bad.initCause(cex); throw bad; } }
return Class.forName(cn);
c = forName(cn); m_classes.put(IDL, c); return c;
public static Class Idl2class(String IDL) { String s = IDL; int a = s.indexOf(':') + 1; int b = s.lastIndexOf(':'); s = IDL.substring(a, b); if (s.startsWith(OMG_PREFIX)) s = JAVA_PREFIX + s.substring(OMG_PREFIX.length()); String cn = s.replace('/', '.'); try { return Class.forName(cn); } catch (ClassNotFoundException ex) { return null; } }
} }
public static Class Idl2class(String IDL) { String s = IDL; int a = s.indexOf(':') + 1; int b = s.lastIndexOf(':'); s = IDL.substring(a, b); if (s.startsWith(OMG_PREFIX)) s = JAVA_PREFIX + s.substring(OMG_PREFIX.length()); String cn = s.replace('/', '.'); try { return Class.forName(cn); } catch (ClassNotFoundException ex) { return null; } }
return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance();
return known.newInstance();
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance();
known = forName(toClassName(JAVA_PREFIX, idl) + suffix); object = known.newInstance(); } catch (Exception ex) { try { known = forName(toClassName(CLASSPATH_PREFIX, idl) + suffix); object = known.newInstance();
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
m_classes.put(idl + 0xff + suffix, known); return object; } }
public static java.lang.Object createObject(String idl, String suffix) { try { return Class.forName(toClassName(JAVA_PREFIX, idl) + suffix) .newInstance(); } catch (Exception ex) { try { return Class.forName(toClassName(CLASSPATH_PREFIX, idl) + suffix) .newInstance(); } catch (Exception exex) { return null; } } }
String m_exception_id = toIDL(exception.getClass().getName());
String m_exception_id = getRepositoryId(exception.getClass());
public static boolean insertSysException(Any into, SystemException exception) { try { cdrBufOutput output = new cdrBufOutput(); String m_exception_id = toIDL(exception.getClass().getName()); output.write_string(m_exception_id); output.write_ulong(exception.minor); CompletionStatusHelper.write(output, exception.completed); String name = getDefaultName(m_exception_id); universalHolder h = new universalHolder(output); into.insert_Streamable(h); recordTypeCode r = new recordTypeCode(TCKind.tk_except); r.setId(m_exception_id); r.setName(name); into.type(r); return true; } catch (Exception ex) { ex.printStackTrace(); return false; } }
protected abstract WritableRaster getDestinationRaster();
protected WritableRaster getDestinationRaster() { Rectangle db = getDeviceBounds(); if (destinationRaster == null) { int[] bandMasks = new int[]{ 0xFF0000, 0xFF00, 0xFF }; destinationRaster = Raster.createPackedRaster(DataBuffer.TYPE_INT, db.width, db.height, bandMasks, null); int x0 = destinationRaster.getMinX(); int x1 = destinationRaster.getWidth() + x0; int y0 = destinationRaster.getMinY(); int y1 = destinationRaster.getHeight() + y0; int numBands = destinationRaster.getNumBands(); for (int y = y0; y < y1; y++) { for (int x = x0; x < x1; x++) { for (int b = 0; b < numBands; b++) destinationRaster.setSample(x, y, b, 255); } } } return destinationRaster; }
protected abstract WritableRaster getDestinationRaster();