rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
return false; | else return false; | public boolean hasMemberObj (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { return true; } else return false; } return false; } |
if (obj!=null) { if (memberObjHash.contains(obj)) { memberObjHash.remove(obj); return obj; } else return null; | if (memberObjHash.contains(obj)) { memberObjHash.remove(obj); return obj; | public Object removeMemberObject (Object obj) { if (obj!=null) { if (memberObjHash.contains(obj)) { memberObjHash.remove(obj); return obj; } else return null; } else return null; } |
throw new Error("not implemented"); | if (GraphicsEnvironment.isHeadless ()) throw new AWTException ("Robot: headless graphics environment"); SecurityManager sm = System.getSecurityManager (); if (sm != null) sm.checkPermission (new AWTPermission ("createRobot")); ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit (); peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment () .getDefaultScreenDevice ()); | public Robot() throws AWTException { throw new Error("not implemented"); } |
public BufferedImage createScreenCapture(Rectangle screen) | public BufferedImage createScreenCapture (Rectangle screenRect) | public BufferedImage createScreenCapture(Rectangle screen) { return null; } |
return null; | if (screenRect.width <= 0) throw new IllegalArgumentException ("Robot: capture width is <= 0"); if (screenRect.height <= 0) throw new IllegalArgumentException ("Robot: capture height is <= 0"); SecurityManager sm = System.getSecurityManager (); if (sm != null) sm.checkPermission (new AWTPermission ("readDisplayPixels")); int[] pixels = peer.getRGBPixels (screenRect); BufferedImage bufferedImage = new BufferedImage (screenRect.width, screenRect.height, BufferedImage.TYPE_INT_ARGB); bufferedImage.setRGB (0, 0, screenRect.width, screenRect.height, pixels, 0, screenRect.width); return bufferedImage; | public BufferedImage createScreenCapture(Rectangle screen) { return null; } |
throw new IllegalArgumentException(); | throw new IllegalArgumentException ("Robot: delay length out-of-bounds"); try { Thread.sleep (ms); } catch (InterruptedException e) { System.err.println ("Robot: delay interrupted"); } | public void delay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); } |
return null; | return new Color (peer.getRGBPixel (x, y)); | public Color getPixelColor(int x, int y) { return null; } |
peer.keyPress (keycode); if (waitForIdle) waitForIdle (); if (autoDelay > 0) delay (autoDelay); | public void keyPress(int keycode) { } |
|
peer.keyRelease (keycode); if (waitForIdle) waitForIdle (); if (autoDelay > 0) delay (autoDelay); | public void keyRelease(int keycode) { } |
|
peer.mouseMove (x, y); if (waitForIdle) waitForIdle (); if (autoDelay > 0) delay (autoDelay); | public void mouseMove(int x, int y) { } |
|
if ((buttons & InputEvent.BUTTON1_MASK) == 0 && (buttons & InputEvent.BUTTON2_MASK) == 0 && (buttons & InputEvent.BUTTON3_MASK) == 0) throw new IllegalArgumentException ("Robot: mousePress:" + " invalid button mask"); peer.mousePress (buttons); if (waitForIdle) waitForIdle (); if (autoDelay > 0) delay (autoDelay); | public void mousePress(int buttons) { } |
|
if ((buttons & InputEvent.BUTTON1_MASK) == 0 && (buttons & InputEvent.BUTTON2_MASK) == 0 && (buttons & InputEvent.BUTTON3_MASK) == 0) throw new IllegalArgumentException ("Robot: mouseRelease:" + " invalid button mask"); peer.mouseRelease (buttons); if (waitForIdle) waitForIdle (); if (autoDelay > 0) delay (autoDelay); | public void mouseRelease(int buttons) { } |
|
peer.mouseWheel (wheelAmt); if (waitForIdle) waitForIdle (); if (autoDelay > 0) delay (autoDelay); | public void mouseWheel(int wheelAmt) { } |
|
if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); | if (ms <= 0 || ms >= 60000) throw new IllegalArgumentException ("Robot: delay length out-of-bounds"); | public void setAutoDelay(int ms) { if (ms < 0 || ms > 60000) throw new IllegalArgumentException(); autoDelay = ms; } |
public void setAutoWaitForIdle(boolean value) | public void setAutoWaitForIdle (boolean isOn) | public void setAutoWaitForIdle(boolean value) { waitForIdle = value; } |
waitForIdle = value; | waitForIdle = isOn; | public void setAutoWaitForIdle(boolean value) { waitForIdle = value; } |
return "unimplemented"; | return getClass ().getName () + "[ autoDelay = " + autoDelay + ", autoWaitForIdle = " + waitForIdle + " ]"; | public String toString() { return "unimplemented"; } |
if (EventQueue.isDispatchThread ()) throw new IllegalThreadStateException ("Robot: waitForIdle called from " + "the event dispatch thread"); EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue (); while (q.peekEvent () != null) { try { wait (); } catch (InterruptedException e) { System.err.println ("Robot: waitForIdle interrupted"); } } | public void waitForIdle() { } |
|
return t_fixed; | return new fixedTypeCode(value); | public TypeCode _type() { return t_fixed; } |
vmClass.link(); | public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { vmClass.link(); // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; } |
|
Object result; | final Object result; | public static Object allocObject(VmType<?> vmClass, int size) throws UninterruptiblePragma { vmClass.link(); // Screen.debug("ao cls{"); // Screen.debug(vmClass.getName()); VmHeapManager hm = heapManager; if (hm == null) { heapManager = hm = Vm.getHeapManager(); } Object result; if (size < 0) { result = hm.newInstance(vmClass); } else { result = hm.newInstance(vmClass, size); } // Screen.debug("}"); return result; } |
int selectedRow = rowSM.getMinSelectionIndex(); connectKey = (String)ctm.getValueAt(selectedRow,0); saveProps(); setVisible(false); | doActionConnect(); | public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { saveProps(); setVisible(false); } if (e.getActionCommand().equals("ADD")) { Configure.doEntry((JFrame)getParent(),null,props); ctm.addSession(); } if (e.getActionCommand().equals("REMOVE")) { removeEntry(); editButton.setEnabled(false); removeButton.setEnabled(false); } if (e.getActionCommand().equals("EDIT")) { int selectedRow = rowSM.getMinSelectionIndex(); Configure.doEntry((JFrame)getParent(),(String)ctm.getValueAt(selectedRow,0),props); ctm.chgSession(selectedRow); } if (e.getActionCommand().equals("CONNECT")) { int selectedRow = rowSM.getMinSelectionIndex(); connectKey = (String)ctm.getValueAt(selectedRow,0); saveProps(); setVisible(false); } } |
setResizable(false); | setResizable(true); | void jbInit() throws Exception { // make it non resizable setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do show(); } |
show(); | this.setVisible(true); | void jbInit() throws Exception { // make it non resizable setResizable(false); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); // create some reusable borders and layouts Border etchedBorder = BorderFactory.createEtchedBorder(); BorderLayout borderLayout = new BorderLayout(); // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JTable(ctm); sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500,200)); sessions.setShowGrid(false); //Create the scroll pane and add the table to it. scrollPane = new JScrollPane(sessions); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //Setup our selection model listener rowSM = sessions.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel)e.getSource(); if (lsm.isSelectionEmpty()) { //no rows are selected editButton.setEnabled(false); removeButton.setEnabled(false); connectButton.setEnabled(false); } else { int selectedRow = lsm.getMinSelectionIndex(); //selectedRow is selected editButton.setEnabled(true); removeButton.setEnabled(true); connectButton.setEnabled(true); } } }); //Setup panels configOptions.setLayout(borderLayout); sessionPanel.setLayout(borderLayout); configOptions.add(sessionPanel, BorderLayout.CENTER); sessionOpts.add(scrollPane, BorderLayout.CENTER); sessionPanel.add(sessionOpts, BorderLayout.NORTH); sessionPanel.add(sessionOptPanel, BorderLayout.SOUTH); sessionPanel.setBorder(BorderFactory.createRaisedBevelBorder()); // add the option buttons addOptButton(LangTool.getString("ss.optAdd"),"ADD",sessionOptPanel); removeButton = addOptButton(LangTool.getString("ss.optDelete"), "REMOVE", sessionOptPanel, false); editButton = addOptButton(LangTool.getString("ss.optEdit"), "EDIT", sessionOptPanel, false); connectButton = addOptButton(LangTool.getString("ss.optConnect"),"CONNECT",options,false); addOptButton(LangTool.getString("ss.optCancel"),"DONE",options); // add the panels to our dialog getContentPane().add(sessionPanel,BorderLayout.CENTER); getContentPane().add(options, BorderLayout.SOUTH); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // set default selection value as the first row if (sessions.getRowCount() > 0) { sessions.getSelectionModel().setSelectionInterval(0,0); } // now show the world what we and they can do show(); } |
if (ctm.getRowCount() == 1) { sessions.getSelectionModel().setSelectionInterval( 0, 0); } | public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("DONE")) { saveProps(); setVisible(false); } if (e.getActionCommand().equals("ADD")) { Configure.doEntry((JFrame) getParent(), null, props); ctm.addSession(); } if (e.getActionCommand().equals("REMOVE")) { removeEntry(); editButton.setEnabled(false); removeButton.setEnabled(false); } if (e.getActionCommand().equals("EDIT")) { int selectedRow = rowSM.getMinSelectionIndex(); Configure.doEntry( (JFrame) getParent(), (String) ctm.getValueAt(selectedRow, 0), props); ctm.chgSession(selectedRow); } if (e.getActionCommand().equals("CONNECT")) { doActionConnect(); } if (e.getActionCommand().equals("APPLY")) { saveProps(); } } |
|
+ " '"+ defaultFactoryClass +"'"); | + " '"+ defaultFactoryClass +"'", e); | private static PreferencesFactory getFactory() throws SecurityException { // First check for permission SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(prefsPermission); } // Get the factory if (factory == null) { // Caller might not have enough permissions factory = (PreferencesFactory) AccessController.doPrivileged( new PrivilegedAction() { public Object run() { PreferencesFactory pf = null; String className = System.getProperty ("java.util.prefs.PreferencesFactory"); if (className != null) { try { Class fc = Class.forName(className); Object o = fc.newInstance(); pf = (PreferencesFactory) o; } catch (ClassNotFoundException cnfe) {/*ignore*/} catch (InstantiationException ie) {/*ignore*/} catch (IllegalAccessException iae) {/*ignore*/} catch (ClassCastException cce) {/*ignore*/} } return pf; } }); // Still no factory? Use our default. if (factory == null) { try { Class cls = Class.forName (defaultFactoryClass); factory = (PreferencesFactory) cls.newInstance(); } catch (Exception e) { throw new RuntimeException ("Couldn't load default factory" + " '"+ defaultFactoryClass +"'"); // XXX - when using 1.4 compatible throwables add cause } } } return factory; } |
public NodeReader(InputStream is, PreferencesFactory factory) { this(new InputStreamReader(is), factory); | public NodeReader(Reader r, PreferencesFactory factory) { if(r instanceof BufferedReader) { br = (BufferedReader) r; } else { br = new BufferedReader(r); } this.factory = factory; | public NodeReader(InputStream is, PreferencesFactory factory) { this(new InputStreamReader(is), factory); } |
PublicKey pubK = new DSSPublicKey(p, q, g, y); PrivateKey secK = new DSSPrivateKey(p, q, g, x); | PublicKey pubK = new DSSPublicKey(preferredFormat, p, q, g, y); PrivateKey secK = new DSSPrivateKey(preferredFormat, p, q, g, x); | public KeyPair generate() { if (p == null) { BigInteger[] params = new FIPS186(L, rnd).generateParameters(); seed = params[FIPS186.DSA_PARAMS_SEED]; counter = params[FIPS186.DSA_PARAMS_COUNTER]; q = params[FIPS186.DSA_PARAMS_Q]; p = params[FIPS186.DSA_PARAMS_P]; e = params[FIPS186.DSA_PARAMS_E]; g = params[FIPS186.DSA_PARAMS_G]; if (DEBUG && debuglevel > 0) { debug("seed: " + seed.toString(16)); debug("counter: " + counter.intValue()); debug("q: " + q.toString(16)); debug("p: " + p.toString(16)); debug("e: " + e.toString(16)); debug("g: " + g.toString(16)); } } BigInteger x = nextX(); BigInteger y = g.modPow(x, p); PublicKey pubK = new DSSPublicKey(p, q, g, y); PrivateKey secK = new DSSPrivateKey(p, q, g, x); return new KeyPair(pubK, secK); } |
Integer formatID = (Integer) attributes.get(PREFERRED_ENCODING_FORMAT); preferredFormat = formatID == null ? DEFAULT_ENCODING_FORMAT : formatID.intValue(); | public void setup(Map attributes) { // find out the modulus length Integer l = (Integer) attributes.get(MODULUS_LENGTH); L = (l == null ? DEFAULT_MODULUS_LENGTH : l.intValue()); if ((L % 64) != 0 || L < 512 || L > 1024) throw new IllegalArgumentException(MODULUS_LENGTH); // should we use the default pre-computed params? Boolean useDefaults = (Boolean) attributes.get(USE_DEFAULTS); if (useDefaults == null) { useDefaults = Boolean.TRUE; } Boolean strictDefaults = (Boolean) attributes.get(STRICT_DEFAULTS); if (strictDefaults == null) strictDefaults = Boolean.FALSE; // are we given a set of DSA params or we shall use/generate our own? DSAParameterSpec params = (DSAParameterSpec) attributes.get(DSS_PARAMETERS); if (params != null) { p = params.getP(); q = params.getQ(); g = params.getG(); } else if (useDefaults.equals(Boolean.TRUE)) { switch (L) { case 512: p = KEY_PARAMS_512.getP(); q = KEY_PARAMS_512.getQ(); g = KEY_PARAMS_512.getG(); break; case 768: p = KEY_PARAMS_768.getP(); q = KEY_PARAMS_768.getQ(); g = KEY_PARAMS_768.getG(); break; case 1024: p = KEY_PARAMS_1024.getP(); q = KEY_PARAMS_1024.getQ(); g = KEY_PARAMS_1024.getG(); break; default: if (strictDefaults.equals(Boolean.TRUE)) throw new IllegalArgumentException( "Does not provide default parameters for " + L + "-bit modulus length"); else { p = null; q = null; g = null; } } } else { p = null; q = null; g = null; } // do we have a SecureRandom, or should we use our own? rnd = (SecureRandom) attributes.get(SOURCE_OF_RANDOMNESS); // set the seed-key byte[] kb = new byte[20]; // we need 160 bits of randomness nextRandomBytes(kb); XKEY = new BigInteger(1, kb).setBit(159).setBit(0); } |
|
int x = c.getMagicCaretPosition().x; | Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; | public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionAbove(t, t.getCaretPosition(), x); if (pos > -1) t.moveCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } } |
int x = c.getMagicCaretPosition().x; | Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; | public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x); if (pos > -1) t.moveCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } } |
int x = c.getMagicCaretPosition().x; | Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; | public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionAbove(t, t.getCaretPosition(), x); if (pos > -1) t.setCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } } |
int x = c.getMagicCaretPosition().x; | Point mcp = c.getMagicCaretPosition(); int x = (mcp != null) ? mcp.x : 0; | public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); try { if (t != null) { Caret c = t.getCaret(); int x = c.getMagicCaretPosition().x; int pos = Utilities.getPositionBelow(t, t.getCaretPosition(), x); if (pos > -1) t.setCaretPosition(pos); } } catch(BadLocationException ble) { // FIXME: Swallowing allowed? } } |
if(offs > 0) | if(offs >= 0) | public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); if (t != null) { int offs = t.getCaretPosition() - 1; if(offs > 0) { Caret c = t.getCaret(); c.moveDot(offs); try { c.setMagicCaretPosition(t.modelToView(offs).getLocation()); } catch(BadLocationException ble) { // Can't happen. } } } } |
scrollTimer = new Timer(200, null); | scrollTimer = new Timer(50, null); | public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(200, null); scrollTimer.setRepeats(true); installComponents(); installDefaults(); configureScrollBarColors(); installListeners(); calculatePreferredSize(); } } |
} 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)."); | 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]; // 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; } } 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; } |
|
protected void changeState(int stateflag, boolean b) | private void changeState(int stateflag, boolean b) | protected void changeState(int stateflag, boolean b) { int oldstate = stateMask; int newstate; if (b) newstate = oldstate | stateflag; else newstate = oldstate & ~ stateflag; if (oldstate == newstate) return; if ((stateflag != SELECTED) && (stateflag != ENABLED) && (stateMask & ENABLED) == 0) return; stateMask = newstate; fireStateChanged(); if ((oldstate & SELECTED) == 0 && (newstate & SELECTED) == SELECTED) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else if ((oldstate & SELECTED) == SELECTED && (newstate & SELECTED) == 0) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } else if (((oldstate & ARMED) == ARMED && (oldstate & PRESSED) == PRESSED) && ((newstate & ARMED) == ARMED && (newstate & PRESSED) == 0)) fireActionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand)); } |
public void fireActionPerformed(ActionEvent e) | protected void fireActionPerformed(ActionEvent e) | public void fireActionPerformed(ActionEvent e) { ActionListener[] ll = getActionListeners(); for (int i = 0; i < ll.length; i++) ll[i].actionPerformed(e); } |
public void fireItemStateChanged(ItemEvent e) | protected void fireItemStateChanged(ItemEvent e) | public void fireItemStateChanged(ItemEvent e) { ItemListener[] ll = getItemListeners(); for (int i = 0; i < ll.length; i++) ll[i].itemStateChanged(e); } |
public void fireStateChanged() | protected void fireStateChanged() | public void fireStateChanged() { ChangeListener[] ll = getChangeListeners(); for (int i = 0; i < ll.length; i++) ll[i].stateChanged(changeEvent); } |
this.operand1 = getOperand(varIndex1); | public BinaryQuad(int address, IRBasicBlock block, int lhsIndex, int varIndex1, int operation, int varIndex2) { super(address, block, lhsIndex); this.operand1 = getOperand(varIndex1); this.operation = operation; this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; this.commutative = operation == IADD || operation == IMUL || operation == LADD || operation == LMUL || operation == FADD || operation == FMUL || operation == DADD || operation == DMUL || operation == IAND || operation == LAND || operation == IOR || operation == LOR || operation == IXOR || operation == LXOR; } |
|
this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; | refs = new Operand[] { getOperand(varIndex1), getOperand(varIndex2) }; | public BinaryQuad(int address, IRBasicBlock block, int lhsIndex, int varIndex1, int operation, int varIndex2) { super(address, block, lhsIndex); this.operand1 = getOperand(varIndex1); this.operation = operation; this.operand2 = getOperand(varIndex2); refs = new Operand[] { operand1, operand2 }; this.commutative = operation == IADD || operation == IMUL || operation == LADD || operation == LMUL || operation == FADD || operation == FMUL || operation == DADD || operation == DMUL || operation == IAND || operation == LAND || operation == IOR || operation == LOR || operation == IXOR || operation == LXOR; } |
operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; | refs[0] = refs[0].simplify(); refs[1] = refs[1].simplify(); if (refs[0] instanceof Variable) { Variable v = (Variable) refs[0]; | public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } |
if (operand2 instanceof Variable) { Variable v = (Variable) operand2; | if (refs[1] instanceof Variable) { Variable v = (Variable) refs[1]; | public void doPass2(BootableHashMap liveVariables) { operand1 = operand1.simplify(); operand2 = operand2.simplify(); if (operand1 instanceof Variable) { Variable v = (Variable) operand1; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } if (operand2 instanceof Variable) { Variable v = (Variable) operand2; v.setLastUseAddress(this.getAddress()); liveVariables.put(v, v); } } |
if (operand1 instanceof Constant && operand2 instanceof Constant) { Constant c1 = (Constant) operand1; Constant c2 = (Constant) operand2; | if (refs[0] instanceof Constant && refs[1] instanceof Constant) { Constant c1 = (Constant) refs[0]; Constant c2 = (Constant) refs[1]; | public Quad foldConstants() { if (operand1 instanceof Constant && operand2 instanceof Constant) { Constant c1 = (Constant) operand1; Constant c2 = (Constant) operand2; switch (operation) { case IADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iAdd(c2)); case ISUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iSub(c2)); case IMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iMul(c2)); case IDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iDiv(c2)); case IREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iRem(c2)); case IAND: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iAnd(c2)); case IOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iOr(c2)); case IXOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iXor(c2)); case ISHL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iShl(c2)); case ISHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iShr(c2)); case IUSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.iUshr(c2)); case LADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lAdd(c2)); case LSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lSub(c2)); case LMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lMul(c2)); case LDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lDiv(c2)); case LREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lRem(c2)); case LAND: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lAnd(c2)); case LOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lOr(c2)); case LXOR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lXor(c2)); case LSHL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lShl(c2)); case LSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lShr(c2)); case LUSHR: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.lUshr(c2)); case FADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fAdd(c2)); case FSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fSub(c2)); case FMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fMul(c2)); case FDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fDiv(c2)); case FREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.fRem(c2)); case DADD: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dAdd(c2)); case DSUB: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dSub(c2)); case DMUL: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dMul(c2)); case DDIV: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dDiv(c2)); case DREM: return new ConstantRefAssignQuad(this.getAddress(), this.getBasicBlock(), this.getLHS().getIndex(), c1.dRem(c2)); default: throw new IllegalArgumentException("Don't know how to fold those yet..."); } } return this; } |
int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); | int op1Mode = refs[0].getAddressingMode(); int op2Mode = refs[1].getAddressingMode(); | public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } } |
Variable var = (Variable) operand1; | Variable var = (Variable) refs[0]; | public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } } |
Variable var = (Variable) operand2; | Variable var = (Variable) refs[1]; | public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } } |
c2 = (Constant) operand1; | c2 = (Constant) refs[0]; | public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } } |
c3 = (Constant) operand2; | c3 = (Constant) refs[1]; | public void generateCode(CodeGenerator cg) { cg.checkLabel(getAddress()); Variable lhs = getLHS(); int lhsMode = lhs.getAddressingMode(); int op1Mode = operand1.getAddressingMode(); int op2Mode = operand2.getAddressingMode(); Object reg1 = null; if (lhsMode == Operand.MODE_REGISTER) { RegisterLocation regLoc = (RegisterLocation) lhs.getLocation(); reg1 = regLoc.getRegister(); } Object reg2 = null; if (op1Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand1; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg2 = regLoc.getRegister(); } Object reg3 = null; if (op2Mode == Operand.MODE_REGISTER) { Variable var = (Variable) operand2; RegisterLocation regLoc = (RegisterLocation) var.getLocation(); reg3 = regLoc.getRegister(); } int disp1 = 0; if (lhsMode == Operand.MODE_STACK) { StackLocation stackLoc = (StackLocation) lhs.getLocation(); disp1 = stackLoc.getDisplacement(); } int disp2 = 0; if (op1Mode == Operand.MODE_STACK) { Variable var = (Variable) operand1; StackLocation stackLoc = (StackLocation) var.getLocation(); disp2 = stackLoc.getDisplacement(); } int disp3 = 0; if (op2Mode == Operand.MODE_STACK) { Variable var = (Variable) operand2; StackLocation stackLoc = (StackLocation) var.getLocation(); disp3 = stackLoc.getDisplacement(); } Constant c2 = null; if (op1Mode == Operand.MODE_CONSTANT) { c2 = (Constant) operand1; } Constant c3 = null; if (op2Mode == Operand.MODE_CONSTANT) { c3 = (Constant) operand2; } int aMode = (lhsMode << 16) | (op1Mode << 8) | op2Mode; switch (aMode) { case MODE_RCC: cg.generateBinaryOP(reg1, c2, operation, c3); break; case MODE_RCR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, c2); } else { cg.generateBinaryOP(reg1, c2, operation, reg3); } break; case MODE_RCS: cg.generateBinaryOP(reg1, c2, operation, disp3); break; case MODE_RRC: cg.generateBinaryOP(reg1, reg2, operation, c3); break; case MODE_RRR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, reg2); } else { cg.generateBinaryOP(reg1, reg2, operation, reg3); } break; case MODE_RRS: cg.generateBinaryOP(reg1, reg2, operation, disp3); break; case MODE_RSC: cg.generateBinaryOP(reg1, disp2, operation, c3); break; case MODE_RSR: if (reg1 == reg3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(reg1, reg3, operation, disp2); } else { cg.generateBinaryOP(reg1, disp2, operation, reg3); } break; case MODE_RSS: cg.generateBinaryOP(reg1, disp2, operation, disp3); break; case MODE_SCC: cg.generateBinaryOP(disp1, c2, operation, c3); break; case MODE_SCR: cg.generateBinaryOP(disp1, c2, operation, reg3); break; case MODE_SCS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, c2); } else { cg.generateBinaryOP(disp1, c2, operation, disp3); } break; case MODE_SRC: cg.generateBinaryOP(disp1, reg2, operation, c3); break; case MODE_SRR: cg.generateBinaryOP(disp1, reg2, operation, reg3); break; case MODE_SRS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, reg2); } else { cg.generateBinaryOP(disp1, reg2, operation, disp3); } break; case MODE_SSC: cg.generateBinaryOP(disp1, disp2, operation, c3); break; case MODE_SSR: cg.generateBinaryOP(disp1, disp2, operation, reg3); break; case MODE_SSS: if (disp1 == disp3 && commutative && !cg.supports3AddrOps()) { cg.generateBinaryOP(disp1, disp3, operation, disp2); } else { cg.generateBinaryOP(disp1, disp2, operation, disp3); } break; default: throw new IllegalArgumentException("Undefined addressing mode: " + aMode); } } |
operand1.toString() + " " + OP_MAP[operation - IADD] + " " + operand2.toString(); | refs[0].toString() + " " + OP_MAP[operation - IADD] + " " + refs[1].toString(); | public String toString() { return getAddress() + ": " + getLHS().toString() + " = " + operand1.toString() + " " + OP_MAP[operation - IADD] + " " + operand2.toString(); } |
CurrentArray = null; | public void action (SaxDocumentHandler handler) { // well, well, which array will we deal with here? // if an appendto is specified, then we will try to append this array // to the specified one, otherwise, the current array is added to // the current structure. String arrayAppendId = CurrentArray.getAppendTo(); if (arrayAppendId != null) { // we just add it to the designated array Array arrayToAppendTo = (Array) ArrayObj.get(arrayAppendId); appendArrayToArray(arrayToAppendTo, CurrentArray); } else { // add the current array and add this array to current structure CurrentStructure.addArray(CurrentArray); } } |
|
int thisInt = Integer.parseInt(thisString, intRadix); | int thisInt = 0; try { thisInt = Integer.parseInt(thisString, intRadix); } catch (NumberFormatException e) { if (thisString.startsWith("+")) { thisInt = Integer.parseInt(thisString.substring(1), intRadix); } else { throw e; } } | private void addDataToCurrentArray ( Locator dataLocator, String thisString, DataFormat CurrentDataFormat, int intRadix ) {/*// this stuff slows down the parser too much to leave commented in.// uncomment as neededLog.debug("Add Data:["+thisString+"] (");List axes = dataLocator.getIterationOrder();Iterator liter = axes.iterator();while (liter.hasNext()) { AxisInterface axis = (AxisInterface) liter.next(); Log.debug(dataLocator.getAxisIndex(axis)+ " ["+axis.getAxisId()+"],");}Log.debugln(") ");*/ // Note that we dont treat binary data at all here try { if ( CurrentDataFormat instanceof StringDataFormat) { CurrentArray.setData(dataLocator, thisString); } else if ( CurrentDataFormat instanceof FloatDataFormat || CurrentDataFormat instanceof BinaryFloatDataFormat) { Double number = new Double (thisString); CurrentArray.setData(dataLocator, number.doubleValue()); } else if ( CurrentDataFormat instanceof IntegerDataFormat || CurrentDataFormat instanceof BinaryIntegerDataFormat) { // Integer number = new Integer (thisString); if (intRadix == 16) // peal off leading "0x" thisString = thisString.substring(2); int thisInt = Integer.parseInt(thisString, intRadix); CurrentArray.setData(dataLocator, thisInt); } else { Log.warnln("Unknown data format, unable to setData:["+thisString+"], ignoring request"); } } catch (SetDataException e) { // bizarre error. Cant add data (out of memory??) :P Log.errorln("Unable to setData:["+thisString+"], ignoring request"); Log.printStackTrace(e); } } |
endElementHandlerHashtable.put(XDFNodeName.STRUCTURE, new structureEndElementHandlerFunc()); | private void initEndHandlerHashtable () { endElementHandlerHashtable.put(XDFNodeName.ARRAY, new arrayEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.DATA, new dataEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.FIELDGROUP, new fieldGroupEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.NOTES, new notesEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.PARAMETERGROUP, new parameterGroupEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.READ, new readEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.REPEAT, new repeatEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD0, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD1, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD2, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD3, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD4, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD5, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD6, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD7, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.TD8, new dataTagEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.VALUEGROUP, new valueGroupEndElementHandlerFunc()); endElementHandlerHashtable.put(XDFNodeName.VALUELIST, new valueListEndElementHandlerFunc()); } |
|
String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi"); if ("default".equals(prop)) return null; Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class, null); if (it == null || ! it.hasNext()) | private static RMIClassLoaderSpi getProviderInstance() { // TODO: Do something more useful here. return null; } |
|
return (RMIClassLoaderSpi) it.next(); | private static RMIClassLoaderSpi getProviderInstance() { // TODO: Do something more useful here. return null; } |
|
return def; | if (settings.containsKey(key)) return settings.getProperty(key); else return def; | public String getProperty(String key, String def) { return def; } |
m.minor = Minor.Header; | public static void close(OutputStream socketStream) { try { Singleton.write(socketStream); socketStream.flush(); } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to flush the stream"); m.initCause(ex); throw m; } } |
|
this.x = x; this.y = y; this.width = w; this.height = h; | this.x = (int) (x * units + 0.5f); this.y = (int) (y * units + 0.5f); this.width = (int) (w * units + 0.5f); this.height = (int) (h * units + 0.5f); | public MediaPrintableArea(float x, float y, float w, float h, int units) { if (x < 0.0f || y < 0.0f || w <= 0.0f || h <= 0.0f) throw new IllegalArgumentException(); this.x = x; this.y = y; this.width = w; this.height = h; } |
throw new IllegalArgumentException(); | throw new IllegalArgumentException("units may not be less than 1"); | public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException(); return height * units; } |
return height * units; | return height / ((float)units); | public float getHeight(int units) { if (units < 1) throw new IllegalArgumentException(); return height * units; } |
throw new IllegalArgumentException(); | throw new IllegalArgumentException("units may not be less than 1"); | public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException(); return width * units; } |
return width * units; | return width / ((float)units); | public float getWidth(int units) { if (units < 1) throw new IllegalArgumentException(); return width * units; } |
throw new IllegalArgumentException(); | throw new IllegalArgumentException("units may not be less than 1"); | public float getX(int units) { if (units < 1) throw new IllegalArgumentException(); return x * units; } |
return x * units; | return x / ((float)units); | public float getX(int units) { if (units < 1) throw new IllegalArgumentException(); return x * units; } |
throw new IllegalArgumentException(); | throw new IllegalArgumentException("units may not be less than 1"); | public float getY(int units) { if (units < 1) throw new IllegalArgumentException(); return y * units; } |
return y * units; | return y / ((float)units); | public float getY(int units) { if (units < 1) throw new IllegalArgumentException(); return y * units; } |
if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); | public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; } |
|
super.setForeground(getTextSelectionColor()); | setForeground(getTextSelectionColor()); | public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; } |
super.setForeground(getTextNonSelectionColor()); | setForeground(getTextNonSelectionColor()); | public Component getTreeCellRendererComponent(JTree tree, Object val, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { this.selected = selected; this.hasFocus = hasFocus; if (leaf) setLeafIcon(getLeafIcon()); else if (expanded) setOpenIcon(getOpenIcon()); else setClosedIcon(getClosedIcon()); setText(val.toString()); setHorizontalAlignment(LEFT); setOpaque(true); setVerticalAlignment(TOP); setEnabled(true); setFont(getFont()); if (selected) { super.setBackground(getBackgroundSelectionColor()); super.setForeground(getTextSelectionColor()); } else { super.setBackground((tree.getParent()).getBackground()); super.setForeground(getTextNonSelectionColor()); } return this; } |
public boolean equals (Object obj) { if (!(obj instanceof VMID)) | public boolean equals(Object obj) | public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); } |
return false; | if (obj instanceof VMID) { VMID other = (VMID) obj; return uid.equals(other.uid) && Arrays.equals(addr, other.addr); | public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); } |
VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); | public boolean equals (Object obj) { if (!(obj instanceof VMID)) { return false; } VMID other = (VMID) obj; if (addr.length != other.addr.length) { return false; } for (int i = addr.length - 1; i >= 0; i--) { if (addr[i] != other.addr[i]) { return false; } } return uid.equals(other.uid); } |
|
return super.hashCode(); } | if (hash==0) { for (int i = 0; i < localAddr.length; i++) hash += addr[i]; hash = hash ^ uid.hashCode(); } return hash; } | public int hashCode () { return super.hashCode(); } |
displayMessage("Internal frame closing", e); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
|
displayMessage("Internal frame closed", e); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
|
displayMessage("Internal frame opened", e); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
|
displayMessage("Internal frame iconified", e); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
|
displayMessage("Internal frame deiconified", e); | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
|
displayMessage("Internal frame activated", e); | activated = true; | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
activated = false; | public MyInternalFrame() { super("#" + (++openFrameCount), true, //resizable true, //closable true, //maximizable true);//iconifiable //...Create the GUI and put it in the window... //...Then set the window size or call pack... setSize(300,300); //Set the window's location. setLocation(xOffset*openFrameCount, yOffset*openFrameCount); addInternalFrameListener(new InternalFrameAdapter() {// public void internalFrameActivated(InternalFrameEvent e) {// paintme();// // displayMessage("Internal frame activated", e);// } public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } }); } |
|
displayMessage("Internal frame activated", e); | activated = true; | public void internalFrameActivated(InternalFrameEvent e) { displayMessage("Internal frame activated", e); repaint(); } |
displayMessage("Internal frame closed", e); | public void internalFrameClosed(InternalFrameEvent e) { displayMessage("Internal frame closed", e); } |
|
displayMessage("Internal frame closing", e); | public void internalFrameClosing(InternalFrameEvent e) { displayMessage("Internal frame closing", e); disconnectMe(); } |
|
activated = false; | public void internalFrameDeactivated(InternalFrameEvent e) { displayMessage("Internal frame deactivated", e); } |
|
displayMessage("Internal frame deiconified", e); | public void internalFrameDeiconified(InternalFrameEvent e) { displayMessage("Internal frame deiconified", e); } |
|
displayMessage("Internal frame iconified", e); | public void internalFrameIconified(InternalFrameEvent e) { displayMessage("Internal frame iconified", e); } |
|
displayMessage("Internal frame opened", e); | public void internalFrameOpened(InternalFrameEvent e) { displayMessage("Internal frame opened", e); } |
|
selectedIndex = desktop.getComponentCount(); | public void addSessionView(String tabText,Session session) { MyInternalFrame frame = new MyInternalFrame(); frame.setVisible(true); desktop.add(frame); frame.setContentPane(session); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException e) {} session.addSessionListener(this); session.addSessionJumpListener(this); } |
|
JInternalFrame[] frames = desktop.getAllFrames(); return (Session)frames[index].getContentPane(); | JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); Session s = (Session)frames[index].getContentPane(); return s; | public Session getSessionAt( int index) { JInternalFrame[] frames = desktop.getAllFrames(); return (Session)frames[index].getContentPane(); } |
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); | JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame(); | private void nextSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index + 1].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
frames[index + 1].setSelected(true); | frames[index].setSelected(true); | private void nextSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index < desktop.getComponentCount() - 1) { try { frames[index + 1].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[0].setSelected(true); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
final int index = desktop.getIndexOf(ses); | final int index = getIndexOfSession(ses); | public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = desktop.getIndexOf(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } }; SwingUtilities.invokeLater(tc); } break; } } |
frames[index].setTitle(d); | frames[index].setTitle(frames[index].getTitle() + " " + d); | public void onSessionChanged(SessionChangeEvent changeEvent) { Session ses = (Session)changeEvent.getSource(); switch (changeEvent.getState()) { case STATE_CONNECTED: final String d = ses.getAllocDeviceName(); if (d != null) { System.out.println(changeEvent.getState() + " " + d); final int index = desktop.getIndexOf(ses); Runnable tc = new Runnable () { public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } }; SwingUtilities.invokeLater(tc); } break; } } |
frames[index].setTitle(d); | frames[index].setTitle(frames[index].getTitle() + " " + d); | public void run() { JInternalFrame[] frames = desktop.getAllFrames(); frames[index].setTitle(d); } |
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); | JInternalFrame[] frames = (JInternalFrame[])desktop.getAllFrames(); JInternalFrame miv = (JInternalFrame)desktop.getSelectedFrame(); int index = selectedIndex; | private void prevSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
selectedIndex--; | private void prevSession() { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame(); int index = desktop.getIndexOf(miv); if (index == 0) {// desktop.setSelectedFrame(frames[frames.length - 1]); try { frames[frames.length - 1].setSelected(true); frames[frames.length - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } else { try { frames[index - 1].setSelected(true); frames[index - 1].repaint(); } catch (java.beans.PropertyVetoException e) { System.out.println(e.getMessage()); } } } |
|
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); int index = desktop.getIndexOf(targetSession); | int index = getIndexOfSession(targetSession); | public void removeSessionView(Session targetSession) { MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); int index = desktop.getIndexOf(targetSession); System.out.println("session found and closing down " + index); targetSession.removeSessionListener(this); targetSession.removeSessionJumpListener(this); desktop.remove(index);// sessionPane.remove(index);// if (index < (sessionPane.getTabCount() - 2)) {// sessionPane.setSelectedIndex(index);// sessionPane.setForegroundAt(index,Color.blue);// sessionPane.setIconAt(index,focused);// }// else {//// if (sessionPane.getTabCount() > 0) {// sessionPane.setSelectedIndex(0);// sessionPane.setForegroundAt(0,Color.blue);// sessionPane.setIconAt(0,focused);// }//// } } |
as400QueryP = new JPanel(); as400QueryP.setLayout(new BorderLayout()); queryStatement = new JTextArea(2, 40); JScrollPane scrollPane = new JScrollPane(queryStatement); queryStatement.setLineWrap(true); as400QueryP.add(scrollPane, BorderLayout.CENTER); | private void initXTFRInfo() { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); Border emptyBorder = BorderFactory.createEmptyBorder(10, 10, 0, 10); // main panel JPanel mp = new JPanel(); mp.setLayout(borderLayout); // system panel JPanel sp = new JPanel(); sp.setLayout(new BorderLayout()); sp.setBorder(emptyBorder); // host panel for as400 as400p = new JPanel(); as400p.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelAS400"))); as400p.setLayout(new GridBagLayout()); JLabel snpLabel = new JLabel(LangTool.getString("xtfr.labelSystemName")); systemName = new JTextField(vt.getHostName()); systemName.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy =0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(snpLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(systemName,gbc); JLabel hfnpLabel = new JLabel(LangTool.getString("xtfr.labelHostFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(hfnpLabel, gbc); hostFile = new JTextField(); hostFile.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(hostFile, gbc); JLabel idpLabel = new JLabel(LangTool.getString("xtfr.labelUserId")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(idpLabel, gbc); user = new JTextField(); user.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(user, gbc); // password panel JLabel pwpLabel = new JLabel(LangTool.getString("xtfr.labelPassword")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(pwpLabel, gbc); password = new JPasswordField(); password.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(password, gbc); // Query Wizard useQuery = new JCheckBox(LangTool.getString("xtfr.labelUseQuery")); useQuery.addItemListener(this); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(useQuery, gbc); //query button queryWizard = new JButton(LangTool.getString("xtfr.labelQueryWizard")); queryWizard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startWizard(); } }); queryWizard.setEnabled(false); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(queryWizard, gbc); // Field Selection panel fieldsLabel = new JLabel(LangTool.getString("xtfr.labelFields")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(fieldsLabel, gbc); allFields = new JRadioButton(LangTool.getString("xtfr.labelAllFields")); allFields.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(allFields, gbc); selectedFields = new JRadioButton(LangTool.getString("xtfr.labelSelectedFields")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 10); as400p.add(selectedFields, gbc); ButtonGroup fieldGroup = new ButtonGroup(); fieldGroup.add(allFields); fieldGroup.add(selectedFields); // Field Text Description panel textDescLabel = new JLabel(LangTool.getString("xtfr.labelTxtDesc")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 6; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(textDescLabel, gbc); txtDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescFull")); txtDesc.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 5); as400p.add(txtDesc, gbc); intDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescInt")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 10); as400p.add(intDesc, gbc); ButtonGroup txtDescGroup = new ButtonGroup(); txtDescGroup.add(txtDesc); txtDescGroup.add(intDesc); // pc panel for pc information JPanel pcp = new JPanel(new GridBagLayout()); pcp.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelpc"))); JLabel pffLabel = new JLabel(LangTool.getString("xtfr.labelFileFormat")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pffLabel, gbc); fileFormat = new JComboBox(); fileFormat.setPreferredSize(new Dimension(220, 25)); fileFormat.addItem(htmlFilter.getDescription()); fileFormat.addItem(OOFilter.getDescription()); fileFormat.addItem(ExcelFilter.getDescription()); fileFormat.addItem(KSpreadFilter.getDescription()); fileFormat.addItem(DelimitedFilter.getDescription()); fileFormat.addItem(FixedWidthFilter.getDescription()); fileFormat.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); filter = getFilterByDescription(); if (filter.getOutputFilterInstance().isCustomizable()) customize.setEnabled(true); else customize.setEnabled(false); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(fileFormat, gbc); customize = new JButton(LangTool.getString("xtfr.labelCustomize")); customize.setPreferredSize(new Dimension(110, 25)); customize.setActionCommand("CUSTOMIZE"); customize.addActionListener(this); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(customize, gbc); // now make sure we set the customizable button enabled or not // depending on the filter. fileFormat.setSelectedIndex(0); JLabel pcpLabel = new JLabel(LangTool.getString("xtfr.labelPCFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pcpLabel, gbc); localFile = new JTextField(); localFile.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(localFile, gbc); JButton browsePC = new JButton(LangTool.getString("xtfr.labelPCBrowse")); browsePC.setActionCommand("BROWSEPC"); browsePC.addActionListener(this); browsePC.setPreferredSize(new Dimension(110, 25)); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(browsePC, gbc); decimalSeparator = new JComboBox(); decimalSeparator.setPreferredSize(new Dimension(220, 25)); decimalSeparator.addItem(LangTool.getString("xtfr.period")); decimalSeparator.addItem(LangTool.getString("xtfr.comma")); // obtain the decimal separator for the machine locale DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.getDefault()); if (formatter.getDecimalFormatSymbols().getDecimalSeparator() == '.') decimalSeparator.setSelectedIndex(0); else decimalSeparator.setSelectedIndex(1); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 10, 5); pcp.add(new JLabel(LangTool.getString("xtfr.labelDecimal")), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 5, 5); pcp.add(decimalSeparator, gbc); sp.add(as400p, BorderLayout.NORTH); sp.add(pcp, BorderLayout.SOUTH); // options panel JPanel op = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); JButton xtfrButton = new JButton(LangTool.getString("xtfr.labelXTFR")); xtfrButton.addActionListener(this); xtfrButton.setActionCommand("XTFR"); op.add(xtfrButton); JButton emailButton = new JButton(LangTool.getString("xtfr.labelXTFREmail")); emailButton.addActionListener(this); emailButton.setActionCommand("EMAIL"); op.add(emailButton); mp.add(sp, BorderLayout.CENTER); mp.add(op, BorderLayout.SOUTH); this.getContentPane().add(mp, BorderLayout.CENTER); // this.setModal(false); // this.setModal(true); this.setTitle(LangTool.getString("xtfr.title")); initXTFRFields(); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation( (screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); //QueryPanel when Use Query selected as400QueryP = new JPanel(); as400QueryP.setLayout(new BorderLayout()); queryStatement = new JTextArea(2, 40); JScrollPane scrollPane = new JScrollPane(queryStatement); queryStatement.setLineWrap(true); as400QueryP.add(scrollPane, BorderLayout.CENTER); // now show the world what we can do show(); } |
|
{ | public void setDragMode(int mode) { if ((mode != LIVE_DRAG_MODE) && (mode != OUTLINE_DRAG_MODE)) throw new IllegalArgumentException("Drag mode not valid."); // FIXME: Unsupported mode. if (mode == OUTLINE_DRAG_MODE) { // throw new IllegalArgumentException("Outline drag modes are unsupported."); mode = LIVE_DRAG_MODE; } dragMode = mode; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.