bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public abstract boolean printDialog();
|
public abstract boolean printDialog() throws HeadlessException;
| 8,130
|
public RequestSenseData requestSense() throws SCSIException, TimeoutException, InterruptedException { final byte[] data = new byte[ 256]; final CDB cdb = new CDBRequestSense(data.length); api.executeCommand(cdb, data, 0, 5000); return new RequestSenseData(data); }
|
public SenseData requestSense() throws SCSIException, TimeoutException, InterruptedException { final byte[] data = new byte[ 256]; final CDB cdb = new CDBRequestSense(data.length); api.executeCommand(cdb, data, 0, 5000); return new RequestSenseData(data); }
| 8,132
|
public RequestSenseData requestSense() throws SCSIException, TimeoutException, InterruptedException { final byte[] data = new byte[ 256]; final CDB cdb = new CDBRequestSense(data.length); api.executeCommand(cdb, data, 0, 5000); return new RequestSenseData(data); }
|
public RequestSenseData requestSense() throws SCSIException, TimeoutException, InterruptedException { final byte[] data = new byte[ 256]; final CDB cdb = new CDBRequestSense(data.length); api.executeCommand(cdb, data, 0, 5000); return new SenseData(data); }
| 8,133
|
public final static String getKeyStrokeText(KeyEvent ke) { if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } System.out.println("getKeyStrokeText " + lastKeyMnemonic); return lastKeyMnemonic; }
|
public final static String getKeyStrokeText(KeyEvent ke) { if (!workStroke.equals(ke)) { workStroke.setAttributes(ke); lastKeyMnemonic = (String)mappedKeys.get(workStroke); } return lastKeyMnemonic; }
| 8,134
|
public void verifyBeforeEmit() { System.out.println("VmStatics#verifyBeforeEmit"); final int max = statics.length; for (int i = 0; i < max; i++) { final Object value = objects[i]; if (value != null) { if (slotLength == 1) { statics[i] = resolver.addressOf32(value); } else { final long lvalue = resolver.addressOf64(value); if (lsbFirst) { statics[i + 0] = (int) (lvalue & 0xFFFFFFFFL); statics[i + 1] = (int) ((lvalue >>> 32) & 0xFFFFFFFFL); } else { statics[i + 1] = (int) (lvalue & 0xFFFFFFFFL); statics[i + 0] = (int) ((lvalue >>> 32) & 0xFFFFFFFFL); } } } else if (types[i] == TYPE_METHOD) { throw new RuntimeException("Method is null"); } } }
|
public void verifyBeforeEmit() { System.out.println("VmStatics#verifyBeforeEmit " + slotLength + ", " + resolver); final int max = statics.length; for (int i = 0; i < max; i++) { final Object value = objects[i]; if (value != null) { if (slotLength == 1) { statics[i] = resolver.addressOf32(value); } else { final long lvalue = resolver.addressOf64(value); if (lsbFirst) { statics[i + 0] = (int) (lvalue & 0xFFFFFFFFL); statics[i + 1] = (int) ((lvalue >>> 32) & 0xFFFFFFFFL); } else { statics[i + 1] = (int) (lvalue & 0xFFFFFFFFL); statics[i + 0] = (int) ((lvalue >>> 32) & 0xFFFFFFFFL); } } } else if (types[i] == TYPE_METHOD) { throw new RuntimeException("Method is null"); } } }
| 8,140
|
public void add(MutableTreeNode child) { if (child == null) throw new IllegalArgumentException(); if (! allowsChildren) throw new IllegalStateException(); children.add(child); child.setParent(this); }
|
public void add(MutableTreeNode child) { if (child == null) throw new IllegalArgumentException(); if (! allowsChildren) throw new IllegalStateException(); children.add(child); child.setParent(this); }
| 8,144
|
public Object clone() { try { return super.clone(); // TODO: Do we need to do more here ? } catch (CloneNotSupportedException e) { // This never happens. return null; } }
|
public Object clone() { try { return super.clone(); // TODO: Do we need to do more here ? } catch (CloneNotSupportedException e) { // This never happens. return null; } }
| 8,145
|
public DefaultMutableTreeNode getNextLeaf() { if (parent == null) return null; // TODO: Fix implementation. return null; //return parent.getChildAfter(this); }
|
public DefaultMutableTreeNode getNextLeaf() { DefaultMutableTreeNode sibling = getNextSibling(); if (sibling != null) return sibling.getFirstLeaf(); if (parent != null) return ((DefaultMutableTreeNode) parent).getNextLeaf(); return null; // TODO: Fix implementation. return null; //return parent.getChildAfter(this); }
| 8,147
|
public DefaultMutableTreeNode getNextLeaf() { if (parent == null) return null; // TODO: Fix implementation. return null; //return parent.getChildAfter(this); }
|
public DefaultMutableTreeNode getNextLeaf() { if (parent == null) // TODO: Fix implementation. //return parent.getChildAfter(this); }
| 8,148
|
public DefaultMutableTreeNode getPreviousLeaf() { if (parent == null) return null; // TODO: Fix implementation. return null; //return parent.getChildBefore(this); }
|
public DefaultMutableTreeNode getPreviousLeaf() { if (parent == null) return null; // TODO: Fix implementation. return null; //return parent.getChildBefore(this); }
| 8,149
|
public void remove(int index) { children.remove(index); }
|
public void remove(int index) { MutableTreeNode child = (MutableTreeNode) children.remove(index); child.setParent(null); }
| 8,152
|
public void removeAllChildren() { children.removeAllElements(); }
|
public void removeAllChildren() { for (int i = getChildCount() - 1; i >= 0; i--) remove(i); }
| 8,153
|
public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); //TODO fix it Point p = awtFrame.getLocationOnScreen(); Insets ins = swingPeer.getInsets(); awtFrame.reshape(p.x + x, p.y + y, width + ins.left + ins.right, height + ins.top + ins.bottom); }
|
public void reshape(int x, int y, int width, int height) { super.reshape(x, y, width, height); //TODO fix it Point p = awtFrame.getLocationOnScreen(); Insets ins = swingPeer.getInsets(); awtFrame.reshape(p.x + x, p.y + y, width + ins.left + ins.right, height + ins.top + ins.bottom); }
| 8,155
|
Rectangle getCellBounds(int x, int y, Object cell) { if (cell != null) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm.getHeight()); } return null; }
|
Rectangle getCellBounds(int x, int y, Object cell) { if (cell != null) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); if (s != null) return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s) + 4, fm.getHeight()); } return null; }
| 8,156
|
Rectangle getCellBounds(int x, int y, Object cell) { if (cell != null) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm.getHeight()); } return null; }
|
Rectangle getCellBounds(int x, int y, Object cell) { if (cell != null) { String s = cell.toString(); Font f = tree.getFont(); FontMetrics fm = tree.getToolkit().getFontMetrics(tree.getFont()); return new Rectangle(x, y, SwingUtilities.computeStringWidth(fm, s), fm.getHeight()); } return new Rectangle(x, y, 0, 0); }
| 8,157
|
Point getCellLocation(int x, int y, JTree tree, TreeModel mod, Object node, Object startNode) { int rowHeight = getRowHeight(); if (startNode == null || startNode.equals(node)) { if (!tree.isRootVisible() && tree.isExpanded(new TreePath(( (DefaultMutableTreeNode) mod.getRoot()).getPath()))) return new Point(x + ((((DefaultMutableTreeNode) node).getLevel()) * rightChildIndent), y); return new Point(x + ((((DefaultMutableTreeNode) node).getLevel() + 1) * rightChildIndent), y); } if (!mod.isLeaf(startNode) && tree.isExpanded(new TreePath( ((DefaultMutableTreeNode) startNode).getPath()))) { Object child = mod.getChild(startNode, 0); if (child != null) return getCellLocation(x, y + rowHeight, tree, mod, node, child); } return getCellLocation(x, y + rowHeight, tree, mod, node, getNextVisibleNode((DefaultMutableTreeNode) startNode)); }
|
Point getCellLocation(int x, int y, JTree tree, TreeModel mod, Object node, Object startNode) { int rowHeight = getRowHeight(); if (startNode == null || startNode.equals(node)) { if (!tree.isRootVisible() && tree.isExpanded(new TreePath(( (DefaultMutableTreeNode) mod.getRoot()).getPath()))) return new Point(x + ((((DefaultMutableTreeNode) node).getLevel()) * rightChildIndent), y); return new Point(x + ((((DefaultMutableTreeNode) node).getLevel() + 1) * rightChildIndent), y); } if (!mod.isLeaf(startNode) && tree.isExpanded(new TreePath( ((DefaultMutableTreeNode) startNode).getPath()))) { Object child = mod.getChild(startNode, 0); if (child != null) return getCellLocation(x, y + rowHeight, tree, mod, node, child); } return getCellLocation(x, y + rowHeight, tree, mod, node, getNextVisibleNode((DefaultMutableTreeNode) startNode)); }
| 8,158
|
public Rectangle getPathBounds(JTree tree, TreePath path) { if (path != null) { Object cell = path.getLastPathComponent(); TreeModel mod = tree.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) mod.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(((DefaultMutableTreeNode) root) .getPath()))) root = root.getNextNode(); Point loc = getCellLocation(0, 0, tree, mod, cell, root); return getCellBounds(loc.x, loc.y, cell); } return null; }
|
public Rectangle getPathBounds(JTree tree, TreePath path) { if (path != null) { Object cell = path.getLastPathComponent(); TreeModel mod = tree.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) mod.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(((DefaultMutableTreeNode) root) .getPath()))) root = root.getNextNode(); Point loc = getCellLocation(0, 0, tree, mod, cell, root); return getCellBounds(loc.x, loc.y, cell); } return null; }
| 8,159
|
public int getRightChildIndent(int newAmount) { return rightChildIndent; }
|
public int getRightChildIndent() { return rightChildIndent; }
| 8,160
|
public void installUI(JComponent c) { super.installUI(c); installDefaults((JTree) c); tree = (JTree) c; setModel(tree.getModel()); tree.setRootVisible(true); tree.expandPath(new TreePath(((DefaultMutableTreeNode) (tree.getModel()).getRoot()).getPath())); treeSelectionModel = tree.getSelectionModel(); installListeners(); installKeyboardActions(); completeUIInstall(); }
|
public void installUI(JComponent c) { super.installUI(c); installDefaults((JTree) c); tree = (JTree) c; setModel(tree.getModel()); tree.setRootVisible(true); tree.expandPath(new TreePath(((DefaultMutableTreeNode) (tree.getModel()).getRoot()).getPath())); treeSelectionModel = tree.getSelectionModel(); installListeners(); installKeyboardActions(); completeUIInstall(); }
| 8,161
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(((DefaultMutableTreeNode) root) .getPath())); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, mod, root); TreePath lead = tree.getLeadSelectionPath(); if (lead != null && tree.isPathSelected(lead)) { Rectangle cell = getPathBounds(tree, lead); g.setColor(UIManager.getLookAndFeelDefaults().getColor( "Tree.selectionBorderColor")); g.drawRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } }
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(((DefaultMutableTreeNode) root) .getPath())); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, mod, root); TreePath lead = tree.getLeadSelectionPath(); if (lead != null && tree.isPathSelected(lead)) { Rectangle cell = getPathBounds(tree, lead); g.setColor(UIManager.getLookAndFeelDefaults().getColor( "Tree.selectionBorderColor")); g.drawRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } }
| 8,162
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(((DefaultMutableTreeNode) root) .getPath())); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, mod, root); TreePath lead = tree.getLeadSelectionPath(); if (lead != null && tree.isPathSelected(lead)) { Rectangle cell = getPathBounds(tree, lead); g.setColor(UIManager.getLookAndFeelDefaults().getColor( "Tree.selectionBorderColor")); g.drawRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } }
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; TreeModel mod = tree.getModel(); Object root = mod.getRoot(); if (!tree.isRootVisible()) tree.expandPath(new TreePath(((DefaultMutableTreeNode) root) .getPath())); paintRecursive(g, 0, 0, 0, 0, tree, mod, root); if (hasControlIcons()) paintControlIcons(g, 0, 0, 0, 0, tree, mod, root); TreePath lead = tree.getLeadSelectionPath(); if (lead != null && tree.isPathSelected(lead)) { Rectangle cell = getPathBounds(tree, lead); g.setColor(UIManager.getLookAndFeelDefaults().getColor( "Tree.selectionBorderColor")); g.drawRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } }
| 8,163
|
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(((DefaultMutableTreeNode) node).getPath()); boolean selected = tree.isPathSelected(curr); boolean expanded = false; if (tree.isVisible(curr)) { DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer) tree .getCellRenderer(); if (!isLeaf) expanded = tree.isExpanded(curr); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, expanded, isLeaf, 0, false); if (selected) { Rectangle cell = getPathBounds(tree, curr); g.setColor(dtcr.getBackgroundSelectionColor()); g.fillRect(cell.x + rightChildIndent - 4, cell.y, cell.width + 4, cell.height); } g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
void paintNode(Graphics g, int x, int y, JTree tree, Object node, boolean isLeaf) { TreePath curr = new TreePath(((DefaultMutableTreeNode) node).getPath()); boolean selected = tree.isPathSelected(curr); boolean expanded = false; if (tree.isVisible(curr)) { DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer) tree .getCellRenderer(); if (!isLeaf) expanded = tree.isExpanded(curr); Component c = dtcr.getTreeCellRendererComponent(tree, node, selected, expanded, isLeaf, 0, false); if (selected) { Rectangle cell = getPathBounds(tree, curr); g.setColor(dtcr.getBackgroundSelectionColor()); g.fillRect(cell.x + icon.getIconWidth()/2, cell.y, cell.width, cell.height); } g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 8,164
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
| 8,166
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); tree.getModel().removeTreeModelListener(treeModelListener); }
|
protected void uninstallListeners() { tree.removePropertyChangeListener(propertyChangeListener); tree.removeFocusListener(focusListener); tree.removeTreeSelectionListener(treeSelectionListener); tree.removeMouseListener(mouseInputListener); tree.removeKeyListener(keyListener); tree.removePropertyChangeListener(selectionModelPropertyChangeListener); tree.removeComponentListener(componentListener); tree.getCellEditor().removeCellEditorListener(cellEditorListener); tree.removeTreeExpansionListener(treeExpansionListener); TreeCellEditor tce = tree.getCellEditor(); if (tce != null) tce.removeCellEditorListener(cellEditorListener); TreeModel tm = tree.getModel(); if (tm != null) tm.removeTreeModelListener(treeModelListener); }
| 8,167
|
public static NotFound extract(Any a) { try { return ((NotFoundHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } }
|
public static NotFound extract(Any a) { try { return ((NotFoundHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; } }
| 8,168
|
public void setValue(Object value) { // TODO: should be setting the value in the editorComp this.value = value; }
|
public void setValue(Object aValue) { // TODO: should be setting the value in the editorComp this.value = value; }
| 8,170
|
public void setValue(Object value) { // TODO: should be setting the value in the editorComp this.value = value; }
|
public void setValue(Object value) { // TODO: should be setting the value in the editorComp value = aValue; }
| 8,171
|
public DefaultCellEditor(JTextField textfield) { editorComponent = textfield; clickCountToStart = 3; } // DefaultCellEditor()
|
public DefaultCellEditor(JTextField textfield) { editorComponent = textfield; clickCountToStart = 2; delegate = new JTextFieldDelegate(); textfield.addActionListener(delegate); } // DefaultCellEditor()
| 8,172
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { // NOTE: as specified by Sun, we don't call new() everytime, we return // editorComponent on each call to getTableCellEditorComponent or // getTreeCellEditorComponent. However, currently JTextFields have a // problem with getting rid of old text, so without calling new() there // are some strange results. If you edit more than one cell in the table // text from previously edited cells may unexpectedly show up in the // cell you are currently editing. This will be fixed automatically // when JTextField is fixed. if (editorComponent instanceof JTextField) { ((JTextField)editorComponent).setText(value.toString()); delegate = new EditorDelegate(); ((JTextField)editorComponent).addActionListener(delegate); } else { // TODO } return editorComponent; } // getTableCellEditorComponent()
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { // NOTE: as specified by Sun, we don't call new() everytime, we return // editorComponent on each call to getTableCellEditorComponent or // getTreeCellEditorComponent. However, currently JTextFields have a // problem with getting rid of old text, so without calling new() there // are some strange results. If you edit more than one cell in the table // text from previously edited cells may unexpectedly show up in the // cell you are currently editing. This will be fixed automatically // when JTextField is fixed. if (editorComponent instanceof JTextField) { ((JTextField)editorComponent).setText(value.toString()); delegate = new EditorDelegate(); ((JTextField)editorComponent).addActionListener(delegate); } else { // TODO } return editorComponent; } // getTableCellEditorComponent()
| 8,173
|
String getDTDType();
|
QName getDTDType();
| 8,174
|
public Object[] getSelectedValues() { int [] idx = getSelectedIndices(); Object [] v = new Object[idx.length]; for (int i = 0; i < idx.length; ++i) v[i] = getModel().getElementAt(i); return v; }
|
public Object[] getSelectedValues() { int [] idx = getSelectedIndices(); Object [] v = new Object[idx.length]; for (int i = 0; i < idx.length; ++i) v[i] = getModel().getElementAt(idx[i]); return v; }
| 8,175
|
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void editingCanceled(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.repaint(); }
| 8,176
|
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } isEditing = false; tree.requestFocusInWindow(false); editorTimer.stop(); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void editingStopped(ChangeEvent e) { editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) { tree.remove(editingComponent.getParent()); editingComponent = null; } if (cellEditor != null) { newVal = ((JTextField) getCellEditor().getCellEditorValue()).getText(); completeEditing(false, false, true); if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } isEditing = false; tree.requestFocusInWindow(false); editorTimer.stop(); validCachedPreferredSize = false; tree.repaint(); }
| 8,177
|
public void propertyChange(PropertyChangeEvent event) { if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); } }
|
public void propertyChange(PropertyChangeEvent event) { if ((event.getPropertyName()).equals("rootVisible")) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); } }
| 8,178
|
public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeCollapsed(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 8,179
|
public void treeExpanded(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeExpanded(TreeExpansionEvent event) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 8,180
|
public void treeNodesChanged(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeNodesChanged(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 8,181
|
public void treeNodesInserted(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeNodesInserted(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 8,182
|
public void treeNodesRemoved(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
|
public void treeNodesRemoved(TreeModelEvent e) { validCachedPreferredSize = false; updateCurrentVisiblePath(); tree.revalidate(); tree.repaint(); }
| 8,183
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); updateCurrentVisiblePath(); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
| 8,184
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); updateCurrentVisiblePath(); validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
public void treeStructureChanged(TreeModelEvent e) { if (e.getPath().length == 1 && !e.getPath()[0].equals(treeModel.getRoot())) tree.expandPath(new TreePath(treeModel.getRoot())); updateCurrentVisiblePath(); validCachedPreferredSize = false; tree.repaint(); }
| 8,185
|
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { TreePath path = new TreePath(mod.getRoot()); if (!tree.isExpanded(path)) toggleExpandState(path); } treeSelectionModel = tree.getSelectionModel(); completeUIInstall(); }
|
public void installUI(JComponent c) { tree = (JTree) c; prepareForUIInstall(); super.installUI(c); installDefaults(); installComponents(); installKeyboardActions(); installListeners(); setCellEditor(createDefaultCellEditor()); createdCellEditor = true; isEditing = false; TreeModel mod = tree.getModel(); setModel(mod); if (mod != null) { Object root = mod.getRoot(); if (root != null) { TreePath path = new TreePath(root); if (!tree.isExpanded(path)) toggleExpandState(path); } treeSelectionModel = tree.getSelectionModel(); completeUIInstall(); }
| 8,186
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; if (currentVisiblePath == null) updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(clip.x, clip.y); int endIndex = tree.getClosestRowForLocation(clip.x + clip.width, clip.y + clip.height); paintVerticalPartOfLeg(g, clip, insets, currentVisiblePath); for (int i = startIndex; i <= endIndex; i++) { Object curr = currentVisiblePath.getPathComponent(i); boolean isLeaf = treeModel.isLeaf(curr); TreePath path = new TreePath(getPathToRoot(curr, 0)); boolean isExpanded = tree.isExpanded(path); Rectangle bounds = getPathBounds(tree, path); paintHorizontalPartOfLeg(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); paintRow(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); } } }
|
public void paint(Graphics g, JComponent c) { JTree tree = (JTree) c; updateCurrentVisiblePath(); Rectangle clip = g.getClipBounds(); Insets insets = tree.getInsets(); if (clip != null && treeModel != null && currentVisiblePath != null) { int startIndex = tree.getClosestRowForLocation(clip.x, clip.y); int endIndex = tree.getClosestRowForLocation(clip.x + clip.width, clip.y + clip.height); paintVerticalPartOfLeg(g, clip, insets, currentVisiblePath); for (int i = startIndex; i <= endIndex; i++) { Object curr = currentVisiblePath.getPathComponent(i); boolean isLeaf = treeModel.isLeaf(curr); TreePath path = new TreePath(getPathToRoot(curr, 0)); boolean isExpanded = tree.isExpanded(path); Rectangle bounds = getPathBounds(tree, path); paintHorizontalPartOfLeg(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); paintRow(g, clip, insets, bounds, path, i, isExpanded, false, isLeaf); } } }
| 8,188
|
protected void pathWasCollapsed(TreePath path) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
protected void pathWasCollapsed(TreePath path) { validCachedPreferredSize = false; tree.repaint(); }
| 8,189
|
protected void pathWasExpanded(TreePath path) { validCachedPreferredSize = false; tree.revalidate(); tree.repaint(); }
|
protected void pathWasExpanded(TreePath path) { validCachedPreferredSize = false; tree.repaint(); }
| 8,190
|
protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) { editingPath = path; editingRow = tree.getRowForPath(editingPath); Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, val, true, expanded, isLeaf(editingRow), editingRow); editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); validCachedPreferredSize = false; tree.revalidate(); ((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); return true; } return false; }
|
protected boolean startEditing(TreePath path, MouseEvent event) { int x; int y; if (event == null) { Rectangle bounds = getPathBounds(tree, path); x = bounds.x; y = bounds.y; } else { x = event.getX(); y = event.getY(); } updateCellEditor(); TreeCellEditor ed = getCellEditor(); if (ed != null && ed.shouldSelectCell(event) && ed.isCellEditable(event)) { editingPath = path; editingRow = tree.getRowForPath(editingPath); Object val = editingPath.getLastPathComponent(); cellEditor.addCellEditorListener(cellEditorListener); stopEditingInCompleteEditing = false; boolean expanded = tree.isExpanded(editingPath); isEditing = true; editingComponent = ed.getTreeCellEditorComponent(tree, val, true, expanded, isLeaf(editingRow), editingRow); editingComponent.getParent().setVisible(true); editingComponent.getParent().validate(); tree.add(editingComponent.getParent()); editingComponent.getParent().validate(); validCachedPreferredSize = false; ((JTextField) editingComponent).requestFocusInWindow(false); editorTimer.start(); return true; } return false; }
| 8,191
|
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); updateCurrentVisiblePath(); }
|
protected void toggleExpandState(TreePath path) { if (tree.isExpanded(path)) tree.collapsePath(path); else tree.expandPath(path); }
| 8,192
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); toolBar.setBorder(new ToolBarBorder()); toolBar.setBackground(defaults.getColor("ToolBar.background")); toolBar.setForeground(defaults.getColor("ToolBar.foreground")); toolBar.setFont(defaults.getFont("ToolBar.font")); dockingBorderColor = defaults.getColor("ToolBar.dockingForeground"); dockingColor = defaults.getColor("ToolBar.dockingBackground"); floatingBorderColor = defaults.getColor("ToolBar.floatingForeground"); floatingColor = defaults.getColor("ToolBar.floatingBackground"); }
|
protected void installDefaults() { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); toolBar.setBorder(defaults.getBorder("ToolBar.border")); toolBar.setBackground(defaults.getColor("ToolBar.background")); toolBar.setForeground(defaults.getColor("ToolBar.foreground")); toolBar.setFont(defaults.getFont("ToolBar.font")); dockingBorderColor = defaults.getColor("ToolBar.dockingForeground"); dockingColor = defaults.getColor("ToolBar.dockingBackground"); floatingBorderColor = defaults.getColor("ToolBar.floatingForeground"); floatingColor = defaults.getColor("ToolBar.floatingBackground"); }
| 8,194
|
public void invoke(String cmdLineStr) { final CommandLine cmdLine = new CommandLine(cmdLineStr); if (!cmdLine.hasNext()) return; String cmdName = cmdLine.next(); commandShell.addCommandToHistory(cmdLineStr); // System.err.println("Got command: "+cmdLineStr+", name="+cmdName); try { Class cmdClass = commandShell.getCommandClass(cmdName); // System.err.println("CmdClass="+cmdClass); final Method main = cmdClass.getMethod("main", MAIN_ARG_TYPES); // System.err.println("main="+main); try { // System.err.println("Invoking..."); try { final Object[] args = new Object[] { cmdLine.getRemainder() .toStringArray()}; AccessController.doPrivileged(new InvokeAction(main, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } //main.invoke(null, ); // System.err.println("Finished invoke."); } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxError) { Help.getInfo(cmdClass).usage(); err.println(tex.getMessage()); } else { err.println("Exception in command"); tex.printStackTrace(err); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); } catch (Error ex) { err.println("Fatal error in command"); ex.printStackTrace(err); } } catch (NoSuchMethodException ex) { err.println("Alias class has no main method " + cmdName); } catch (ClassNotFoundException ex) { err.println("Unknown alias class " + ex.getMessage()); } catch (ClassCastException ex) { err.println("Invalid command " + cmdName); } catch (Exception ex) { err.println("I FOUND AN ERROR: " + ex); } }
|
public void invoke(String cmdLineStr) { final CommandLine cmdLine = new CommandLine(cmdLineStr); if (!cmdLine.hasNext()) return; String cmdName = cmdLine.next(); commandShell.addCommandToHistory(cmdLineStr); // System.err.println("Got command: "+cmdLineStr+", name="+cmdName); try { Class cmdClass = commandShell.getCommandClass(cmdName); // System.err.println("CmdClass="+cmdClass); final Method main = cmdClass.getMethod("main", MAIN_ARG_TYPES); // System.err.println("main="+main); try { // System.err.println("Invoking..."); try { final Object[] args = new Object[] { cmdLine.getRemainder() .toStringArray()}; AccessController.doPrivileged(new InvokeAction(main, null, args)); } catch (PrivilegedActionException ex) { throw ex.getException(); } //main.invoke(null, ); // System.err.println("Finished invoke."); } catch (InvocationTargetException ex) { Throwable tex = ex.getTargetException(); if (tex instanceof SyntaxErrorException) { Help.getInfo(cmdClass).usage(); err.println(tex.getMessage()); } else { err.println("Exception in command"); tex.printStackTrace(err); } } catch (Exception ex) { err.println("Exception in command"); ex.printStackTrace(err); } catch (Error ex) { err.println("Fatal error in command"); ex.printStackTrace(err); } } catch (NoSuchMethodException ex) { err.println("Alias class has no main method " + cmdName); } catch (ClassNotFoundException ex) { err.println("Unknown alias class " + ex.getMessage()); } catch (ClassCastException ex) { err.println("Invalid command " + cmdName); } catch (Exception ex) { err.println("I FOUND AN ERROR: " + ex); } }
| 8,195
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); }// catch (AddressException ae) {//// }// catch ( MessagingException me) {//// } return false; }
|
public boolean send() throws Exception { try { if(!loadConfig(configFile)) return false; Session session = Session.getDefaultInstance(SMTPProperties, null); session.setDebug(false); // create the Multipart and its parts to it Multipart mp = new MimeMultipart(); Message msg = new MimeMessage(session); InternetAddress[] toAddrs = null, ccAddrs = null; toAddrs = InternetAddress.parse(to, false); msg.setRecipients(Message.RecipientType.TO, toAddrs); if (cc != null) { ccAddrs = InternetAddress.parse(cc, false); msg.setRecipients(Message.RecipientType.CC, ccAddrs); } if (subject != null) msg.setSubject(subject.trim()); if (from != null && from.length() > 0) msg.setFrom(new InternetAddress(from)); if (message != null && message.length() > 0) { // create and fill the attachment message part MimeBodyPart mbp = new MimeBodyPart(); mbp.setText(message,"us-ascii"); mp.addBodyPart(mbp); } msg.setSentDate(new Date()); if (attachment != null && attachment.length() > 0) { // create and fill the attachment message part MimeBodyPart abp = new MimeBodyPart(); abp.setText(attachment,"us-ascii"); if (attachmentName == null || attachmentName.length() == 0) abp.setFileName("tn5250j.txt"); else abp.setFileName(attachmentName); mp.addBodyPart(abp); } if (fileName != null && fileName.length() > 0) { // create and fill the attachment message part MimeBodyPart fbp = new MimeBodyPart(); fbp.setText("File sent using tn5250j","us-ascii"); if (attachmentName == null || attachmentName.length() == 0) fbp.setFileName("tn5250j.txt"); else fbp.setFileName(attachmentName); // Get the attachment DataSource source = new FileDataSource(fileName); // Set the data handler to the attachment fbp.setDataHandler(new DataHandler(source)); mp.addBodyPart(fbp); } // add the Multipart to the message msg.setContent(mp); // send the message Transport.send(msg); return true; } catch (SendFailedException sfe) { showFailedException(sfe); }// catch (AddressException ae) {//// }// catch ( MessagingException me) {//// } return false; }
| 8,196
|
private void showFailedException(SendFailedException sfe) { String error = sfe.getMessage() + "\n"; Address[] ia = sfe.getInvalidAddresses(); for (int x = 0; x < ia.length; x++) { error += "Invalid Address: " + ia[x].toString() + "\n"; } JTextArea ea = new JTextArea(error,6,50); JScrollPane errorScrollPane = new JScrollPane(ea); errorScrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); errorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); JOptionPane.showMessageDialog(null, errorScrollPane, LangTool.getString("em.titleConfirmation"), JOptionPane.ERROR_MESSAGE); }
|
private void showFailedException(SendFailedException sfe) { String error = sfe.getMessage() + "\n"; Address[] ia = sfe.getInvalidAddresses(); for (int x = 0; x < ia.length; x++) { error += "Invalid Address: " + ia[x].toString() + "\n"; } JTextArea ea = new JTextArea(error,6,50); JScrollPane errorScrollPane = new JScrollPane(ea); errorScrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); errorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); JOptionPane.showMessageDialog(null, errorScrollPane, LangTool.getString("em.titleConfirmation"), JOptionPane.ERROR_MESSAGE); }
| 8,197
|
public HostNameArgument(String _name, String _description) { super(_name, _description); }
|
public HostNameArgument(String _name, String _description, boolean _multi) { super(_name, _description); }
| 8,198
|
public HostNameArgument(String _name, String _description) { super(_name, _description); }
|
public HostNameArgument(String _name, String _description) { super(_name, _description, _multi); }
| 8,199
|
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; } } } }
|
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; } } } }
| 8,200
|
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; } } } }
|
private void handleEvent(AWTEvent e) { if (e instanceof MouseEvent) { MouseEvent me = SwingUtilities.convertMouseEvent(frame.getRootPane() .getGlassPane(), (MouseEvent) e, frame.getRootPane() .getGlassPane()); if (mouseEventTarget == null) return; if (mouseEventTarget.equals(frame.getGlassPane())) return; // 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; } } } }
| 8,201
|
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; } } } }
|
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; } } } }
| 8,202
|
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); } */ }
|
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); } */ }
| 8,203
|
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(); }
|
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(); }
| 8,205
|
public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); textComponent.removePropertyChangeListener(updateHandler); uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); textComponent = null; }
|
public void uninstallUI(final JComponent component) { super.uninstallUI(component); rootView.setView(null); uninstallDefaults(); uninstallListeners(); uninstallKeyboardActions(); textComponent = null; }
| 8,208
|
public void add(org.omg.CORBA.Object object) { add(generateObjectKey(object), object); }
|
public cObject add(org.omg.CORBA.Object object, int port) { add(generateObjectKey(object), object); }
| 8,209
|
public void add(org.omg.CORBA.Object object) { add(generateObjectKey(object), object); }
|
public void add(org.omg.CORBA.Object object) { return add(generateObjectKey(object), object, port); }
| 8,210
|
public org.omg.CORBA.Object get(byte[] key) { return (org.omg.CORBA.Object) objects.get(key); }
|
public cObject get(byte[] key) { return (org.omg.CORBA.Object) objects.get(key); }
| 8,211
|
public org.omg.CORBA.Object get(byte[] key) { return (org.omg.CORBA.Object) objects.get(key); }
|
public org.omg.CORBA.Object get(byte[] key) { return (cObject) objects.get(key); }
| 8,212
|
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; }
|
public cObject 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; }
| 8,213
|
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; }
|
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; }
| 8,214
|
public void remove(org.omg.CORBA.Object object) { byte[] key = getKey(object); if (key != null) objects.remove(key); }
|
public void remove(org.omg.CORBA.Object object) { byte[] key = getKey(object); if (key != null) objects.remove(key); }
| 8,215
|
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; }
|
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; }
| 8,216
|
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; }
|
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; }
| 8,217
|
public void remove(int index) { popupMenu.remove(index); }
|
public void remove(JMenuItem item) { popupMenu.remove(index); }
| 8,218
|
public void remove(int index) { popupMenu.remove(index); }
|
public void remove(int index) { popupMenu.remove(item); }
| 8,219
|
public Boolean isHidden(File f) { return new Boolean(filechooser.getFileSystemView().isHiddenFile(f)); }
|
public Boolean isHidden(File f) { return Boolean.valueOf(filechooser.getFileSystemView().isHiddenFile(f)); }
| 8,220
|
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(); } }; }
|
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(); } }; }
| 8,221
|
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); }
|
public void installComponents(JFileChooser fc) { JLabel look = new JLabel("Look In:"); parents = new JComboBox(); parents.setRenderer(new BasicComboBoxRenderer()); 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); }
| 8,222
|
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); }
|
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(); parentsPanel.add(buttonPanel); topPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 0)); 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); }
| 8,223
|
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); }
|
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); 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); }
| 8,224
|
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; } }
|
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; } }
| 8,230
|
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(); } } ); } }
|
public void bootOptionsReceived(BootEvent bootEvent) { log.info(" 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(); } } ); } }
| 8,232
|
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); }
|
private void initScripting() { try { Class.forName("org.tn5250j.scripting.JPythonInterpreterDriver"); } catch (java.lang.NoClassDefFoundError ncdfe) { log.warn("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ncdfe); } catch (Exception ex) { log.warn("Information Message: Can not find scripting support" + " files, scripting will not be available: " + "Failed to load interpreter drivers " + ex); } splash.updateProgress(++step); }
| 8,233
|
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")); }
|
protected void installDefaults() { resetLayoutManager(); 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")); }
| 8,234
|
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); }
|
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); }
| 8,235
|
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(); }
|
protected void resetLayoutManager() { if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) layoutManager = new BasicHorizontalLayoutManager(); else layoutManager = new BasicVerticalLayoutManager(); getSplitPane().setLayout(layoutManager); layoutManager.updateComponents(); getSplitPane().setLayout(layoutManager); // invalidating by itself does not invalidate the layout. getSplitPane().revalidate(); }
| 8,236
|
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(); }
|
protected void resetLayoutManager() { if (getOrientation() == JSplitPane.HORIZONTAL_SPLIT) layoutManager = new BasicHorizontalLayoutManager(); else layoutManager = new BasicVerticalLayoutManager(); layoutManager.invalidateLayout(splitPane); layoutManager.updateComponents(); // invalidating by itself does not invalidate the layout. getSplitPane().revalidate(); }
| 8,237
|
public Data(char[] text, char[] color, char[] extended) { this.text = text; this.color = color; this.extended = extended; this.graphic = null; this.field = null; }
|
public Data(char[] text, char[] attr, char[] color, char[] extended, char[] graphic) { this.text = text; this.color = color; this.extended = extended; this.graphic = null; this.field = null; }
| 8,239
|
public Data(char[] text, char[] color, char[] extended) { this.text = text; this.color = color; this.extended = extended; this.graphic = null; this.field = null; }
|
public Data(char[] text, char[] color, char[] extended) { this.text = text; this.color = color; this.extended = extended; this.graphic = graphic; this.attr = attr; this.field = null; }
| 8,240
|
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; } } }
|
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 = updateRect.attr[pos]; 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; } } }
| 8,241
|
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(); }
|
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(); }
| 8,242
|
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; }
|
public File[] getFiles(File dir, boolean useFileHiding) { if (dir == null || dir.listFiles() == 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; }
| 8,243
|
public void addDropTargetListener (DropTargetListener dtl) throws TooManyListenersException { if (dtl != null) throw new TooManyListenersException (); dropTargetListener = dtl; }
|
public void addDropTargetListener (DropTargetListener dtl) throws TooManyListenersException { if (dtl != null) throw new TooManyListenersException (); dropTargetListener = dtl; }
| 8,244
|
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); }
|
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), null, tx, randomColor(), paintMode); }
| 8,245
|
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); }
|
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)), null, tx, randomColor(), paintMode); }
| 8,246
|
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); }
|
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)), null, tx, randomColor(), paintMode); }
| 8,247
|
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); }
|
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), null, tx, randomColor(), paintMode); }
| 8,248
|
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); }
|
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)), null, tx, randomColor(), paintMode); }
| 8,249
|
public JDialog() { this(SwingUtilities.getOwnerFrame(), "", false, null); }
|
public JDialog() { this((Frame) SwingUtilities.getOwnerFrame(null), "", false, null); }
| 8,250
|
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); } }
|
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(); Rectangle sb = OperatingSystem.getScreenBounds(); frameSize.height = (sb.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); } }
| 8,251
|
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; }
|
public static int vmMain() throws PragmaUninterruptible { //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; }
| 8,252
|
public final void visit_aload(int index) { vstack.push(ifac.createLocal(JvmType.REFERENCE, stackFrame .getEbpOffset(typeSizeInfo, index))); }
|
public final void visit_aload(int index) { vstack.push(ifac.createLocal(JvmType.REFERENCE, stackFrame .getEbpOffset(typeSizeInfo, index))); }
| 8,256
|
public final void visit_fload(int index) { vstack.push(ifac.createLocal(JvmType.FLOAT, stackFrame .getEbpOffset(typeSizeInfo, index))); }
|
public final void visit_fload(int index) { vstack.push(ifac.createLocal(JvmType.FLOAT, stackFrame .getEbpOffset(typeSizeInfo, index))); }
| 8,257
|
public final void visit_iload(int index) { vstack.push(ifac.createLocal(JvmType.INT, stackFrame .getEbpOffset(typeSizeInfo, index))); }
|
public final void visit_iload(int index) { vstack.push(ifac.createLocal(JvmType.INT, stackFrame .getEbpOffset(typeSizeInfo, index))); }
| 8,258
|
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); }
|
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); }
| 8,260
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.