rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); | MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent(me); | private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } } |
acquireComponentForMouseEvent(me); | if (mouseEventTarget == null) return; if (mouseEventTarget.equals(frame.getGlassPane())) return; | private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } } |
if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); | if (mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent( frame.getGlassPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); | private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); acquireComponentForMouseEvent(me); // Avoid dispatching ENTERED and EXITED events twice. if (mouseEventTarget != null && mouseEventTarget.isShowing() && e.getID() != MouseEvent.MOUSE_ENTERED && e.getID() != MouseEvent.MOUSE_EXITED) { MouseEvent newEvt = SwingUtilities.convertMouseEvent(frame .getContentPane(), me, mouseEventTarget); mouseEventTarget.dispatchEvent(newEvt); switch (e.getID()) { case MouseEvent.MOUSE_PRESSED: if (pressCount++ == 0) pressedComponent = mouseEventTarget; break; case MouseEvent.MOUSE_RELEASED: // Clear our memory of the original PRESSED event, only if // we're not expecting a CLICKED event after this. If // there is a CLICKED event after this, it will do clean up. if (--pressCount == 0 && mouseEventTarget != pressedComponent) pressedComponent = null; break; } } } } |
if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); | if (frame.isSelected()) activateFrame(frame); else deactivateFrame(frame); | public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(JInternalFrame.IS_MAXIMUM_PROPERTY)) { if (frame.isMaximum()) maximizeFrame(frame); else minimizeFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY)) { if (frame.isIcon()) iconifyFrame(frame); else deiconifyFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.IS_SELECTED_PROPERTY)) { if (frame.isSelected()) activateFrame(frame); else getDesktopManager().deactivateFrame(frame); } else if (evt.getPropertyName().equals(JInternalFrame.ROOT_PANE_PROPERTY) || evt.getPropertyName().equals(JInternalFrame.GLASS_PANE_PROPERTY)) { Component old = (Component) evt.getOldValue(); old.removeMouseListener(glassPaneDispatcher); old.removeMouseMotionListener(glassPaneDispatcher); Component newPane = (Component) evt.getNewValue(); newPane.addMouseListener(glassPaneDispatcher); newPane.addMouseMotionListener(glassPaneDispatcher); frame.revalidate(); } /* FIXME: need to add ancestor properties to JComponents. else if (evt.getPropertyName().equals(JComponent.ANCESTOR_PROPERTY)) { if (desktopPane != null) desktopPane.removeComponentListener(componentListener); desktopPane = frame.getDesktopPane(); if (desktopPane != null) desktopPane.addComponentListener(componentListener); } */ } |
textComponent.addPropertyChangeListener(updateHandler); | protected void installListeners() { textComponent.addFocusListener(focuslistener); installDocumentListeners(); } |
|
textComponent.addPropertyChangeListener(updateHandler); modelChanged(); | public void installUI(final JComponent c) { super.installUI(c); c.setOpaque(true); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } textComponent.addPropertyChangeListener(updateHandler); modelChanged(); installDefaults(); installListeners(); installKeyboardActions(); } |
|
modelChanged(); | public void installUI(final JComponent c) { super.installUI(c); c.setOpaque(true); textComponent = (JTextComponent) c; Document doc = textComponent.getDocument(); if (doc == null) { doc = getEditorKit(textComponent).createDefaultDocument(); textComponent.setDocument(doc); } textComponent.addPropertyChangeListener(updateHandler); modelChanged(); installDefaults(); installListeners(); installKeyboardActions(); } |
|
textComponent.removePropertyChangeListener(updateHandler); | protected void uninstallListeners() { textComponent.removeFocusListener(focuslistener); textComponent.getDocument().removeDocumentListener(documentHandler); } |
|
textComponent.removePropertyChangeListener(updateHandler); | public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); textComponent = null; } |
|
public void add(org.omg.CORBA.Object object) | public cObject add(org.omg.CORBA.Object object, int port) | public void add(org.omg.CORBA.Object object) { add(generateObjectKey(object), object); } |
add(generateObjectKey(object), object); | return add(generateObjectKey(object), object, port); | public void add(org.omg.CORBA.Object object) { add(generateObjectKey(object), object); } |
public org.omg.CORBA.Object get(byte[] key) | public cObject get(byte[] key) | public org.omg.CORBA.Object get(byte[] key) { return (org.omg.CORBA.Object) objects.get(key); } |
return (org.omg.CORBA.Object) objects.get(key); | return (cObject) objects.get(key); | public org.omg.CORBA.Object get(byte[] key) { return (org.omg.CORBA.Object) objects.get(key); } |
public byte[] getKey(org.omg.CORBA.Object stored_object) | public cObject getKey(org.omg.CORBA.Object stored_object) | public byte[] getKey(org.omg.CORBA.Object stored_object) { Map.Entry item; Iterator iter = objects.entrySet().iterator(); while (iter.hasNext()) { item = (Map.Entry) iter.next(); if (stored_object._is_equivalent((org.omg.CORBA.Object) item.getValue()) ) return (byte[]) item.getKey(); } return null; } |
if (stored_object._is_equivalent((org.omg.CORBA.Object) item.getValue()) ) return (byte[]) item.getKey(); | ref = (cObject) item.getValue(); if (stored_object.equals(ref.object)) return ref; | public byte[] getKey(org.omg.CORBA.Object stored_object) { Map.Entry item; Iterator iter = objects.entrySet().iterator(); while (iter.hasNext()) { item = (Map.Entry) iter.next(); if (stored_object._is_equivalent((org.omg.CORBA.Object) item.getValue()) ) return (byte[]) item.getKey(); } return null; } |
byte[] key = getKey(object); if (key != null) objects.remove(key); | cObject ref = getKey(object); if (ref != null) objects.remove(ref.key); | public void remove(org.omg.CORBA.Object object) { byte[] key = getKey(object); if (key != null) objects.remove(key); } |
if (noData != null) { writeOut(outputstream, noData); | if (noData != null) writeOut(outputstream, noData); | private void recursiveWriteFormattedData(OutputStream outputstream, Locator locator, List commands, AxisInterface fastestAxis, String[] noDataValues) { int stop = commands.size(); for (int i = 0; i<stop; i++) { FormattedIOCmd command = (FormattedIOCmd) commands.get(i); if (command instanceof RepeatFormattedIOCmd) { int end = ((RepeatFormattedIOCmd) command).getCount().intValue(); List repeatCommandList = ((RepeatFormattedIOCmd)command).getCommands(); for (int j = 0; j < end; j ++) { recursiveWriteFormattedData(outputstream, locator, repeatCommandList, fastestAxis, noDataValues); } } else { if (command instanceof SkipCharFormattedIOCmd) { try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) { writeOut(outputstream, noData); } String output=((SkipCharFormattedIOCmd) command).getOutput(); if (output == null) { writeOut(outputstream, SkipCharFormattedIOCmd.DefaultOutput) ; } else { writeOut(outputstream, output); } if (!locator.next()) //no more data, we are done return; } } //done dealing with SkipCharFormattedIOCmd } //end of outer for loop } // //PROTECTED methods // /**clone for DataCube should not be invoked externally. it has to be invoked * by its parentArray. */ protected Object clone() throws CloneNotSupportedException { DataCube cloneObj = (DataCube) super.clone(); synchronized (this) { synchronized (cloneObj) { cloneObj.data= deepCopy(this.data, dimension); } } return cloneObj; } |
protected Object clone() throws CloneNotSupportedException { DataCube cloneObj = (DataCube) super.clone(); synchronized (this) { synchronized (cloneObj) { cloneObj.data= deepCopy(this.data, dimension); } } return cloneObj; } | private void recursiveWriteFormattedData(OutputStream outputstream, Locator locator, List commands, AxisInterface fastestAxis, String[] noDataValues) { int stop = commands.size(); for (int i = 0; i<stop; i++) { FormattedIOCmd command = (FormattedIOCmd) commands.get(i); if (command instanceof RepeatFormattedIOCmd) { int end = ((RepeatFormattedIOCmd) command).getCount().intValue(); List repeatCommandList = ((RepeatFormattedIOCmd)command).getCommands(); for (int j = 0; j < end; j ++) { recursiveWriteFormattedData(outputstream, locator, repeatCommandList, fastestAxis, noDataValues); } } else { if (command instanceof SkipCharFormattedIOCmd) { try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData != null) { writeOut(outputstream, noData); } String output=((SkipCharFormattedIOCmd) command).getOutput(); if (output == null) { writeOut(outputstream, SkipCharFormattedIOCmd.DefaultOutput) ; } else { writeOut(outputstream, output); } if (!locator.next()) //no more data, we are done return; } } //done dealing with SkipCharFormattedIOCmd } //end of outer for loop } // //PROTECTED methods // /**clone for DataCube should not be invoked externally. it has to be invoked * by its parentArray. */ protected Object clone() throws CloneNotSupportedException { DataCube cloneObj = (DataCube) super.clone(); synchronized (this) { synchronized (cloneObj) { cloneObj.data= deepCopy(this.data, dimension); } } return cloneObj; } |
|
public void remove(int index) | public void remove(JMenuItem item) | public void remove(int index) { popupMenu.remove(index); } |
popupMenu.remove(index); | popupMenu.remove(item); | public void remove(int index) { popupMenu.remove(index); } |
return new Boolean(filechooser.getFileSystemView().isHiddenFile(f)); | return Boolean.valueOf(filechooser.getFileSystemView().isHiddenFile(f)); | public Boolean isHidden(File f) { return new Boolean(filechooser.getFileSystemView().isHiddenFile(f)); } |
public void propertyChange(PropertyChangeEvent e) { | public PropertyChangeListener createPropertyChangeListener(JFileChooser fc) { return new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // FIXME: Multiple file selection waiting on JList multiple selection // bug. if (e.getPropertyName().equals( JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { if (filechooser.getSelectedFile() == null) setFileName(null); else setFileName(filechooser.getSelectedFile().toString()); int index = -1; File file = filechooser.getSelectedFile(); for (index = 0; index < model.getSize(); index++) if (((File) model.getElementAt(index)).equals(file)) break; if (index == -1) return; filelist.setSelectedIndex(index); filelist.ensureIndexIsVisible(index); filelist.revalidate(); filelist.repaint(); } else if (e.getPropertyName().equals( JFileChooser.DIRECTORY_CHANGED_PROPERTY)) { filelist.clearSelection(); filelist.revalidate(); filelist.repaint(); setDirectorySelected(false); setDirectory(filechooser.getCurrentDirectory()); boxEntries(); } else if (e.getPropertyName().equals( JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals( JFileChooser.FILE_FILTER_CHANGED_PROPERTY)) filterEntries(); else if (e.getPropertyName().equals( JFileChooser.DIALOG_TYPE_CHANGED_PROPERTY) || e.getPropertyName().equals( JFileChooser.DIALOG_TITLE_CHANGED_PROPERTY)) { Window owner = SwingUtilities.windowForComponent(filechooser); if (owner instanceof JDialog) ((JDialog) owner).setTitle(getDialogTitle(filechooser)); accept.setText(getApproveButtonText(filechooser)); accept.setToolTipText(getApproveButtonToolTipText(filechooser)); accept.setMnemonic(getApproveButtonMnemonic(filechooser)); } else if (e.getPropertyName().equals( JFileChooser.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY)) accept.setText(getApproveButtonText(filechooser)); else if (e.getPropertyName().equals( JFileChooser.APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY)) accept.setToolTipText(getApproveButtonToolTipText(filechooser)); else if (e.getPropertyName().equals( JFileChooser.APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY)) accept.setMnemonic(getApproveButtonMnemonic(filechooser)); else if (e.getPropertyName().equals( JFileChooser.CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY)) { if (filechooser.getControlButtonsAreShown()) { GridBagConstraints c = new GridBagConstraints(); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.BOTH; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); bottomPanel.revalidate(); bottomPanel.repaint(); bottomPanel.doLayout(); } else bottomPanel.remove(closePanel); } else if (e.getPropertyName().equals( JFileChooser.ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY)) { if (filechooser.isAcceptAllFileFilterUsed()) filechooser.addChoosableFileFilter(getAcceptAllFileFilter(filechooser)); else filechooser.removeChoosableFileFilter(getAcceptAllFileFilter(filechooser)); } else if (e.getPropertyName().equals( JFileChooser.ACCESSORY_CHANGED_PROPERTY)) { JComponent old = (JComponent) e.getOldValue(); if (old != null) getAccessoryPanel().remove(old); JComponent newval = (JComponent) e.getNewValue(); if (newval != null) getAccessoryPanel().add(newval); } if (e.getPropertyName().equals(JFileChooser.DIRECTORY_CHANGED_PROPERTY) || e.getPropertyName().equals( JFileChooser.FILE_FILTER_CHANGED_PROPERTY) || e.getPropertyName().equals( JFileChooser.FILE_HIDING_CHANGED_PROPERTY)) rescanCurrentDirectory(filechooser); filechooser.revalidate(); filechooser.repaint(); } }; } |
|
parents.setRenderer(new CBLabelRenderer()); | parents.setRenderer(new BasicComboBoxRenderer()); | public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); } |
topPanel.setLayout(new java.awt.FlowLayout()); | parentsPanel.add(buttonPanel); topPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 0)); | public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); } |
topPanel.add(buttonPanel); | public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new CBLabelRenderer()); boxEntries(); look.setLabelFor(parents); JPanel parentsPanel = new JPanel(); parentsPanel.add(look); parentsPanel.add(parents); JPanel buttonPanel = new JPanel(); upFolderButton = new JButton(); upFolderButton.setIcon(upFolderIcon); buttonPanel.add(upFolderButton); homeFolderButton = new JButton(); homeFolderButton = new JButton(homeFolderIcon); buttonPanel.add(homeFolderButton); newFolderButton = new JButton(); newFolderButton.setIcon(newFolderIcon); buttonPanel.add(newFolderButton); ButtonGroup toggles = new ButtonGroup(); JToggleButton listViewButton = new JToggleButton(); listViewButton.setIcon(listViewIcon); toggles.add(listViewButton); buttonPanel.add(listViewButton); JToggleButton detailsViewButton = new JToggleButton(); detailsViewButton.setIcon(detailsViewIcon); toggles.add(detailsViewButton); buttonPanel.add(detailsViewButton); JPanel topPanel = new JPanel(); topPanel.setLayout(new java.awt.FlowLayout()); topPanel.add(parentsPanel); topPanel.add(buttonPanel); accessoryPanel = new JPanel(); if (filechooser.getAccessory() != null) accessoryPanel.add(filechooser.getAccessory(), BorderLayout.CENTER); filelist = new JList(model); filelist.setVisibleRowCount(6); JScrollPane scrollp = new JScrollPane(filelist); scrollp.setPreferredSize(new Dimension(400, 175)); filelist.setBackground(Color.WHITE); filelist.setLayoutOrientation(JList.VERTICAL_WRAP); filelist.setCellRenderer(new ListLabelRenderer()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; JPanel centrePanel = new JPanel(); centrePanel.setLayout(new GridBagLayout()); centrePanel.add(scrollp, c); c.gridx = 1; centrePanel.add(accessoryPanel, c); JLabel fileNameLabel = new JLabel("File Name:"); JLabel fileTypesLabel = new JLabel("Files of Type:"); entry = new JTextField(); filters = new JComboBox(); filterEntries(); fileNameLabel.setLabelFor(entry); fileNameLabel.setHorizontalTextPosition(SwingConstants.LEFT); fileTypesLabel.setLabelFor(filters); fileTypesLabel.setHorizontalTextPosition(SwingConstants.LEFT); closePanel = new JPanel(); accept = getApproveButton(filechooser); cancel = new JButton(cancelButtonText); cancel.setMnemonic(cancelButtonMnemonic); cancel.setToolTipText(cancelButtonToolTipText); closePanel.add(accept); closePanel.add(cancel); c.anchor = GridBagConstraints.WEST; c.weighty = 0; c.weightx = 0; c.gridx = 0; bottomPanel = new JPanel(); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(fileNameLabel, c); c.gridy = 1; bottomPanel.add(fileTypesLabel, c); c.gridx = 1; c.gridy = 0; c.weightx = 1; c.weighty = 1; bottomPanel.add(entry, c); c.gridy = 1; bottomPanel.add(filters, c); c.fill = GridBagConstraints.NONE; c.gridy = 2; c.anchor = GridBagConstraints.EAST; bottomPanel.add(closePanel, c); filechooser.setLayout(new BorderLayout()); filechooser.add(topPanel, BorderLayout.NORTH); filechooser.add(centrePanel, BorderLayout.CENTER); filechooser.add(bottomPanel, BorderLayout.SOUTH); } |
|
m.minor = Minor.UserException; | public static StructMember read(InputStream istream) { try { StructMember value = new StructMember(); value.name = istream.read_string(); value.type = TypeCodeHelper.read(istream); value.type_def = IDLTypeHelper.read(istream); return value; } catch (UserException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } |
|
m.minor = Minor.UserException; | public static void write(OutputStream ostream, StructMember value) { try { ostream.write_string(value.name); TypeCodeHelper.write(ostream, value.type); IDLTypeHelper.write(ostream, value.type_def); } catch (UserException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } |
|
char c = event.getActionCommand().charAt(0); if (Character.isISOControl(c)) return; | public void actionPerformed(ActionEvent event) { JTextComponent t = getTextComponent(event); if (t != null) { try { t.getDocument().insertString(t.getCaret().getDot(), event.getActionCommand(), null); t.getCaret().setDot(Math.min(t.getCaret().getDot() + 1, t.getDocument().getEndPosition().getOffset())); } catch (BadLocationException be) { // FIXME: we're not authorized to throw this.. swallow it? } } } |
|
JTextComponent t = getTextComponent(event); t.replaceSelection("\n"); | public void actionPerformed(ActionEvent event) { } |
|
"Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.nonSelectionBorder", new BorderUIResource.LineBorderUIResource(Color.white), | protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", new ColorUIResource(getControl()), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", new ColorUIResource(getControlDarkShadow()), "Button.disabledText", new ColorUIResource(getControlDisabled()), "Button.focus", new ColorUIResource(getFocusColor()), "Button.font", getControlTextFont(), "Button.foreground", new ColorUIResource(getSystemTextColor()), "Button.highlight", new ColorUIResource(getControlHighlight()), "Button.light", new ColorUIResource(getControlHighlight()), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", new ColorUIResource(getPrimaryControlShadow()), "Button.shadow", new ColorUIResource(getPrimaryControlShadow()), "CheckBox.background", new ColorUIResource(getControl()), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBoxMenuItem.background", new ColorUIResource(getControl()), "ToolBar.background", new ColorUIResource(getControl()), "Panel.background", new ColorUIResource(getControl()), "Slider.background", new ColorUIResource(getControl()), "OptionPane.background", new ColorUIResource(getControl()), "ProgressBar.background", new ColorUIResource(getControl()), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "TabbedPane.background", new ColorUIResource(getControl()), "Label.background", new ColorUIResource(getControl()), "Label.font", getControlTextFont(), "Label.disabledForeground", new ColorUIResource(getControlDisabled()), "Label.foreground", new ColorUIResource(getSystemTextColor()), "Menu.background", new ColorUIResource(getControl()), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.font", getControlTextFont(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", new ColorUIResource(getControl()), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuItem.background", new ColorUIResource(getControl()), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.font", getControlTextFont(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "Panel.background", new ColorUIResource(getControl()), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "ScrollBar.background", new ColorUIResource(getControl()), "ScrollBar.shadow", new ColorUIResource(getControlShadow()), "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), "ScrollBar.thumbDarkShadow", new ColorUIResource(getPrimaryControlDarkShadow()), "ScrollBar.thumbHighlight", new ColorUIResource(getPrimaryControl()), "SplitPane.darkShadow", new ColorUIResource(getControlDarkShadow()), "SplitPane.highlight", new ColorUIResource(getControlHighlight()), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "ToggleButton.background", new ColorUIResource(getControl()), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", new ColorUIResource(getControlDarkShadow()), "ToggleButton.disabledText", new ColorUIResource(getControlDisabled()), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", new ColorUIResource(getSystemTextColor()), "ToggleButton.highlight", new ColorUIResource(getControlHighlight()), "ToggleButton.light", new ColorUIResource(getControlHighlight()), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", new ColorUIResource(getPrimaryControlShadow()), "ToggleButton.shadow", new ColorUIResource(getPrimaryControlShadow()), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), "Tree.background", new ColorUIResource(Color.white), "Tree.foreground", new ColorUIResource(new Color(204, 204, 255)), "Tree.hash", new ColorUIResource(new Color(204, 204, 255)), "Tree.leftChildIndent", new Integer(7), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.nonSelectionBackground", new ColorUIResource(Color.white), "Tree.selectionBorderColor", new ColorUIResource(new Color(102, 102, 153)), "Tree.selectionForeground", new ColorUIResource(Color.black), "Tree.textBackground", new ColorUIResource(new Color(204, 204, 255)), "Tree.textForeground", new ColorUIResource(Color.black), "Tree.selectionForeground", new ColorUIResource(Color.black), "PopupMenu.border", new MetalBorders.PopupMenuBorder() }; defaults.putDefaults(myDefaults); } |
|
else { LeafElement el1 = (LeafElement) rootElement.getElement(i1); el1.end -= len; } for (int i = rootElement.getElementIndex(p0) + 1; i < rootElement.getElementCount(); i++) { LeafElement el = (LeafElement) rootElement.getElement(i); el.start -= len; el.end -= len; } | protected void removeUpdate(DefaultDocumentEvent event) { super.removeUpdate(event); int p0 = event.getOffset(); int len = event.getLength(); int p1 = len + p0; // check if we must collapse some elements int i1 = rootElement.getElementIndex(p0); int i2 = rootElement.getElementIndex(p1); if (i1 != i2) { Element el1 = rootElement.getElement(i1); Element el2 = rootElement.getElement(i2); int start = el1.getStartOffset(); int end = el2.getEndOffset(); // collapse elements if the removal spans more than 1 line Element newEl = createLeafElement(rootElement, SimpleAttributeSet.EMPTY, start, end - len); rootElement.replace(i1, i2 - i1, new Element[]{ newEl }); } else { // otherwise only adjust indices of the element LeafElement el1 = (LeafElement) rootElement.getElement(i1); el1.end -= len; } // reindex remaining elements for (int i = rootElement.getElementIndex(p0) + 1; i < rootElement.getElementCount(); i++) { LeafElement el = (LeafElement) rootElement.getElement(i); el.start -= len; el.end -= len; } } |
|
setVisible(false); | public CellRendererPane() { // Nothing to do here. } |
|
System.out.println(" boot options received " + bootEvent.getNewSessionOptions()); | log.info(" boot options received " + bootEvent.getNewSessionOptions()); | public void bootOptionsReceived(BootEvent bootEvent) { System.out.println(" boot options received " + bootEvent.getNewSessionOptions()); // If the options are not equal to the string 'null' then we have // boot options if (!bootEvent.getNewSessionOptions().equals("null")) { // check if a session parameter is specified on the command line String[] args = new String[NUM_PARMS]; parseArgs(bootEvent.getNewSessionOptions(), args); if (isSpecified("-s",args)) { String sd = getParm("-s",args); if (sessions.containsKey(sd)) { parseArgs(sessions.getProperty(sd), args); final String[] args2 = args; final String sd2 = sd; SwingUtilities.invokeLater( new Runnable () { public void run() { newSession(sd2,args2); } } ); } } else { if (args[0].startsWith("-")) { SwingUtilities.invokeLater( new Runnable () { public void run() { startNewSession(); } } ); } else { final String[] args2 = args; final String sd2 = args[0]; SwingUtilities.invokeLater( new Runnable () { public void run() { newSession(sd2,args2); } } ); } } } else { SwingUtilities.invokeLater( new Runnable () { public void run() { startNewSession(); } } ); } } |
System.out.println("Information Message: Can not find scripting support" | log.warn("Information Message: Can not find scripting support" | private void initScripting() { try { Class.forName("org.tn5250j.scripting.JPythonInterpreterDriver"); } catch (java.lang.NoClassDefFoundError ncdfe) { System.out.println("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ncdfe); } catch (Exception ex) { System.out.println("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ex); } splash.updateProgress(++step); } |
divider = createDefaultDivider(); | protected void installDefaults() { resetLayoutManager(); divider = createDefaultDivider(); nonContinuousLayoutDivider = createDefaultNonContinuousLayoutDivider(); splitPane.add(divider, JSplitPane.DIVIDER); // There is no need to add the nonContinuousLayoutDivider UIDefaults defaults = UIManager.getLookAndFeelDefaults(); splitPane.setBackground(defaults.getColor("SplitPane.background")); splitPane.setBorder(defaults.getBorder("SplitPane.border")); splitPane.setDividerSize(defaults.getInt("SplitPane.dividerSize")); } |
|
int divLoc = splitPane.getDividerLocation(); int valLoc = validLocation(divLoc); if (divLoc != valLoc) splitPane.setDividerLocation(valLoc); | public void paint(Graphics g, JComponent jc) { // Make sure that the location is valid int divLoc = splitPane.getDividerLocation(); int valLoc = validLocation(divLoc); if (divLoc != valLoc) splitPane.setDividerLocation(valLoc); } |
|
layoutManager.invalidateLayout(splitPane); | getSplitPane().setLayout(layoutManager); | protected void resetLayoutManager() { if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) layoutManager = new BasicHorizontalLayoutManager(); else layoutManager = new BasicVerticalLayoutManager(); layoutManager.invalidateLayout(splitPane); layoutManager.updateComponents(); getSplitPane().setLayout(layoutManager); // invalidating by itself does not invalidate the layout. getSplitPane().revalidate(); } |
getSplitPane().setLayout(layoutManager); | protected void resetLayoutManager() { if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) layoutManager = new BasicHorizontalLayoutManager(); else layoutManager = new BasicVerticalLayoutManager(); layoutManager.invalidateLayout(splitPane); layoutManager.updateComponents(); getSplitPane().setLayout(layoutManager); // invalidating by itself does not invalidate the layout. getSplitPane().revalidate(); } |
|
if (!debug) { return; } | protected final void printLabels(NativeStream os, VmType[] bootClasses, VmStatics statics) throws BuildException, UnresolvedObjectRefException { try { int unresolvedCount = 0; final PrintWriter w = new PrintWriter(new FileWriter(listFile)); // Print a list of boot classes. for (int i = 0; i < bootClasses.length; i++) { final VmType vmClass = bootClasses[i]; w.print("bootclass "); w.print(i); w.print(": "); w.print(vmClass.getName()); if (vmClass instanceof VmClassType) { final int cnt = ((VmClassType) vmClass).getInstanceCount(); if (cnt > 0) { w.print(", "); w.print(cnt); w.print(" instances"); if (vmClass instanceof VmNormalClass) { long objSize = ((VmNormalClass)vmClass).getObjectSize(); long totalSize = objSize * cnt; w.print(", "); w.print(objSize); w.print(" objsize "); w.print(totalSize); w.print(" totsize"); if (totalSize > 200000) { log(vmClass.getName() + " is large (" + totalSize + " , #" + cnt + ")", Project.MSG_WARN); } } } } if (vmClass.isArray()) { final long len = ((VmArrayClass) vmClass).getTotalLength(); if (len > 0) { w.print(", "); w.print(len); w.print(" total length "); w.print(len / ((VmArrayClass) vmClass).getInstanceCount()); w.print(" avg length "); w.print(((VmArrayClass)vmClass).getMaximumLength()); w.print(" max length "); } } int cnt = vmClass.getNoInterfaces(); if (cnt > 0) { w.print(", "); w.print(cnt); w.print(" interfaces"); } w.print(vmClass.isInitialized() ? "" : ", not initialized"); w.println(); } w.println(); // Print the statics table final int[] table = (int[]) statics.getTable(); for (int i = 0; i < table.length; i++) { w.print(NumberUtils.hex((VmArray.DATA_OFFSET + i) << 2)); w.print(":"); w.print(NumberUtils.hex(statics.getType(i), 2)); w.print("\t"); w.print(NumberUtils.hex(table[i])); w.println(); } // Look for unresolved labels and put all resolved // label into the sorted map. This will be used later // to print to the listing file. final Collection<? extends ObjectRef> xrefs = os.getObjectRefs(); final SortedMap<Integer, ObjectRef> map = new TreeMap<Integer, ObjectRef>(); for (ObjectRef ref : xrefs) { if (!ref.isResolved()) { StringBuffer buf = new StringBuffer(); buf.append(" $" + Integer.toHexString(ref.getOffset())); buf.append("\t" + ref.getObject()); System.err.println("Unresolved label " + buf.toString()); unresolvedCount++; } else { map.put(new Integer(ref.getOffset()), ref); } } if (unresolvedCount > 0) { throw new BuildException("There are " + unresolvedCount + " unresolved labels"); } // Print the // listing // file. for (ObjectRef ref : map.values()) { final Object object = ref.getObject(); w.print('$'); w.print(hex(ref.getOffset() + os.getBaseAddr())); w.print('\t'); w.print(object); w.print(" ("); if (object instanceof VmSystemObject) { final String info = ((VmSystemObject) object) .getExtraInfo(); if (info != null) { w.print(info); w.print(", "); } } w.print(object.getClass().getName()); w.println(')'); } w.close(); } catch (IOException ex) { throw new BuildException("Writing list", ex); } } |
|
public Data(char[] text, char[] color, char[] extended) { | public Data(char[] text, char[] attr, char[] color, char[] extended, char[] graphic) { | public Data(char[] text, char[] color, char[] extended) { this.text = text; this.color = color; this.extended = extended; this.graphic = null; this.field = null; } |
this.graphic = null; | this.graphic = graphic; this.attr = attr; | public Data(char[] text, char[] color, char[] extended) { this.text = text; this.color = color; this.extended = extended; this.graphic = null; this.field = null; } |
int attr = planes.getCharAttr(s.getPos(row,col)); | int attr = updateRect.attr[pos]; | public final void drawChar(Graphics2D g, int pos, int row, int col) { Screen5250 s = screen; ScreenPlanes planes = s.planes;// int attr = planes.getCharAttr(pos); int attr = planes.getCharAttr(s.getPos(row,col)); sChar[0] = updateRect.text[pos]; setDrawAttr(pos); boolean attributePlace = planes.isAttributePlace(s.getPos(row,col)); //attributePlace = true; int whichGui = updateRect.graphic[pos]; boolean useGui = whichGui == 0 ? false : true; csArea = modelToView(row, col, csArea); int x = csArea.x; int y = csArea.y; int cy = (int)(y + rowHeight - (s.lm.getDescent() + s.lm.getLeading()));// int x = sc.x;// int y = sc.y;// int cy = sc.cy; if (attributePlace && s.isShowHex()) {// if ((sc.sChar[0] == 0x20 || sc.sChar[0] == 0x0 || nonDisplay) && s.isShowHex()) { Font f = g.getFont(); Font k = f.deriveFont(f.getSize2D()/2); g.setFont(k); g.setColor(s.colorHexAttr); char[] a = Integer.toHexString(attr).toCharArray(); g.drawChars(a, 0, 1, x, y + (int)(rowHeight /2)); g.drawChars(a, 1, 1, x+(int)(columnWidth/2), (int)(y + rowHeight - (s.lm.getDescent() + s.lm.getLeading())-2)); g.setFont(f);//return; } if(!nonDisplay && !attributePlace) { if (!useGui) { g.setColor(bg); g.fill(csArea); } else { if (bg == s.colorBg && whichGui >= FIELD_LEFT && whichGui <= FIELD_ONE) g.setColor(s.colorGUIField); else g.setColor(bg); g.fill(csArea); } if (useGui && (whichGui < FIELD_LEFT)) { int w = 0; g.setColor(fg); switch (whichGui) { case UPPER_LEFT: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpperLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinUpperLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; case UPPER: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpper(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinUpper(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; case UPPER_RIGHT: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinUpperRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, s.colorBlue, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinUpperRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; case GUI_LEFT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); g.drawLine(x + columnWidth / 2, y, x + columnWidth / 2, y + rowHeight); } } break; case GUI_RIGHT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; case LOWER_LEFT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLowerLeft(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinLowerLeft(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; case BOTTOM: if (sChar[0] == '.') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinBottom(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinBottom(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; case LOWER_RIGHT: if (sChar[0] == ':') { if (s.isUsingGuiInterface()) { GUIGraphicsUtils.drawWinLowerRight(g, GUIGraphicsUtils.WINDOW_GRAPHIC, bg, x,y,columnWidth,rowHeight); } else { GUIGraphicsUtils.drawWinLowerRight(g, GUIGraphicsUtils.WINDOW_NORMAL, fg, x,y,columnWidth,rowHeight); } } break; } } else { if (sChar[0] != 0x0) { // use this until we define colors for gui stuff if ((useGui && whichGui < BUTTON_LEFT) && (fg == s.colorGUIField)) g.setColor(Color.black); else g.setColor(fg); try { if (useGui) if (sChar[0] == 0x1C) g.drawChars(dupChar, 0, 1, x+1, cy -2); else g.drawChars(sChar, 0, 1, x+1, cy -2); else if (sChar[0] == 0x1C) g.drawChars(dupChar, 0, 1, x, cy -2); else g.drawChars(sChar, 0, 1, x, cy -2); } catch (IllegalArgumentException iae) { System.out.println(" ScreenChar iae " + iae.getMessage()); } } if(underLine ) { if (!useGui || s.guiShowUnderline) { g.setColor(fg);// g.drawLine(x, cy -2, (int)(x + columnWidth), cy -2);// g.drawLine(x, (int)(y + (rowHeight - s.lm.getLeading()-5)), (int)(x + columnWidth), (int)(y + (rowHeight - s.lm.getLeading())-5)); g.drawLine(x, (int)(y + (rowHeight - (s.lm.getLeading() + s.lm.getDescent()))), (int)(x + columnWidth), (int)(y + (rowHeight -(s.lm.getLeading() + s.lm.getDescent())))); } } if(colSep) { g.setColor(s.colorSep); switch (s.getColSepLine()) { case 0: // line g.drawLine(x, y, x, y + rowHeight - 1); g.drawLine(x + columnWidth - 1, y, x + columnWidth - 1, y + rowHeight); break; case 1: // short line g.drawLine(x, y + rowHeight - (int)s.lm.getLeading()-4, x, y + rowHeight); g.drawLine(x + columnWidth - 1, y + rowHeight - (int)s.lm.getLeading()-4, x + columnWidth - 1, y + rowHeight); break; case 2: // dot g.drawLine(x, y + rowHeight - (int)s.lm.getLeading()-3, x, y + rowHeight - (int)s.lm.getLeading()-4); g.drawLine(x + columnWidth - 1, y + rowHeight - (int)s.lm.getLeading()-3, x + columnWidth - 1, y + rowHeight - (int)s.lm.getLeading()-4); break; case 3: // hide break; } } } } if (useGui & (whichGui >= FIELD_LEFT)) { int w = 0; switch (whichGui) { case FIELD_LEFT: GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.INSET, x,y, columnWidth,rowHeight); break; case FIELD_MIDDLE: GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.INSET, x,y, columnWidth,rowHeight); break; case FIELD_RIGHT: GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.INSET, x,y, columnWidth,rowHeight); break; case FIELD_ONE: GUIGraphicsUtils.draw3DOne(g, GUIGraphicsUtils.INSET, x,y, columnWidth,rowHeight); break; case BUTTON_LEFT: case BUTTON_LEFT_UP: case BUTTON_LEFT_DN: case BUTTON_LEFT_EB: GUIGraphicsUtils.draw3DLeft(g, GUIGraphicsUtils.RAISED, x,y, columnWidth,rowHeight); break; case BUTTON_MIDDLE: case BUTTON_MIDDLE_UP: case BUTTON_MIDDLE_DN: case BUTTON_MIDDLE_EB: GUIGraphicsUtils.draw3DMiddle(g, GUIGraphicsUtils.RAISED, x,y, columnWidth,rowHeight); break; case BUTTON_RIGHT: case BUTTON_RIGHT_UP: case BUTTON_RIGHT_DN: case BUTTON_RIGHT_EB: GUIGraphicsUtils.draw3DRight(g, GUIGraphicsUtils.RAISED, x,y, columnWidth,rowHeight); break; // scroll bar case BUTTON_SB_UP: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 1, x,y, columnWidth,rowHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_DN: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.RAISED, 2, x,y, columnWidth,rowHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_GUIDE: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 0,x,y, columnWidth,rowHeight, s.colorWhite,s.colorBg); break; // scroll bar case BUTTON_SB_THUMB: GUIGraphicsUtils.drawScrollBar(g, GUIGraphicsUtils.INSET, 3,x,y, columnWidth,rowHeight, s.colorWhite,s.colorBg); break; } } } |
int fmHeight = rowHeight; int fmWidth = columnWidth; | public void drawCursor() {// public void drawCursor(int row, int col) {// int fmWidth, int fmHeight,// boolean insertMode, int crossHair,// boolean rulerFixed,// int cursorSize, Color colorCursor,// Color colorBg,Color colorWhite,// Font font,int botOffset) { int row = screen.getRow(screen.getLastPos()); int col = screen.getCol(screen.getLastPos()); int fmHeight = rowHeight; int fmWidth = columnWidth; int botOffset = screen.cursorBottOffset; int cursorSize = screen.cursorSize; boolean insertMode = screen.insertMode; boolean rulerFixed = screen.rulerFixed; int crossHair = screen.crossHair; Graphics2D g2 = getDrawingArea(); switch (screen.cursorSize) { case 0: cursor.setRect( columnWidth * (col), (rowHeight * (row + 1)) - botOffset, columnWidth, 1 ); break; case 1: cursor.setRect( columnWidth * (col), (rowHeight * (row + 1) - rowHeight / 2), columnWidth, (rowHeight / 2) - botOffset ); break; case 2: cursor.setRect( columnWidth * (col), (rowHeight * row), columnWidth, rowHeight - botOffset ); break; } if (insertMode && cursorSize != 1) { cursor.setRect( columnWidth * (col), (rowHeight * (row + 1) - rowHeight / 2), columnWidth, (rowHeight / 2) - botOffset ); } Rectangle r = cursor.getBounds(); r.setSize(r.width,r.height); g2.setColor(screen.colorCursor); g2.setXORMode(screen.colorBg); g2.fill(cursor); screen.updateImage(r); if (!rulerFixed) { crossRow = row; crossCol = col; crossRect.setBounds(r); } else { if (crossHair == 0) { crossRow = row; crossCol = col; crossRect.setBounds(r); } } switch (crossHair) { case 1: // horizontal g2.drawLine(0,(rowHeight * (crossRow + 1))- botOffset, bi.getWidth(null), (rowHeight * (crossRow + 1))- botOffset); screen.updateImage(0,rowHeight * (crossRow + 1)- botOffset, bi.getWidth(null),1); break; case 2: // vertical g2.drawLine(crossRect.x,0,crossRect.x,bi.getHeight(null) - rowHeight - rowHeight); screen.updateImage(crossRect.x,0,1,bi.getHeight(null) - rowHeight - rowHeight); break; case 3: // horizontal & vertical g2.drawLine(0,(rowHeight * (crossRow + 1))- botOffset, bi.getWidth(null), (rowHeight * (crossRow + 1))- botOffset); g2.drawLine(crossRect.x,0,crossRect.x,bi.getHeight(null) - rowHeight - rowHeight); screen.updateImage(0,rowHeight * (crossRow + 1)- botOffset, bi.getWidth(null),1); screen.updateImage(crossRect.x,0,1,bi.getHeight(null) - rowHeight - rowHeight); break; } g2.dispose(); g2 = getWritingArea(screen.font); g2.setPaint(screen.colorBg); g2.fill(pArea); g2.setColor(screen.colorWhite); g2.drawString((row + 1) + "/" + (col + 1) ,(float)pArea.getX(), (float)pArea.getY() + rowHeight); screen.updateImage(pArea.getBounds()); g2.dispose(); } |
|
if (dir == null) | if (dir == null || dir.listFiles() == null) | public File[] getFiles(File dir, boolean useFileHiding) { if (dir == null) return null; File[] files = dir.listFiles(); if (! useFileHiding) return files; ArrayList trim = new ArrayList(); for (int i = 0; i < files.length; i++) if (! files[i].isHidden()) trim.add(files[i]); File[] value = (File[]) trim.toArray(new File[0]); return value; } |
if (dtl != null) throw new TooManyListenersException (); | public void addDropTargetListener (DropTargetListener dtl) throws TooManyListenersException { if (dtl != null) throw new TooManyListenersException (); dropTargetListener = dtl; } |
|
g.draw(new Arc2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1), 40, 300, Arc2D.PIE), tx, randomColor(), paintMode); | g.draw(new Arc2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1), 40, 300, Arc2D.PIE), null, tx, randomColor(), paintMode); | public void perform() { final int x1 = randomX(); final int y1 = randomY(); final int x2 = randomX(); final int y2 = randomY(); g.draw(new Arc2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1), 40, 300, Arc2D.PIE), tx, randomColor(), paintMode); } |
g.draw(new Ellipse2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), tx, randomColor(), paintMode); | g.draw(new Ellipse2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), null, tx, randomColor(), paintMode); | public void perform() { final int x1 = randomX(); final int y1 = randomY(); final int x2 = randomX(); final int y2 = randomY(); g.draw(new Ellipse2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), tx, randomColor(), paintMode); } |
g.draw(new Line2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), tx, randomColor(), paintMode); | g.draw(new Line2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), null, tx, randomColor(), paintMode); | public void perform() { final int x1 = randomX(); final int y1 = randomY(); final int x2 = randomX(); final int y2 = randomY(); g.draw(new Line2D.Double(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), tx, randomColor(), paintMode); } |
g.draw(new QuadCurve2D.Double(x1, y1, cx, cy, x2, y2), tx, randomColor(), paintMode); | g.draw(new QuadCurve2D.Double(x1, y1, cx, cy, x2, y2), null, tx, randomColor(), paintMode); | public void perform() { final int x1 = randomX(); final int y1 = randomY(); final int x2 = randomX(); final int y2 = randomY(); final int cx = randomX(); final int cy = randomY(); g.draw(new QuadCurve2D.Double(x1, y1, cx, cy, x2, y2), tx, randomColor(), paintMode); } |
g.draw(new Rectangle(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), tx, randomColor(), paintMode); | g.draw(new Rectangle(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), null, tx, randomColor(), paintMode); | public void perform() { final int x1 = randomX(); final int y1 = randomY(); final int x2 = randomX(); final int y2 = randomY(); g.draw(new Rectangle(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x2-x1), Math.abs(y2-y1)), tx, randomColor(), paintMode); } |
this(SwingUtilities.getOwnerFrame(), "", false, null); | this((Frame) SwingUtilities.getOwnerFrame(null), "", false, null); | public JDialog() { this(SwingUtilities.getOwnerFrame(), "", false, null); } |
frameSize.height = (Integer.parseInt(My5250.sessions.getProperty("emul.height"))-100); | Rectangle sb = OperatingSystem.getScreenBounds(); frameSize.height = (sb.height - 100); | private void jbInit() throws Exception { try { setIconImage(GUIGraphicsUtils.getApplicationIcon().getImage()); // set title setTitle(LangTool.getString("xtfr.wizardTitle")); // Load the JDBC driver. Driver driver2 = (Driver)Class.forName("com.ibm.as400.access.AS400JDBCDriver").newInstance(); DriverManager.registerDriver(driver2); // Get a connection to the database. Since we do not // provide a user id or password, a prompt will appear. connection = new SQLConnection("jdbc:as400://" + host, name, password); // Create an SQLQueryBuilderPane // object. Assume that "connection" // is an SQLConnection object that is // created and initialized elsewhere. queryBuilder = new SQLQueryBuilderPane(connection); queryBuilder.setTableSchemas(new String[] {"*USRLIBL"}); // Load the data needed for the query // builder. queryBuilder.load(); JButton done = new JButton(LangTool.getString("xtfr.tableDone")); done.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { fillQueryTextArea(); } }); JPanel panel = new JPanel(); panel.add(done); getContentPane().add(queryBuilder, BorderLayout.CENTER); getContentPane().add(panel, BorderLayout.SOUTH); Dimension max = new Dimension(OperatingSystem.getScreenBounds().width, OperatingSystem.getScreenBounds().height); pack(); if (getSize().width > max.width) setSize(max.width,getSize().height); if (getSize().height > max.height) setSize(getSize().width,max.height); //Center the window Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); frameSize.height = (Integer.parseInt(My5250.sessions.getProperty("emul.height"))-100); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setSize(frameSize.width, frameSize.height); setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 3); setVisible(true); } catch (ClassNotFoundException cnfe) { JOptionPane.showMessageDialog(null,"Error loading AS400 JDBC Driver", "Error", JOptionPane.ERROR_MESSAGE); } } |
public static int vmMain() { | public static int vmMain() throws PragmaUninterruptible { | public static int vmMain() { //return 15; try { Unsafe.debug("Starting JNode\n"); final long start = VmSystem.currentKernelMillis(); //Unsafe.debug("VmSystem.initialize\n"); VmSystem.initialize(); //Unsafe.debug("Starting PluginManager"); final PluginManager piMgr = new DefaultPluginManager(pluginRegistry); piMgr.startPlugins(); final long end = VmSystem.currentKernelMillis(); System.out.println("JNode initialization finished in " + (end - start) + "ms."); Class shellClass = Class.forName("org.jnode.shell.CommandShell"); Runnable shell = (Runnable) shellClass.newInstance(); shell.run(); } catch (Throwable ex) { BootLog.error("Error in bootstrap", ex); return -2; } Unsafe.debug("System has finished"); return 0; } |
if (e.isControlDown() && table. isCellSelected(table.rowAtPoint(begin),table.columnAtPoint(begin))) { table.getSelectionModel(). removeSelectionInterval(table.rowAtPoint(begin), table.rowAtPoint(begin)); table.getColumnModel().getSelectionModel(). removeSelectionInterval(table.columnAtPoint(begin), table.columnAtPoint(begin)); } else | public void mousePressed(MouseEvent e) { begin = new Point(e.getX(), e.getY()); curr = new Point(e.getX(), e.getY()); updateSelection(e.isControlDown()); } |
|
highlightCellBorder = defaults.getBorder("Table.focusCellHighlightBorder"); cellBorder = BorderFactory.createEmptyBorder(1, 1, 1, 1); | protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); table.setFont(defaults.getFont("Table.font")); table.setGridColor(defaults.getColor("Table.gridColor")); table.setForeground(defaults.getColor("Table.foreground")); table.setBackground(defaults.getColor("Table.background")); table.setSelectionForeground(defaults.getColor("Table.selectionForeground")); table.setSelectionBackground(defaults.getColor("Table.selectionBackground")); table.setOpaque(true); } |
|
if (comp instanceof JComponent) { if (table.isCellSelected(r, c)) ((JComponent) comp).setBorder(highlightCellBorder); else ((JComponent) comp).setBorder(cellBorder); } | public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 = 0, y0 = 0; int x = x0; int y = y0; Dimension gap = table.getIntercellSpacing(); int ymax = clip.y + clip.height; int xmax = clip.x + clip.width; // paint the cell contents for (int c = 0; c < ncols && x < xmax; ++c) { y = y0; TableColumn col = cols.getColumn(c); int width = col.getWidth(); int modelCol = col.getModelIndex(); for (int r = 0; r < nrows && y < ymax; ++r) { Rectangle bounds = new Rectangle(x, y, width, height); if (bounds.intersects(clip)) { TableCellRenderer rend = table.getCellRenderer(r, c); Component comp = table.prepareRenderer(rend, r, c); gfx.translate(x, y); comp.setBounds(new Rectangle(0, 0, width, height)); comp.paint(gfx); gfx.translate(-x, -y); } y += height; if (gap != null) y += gap.height; } x += width; if (gap != null) x += gap.width; } // tighten up the x and y max bounds ymax = y; xmax = x; Color grid = table.getGridColor(); // paint vertical grid lines if (grid != null && table.getShowVerticalLines()) { x = x0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int c = 0; c < ncols && x < xmax; ++c) { x += cols.getColumn(c).getWidth();; if (gap != null) x += gap.width; gfx.drawLine(x, y0, x, ymax); paintedLine = true; } gfx.setColor(save); } // paint horizontal grid lines if (grid != null && table.getShowHorizontalLines()) { y = y0; Color save = gfx.getColor(); gfx.setColor(grid); boolean paintedLine = false; for (int r = 0; r < nrows && y < ymax; ++r) { y += height; if (gap != null) y += gap.height; gfx.drawLine(x0, y, xmax, y); paintedLine = true; } gfx.setColor(save); } } |
|
vstack.push(ifac.createLocal(JvmType.REFERENCE, stackFrame .getEbpOffset(typeSizeInfo, index))); | wload(JvmType.REFERENCE, index, false); | public final void visit_aload(int index) { vstack.push(ifac.createLocal(JvmType.REFERENCE, stackFrame .getEbpOffset(typeSizeInfo, index))); } |
vstack.push(ifac.createLocal(JvmType.FLOAT, stackFrame .getEbpOffset(typeSizeInfo, index))); | wload(JvmType.FLOAT, index, false); | public final void visit_fload(int index) { vstack.push(ifac.createLocal(JvmType.FLOAT, stackFrame .getEbpOffset(typeSizeInfo, index))); } |
vstack.push(ifac.createLocal(JvmType.INT, stackFrame .getEbpOffset(typeSizeInfo, index))); | wload(JvmType.INT, index, false); | public final void visit_iload(int index) { vstack.push(ifac.createLocal(JvmType.INT, stackFrame .getEbpOffset(typeSizeInfo, index))); } |
assertCondition(eContext.getGPRPool().isFree(X86Register.EAX), "EAX not free"); assertCondition(eContext.getGPRPool().isFree(X86Register.EBX), "EBX not free"); assertCondition(eContext.getGPRPool().isFree(X86Register.ECX), "ECX not free"); assertCondition(eContext.getGPRPool().isFree(X86Register.EDX), "EDX not free"); assertCondition(eContext.getGPRPool().isFree(X86Register.ESI), "ESI not free"); | public final void visit_lmul() { // Maintain counter counters.getCounter("lmul").inc(); if (os.isCode32()) { final Label curInstrLabel = getCurInstrLabel(); // TODO: port to orp-style vstack.push(eContext); final LongItem v2 = vstack.popLong(); final LongItem v1 = vstack.popLong(); v2.release1(eContext); v1.release1(eContext); writePOP64(X86Register.EBX, X86Register.ECX); // Value 2 final GPR v2_lsb = X86Register.EBX; final GPR v2_msb = X86Register.ECX; writePOP64(X86Register.ESI, X86Register.EDI); // Value 1 final GPR v1_lsb = X86Register.ESI; final GPR v1_msb = X86Register.EDI; final Label tmp1 = new Label(curInstrLabel + "$tmp1"); final Label tmp2 = new Label(curInstrLabel + "$tmp2"); final GPR EAX = X86Register.EAX; final GPR EDX = X86Register.EDX; os.writeMOV(INTSIZE, EAX, v1_msb); // hi2 os.writeOR(EAX, v2_msb); // hi1 | hi2 os.writeJCC(tmp1, X86Constants.JNZ); os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_lsb); // lo1*lo2 os.writeJMP(tmp2); os.setObjectRef(tmp1); os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_msb); // hi1*lo2 os.writeMOV(INTSIZE, v2_msb, EAX); os.writeMOV(INTSIZE, EAX, v1_msb); // hi2 os.writeMUL_EAX(v2_lsb); // hi2*lo1 os.writeADD(v2_msb, EAX); // hi2*lo1 + hi1*lo2 os.writeMOV(INTSIZE, EAX, v1_lsb); // lo2 os.writeMUL_EAX(v2_lsb); // lo1*lo2 os.writeADD(EDX, v2_msb); // hi2*lo1 + hi1*lo2 + // hi(lo1*lo2) os.setObjectRef(tmp2); // Reload the statics table, since it was destroyed here helper.writeLoadSTATICS(curInstrLabel, "lmul", false); // Push final LongItem result = (LongItem) L1AHelper .requestDoubleWordRegisters(eContext, JvmType.LONG, EAX, EDX); vstack.push(result); } else { final LongItem v2 = vstack.popLong(); final LongItem v1 = vstack.popLong(); v2.load(eContext); v1.load(eContext); os.writeIMUL(v1.getRegister(eContext), v2.getRegister(eContext)); v2.release(eContext); vstack.push(v1); } } |
|
final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); | final GPR ECX = X86Register.ECX; final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong(); | public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); } |
L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); | if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); } val.load(eContext); | public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); } |
final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); | final GPR v1_lsb = val.getLsbRegister(eContext); final GPR v1_msb = val.getMsbRegister(eContext); | public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); } |
os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); | os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); | public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); } |
final GPR64 v1r = v1.getRegister(eContext); | final GPR64 v1r = val.getRegister(eContext); | public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); } |
v2.release(eContext); vstack.push(v1); | cnt.release(eContext); vstack.push(val); | public final void visit_lshl() { final IntItem v2 = vstack.popInt(); final LongItem v1 = vstack.popLong(); L1AHelper.requestRegister(eContext, X86Register.ECX, v2); v2.loadTo(eContext, X86Register.ECX); v1.load(eContext); if (os.isCode32()) { final GPR v1_lsb = v1.getLsbRegister(eContext); final GPR v1_msb = v1.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHLD_CL(v1_msb, v1_lsb); os.writeSHL_CL(v1_lsb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, v1_msb, v1_lsb); os.writeXOR(v1_lsb, v1_lsb); os.writeSHL_CL(v1_msb); os.setObjectRef(endLabel); } else { final GPR64 v1r = v1.getRegister(eContext); os.writeSHL_CL(v1r); } // Release v2.release(eContext); vstack.push(v1); } |
if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); | if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); | public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSAR_CL(valr); } vstack.push(val); // Release cnt.release(eContext); } |
os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); | os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); | public final void visit_lshr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSAR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeSAR(msb, 31); os.writeSAR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSAR_CL(valr); } vstack.push(val); // Release cnt.release(eContext); } |
if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); | if (!cnt.uses(ECX)) { val.spillIfUsing(eContext, ECX); L1AHelper.requestRegister(eContext, ECX, cnt); cnt.loadTo(eContext, ECX); | public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSHR_CL(valr); } // Push vstack.push(val); // Release cnt.release(eContext); } |
os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); | os.writeAND(ECX, 63); os.writeCMP_Const(ECX, 32); | public final void visit_lushr() { final IntItem cnt = vstack.popInt(); final LongItem val = vstack.popLong();// final X86RegisterPool pool = eContext.getGPRPool(); // Get cnt into ECX if (!cnt.uses(X86Register.ECX)) { val.spillIfUsing(eContext, X86Register.ECX); L1AHelper.requestRegister(eContext, X86Register.ECX, cnt); cnt.loadTo(eContext, X86Register.ECX); } // Load val val.load(eContext); if (os.isCode32()) { final X86Register.GPR lsb = val.getLsbRegister(eContext); final X86Register.GPR msb = val.getMsbRegister(eContext); final Label curInstrLabel = getCurInstrLabel(); // Calculate os.writeAND(X86Register.ECX, 63); os.writeCMP_Const(X86Register.ECX, 32); final Label gt32Label = new Label(curInstrLabel + "gt32"); final Label endLabel = new Label(curInstrLabel + "end"); os.writeJCC(gt32Label, X86Constants.JAE); // JAE /** ECX < 32 */ os.writeSHRD_CL(lsb, msb); os.writeSHR_CL(msb); os.writeJMP(endLabel); /** ECX >= 32 */ os.setObjectRef(gt32Label); os.writeMOV(INTSIZE, lsb, msb); os.writeXOR(msb, msb); os.writeSHR_CL(lsb); os.setObjectRef(endLabel); } else { final GPR64 valr = val.getRegister(eContext); os.writeSHR_CL(valr); } // Push vstack.push(val); // Release cnt.release(eContext); } |
wstoreOffset = os.getLength(); | private final void wstore(int jvmType, int index) { final int disp = stackFrame.getEbpOffset(typeSizeInfo, index); // Pin down (load) other references to this local vstack.loadLocal(eContext, disp); // Load final WordItem val = (WordItem) vstack.pop(jvmType); final boolean vconst = val.isConstant(); if (vconst && (jvmType == JvmType.INT)) { // Store constant int final int ival = ((IntItem) val).getValue(); os.writeMOV_Const(BITS32, helper.BP, disp, ival); } else if (vconst && (jvmType == JvmType.FLOAT)) { // Store constant float final int ival = Float.floatToRawIntBits(((FloatItem) val) .getValue()); os.writeMOV_Const(BITS32, helper.BP, disp, ival); } else if (val.isFPUStack()) { // Ensure item is on top of fpu stack FPUHelper.fxch(os, vstack.fpuStack, val); if (jvmType == JvmType.FLOAT) { os.writeFSTP32(helper.BP, disp); } else { os.writeFISTP32(helper.BP, disp); } vstack.fpuStack.pop(val); } else if (val.isStack()) { // Must be top of stack if (VirtualStack.checkOperandStack) { vstack.operandStack.pop(val); } os.writePOP(helper.BP, disp); } else { // Load into register val.load(eContext); final GPR valr = val.getRegister(); // Store os.writeMOV(valr.getSize(), helper.BP, disp, valr); } // Release val.release(eContext); } |
|
switch (col) { case 0: case 3: case 6: action = new AbstractAction(LangTool.getString("spool.labelFilter")) { public void actionPerformed(ActionEvent e) { setFilter(row,col); } }; jpm.add(action); jpm.addSeparator(); break; } | private void showPopupMenu(MouseEvent me) { JPopupMenu jpm = new JPopupMenu(); JMenuItem menuItem; Action action; final int row = spools.rowAtPoint(me.getPoint()); action = new AbstractAction(LangTool.getString("spool.optionView")) { public void actionPerformed(ActionEvent e) { System.out.println(row + " is selected "); spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater( new Runnable () { public void run() { displayViewer(getSpooledFile(row)); } } ); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionProps")) { public void actionPerformed(ActionEvent e) {// spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));// SwingUtilities.invokeLater(// new Runnable () {// public void run() {//// displayViewer(getSpooledFile(row));// }// }// ); JOptionPane.showMessageDialog(null,"Not Available yet","Not yet", JOptionPane.WARNING_MESSAGE); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionExport")) { public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionHold")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionRelease")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionDelete")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); GUIGraphicsUtils.positionPopup(spools,jpm,me.getX(),me.getY()); } |
|
doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } | setFilter(row,col); } | public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } |
status.setText(stat); } | displayViewer(getSpooledFile(row)); } | public void run() { status.setText(stat); } |
mouseListener = new MouseInputHandler(); | public BasicMenuBarUI() { changeListener = createChangeListener(); containerListener = createContainerListener(); propertyChangeListener = new PropertyChangeHandler(); } |
|
menuBar.addMouseListener(mouseListener); | protected void installListeners() { menuBar.addContainerListener(containerListener); menuBar.addPropertyChangeListener(propertyChangeListener); } |
|
menuBar.removeMouseListener(mouseListener); | protected void uninstallListeners() { menuBar.removeContainerListener(containerListener); menuBar.removePropertyChangeListener(propertyChangeListener); } |
|
private static void incorrect_plug_in(Throwable ex) | static void incorrect_plug_in(Throwable ex) | private static void incorrect_plug_in(Throwable ex) throws NO_IMPLEMENT { NO_IMPLEMENT no = new NO_IMPLEMENT("Incorrect CORBA plug-in"); no.initCause(ex); throw no; } |
read_instance(input, ox, value_tag); | read_instance(input, ox, value_tag, null); | public static Serializable read(InputStream input) { // Explicitly prevent the stream from closing as we may need // to read the subsequent bytes as well. Stream may be auto-closed // in its finalizer. try { // We may need to jump back if the value is read via value factory. input.mark(512); int value_tag = input.read_long(); checkTag(value_tag); String codebase = null; String[] ids = null; String id = null; // The existing implementing object. java.lang.Object ox = null; // Check for the agreed null value. if (value_tag == vt_NULL) return null; else if (value_tag == vt_INDIRECTION) // TODO FIXME Implement support for indirections. throw new NO_IMPLEMENT("Indirections unsupported"); else { // Read the value. if ((value_tag & vf_CODEBASE) != 0) { // The codebase is present. The codebase is a space // separated list of URLs from where the implementing // code can be downloaded. codebase = input.read_string(); } if ((value_tag & vf_MULTIPLE_IDS) != 0) { // Multiple supported repository ids are present. ids = StringSeqHelper.read(input); for (int i = 0; (i < ids.length) && (ox == null); i++) { ox = ObjectCreator.Idl2Object(ids [ i ]); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(ids [ i ]); if (f != null) { // Reset, as the value factory reads from beginning. input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } else if ((value_tag & vf_ID) != 0) { // Single supported repository id is present. id = input.read_string(); ox = ObjectCreator.Idl2Object(id); if (ox == null) { // Try to find the value factory. ValueFactory f = ((org.omg.CORBA_2_3.ORB) input.orb()).lookup_value_factory(id); if (f != null) { input.reset(); return f.read_value((org.omg.CORBA_2_3.portable.InputStream) input); } } } } if (ox == null) throw new MARSHAL("Unable to instantiate the value type"); else { read_instance(input, ox, value_tag); return (Serializable) ox; } } catch (Exception ex) { throw new MARSHAL(ex + ":" + ex.getMessage()); } } |
public static void read_instance(InputStream input, Object value, int value_tag | private static Object read_instance(InputStream input, Object value, int value_tag, Object helper | public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } } |
if (chunk_size <= 0) | if (chunk_size < 0) | public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } } |
input = new cdrBufInput(bout.toByteArray()); | input = new noHeaderInput(bout.toByteArray()); | public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } } |
input = new cdrBufInput(r); | input = new noHeaderInput(r); } } else { if (input instanceof cdrBufInput) { input = new noHeaderInput(((cdrBufInput) input).buffer.getBuffer()); } else { cdrBufOutput bout = new cdrBufOutput(); int c; while ((c = input.read()) >= 0) bout.write((byte) c); input = new noHeaderInput(bout.buffer.toByteArray()); | public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } } |
return value; | public static void read_instance(InputStream input, Object value, int value_tag ) { try { if ((value_tag & vf_CHUNKING) != 0) { ByteArrayOutputStream bout = null; int n = -1; // Read all chunks. int chunk_size = input.read_long(); if (chunk_size <= 0) throw new MARSHAL("Invalid first chunk size " + chunk_size); byte[] r = new byte[ chunk_size ]; while (chunk_size > 0) { if (r.length < chunk_size) r = new byte[ chunk_size + 256 ]; n = 0; reading: while (n < chunk_size) n += input.read(r, n, r.length - n); // Read the size of the next chunk. chunk_size = input.read_long(); // If the value is non negative, there is more than one chunk. // Accumulate chunks in the buffer. // The last chunk (or the only chunk, if only one chunk is // present) is not written in the buffer. It is stored in the // array r, avoiding unnecessary buffer operations. if (chunk_size > 0) { bout = new ByteArrayOutputStream(2 * chunk_size); bout.write(r, 0, chunk_size); } } if (bout != null) { // More than one chunk was present. // Add the last chunk. bout.write(r, 0, n); input = new cdrBufInput(bout.toByteArray()); } else { // Only one chunk was present. input = new cdrBufInput(r); } } } catch (IOException ex) { MARSHAL m = new MARSHAL("Unable to read chunks"); m.initCause(ex); throw m; } // The user-defines io operations are implemented. if (value instanceof CustomMarshal) { CustomMarshal marsh = (CustomMarshal) value; try { marsh.unmarshal((DataInputStream) input); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else // The IDL-generated io operations are implemented. if (value instanceof Streamable) { ((Streamable) value)._read(input); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); // The negative end of state marker is expected from OMG standard. // If the chunking is used, this marker is already extracted. if ((value_tag & vf_CHUNKING) == 0) { int eor = input.read_long(); if (eor >= 0) throw new MARSHAL("End of state marker has an invalid value " + eor); } } |
|
String id | String id, Object helper | private static void write_instance(OutputStream output, Serializable value, String id ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); } |
" must implement either StreamableValue or CustomValue." | " must implement either StreamableValue" + " or CustomValue." | private static void write_instance(OutputStream output, Serializable value, String id ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); } |
} | private static void write_instance(OutputStream output, Serializable value, String id ) { // This implementation always writes a single repository id. // It never writes multiple repository ids and currently does not use // a codebase. int value_tag = vt_VALUE_TAG | vf_ID; OutputStream outObj; cdrBufOutput out = null; if (USE_CHUNKING) { out = new cdrBufOutput(); out.setOrb(output.orb()); outObj = out; value_tag |= vf_CHUNKING; } else outObj = output; output.write_long(value_tag); output.write_string(id); // User defince write method is present. if (value instanceof CustomMarshal) { try { ((CustomMarshal) value).marshal((DataOutputStream) outObj); } catch (ClassCastException ex) { incorrect_plug_in(ex); } } else if (value instanceof Streamable) { ((Streamable) value)._write(outObj); } else // Stating the interfaces that the USER should use. throw new MARSHAL("The " + value.getClass().getName() + " must implement either StreamableValue or CustomValue." ); if (USE_CHUNKING) { output.write_long(out.buffer.size()); try { out.buffer.writeTo(output); } catch (IOException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } } // The end of record marker, required by OMG standard. output.write_long(-1); } |
|
if ( (attrib=getEndian()) !=null) | attrib = (String) ((Attribute) attribHash.get(ENDIAN_XML_ATTRIBUTE_NAME)).getAttribValue(); if ( attrib != null) | protected String basicXMLWriter ( Writer outputWriter, String indent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) throws java.io.IOException { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String myIndent; if (indent!=null) myIndent = indent; else myIndent = ""; String moreIndent = myIndent + Specification.getInstance().getPrettyXDFOutputIndentation(); if (niceOutput) outputWriter.write( myIndent); //open the read block outputWriter.write( "<"+READ_NODE_NAME); //write out attributes of read, ie. synchronized(attribHash) { //sync, prevent the attribHash' structure be changed String attrib; if ( (attrib=getEncoding()) !=null) { outputWriter.write( " "+ENCODING_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getEndian()) !=null) { outputWriter.write( " "+ENDIAN_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getReadId()) !=null) { outputWriter.write( " "+ID_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } if ( (attrib=getReadIdRef()) !=null) { outputWriter.write( " "+IDREF_XML_ATTRIBUTE_NAME+"=\""); outputWriter.write( attrib); outputWriter.write( "\""); } } outputWriter.write( ">"); //specific tailoring for childObj: Tagged, Delimited, Formated specificIOStyleToXDF(outputWriter, moreIndent); //close the read block if (niceOutput) { // outputWriter.write( Constants.NEW_LINE); outputWriter.write( indent); } outputWriter.write( "</"+READ_NODE_NAME+">");// if (niceOutput) { outputWriter.write(Constants.NEW_LINE); } return READ_NODE_NAME; } |
return addInternal(attribute, interfaceName); | return addInternal(attribute, myInterface); | public boolean add(Attribute attribute) { return addInternal(attribute, interfaceName); } |
return addAllInternal(attributes, interfaceName); | return addAllInternal(attributes, myInterface); | public boolean addAll(AttributeSet attributes) { return addAllInternal(attributes, interfaceName); } |
this.interfaceName); | myInterface); | private boolean addInternal(Attribute attribute, Class interfaceName) { if (attribute == null) throw new NullPointerException("attribute may not be null"); AttributeSetUtilities.verifyAttributeCategory(interfaceName, this.interfaceName); Object old = attributeMap.put (attribute.getCategory(), AttributeSetUtilities.verifyAttributeValue (attribute, interfaceName)); return !attribute.equals(old); } |
interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); | interfacePanel = new JPanel(new GridBagLayout()); | private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); } |
TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); | TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); tb.setTitleJustification(TitledBorder.CENTER); | private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); } |
interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); | gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(10, 10, 5, 10); interfacePanel.add(intTABS, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 27, 5, 10); interfacePanel.add(hideTabBar, gbc); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 10, 10); interfacePanel.add(intMDI, gbc); | private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); } |
JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); | JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder( LangTool.getString("ss.title")); smb.setTitleJustification(TitledBorder.CENTER); | private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); } |
contentPane.add(interfacePanel); contentPane.add(showMePanel); } | contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); contentPane.add(interfacePanel); contentPane.add(Box.createVerticalStrut(10)); contentPane.add(showMePanel); } | private void createEmulatorOptionsPanel() { // create emulator options panel emulOptPanel.setLayout(new BorderLayout()); JPanel contentPane = new JPanel(); contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.Y_AXIS)); emulOptPanel.add(contentPane,BorderLayout.NORTH); // setup the frame interface panel interfacePanel = new JPanel(); interfacePanel.setLayout(new AlignLayout(2,5,5)); TitledBorder tb = BorderFactory.createTitledBorder( LangTool.getString("conf.labelPresentation")); interfacePanel.setBorder(tb); ButtonGroup intGroup = new ButtonGroup(); // create the checkbox for hiding the tab bar when only one tab exists hideTabBar = new JCheckBox(LangTool.getString("conf.labelHideTabBar")); hideTabBar.setSelected(false); if (props.containsKey("emul.hideTabBar")) { if (props.getProperty("emul.hideTabBar").equals("yes")) hideTabBar.setSelected(true); } hideTabBar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { hideTabBar_itemStateChanged(e); } }); intTABS = new JRadioButton(LangTool.getString("conf.labelTABS")); intTABS.setSelected(true); intTABS.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { intTABS_itemStateChanged(e); } }); intMDI = new JRadioButton(LangTool.getString("conf.labelMDI")); // add the interface options to the group control intGroup.add(intTABS); intGroup.add(intMDI); if (props.containsKey("emul.interface")) { if (props.getProperty("emul.interface").equalsIgnoreCase("MDI")) intMDI.setSelected(true); } interfacePanel.add(intTABS); interfacePanel.add(hideTabBar); interfacePanel.add(intMDI); interfacePanel.add(new JLabel()); // create show me panel JPanel showMePanel = new JPanel(); TitledBorder smb = BorderFactory.createTitledBorder(""); showMePanel.setBorder(smb); showMe = new JCheckBox(LangTool.getString("ss.labelShowMe")); if(props.containsKey("emul.showConnectDialog")) showMe.setSelected(true); showMe.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { showMe_itemStateChanged(e); } }); showMePanel.add(showMe); contentPane.add(interfacePanel); contentPane.add(showMePanel); } |
ctm = new ConfigureTableModel(); | sessions = new JSortTable(ctm); | private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); 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); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //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); } |
sessions = new JSortTable(ctm); | Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; | private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); 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); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //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); } |
Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; | KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false); sessions.getInputMap().put(enter, "connect"); sessions.getActionMap().put("connect", connect); | private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); 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); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //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); } |
KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); | sessions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); sessions.setPreferredScrollableViewportSize(new Dimension(500, 200)); sessions.setShowGrid(false); | private void createSessionsPanel() { // get an instance of our table model ctm = new ConfigureTableModel(); // create a table using our custom table model sessions = new JSortTable(ctm); // Add enter as default key for connect with this session Action connect = new AbstractAction("connect") { public void actionPerformed(ActionEvent e) { doActionConnect(); } }; KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0,false); sessions.getInputMap().put(enter,"connect"); sessions.getActionMap().put("connect",connect ); 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); // This will make the connect dialog react to two clicks instead of having // to click on the selection and then clicking twice sessions.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { doActionConnect(); } } }); //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); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.