bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: log.setLevel((Level)Level.ERROR); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
| 2,690
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: Level.toLevel(org.apache.log4j.Level.FATAL_INT); break; } }
|
public void setLevel(int newLevel) { switch (newLevel) { case OFF: Level.toLevel(Level.OFF_INT); break; case DEBUG: Level.toLevel(org.apache.log4j.Level.DEBUG_INT); break; case INFO: Level.toLevel(org.apache.log4j.Level.INFO_INT); break; case WARN: Level.toLevel(org.apache.log4j.Level.WARN_INT); break; case ERROR: Level.toLevel(org.apache.log4j.Level.ERROR_INT); break; case FATAL: log.setLevel((Level)Level.FATAL); break; } }
| 2,691
|
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if ((mY % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
|
static void fillMetalPattern(Graphics g, int x, int y, int w, int h, Color light, Color dark) { int xOff = 0; for (int mY = y; mY < (y + h); mY++) { // set color alternating with every line if (((mY - y) % 2) == 0) g.setColor(light); else g.setColor(dark); for (int mX = x + (xOff); mX < (x + w); mX += 4) { g.drawLine(mX, mY, mX, mY); } // increase x offset xOff++; if (xOff > 3) xOff = 0; } }
| 2,692
|
public int[] getSelectedIndices() { int lo, hi, n, i, j; if (selectionModel.isSelectionEmpty()) return new int[0]; lo = selectionModel.getMinSelectionIndex(); hi = selectionModel.getMaxSelectionIndex(); n = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) n++; int [] v = new int[n]; j = 0; for (i = lo; i < hi; ++i) if (selectionModel.isSelectedIndex(i)) v[j++] = i; return v; }
|
public int[] getSelectedIndices() { int lo, hi, n, i, j; if (selectionModel.isSelectionEmpty()) return new int[0]; lo = selectionModel.getMinSelectionIndex(); hi = selectionModel.getMaxSelectionIndex(); n = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) n++; int [] v = new int[n]; j = 0; for (i = lo; i <= hi; ++i) if (selectionModel.isSelectedIndex(i)) v[j++] = i; return v; }
| 2,693
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 2,694
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
publicvoidmouseClicked(MouseEvente) { Pointclick=e.getPoint(); introw=((int)click.getY()/getRowHeight())-1; if(BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); elseif(BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode()== treeSelectionModel.SINGLE_TREE_SELECTION) { //clearselection,sinceonlyabletoselectonerowatatime. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } elseif(BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode()== treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 2,695
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 2,696
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 2,697
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
|
public void mouseClicked(MouseEvent e) { Point click = e.getPoint(); int row = ((int) click.getY() / getRowHeight()) - 1; if (BasicTreeUI.this.tree.isRowSelected(row)) BasicTreeUI.this.tree.removeSelectionRow(row); else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.SINGLE_TREE_SELECTION) { // clear selection, since only able to select one row at a time. BasicTreeUI.this.tree.getSelectionModel().clearSelection(); BasicTreeUI.this.tree.addSelectionRow(row); } else if (BasicTreeUI.this.tree.getSelectionModel() .getSelectionMode() == treeSelectionModel.CONTIGUOUS_TREE_SELECTION) { //TODO } else { BasicTreeUI.this.tree.getSelectionModel() .setSelectionMode( treeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); BasicTreeUI.this.tree.addSelectionRow(row); } }
| 2,698
|
protected TreeCellEditor createDefaultCellEditor() { return new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
|
protected TreeCellEditor createDefaultCellEditor() { return new DefaultTreeCellEditor(tree, (DefaultTreeCellRenderer) createDefaultCellRenderer(), cellEditor); }
| 2,702
|
private Rectangle getCellBounds(int x, int y, Object cell) { 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()); }
|
private Rectangle getCellBounds(int x, int y, Object cell) { 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()); }
| 2,703
|
public Dimension getMaximumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
|
public Dimension getMaximumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
| 2,704
|
public Dimension getMinimumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
|
public Dimension getMinimumSize(JComponent c) { // FIXME: not implemented return new Dimension(200, 900); }
| 2,705
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
| 2,706
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
|
public TreePath getPathForRow(JTree tree, int row) { // FIXME: check visibility when expand/collapse is implemented DefaultMutableTreeNode pathForRow = ((DefaultMutableTreeNode) (tree .getModel()).getRoot()); for (int i = 0; i < row; i++) { if (pathForRow != null) pathForRow = pathForRow.getNextNode(); } if (pathForRow == null) return null; return new TreePath(pathForRow.getPath()); }
| 2,707
|
public int getRowCount(JTree tree) { return treeState.getRowCount(); }
|
public int getRowCount(JTree tree) { return treeState.getRowCount(); }
| 2,708
|
protected void handleExpandControlClick(TreePath path, int mouseX, int mouseY) { // FIXME: not implemented }
|
protected void handleExpandControlClick(TreePath path, int mouseX, int mouseY) { // FIXME: not implemented }
| 2,709
|
protected boolean isLeaf(int row) { return false; // FIXME: not implemented }
|
protected boolean isLeaf(int row) { return false; // FIXME: not implemented }
| 2,710
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 2,711
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 2,712
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintLeaf(Graphics g, int x, int y, JTree tree, Object leaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) leaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, leaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, leaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, leaf, false, false, true, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 2,713
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 2,714
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 2,715
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
|
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp); if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else { Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree, nonLeaf, false, false, false, 0, false); g.translate(x, y); c.paint(g); g.translate(-x, -y); } }
| 2,716
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 2,717
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 2,718
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 2,719
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
| 2,720
|
private int paintRecursive(Graphics g, int indentation, int descent, int childNumber, int depth, JTree tree, TreeModel mod, Object curr) { Rectangle clip = g.getClipBounds(); if (indentation > clip.x + clip.width + rightChildIndent || descent > clip.y + clip.height + getRowHeight()) return descent; int halfHeight = getRowHeight() / 2; int halfWidth = rightChildIndent / 2; int y0 = descent + halfHeight; if (mod.isLeaf(curr)) { paintLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); } else { if (depth > 0 || tree.isRootVisible()) { paintNonLeaf(g, indentation, descent, tree, curr); descent += getRowHeight(); y0 += halfHeight; } int max = mod.getChildCount(curr); for (int i = 0; i < max; ++i) { g.setColor(getHashColor()); g.drawLine(indentation + halfWidth, descent + halfHeight, indentation + rightChildIndent, descent + halfHeight); descent = paintRecursive(g, indentation + rightChildIndent, descent, i, depth + 1, tree, mod, mod.getChild(curr, i)); } } int y1 = descent - halfHeight; if (y0 != y1) { g.setColor(getHashColor()); g .drawLine(indentation + halfWidth, y0, indentation + halfWidth, y1); } return descent; }
|
privateintpaintRecursive(Graphicsg,intindentation,intdescent, intchildNumber,intdepth,JTreetree,TreeModelmod,Objectcurr){Rectangleclip=g.getClipBounds(); if(indentation>clip.x+clip.width+rightChildIndent ||descent>clip.y+clip.height+getRowHeight())returndescent; inthalfHeight=getRowHeight()/2;inthalfWidth=rightChildIndent/2;inty0=descent+halfHeight;if(mod.isLeaf(curr)){paintLeaf(g,indentation,descent,tree,curr); descent+=getRowHeight(); }else{if(depth>0||tree.isRootVisible()){paintNonLeaf(g,indentation,descent,tree,curr); descent+=getRowHeight();y0+=halfHeight;}intmax=mod.getChildCount(curr);for(inti=0;i<max;++i){ g.setColor(getHashColor());g.drawLine(indentation+halfWidth,descent+halfHeight,indentation+rightChildIndent,descent+halfHeight); descent=paintRecursive(g,indentation+rightChildIndent, descent,i,depth+1,tree,mod,mod.getChild(curr,i));}}inty1=descent-halfHeight;if(y0!=y1){ g.setColor(getHashColor()); g .drawLine(indentation+halfWidth,y0,indentation +halfWidth,y1);}returndescent;}
| 2,721
|
public Point getLocationOnScreen() { final Point screen = new Point(location); final Component parent = component.getParent(); if (parent != null) { final Point parentScreen = parent.getLocationOnScreen(); screen.translate(parentScreen.x, parentScreen.y); } return screen; }
|
public Point getLocationOnScreen() { final Point screen = new Point(location); final Component parent = component.getParent(); if (parent != null) { final Point parentScreen = parent.getLocationOnScreen(); screen.translate(parentScreen.x, parentScreen.y); } return screen; }
| 2,722
|
public Image createImage(ImageProducer producer) { return new JNodeImage(producer); }
|
public Image createImage(ImageProducer producer) { return new JNodeImage(producer); }
| 2,723
|
void setEventMask (long mask);
|
void setEventMask (long mask);
| 2,725
|
private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList);// NumberFormat nf = NumberFormat.getNumberInstance();// ((DecimalFormat)nf).setPositiveSuffix(" ");// ((DecimalFormat)nf).setMaximumFractionDigits(1);// ((DecimalFormat)nf).setMinimumFractionDigits(1); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor", getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep", getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr", getColorProperty("colorWhite"))); } } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) { jp.removeAll(); jp.add(fp,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) { jp.removeAll(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) { jp.removeAll(); jp.add(display,BorderLayout.NORTH); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) { jp.removeAll(); jp.add(cuPanel,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) { jp.removeAll(); jp.add(onConnect,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) { jp.removeAll(); jp.add(mouse,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) { jp.removeAll(); jp.add(hotspot,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) { jp.removeAll(); jp.add(kp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); jp.validate(); jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); }
|
private void jbInit() throws Exception { changes = new PropertyChangeSupport(this); Dimension ps = null; // fonts Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); // define fonts panel final JPanel fp = new JPanel(); fp.setLayout(new BorderLayout()); JPanel flp = new JPanel(); TitledBorder tb = BorderFactory.createTitledBorder(LangTool.getString("sa.font")); flp.setBorder(tb); fontsList = new JComboBox(); String font = getStringProperty("font"); for (int x = 0; x < fonts.length; x++) { if (fonts[x].getFontName().indexOf('.') < 0) fontsList.addItem(fonts[x].getFontName()); } fontsList.setSelectedItem(font); flp.add(fontsList);// NumberFormat nf = NumberFormat.getNumberInstance();// ((DecimalFormat)nf).setPositiveSuffix(" ");// ((DecimalFormat)nf).setMaximumFractionDigits(1);// ((DecimalFormat)nf).setMinimumFractionDigits(1); JPanel fsp = new JPanel(); fsp.setLayout(new AlignLayout(2,5,5)); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.scaleLabel")); fsp.setBorder(tb); verticalScale = new JTextField("1.2",5); horizontalScale = new JTextField("1.0",5); pointSize = new JTextField("0",5); if (getStringProperty("fontScaleWidth").length() != 0) horizontalScale.setText(getStringProperty("fontScaleWidth")); if (getStringProperty("fontScaleHeight").length() != 0) verticalScale.setText(getStringProperty("fontScaleHeight")); if (getStringProperty("fontPointSize").length() != 0) pointSize.setText(getStringProperty("fontPointSize")); fsp.add(new JLabel(LangTool.getString("sa.fixedPointSize"))); fsp.add(pointSize); fsp.add(new JLabel(LangTool.getString("sa.horScaleLabel"))); fsp.add(horizontalScale); fsp.add(new JLabel(LangTool.getString("sa.vertScaleLabel"))); fsp.add(verticalScale); fp.add(flp,BorderLayout.NORTH); fp.add(fsp,BorderLayout.SOUTH); // define colors panel final JPanel cpp = new JPanel(); cpp.setLayout(new BorderLayout()); JPanel cp = new JPanel(); cp.setLayout(new BorderLayout()); JPanel cschp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colorSchema")); cschp.setBorder(tb); colorSchemaList = new JComboBox(); loadSchemas(colorSchemaList); colorSchemaList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); Object obj = cb.getSelectedItem(); if (obj instanceof Schema) { System.out.println(" we got a schema "); colorSchema = (Schema)obj; } else { colorSchema = null; } } }); cschp.add(colorSchemaList); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.colors")); cp.setBorder(tb); colorList = new JComboBox(); colorList.addItem(LangTool.getString("sa.bg")); colorList.addItem(LangTool.getString("sa.blue")); colorList.addItem(LangTool.getString("sa.red")); colorList.addItem(LangTool.getString("sa.pink")); colorList.addItem(LangTool.getString("sa.green")); colorList.addItem(LangTool.getString("sa.turq")); colorList.addItem(LangTool.getString("sa.yellow")); colorList.addItem(LangTool.getString("sa.white")); colorList.addItem(LangTool.getString("sa.guiField")); colorList.addItem(LangTool.getString("sa.cursorColor")); colorList.addItem(LangTool.getString("sa.columnSep")); colorList.addItem(LangTool.getString("sa.hexAttrColor")); jcc = new JColorChooser(); // set the default color for display as that being for back ground jcc.setColor(getColorProperty("colorBg")); colorList.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); String newSelection = (String)cb.getSelectedItem(); if (newSelection.equals(LangTool.getString("sa.bg"))) { jcc.setColor(getColorProperty("colorBg")); } if (newSelection.equals(LangTool.getString("sa.blue"))) { jcc.setColor(getColorProperty("colorBlue")); } if (newSelection.equals(LangTool.getString("sa.red"))) { jcc.setColor(getColorProperty("colorRed")); } if (newSelection.equals(LangTool.getString("sa.pink"))) { jcc.setColor(getColorProperty("colorPink")); } if (newSelection.equals(LangTool.getString("sa.green"))) { jcc.setColor(getColorProperty("colorGreen")); } if (newSelection.equals(LangTool.getString("sa.turq"))) { jcc.setColor(getColorProperty("colorTurq")); } if (newSelection.equals(LangTool.getString("sa.yellow"))) { jcc.setColor(getColorProperty("colorYellow")); } if (newSelection.equals(LangTool.getString("sa.white"))) { jcc.setColor(getColorProperty("colorWhite")); } if (newSelection.equals(LangTool.getString("sa.guiField"))) { jcc.setColor(getColorProperty("colorGUIField",Color.white)); } if (newSelection.equals(LangTool.getString("sa.cursorColor"))) { jcc.setColor(getColorProperty("colorCursor",getColorProperty("colorBg"))); } if (newSelection.equals(LangTool.getString("sa.columnSep"))) { jcc.setColor(getColorProperty("colorSep",getColorProperty("colorWhite"))); } if (newSelection.equals(LangTool.getString("sa.hexAttrColor"))) { jcc.setColor(getColorProperty("colorHexAttr",getColorProperty("colorWhite"))); } } }); cp.add(colorList,BorderLayout.NORTH); cp.add(jcc,BorderLayout.CENTER); cpp.add(cschp,BorderLayout.NORTH); cpp.add(cp,BorderLayout.CENTER); // define display panel final JPanel display = new JPanel(); display.setLayout(new BoxLayout(display,BoxLayout.Y_AXIS)); // define column separator panel JPanel csp = new JPanel(); tb = BorderFactory.createTitledBorder(LangTool.getString("sa.cs")); csp.setBorder(tb); csLine = new JRadioButton(LangTool.getString("sa.csLine")); csLine.setActionCommand("Line"); csDot = new JRadioButton(LangTool.getString("sa.csDot")); csDot.setActionCommand("Dot"); csShortLine = new JRadioButton(LangTool.getString("sa.csShortLine")); csShortLine.setActionCommand("ShortLine"); // Group the radio buttons. ButtonGroup csGroup = new ButtonGroup(); csGroup.add(csLine); csGroup.add(csDot); csGroup.add(csShortLine); if (getStringProperty("colSeparator").equals("Dot")) csDot.setSelected(true); else if (getStringProperty("colSeparator").equals("ShortLine")) csShortLine.setSelected(true); else csLine.setSelected(true); csp.add(csLine); csp.add(csDot); csp.add(csShortLine); // define show attributs panel JPanel sap = new JPanel(); sap.setBorder( BorderFactory.createTitledBorder(LangTool.getString("sa.showAttr"))); saNormal = new JRadioButton(LangTool.getString("sa.showNormal")); saNormal.setActionCommand("Normal"); JRadioButton saHex = new JRadioButton(LangTool.getString("sa.showHex")); saHex.setActionCommand("Hex"); // Group the radio buttons. ButtonGroup saGroup = new ButtonGroup(); saGroup.add(saNormal); saGroup.add(saHex); if (getStringProperty("showAttr").equals("Hex")) saHex.setSelected(true); else saNormal.setSelected(true); sap.add(saNormal); sap.add(saHex); // define gui panel JPanel cgp = new JPanel(); cgp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.cgp"))); cgp.setLayout(new AlignLayout(1,5,5));// cgp.setLayout(new BoxLayout(cgp,BoxLayout.Y_AXIS)); guiCheck = new JCheckBox(LangTool.getString("sa.guiCheck")); guiShowUnderline = new JCheckBox(LangTool.getString("sa.guiShowUnderline")); if (getStringProperty("guiInterface").equals("Yes")) guiCheck.setSelected(true); // since this is a new property added then it might not exist in existing // profiles and it should be defaulted to yes. String under = getStringProperty("guiShowUnderline"); if (under.equals("Yes") || under.length() == 0) guiShowUnderline.setSelected(true); cgp.add(guiCheck); cgp.add(guiShowUnderline); display.add(csp); display.add(sap); display.add(cgp); // define cursor panel final JPanel cuPanel = new JPanel(); cuPanel.setLayout(new BoxLayout(cuPanel,BoxLayout.Y_AXIS)); // define cursor size panel JPanel crp = new JPanel(); crp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crsSize"))); cFull = new JRadioButton(LangTool.getString("sa.cFull")); cHalf = new JRadioButton(LangTool.getString("sa.cHalf")); cLine = new JRadioButton(LangTool.getString("sa.cLine")); // Group the radio buttons. ButtonGroup cGroup = new ButtonGroup(); cGroup.add(cFull); cGroup.add(cHalf); cGroup.add(cLine); int cursorSize = 0; if (getStringProperty("cursorSize").equals("Full")) cursorSize = 2; if (getStringProperty("cursorSize").equals("Half")) cursorSize = 1; switch (cursorSize) { case 0: cLine.setSelected(true); break; case 1: cHalf.setSelected(true); break; case 2: cFull.setSelected(true); break; } crp.add(cFull); crp.add(cHalf); crp.add(cLine); // define cursor ruler panel JPanel chp = new JPanel(); chp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.crossHair"))); chNone = new JRadioButton(LangTool.getString("sa.chNone")); chHorz = new JRadioButton(LangTool.getString("sa.chHorz")); chVert = new JRadioButton(LangTool.getString("sa.chVert")); chCross = new JRadioButton(LangTool.getString("sa.chCross")); // Group the radio buttons. ButtonGroup chGroup = new ButtonGroup(); chGroup.add(chNone); chGroup.add(chHorz); chGroup.add(chVert); chGroup.add(chCross); int crossHair = 0; if (getStringProperty("crossHair").equals("Horz")) crossHair = 1; if (getStringProperty("crossHair").equals("Vert")) crossHair = 2; if (getStringProperty("crossHair").equals("Both")) crossHair = 3; switch (crossHair) { case 0: chNone.setSelected(true); break; case 1: chHorz.setSelected(true); break; case 2: chVert.setSelected(true); break; case 3: chCross.setSelected(true); break; } chp.add(chNone); chp.add(chHorz); chp.add(chVert); chp.add(chCross); // define double click as enter JPanel rulerFPanel = new JPanel(); rulerFPanel.setBorder(BorderFactory.createTitledBorder("")); rulerFixed = new JCheckBox(LangTool.getString("sa.rulerFixed")); rulerFPanel.add(rulerFixed); cuPanel.add(crp); cuPanel.add(chp); cuPanel.add(rulerFPanel); // define onConnect panel final JPanel onConnect = new JPanel(); onConnect.setLayout(new BoxLayout(onConnect,BoxLayout.Y_AXIS)); // define onConnect macro to run JPanel ocMacrop = new JPanel(); ocMacrop.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.connectMacro"))); connectMacro = new JTextField(); connectMacro.setColumns(30); // check if double click sends enter connectMacro.setText(getStringProperty("connectMacro")); ocMacrop.add(connectMacro); onConnect.add(ocMacrop); // define mouse panel final JPanel mouse = new JPanel(); mouse.setLayout(new BoxLayout(mouse,BoxLayout.Y_AXIS)); // define double click as enter JPanel dcep = new JPanel(); dcep.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.doubleClick"))); dceCheck = new JCheckBox(LangTool.getString("sa.sendEnter")); // check if double click sends enter dceCheck.setSelected(getStringProperty("doubleClick").equals("Yes")); dcep.add(dceCheck); mouse.add(dcep); // define hotspot panel final JPanel hotspot = new JPanel(); hotspot.setLayout(new BoxLayout(hotspot,BoxLayout.Y_AXIS)); // define hsPanel panel JPanel hsp = new JPanel(); hsp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsp"))); hsCheck = new JCheckBox(LangTool.getString("sa.hsCheck")); if (getStringProperty("hotspots").equals("Yes")) hsCheck.setSelected(true); hsp.add(hsCheck); // define assignment panel JPanel hsap = new JPanel(); hsap.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.hsap"))); hsap.setLayout(new GridLayout(2,2)); JLabel moreLabel = new JLabel(LangTool.getString("sa.hsMore")); JLabel bottomLabel = new JLabel(LangTool.getString("sa.hsBottom")); hsMore = new JTextField(getStringProperty("hsMore")); hsBottom = new JTextField(getStringProperty("hsBottom")); hsap.add(moreLabel); hsap.add(hsMore); hsap.add(bottomLabel); hsap.add(hsBottom); hotspot.add(hsp); hotspot.add(hsap); // define Key Pad panel final JPanel kp = new JPanel(); kp.setLayout(new BoxLayout(kp,BoxLayout.Y_AXIS)); // define kpPanel panel JPanel kpp = new JPanel(); kpp.setBorder(BorderFactory.createTitledBorder(LangTool.getString("sa.kpp"))); kpCheck = new JCheckBox(LangTool.getString("sa.kpCheck")); if (getStringProperty("keypad").equals("Yes")) kpCheck.setSelected(true); kpp.add(kpCheck); kp.add(kpp); // define default final JPanel jp = new JPanel(); jp.add(cpp,BorderLayout.CENTER); jp.setPreferredSize(cpp.getPreferredSize()); //Create the nodes. DefaultMutableTreeNode top = new DefaultMutableTreeNode(fileName); createNodes(top); //Create a tree that allows one selection at a time. final JTree tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); //Listen for when the selection changes. tree.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null)return; Object nodeInfo = node.getUserObject(); if (nodeInfo.toString().equals(LangTool.getString("sa.nodeFonts"))) {jp.removeAll();jp.add(fp,BorderLayout.NORTH);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeColors"))) {jp.removeAll();jp.add(cpp,BorderLayout.CENTER);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeDisplay"))) {jp.removeAll();jp.add(display,BorderLayout.NORTH);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeCursor"))) {jp.removeAll();jp.add(cuPanel,BorderLayout.CENTER);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeOnConnect"))) {jp.removeAll();jp.add(onConnect,BorderLayout.CENTER);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeMouse"))) {jp.removeAll();jp.add(mouse,BorderLayout.CENTER);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeHS"))) {jp.removeAll();jp.add(hotspot,BorderLayout.CENTER);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } if (nodeInfo.toString().equals(LangTool.getString("sa.nodeKP"))) {jp.removeAll();jp.add(kp,BorderLayout.CENTER);jp.setPreferredSize(cpp.getPreferredSize());jp.validate();jpm.repaint(); } } }); // define tree selection panel JPanel jsp = new JPanel(); jsp.setBackground(Color.white); jsp.add(tree); jpm.add(jp,BorderLayout.EAST); jpm.add(jsp,BorderLayout.WEST); }
| 2,726
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "[] value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
| 2,730
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "[en_US] value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
| 2,731
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
| 2,732
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr", "FR" ), "key3" ); assertEquals( "value1", s5 ); }
| 2,733
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "value1", s5 ); }
|
public void testLocalization() { String s0 = i18n.getString( null, null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: default", s0, "value1" ); String s1 = i18n.getString( null, new Locale( "en", "US" ), "key2" ); assertEquals( "Unable to retrieve localized text for locale: en-US", s1, "value2" ); String s2 = i18n.getString( "org.codehaus.plexus.i18n.BarBundle", new Locale( "ko", "KR" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: ko-KR", s2, "[ko] value3" ); String s4 = i18n.getString( "org.codehaus.plexus.i18n.FooBundle", new Locale( "fr" ), "key3" ); assertEquals( "Unable to retrieve localized text for locale: fr-US", s4, "[fr] value3" ); String s5 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "Unable to retrieve localized text for locale: fr-FR", s5, "[fr] value3" ); String s6 = i18n.getString( "org.codehaus.plexus.i18n.i18n", null, "key1" ); assertEquals( "Unable to retrieve localized properties for locale: default", "[] value1", s6 ); Locale old = Locale.getDefault(); Locale.setDefault(Locale.FRENCH); try { String s7 = i18n.getString( "org.codehaus.plexus.i18n.i18n", Locale.ENGLISH, "key1" ); assertEquals( "Not picking up new default locale: fr", "[fr] value1", s7 ); String s8 = i18n.getString( "org.codehaus.plexus.i18n.i18n", Locale.ITALIAN, "key1" ); assertEquals( "Unable to retrieve localized properties for locale: it", "[it] value1", s8 ); } finally { Locale.setDefault(old); } }
| 2,734
|
private void showPopupMenu(MouseEvent me) { JPopupMenu jpm = new JPopupMenu(); JMenuItem menuItem; Action action; final int row = spools.rowAtPoint(me.getPoint()); final int col = spools.convertColumnIndexToModel( spools.columnAtPoint(me.getPoint()));// System.out.println(" column clicked " + col);// System.out.println(" column clicked to model " + spools.convertColumnIndexToModel(col)); action = new AbstractAction(LangTool.getString("spool.optionView")) { public void actionPerformed(ActionEvent e) { System.out.println(row + " is selected "); spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater( new Runnable () { public void run() { displayViewer(getSpooledFile(row)); } } ); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionProps")) { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null,"Not Available yet","Not yet", JOptionPane.WARNING_MESSAGE); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionExport")) { public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); } }; jpm.add(action); jpm.addSeparator(); switch (col) { case 0: case 3: case 6: action = new AbstractAction(LangTool.getString("spool.labelFilter")) { public void actionPerformed(ActionEvent e) { setFilter(row,col); } }; jpm.add(action); jpm.addSeparator(); break; } action = new AbstractAction(LangTool.getString("spool.optionHold")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionRelease")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionDelete")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); GUIGraphicsUtils.positionPopup(spools,jpm,me.getX(),me.getY()); }
|
private void showPopupMenu(MouseEvent me) { JPopupMenu jpm = new JPopupMenu(); JMenuItem menuItem; Action action; final int row = spools.rowAtPoint(me.getPoint()); final int col = spools.convertColumnIndexToModel( spools.columnAtPoint(me.getPoint()));// System.out.println(" column clicked " + col);// System.out.println(" column clicked to model " + spools.convertColumnIndexToModel(col)); action = new AbstractAction(LangTool.getString("spool.optionView")) { public void actionPerformed(ActionEvent e) { System.out.println(row + " is selected "); spools.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater( new Runnable () { public void run() { displayViewer(getSpooledFile(row)); } } ); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionProps")) { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null,"Not Available yet","Not yet", JOptionPane.WARNING_MESSAGE); } }; jpm.add(action); jpm.addSeparator(); action = new AbstractAction(LangTool.getString("spool.optionExport")) { public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.setVisible(true); } }; jpm.add(action); jpm.addSeparator(); switch (col) { case 0: case 3: case 6: action = new AbstractAction(LangTool.getString("spool.labelFilter")) { public void actionPerformed(ActionEvent e) { setFilter(row,col); } }; jpm.add(action); jpm.addSeparator(); break; } action = new AbstractAction(LangTool.getString("spool.optionHold")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionRelease")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); action = new AbstractAction(LangTool.getString("spool.optionDelete")) { public void actionPerformed(ActionEvent e) { doSpoolStuff(getSpooledFile(row),e.getActionCommand()); } }; jpm.add(action); GUIGraphicsUtils.positionPopup(spools,jpm,me.getX(),me.getY()); }
| 2,735
|
public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.show(); }
|
public void actionPerformed(ActionEvent e) { SpoolExportWizard sew = new SpoolExportWizard(getSpooledFile(row), session); sew.setVisible(true); }
| 2,736
|
public NoSuchMethodException() { super(); }
|
public NoSuchMethodException() { super(); }
| 2,737
|
public NoSuchAlgorithmException(String msg) { super(msg); }
|
public NoSuchAlgorithmException() { super(msg); }
| 2,738
|
public NoSuchAlgorithmException(String msg) { super(msg); }
|
public NoSuchAlgorithmException(String msg) { }
| 2,739
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection inElements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
| 2,740
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = inElements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
| 2,741
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!this.elements.contains (o)) { elements.add (o); } } }
| 2,742
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { elements.add (o); } } }
|
SecureSet (final Subject subject, final int type, final Collection elements) { this (subject, type); for (Iterator it = elements.iterator(); it.hasNext(); ) { Object o = it.next(); if (type == PRINCIPALS && !(o instanceof Principal)) { throw new IllegalArgumentException(o+" is not a Principal"); } if (!elements.contains (o)) { this.elements.add (o); } } }
| 2,743
|
public synchronized boolean contains (final Object element) { return elements.remove (element); }
|
public synchronized boolean contains (final Object element) { return elements.contains (element); }
| 2,744
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors y = y + getShift(); g.setColor(MetalLookAndFeel.getBlack()); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
| 2,745
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(new Color(204, 204, 255)); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y, x + 9, y); g.drawLine(x, y + 1, x, y + 15); g.drawLine(x, y + 15, x + 12, y + 15); g.drawLine(x + 12, y + 15, x + 12, y + 6); g.drawLine(x + 12, y + 6, x + 9, y); g.drawLine(x + 7, y + 2, x + 11, y + 6); g.drawLine(x + 8, y + 1, x + 9, y + 1); g.setColor(MetalLookAndFeel.getPrimaryControl()); g.drawLine(x + 1, y + 1, x + 7, y + 1); g.drawLine(x + 1, y + 1, x + 1, y + 14); g.drawLine(x + 1, y + 14, x + 11, y + 14); g.drawLine(x + 11, y + 14, x + 11, y + 7); g.drawLine(x + 8, y + 2, x + 10, y + 4); }
| 2,746
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y + 3, x, y + 12); g.drawLine(x, y + 12, x + 15, y + 12); g.drawLine(x + 15, y + 12, x + 15, y + 2); g.drawLine(x + 14, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 2, x + 1, y + 2); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 4, 7, 8); g.fillRect(x + 9, y + 5, 6, 7); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 9, y + 2, x + 14, y + 2); g.setColor(new Color(50, 50, 120)); g.drawLine(x + 9, y + 1, x + 15, y + 1); g.drawLine(x + 10, y, x + 15, y); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { // TODO: pick up appropriate UI colors g.setColor(Color.black); g.drawLine(x, y + 3, x, y + 12); g.drawLine(x, y + 12, x + 15, y + 12); g.drawLine(x + 15, y + 12, x + 15, y + 2); g.drawLine(x + 14, y + 3, x + 9, y + 3); g.drawLine(x + 8, y + 2, x + 1, y + 2); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 4, 7, 8); g.fillRect(x + 9, y + 5, 6, 7); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 9, y + 2, x + 14, y + 2); g.setColor(new Color(50, 50, 120)); g.drawLine(x + 9, y + 1, x + 15, y + 1); g.drawLine(x + 10, y, x + 15, y); }
| 2,747
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 2,748
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(MetalLookAndFeel.getPrimaryControl()); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 2,749
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(MetalLookAndFeel.getPrimaryControlDarkShadow()); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 2,750
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(Color.white); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
|
public void paintIcon(Component c, Graphics g, int x, int y) { g.setColor(new Color(102, 102, 153)); g.fillRect(x + 1, y, 14, 2); g.fillRect(x, y + 1, 2, 14); g.fillRect(x + 1, y + 14, 14, 2); g.fillRect(x + 14, y + 1, 2, 14); g.drawLine(x + 2, y + 5, x + 14, y + 5); g.setColor(new Color(204, 204, 255)); g.fillRect(x + 2, y + 2, 12, 3); g.setColor(new Color(102, 102, 153)); g.drawLine(x + 3, y + 3, x + 3, y + 3); g.drawLine(x + 6, y + 3, x + 6, y + 3); g.drawLine(x + 9, y + 3, x + 9, y + 3); g.drawLine(x + 12, y + 3, x + 12, y + 3); g.setColor(MetalLookAndFeel.getWhite()); g.fillRect(x + 2, y + 6, 12, 8); g.drawLine(x + 2, y + 2, x + 2, y + 2); g.drawLine(x + 5, y + 2, x + 5, y + 2); g.drawLine(x + 8, y + 2, x + 8, y + 2); g.drawLine(x + 11, y + 2, x + 11, y + 2); }
| 2,751
|
public boolean equals(Object obj) { return (obj instanceof SmallAttributeSet) && this.isEqual((AttributeSet)obj); }
|
public boolean equals(Object obj) { return (obj instanceof AttributeSet) && this.isEqual((AttributeSet)obj); }
| 2,752
|
public final static void setMacro(String name, String keyStrokes) { int x = 0; while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; saveMacros(); }
|
public final static void setMacro(String name, String keyStrokes) { int x = 0; while (getMacroByNumber(++x) != null) {} macros.put("macro" + x + "." + name,keyStrokes); macrosExist = true; saveMacros(); }
| 2,753
|
public void undo() { super.undo(); try { StringContent.this.checkLocation(this.start, this.length); this.redoContent = new String(StringContent.this.content, this.start, this.length); StringContent.this.remove(this.start, this.length); } catch (BadLocationException b) { throw new CannotUndoException(); } }
|
public void undo() { super.undo(); try { StringContent.this.checkLocation(this.start, this.length); this.redoContent = new String(StringContent.this.content, this.start, this.length); StringContent.this.remove(this.start, this.length); } catch (BadLocationException b) { throw new CannotUndoException(); } }
| 2,754
|
void checkLocation(int where, int len) throws BadLocationException { if (where < 0) throw new BadLocationException("Invalid location", 1); else if (where > this.count) throw new BadLocationException("Invalid location", this.count); else if ((where + len)>this.count) throw new BadLocationException("Invalid range", this.count); }
|
void checkLocation(int where, int len) throws BadLocationException { if (where < 0) throw new BadLocationException("Invalid location", 1); else if (where > this.count) throw new BadLocationException("Invalid location", this.count); else if ((where + len) > this.count) throw new BadLocationException("Invalid range", this.count); }
| 2,755
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
| 2,756
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
| 2,757
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; } }
|
public void getChars(int where, int len, Segment txt) throws BadLocationException { checkLocation(where, len); if (txt != null) { txt.array = this.content; txt.offset = where; txt.count = len; }
| 2,758
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector refPos = new Vector(); Iterator iter = this.positions.iterator(); while(iter.hasNext()) { Position p = (Position)iter.next(); if ((offset <= p.getOffset()) && (p.getOffset() <= (offset + length))) refPos.add(p); } return refPos; }
|
protected Vector getPositionsInRange(Vector v, int offset, int length) { Vector refPos = new Vector(); Iterator iter = this.positions.iterator(); while(iter.hasNext()) { Position p = (Position) iter.next(); if ((offset <= p.getOffset()) && (p.getOffset() <= (offset + length))) refPos.add(p); } return refPos; }
| 2,759
|
public String getString(int where, int len) throws BadLocationException { checkLocation(where, len); return new String (this.content, where, len); }
|
public String getString(int where, int len) throws BadLocationException { checkLocation(where, len); return new String(this.content, where, len); }
| 2,760
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { checkLocation(where, 0); if (where == this.count) throw new BadLocationException("Invalid location", 1); if (str == null) throw new NullPointerException(); char[] insert = str.toCharArray(); char[] temp = new char[this.content.length + insert.length]; this.count += insert.length; // Copy array and insert the string. if (where > 0) System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(insert, 0, temp, where, insert.length); System.arraycopy(this.content, where, temp, (where + insert.length), (temp.length - where - insert.length)); if (this.content.length < temp.length) this.content = new char[temp.length]; // Copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, temp.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, temp.length - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); p.setOffset(p.getOffset() + str.length()); } InsertUndo iundo = new InsertUndo(where, insert.length); return iundo; }
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { checkLocation(where, 0); if (where == this.count) throw new BadLocationException("Invalid location", 1); if (str == null) throw new NullPointerException(); char[] insert = str.toCharArray(); char[] temp = new char[this.content.length + insert.length]; this.count += insert.length; // Copy array and insert the string. if (where > 0) System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(insert, 0, temp, where, insert.length); System.arraycopy(this.content, where, temp, (where + insert.length), (temp.length - where - insert.length)); if (this.content.length < temp.length) this.content = new char[temp.length]; // Copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, temp.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, temp.length - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); p.setOffset(p.getOffset() + str.length()); } InsertUndo iundo = new InsertUndo(where, insert.length); return iundo; }
| 2,761
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { checkLocation(where, 0); if (where == this.count) throw new BadLocationException("Invalid location", 1); if (str == null) throw new NullPointerException(); char[] insert = str.toCharArray(); char[] temp = new char[this.content.length + insert.length]; this.count += insert.length; // Copy array and insert the string. if (where > 0) System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(insert, 0, temp, where, insert.length); System.arraycopy(this.content, where, temp, (where + insert.length), (temp.length - where - insert.length)); if (this.content.length < temp.length) this.content = new char[temp.length]; // Copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, temp.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, temp.length - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); p.setOffset(p.getOffset() + str.length()); } InsertUndo iundo = new InsertUndo(where, insert.length); return iundo; }
|
public UndoableEdit insertString(int where, String str) throws BadLocationException { checkLocation(where, 0); if (where == this.count) throw new BadLocationException("Invalid location", 1); if (str == null) throw new NullPointerException(); char[] insert = str.toCharArray(); char[] temp = new char[this.content.length + insert.length]; this.count += insert.length; // Copy array and insert the string. if (where > 0) System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(insert, 0, temp, where, insert.length); System.arraycopy(this.content, where, temp, (where + insert.length), (temp.length - where - insert.length)); if (this.content.length < temp.length) this.content = new char[temp.length]; // Copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, temp.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, temp.length - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); p.setOffset(p.getOffset() + str.length()); } InsertUndo iundo = new InsertUndo(where, insert.length); return iundo; }
| 2,762
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems + 1); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
| 2,763
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
| 2,764
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
| 2,765
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
|
public UndoableEdit remove(int where, int nitems) throws BadLocationException { checkLocation(where, nitems); char[] temp = new char[(this.content.length - nitems)]; this.count = this.count - nitems; RemoveUndo rundo = new RemoveUndo(where, new String(this.content, where, nitems)); // Copy array. System.arraycopy(this.content, 0, temp, 0, where); System.arraycopy(this.content, where + nitems, temp, where, this.content.length - where - nitems); this.content = new char[temp.length]; // Then copy the result in the original char array. System.arraycopy(temp, 0, this.content, 0, this.content.length); // Move all the positions. Vector refPos = getPositionsInRange(this.positions, where, this.content.length + nitems - where); Iterator iter = refPos.iterator(); while (iter.hasNext()) { StickyPosition p = (StickyPosition)iter.next(); int result = p.getOffset() - nitems; p.setOffset(result); if (result < 0) this.positions.remove(p); } return rundo; }
| 2,766
|
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
|
protected DatagramSocket(DatagramSocketImpl impl) { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
| 2,770
|
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
|
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
| 2,771
|
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
|
public DatagramSocket(SocketAddress address) throws SocketException { // @classpath-bugfix Security String propVal = (String)AccessController.doPrivileged(new GetPropertyAction("impl.prefix")); if (factory != null) { // @classpath-bugfix Use factory impl = factory.createDatagramSocketImpl(); } else if (propVal == null || propVal.equals("")) impl = new PlainDatagramSocketImpl(); else try { impl = (DatagramSocketImpl) Class.forName("java.net." + propVal + "DatagramSocketImpl") .newInstance(); } catch (Exception e) { System.err.println("Could not instantiate class: java.net." + propVal + "DatagramSocketImpl"); impl = new PlainDatagramSocketImpl(); } if (address != null) bind(address); }
| 2,772
|
public ViewportLayout() { }
|
public ViewportLayout() { }
| 2,773
|
public AccessibleJWindow() { super(); // Nothing to do here. }
|
protected AccessibleJWindow() { super(); // Nothing to do here. }
| 2,774
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // The root node is just a "structure" node, // but is always the first one. XDF.setXMLAttributes(attrs); // set XML attributes from passed list CurrentStructure = XDF; // current working structure is now the root // structure // if this global option is set in the reader, we use it if(Options.contains("DefaultDataDimensionSize")) { int value = ((Integer) Options.get("DefaultDataDimensionSize")).intValue(); XDF.setDefaultDataArraySize(value); } return CurrentStructure; }
|
public Object action (SaxDocumentHandler handler, AttributeList attrs) { // The root node is just a "structure" node, // but is always the first one. XDF.setXMLAttributes(attrs); // set XML attributes from passed list CurrentStructure = XDF; // current working structure is now the root // structure // if this global option is set in the reader, we use it if(Options.contains("DefaultDataDimensionSize")) { int value = ((Integer) Options.get("DefaultDataDimensionSize")).intValue(); Specification.getInstance().setDefaultDataArraySize(value); } return CurrentStructure; }
| 2,776
|
protected synchronized void create(boolean stream) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
|
protected synchronized void create(boolean stream) throws IOException { // @vm-specific no natives //TODO implement me throw new SocketException("Not implemented"); }
| 2,777
|
protected FontMetrics createFontMetrics(Font font) throws IOException { final BDFFont bdfFont = (BDFFont) font; return bdfFont.getFontMetrics(); }
|
protected FontMetrics createFontMetrics(Font font) throws IOException { final BDFFont bdfFont = (BDFFont) font; return bdfFont.getFontMetrics(); }
| 2,779
|
protected TextRenderer createTextRenderer(RenderCache renderCache, Font font) { final BDFFont bdfFont = (BDFFont) font; final TextRenderer renderer = new BDFTextRenderer(bdfFont.getContainer()); log.debug("created TextRenderer for BDF"); return renderer; }
|
protected TextRenderer createTextRenderer(RenderCache renderCache, Font font) { final BDFFont bdfFont = (BDFFont) font; final TextRenderer renderer = new BDFTextRenderer(bdfFont.getContainer()); log.debug("created TextRenderer for BDF"); return renderer; }
| 2,780
|
protected GnuRSAKey(final BigInteger n, final BigInteger e) { super(); this.n = n; this.e = e; }
|
protected GnuRSAKey(int defaultFormat, BigInteger n, BigInteger e) { super(); this.n = n; this.e = e; }
| 2,781
|
public String getFormat() { return null; }
|
public String getFormat() { return KeyPairCodecFactory.getEncodingShortName(defaultFormat); }
| 2,783
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
| 2,784
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
| 2,785
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); exc.insert_Streamable(new streamReadyHolder(input)); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
| 2,786
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
|
private void p_invoke() throws SystemException { binaryReply response = submit(); ReplyHeader rh = response.header.create_reply_header(); cdrBufInput input = response.getStream(); input.setOrb(orb); rh.read(input); // The stream must be aligned sinve v1.2, but only once. boolean align = response.header.version.since_inclusive(1, 2); boolean moved_permanently = false; switch (rh.reply_status) { case ReplyHeader.NO_EXCEPTION : NamedValue arg; // Read return value, if set. if (m_result != null) { if (align) { input.align(8); align = false; } m_result.value().read_value(input, m_result.value().type()); } // Read returned parameters, if set. if (m_args != null) for (int i = 0; i < m_args.count(); i++) { try { arg = m_args.item(i); // Both ARG_INOUT and ARG_OUT have this binary flag set. if ((arg.flags() & ARG_OUT.value) != 0) { if (align) { input.align(8); align = false; } arg.value().read_value(input, arg.value().type()); } } catch (Bounds ex) { Unexpected.error(ex); } } break; case ReplyHeader.SYSTEM_EXCEPTION : if (align) { input.align(8); align = false; } SystemException exception = ObjectCreator.readSystemException(input); m_environment.exception(exception); throw exception; case ReplyHeader.USER_EXCEPTION : if (align) { input.align(8); align = false; } input.mark(2000); String uxId = input.read_string(); input.reset(); UserException uex = ObjectCreator.readUserException(uxId, input); if (uex == null) m_environment.exception(new UserException(uxId)); else m_environment.exception(uex); break; case ReplyHeader.LOCATION_FORWARD_PERM : case ReplyHeader.LOCATION_FORWARD : if (response.header.version.since_inclusive(1, 2)) input.align(8); IOR forwarded = new IOR(); try { forwarded._read_no_endian(input); } catch (IOException ex) { throw new MARSHAL(ex + " while reading the forwarding info"); } setIor(forwarded); // Repeat with the forwarded information. p_invoke(); return; default : throw new MARSHAL("Unknow reply status: " + rh.reply_status); } }
| 2,787
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { long pause = PAUSE_INITIAL; if (socket == null) { Open: for (int i = 0; i < PAUSE_STEPS; i++) { try { socket = new Socket(ior.Internet.host, ior.Internet.port); break Open; } catch (BindException ex) { try { System.gc(); Thread.sleep(pause); pause = pause * 2; if (pause > PAUSE_MAX) pause = PAUSE_MAX; } catch (InterruptedException iex) { } } } } if (socket == null) throw new NO_RESOURCES(ior.Internet.host + ":" + ior.Internet.port + " in use" ); socket.setKeepAlive(true); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
| 2,790
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n += socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
| 2,791
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
| 2,792
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException io_ex) { ex1.printStackTrace(); return null; } }
| 2,793
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { ex1.printStackTrace(); return null; } }
|
public synchronized binaryReply submit() { gnu.CORBA.GIOP.MessageHeader header = new gnu.CORBA.GIOP.MessageHeader(); // The byte order will be Big Endian by default. header.message_type = gnu.CORBA.GIOP.MessageHeader.REQUEST; header.version = useVersion(ior.Internet.version); RequestHeader rh = header.create_request_header(); rh.object_key = ior.key; rh.operation = m_operation; // Prepare the submission. cdrBufOutput request_part = new cdrBufOutput(); request_part.setOffset(header.getHeaderSize()); request_part.setVersion(header.version); request_part.setCodeSet(cxCodeSet.negotiate(ior.CodeSets)); request_part.setOrb(orb); // This also sets the stream encoding to the encoding, specified // in the header. rh.write(request_part); if (m_args != null && m_args.count() > 0) { write_parameters(header, request_part); if (m_parameter_buffer != null) throw new BAD_INV_ORDER("Please either add parameters or " + "write them into stream, but not both " + "at once." ); } if (m_parameter_buffer != null) { write_parameter_buffer(header, request_part); } // Now the message size is available. header.message_size = request_part.buffer.size(); try { Socket socket = new Socket(ior.Internet.host, ior.Internet.port); OutputStream socketOutput = socket.getOutputStream(); // Write the message header. header.write(socketOutput); // Write the request header and parameters (if present). request_part.buffer.writeTo(socketOutput); socketOutput.flush(); if (!socket.isClosed()) { MessageHeader response_header = new MessageHeader(); InputStream socketInput = socket.getInputStream(); response_header.read(socketInput); byte[] r = new byte[ response_header.message_size ]; int n = 0; reading: while (n < r.length) { n = socketInput.read(r, n, r.length - n); } socketInput.close(); return new binaryReply(orb, response_header, r); } else return EMPTY; } catch (IOException ex1) { return null; } }
| 2,794
|
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
|
public static SystemException readSystemException(InputStream input, ServiceContext[] contexts) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
| 2,796
|
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
|
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus completed = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
| 2,797
|
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
|
public static SystemException readSystemException(InputStream input) { String idl = input.read_string(); int minor = input.read_ulong(); CompletionStatus status = CompletionStatusHelper.read(input); SystemException exception = ObjectCreator.createSystemException(idl, minor, status); return exception; }
| 2,798
|
public static UserException readUserException(String idl, InputStream input) { try { String helper = toHelperName(idl); Class helperClass = Class.forName(helper); Method read = helperClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
|
public static UserException readUserException(String idl, InputStream input) { try { String helper = toHelperName(idl); Class helperClass = Class.forName(helper); Method read = helperClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
| 2,799
|
public static UserException readUserException(String idl, InputStream input) { try { String helper = toHelperName(idl); Class helperClass = Class.forName(helper); Method read = helperClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
|
public static UserException readUserException(String idl, InputStream input) { try { String helper = toHelperName(idl); Class helperClass = Class.forName(helper); Method read = helperClass.getMethod("read", new Class[] { org.omg.CORBA.portable.InputStream.class } ); return (UserException) read.invoke(null, new Object[] { input }); } catch (MARSHAL mex) { // This one is ok to throw throw mex; } catch (Exception ex) { ex.printStackTrace(); return null; } }
| 2,800
|
public void read(java.io.InputStream istream) throws MARSHAL { try { byte[] xMagic = new byte[ MAGIC.length ]; istream.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) throw new MARSHAL("Not a GIOP message"); version = Version.read_version(istream); abstractDataInputStream din; flags = (byte) istream.read(); // This checks the bit in the byte we have just received. if (isBigEndian()) din = new BigEndianInputStream(istream); else din = new LittleEndianInputStream(istream); message_type = (byte) din.read(); message_size = din.readInt(); } catch (IOException ex) { MARSHAL t = new MARSHAL(); t.initCause(ex); throw t; } }
|
public void read(java.io.InputStream istream) throws MARSHAL { try { byte[] xMagic = new byte[ MAGIC.length ]; istream.read(xMagic); if (!Arrays.equals(xMagic, MAGIC)) { MARSHAL m = new MARSHAL("Not a GIOP message"); m.minor = Minor.Giop; throw m; } version = Version.read_version(istream); abstractDataInputStream din; flags = (byte) istream.read(); // This checks the bit in the byte we have just received. if (isBigEndian()) din = new BigEndianInputStream(istream); else din = new LittleEndianInputStream(istream); message_type = (byte) din.read(); message_size = din.readInt(); } catch (IOException ex) { MARSHAL t = new MARSHAL(); t.initCause(ex); throw t; } }
| 2,802
|
public UnsatisfiedLinkError(String s) { super(s); }
|
public UnsatisfiedLinkError(String s) { super(s); }
| 2,804
|
public void checkRead(String filename) { checkPermission(new FilePermission(filename, "read")); }
|
public void checkRead(FileDescriptor desc) { checkPermission(new FilePermission(filename, "read")); }
| 2,805
|
public void checkRead(String filename) { checkPermission(new FilePermission(filename, "read")); }
|
public void checkRead(String filename) { if (desc == null) throw new NullPointerException(); checkPermission(new RuntimePermission("readFileDescriptor")); }
| 2,806
|
public static SortedMap availableCharsets () { TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER); for (Iterator i = provider ().charsets (); i.hasNext (); ) { Charset cs = (Charset) i.next (); charsets.put (cs.name (), cs); } return Collections.unmodifiableSortedMap (charsets); }
|
public static SortedMap availableCharsets() { TreeMap charsets = new TreeMap (String.CASE_INSENSITIVE_ORDER); for (Iterator i = provider ().charsets (); i.hasNext (); ) { Charset cs = (Charset) i.next (); charsets.put (cs.name (), cs); } return Collections.unmodifiableSortedMap (charsets); }
| 2,807
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.