rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
return 0; | return getAccessibleColumnAtIndex(index); | public int getAccessibleColumn(int index) { // TODO Auto-generated method stub return 0; } |
return 0; | return getColumnCount(); | public int getAccessibleColumnCount() { // TODO Auto-generated method stub return 0; } |
return null; | Accessible descr = null; if (columnDescriptions != null) descr = columnDescriptions[c]; return descr; | public Accessible getAccessibleColumnDescription(int c) { // TODO Auto-generated method stub return null; } |
return 0; | return 1; | public int getAccessibleColumnExtentAt(int r, int c) { // TODO Auto-generated method stub return 0; } |
return null; | JTableHeader h = getTableHeader(); AccessibleTable header = null; if (h != null) header = new AccessibleTableHeader(h); return header; | public AccessibleTable getAccessibleColumnHeader() { // TODO Auto-generated method stub return null; } |
return 0; | return getAccessibleIndexAt(r, c); | public int getAccessibleIndex(int r, int c) { // TODO Auto-generated method stub return 0; } |
return 0; | return getAccessibleRowAtIndex(index); | public int getAccessibleRow(int index) { // TODO Auto-generated method stub return 0; } |
return 0; | return getRowCount(); | public int getAccessibleRowCount() { // TODO Auto-generated method stub return 0; } |
return null; | Accessible descr = null; if (rowDescriptions != null) descr = rowDescriptions[r]; return descr; | public Accessible getAccessibleRowDescription(int r) { // TODO Auto-generated method stub return null; } |
return 0; | return 1; | public int getAccessibleRowExtentAt(int r, int c) { // TODO Auto-generated method stub return 0; } |
return null; | Accessible found = null; int[] selectedRows = getSelectedRows(); int[] selectedColumns = getSelectedColumns(); int numCols = getColumnCount(); int numRows = getRowCount(); if (getRowSelectionAllowed() && getColumnSelectionAllowed()) { int current = -1; int newIndex = current; int lastSelectedRow = -1; for (int j = 0; i < selectedRows.length; i++) { int selectedRow = selectedRows[j]; int r = -1; int ci = -1; for (r = lastSelectedRow + 1; r < selectedRow && current < i; r++) { for (ci = 0; ci < selectedColumns.length && current < i; ci++) { current++; } } if (current == i) { found = getAccessibleChild(r * numCols + selectedColumns[ci]); break; } if (current < i && current + numCols >= i) { found = getAccessibleChild(r * numCols + (i - current)); break; } current += numCols; } if (found == null) { int r = 0; int ci = 0; for (r = lastSelectedRow + 1; r < numRows && current < i; r++) { for (ci = 0; ci < selectedColumns.length && current < i; ci++) { current++; } } if (current == i) { found = getAccessibleChild(r * numCols + selectedColumns[ci]); } } } else if (getRowSelectionAllowed()) { int c = i % numCols; int r = selectedRows[i / numCols]; found = getAccessibleChild(r * numCols + c); } else if (getRowSelectionAllowed()) { int numSelectedColumns = selectedColumns.length; int c = selectedColumns[i % numSelectedColumns]; int r = i / numSelectedColumns; found = getAccessibleChild(r * numCols + c); } return found; | public Accessible getAccessibleSelection(int i) { // TODO Auto-generated method stub return null; } |
return null; | return summary; | public Accessible getAccessibleSummary() { // TODO Auto-generated method stub return null; } |
return null; | return getSelectedColumns(); | public int[] getSelectedAccessibleColumns() { // TODO Auto-generated method stub return null; } |
return null; | return getSelectedRows(); | public int[] getSelectedAccessibleRows() { // TODO Auto-generated method stub return null; } |
return false; | int r = getAccessibleRowAtIndex(i); int c = getAccessibleColumnAtIndex(i); return isCellSelected(r, c); | public boolean isAccessibleChildSelected(int i) { // TODO Auto-generated method stub return false; } |
return false; | return isColumnSelected(c); | public boolean isAccessibleColumnSelected(int c) { // TODO Auto-generated method stub return false; } |
return false; | return isRowSelected(r); | public boolean isAccessibleRowSelected(int r) { // TODO Auto-generated method stub return false; } |
return false; | return isCellSelected(r, c); | public boolean isAccessibleSelected(int r, int c) { // TODO Auto-generated method stub return false; } |
if (! getRowSelectionAllowed() && ! getColumnSelectionAllowed()) { int r = getAccessibleRowAtIndex(i); int c = getAccessibleColumnAtIndex(i); removeRowSelectionInterval(r, r); removeColumnSelectionInterval(c, c); } | public void removeAccessibleSelection(int i) { // TODO Auto-generated method stub } |
|
selectAll(); | public void selectAllAccessibleSelection() { // TODO Auto-generated method stub } |
|
public void setAccessibleCaption(Accessible caption) | public void setAccessibleCaption(Accessible c) | public void setAccessibleCaption(Accessible caption) { // TODO Auto-generated method stub } |
caption = c; | public void setAccessibleCaption(Accessible caption) { // TODO Auto-generated method stub } |
|
if (columnDescriptions == null) columnDescriptions = new Accessible[getAccessibleRowCount()]; columnDescriptions[c] = description; | public void setAccessibleColumnDescription(int c, Accessible description) { // TODO Auto-generated method stub } |
|
if (rowDescriptions == null) rowDescriptions = new Accessible[getAccessibleRowCount()]; rowDescriptions[r] = description; | public void setAccessibleRowDescription(int r, Accessible description) { // TODO Auto-generated method stub } |
|
public void setAccessibleSummary(Accessible summary) | public void setAccessibleSummary(Accessible s) | public void setAccessibleSummary(Accessible summary) { // TODO Auto-generated method stub } |
summary = s; | public void setAccessibleSummary(Accessible summary) { // TODO Auto-generated method stub } |
|
handleRowChange(event); | public void tableRowsDeleted(TableModelEvent event) { // TODO: What to do here, if anything? This might be a hook method for // subclasses... } |
|
handleRowChange(event); | public void tableRowsInserted(TableModelEvent event) { // TODO: What to do here, if anything? This might be a hook method for // subclasses... } |
|
firePropertyChange(AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY, Boolean.FALSE, Boolean.TRUE); int r = getSelectedRow(); int c = getSelectedColumn(); if (r != lastSelectedRow || c != lastSelectedColumn) { Accessible o = getAccessibleAt(lastSelectedRow, lastSelectedColumn); Accessible n = getAccessibleAt(r, c); firePropertyChange(AccessibleContext .ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, o, n); lastSelectedRow = r; lastSelectedColumn = c; } | public void valueChanged(ListSelectionEvent event) { // TODO Auto-generated method stub } |
|
setText(""); | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Icon) { Icon iconValue = (Icon) value; setIcon(iconValue); setText(""); } return this; } |
|
else { setIcon(null); } setText(""); | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (value instanceof Icon) { Icon iconValue = (Icon) value; setIcon(iconValue); setText(""); } return this; } |
|
if (isEditing()) editingCanceled(null); | public void columnMoved (TableColumnModelEvent event) { revalidate(); repaint(); } |
|
if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; | int idx0 = Math.max(0, Math.min(getColumnCount() - 1, event.getFirstIndex())); int idxn = Math.max(0, Math.min(getColumnCount() - 1, event.getLastIndex())); | public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); } |
for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); | int minRow = 0; int maxRow = getRowCount() - 1; if (getRowSelectionAllowed()) { minRow = selectionModel.getMinSelectionIndex(); maxRow = selectionModel.getMaxSelectionIndex(); int leadRow = selectionModel.getLeadSelectionIndex(); if (minRow == -1 && maxRow == -1) { minRow = leadRow; maxRow = leadRow; } else { if (leadRow != -1) { minRow = Math.min(minRow, leadRow); maxRow = Math.max(maxRow, leadRow); } } } if (minRow != -1 && maxRow != -1) { Rectangle first = getCellRect(minRow, idx0, false); Rectangle last = getCellRect(maxRow, idxn, false); Rectangle dirty = SwingUtilities.computeUnion(first.x, first.y, first.width, first.height, last); repaint(dirty); } | public void columnSelectionChanged (ListSelectionEvent event) { // Does not make sense for the table with the single column. if (getColumnCount() < 2) return; int x0 = 0; int idx0 = event.getFirstIndex(); int idxn = event.getLastIndex(); int i; for (i = 0; i < idx0; i++) x0 += columnModel.getColumn(i).getWidth(); int xn = x0; for (i = idx0; i <= idxn; i++) xn += columnModel.getColumn(i).getWidth(); repaint(x0, 0, xn-x0, getHeight()); } |
setDefaultEditor(Boolean.class, new DefaultCellEditor(box)); | box.setBorder(BorderFactory.createLineBorder(getGridColor(), 2)); box.setBorderPainted(true); booleanInvertingEditor = new DefaultCellEditor(box); setDefaultEditor(Boolean.class, booleanInvertingEditor); | protected void createDefaultEditors() { JCheckBox box = new BooleanCellRenderer().getCheckBox(); setDefaultEditor(Boolean.class, new DefaultCellEditor(box)); } |
repaint(); if (tableHeader!=null) tableHeader.repaint(); | int leftBoundary = getLeftResizingBoundary(); int width = getWidth() - leftBoundary; repaint(leftBoundary, 0, width, getHeight()); if (tableHeader != null) tableHeader.repaint(leftBoundary, 0, width, tableHeader.getHeight()); | public void doLayout() { TableColumn resizingColumn = null; int ncols = getColumnCount(); if (ncols < 1) return; int prefSum = 0; int rCol = -1; if (tableHeader != null) resizingColumn = tableHeader.getResizingColumn(); for (int i = 0; i < ncols; ++i) { TableColumn col = columnModel.getColumn(i); int p = col.getPreferredWidth(); prefSum += p; if (resizingColumn == col) rCol = i; } int spill = getWidth() - prefSum; if (resizingColumn != null) { TableColumn col; TableColumn [] cols; switch (getAutoResizeMode()) { case AUTO_RESIZE_LAST_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_NEXT_COLUMN: col = columnModel.getColumn(ncols-1); col.setWidth(col.getPreferredWidth() + spill); break; case AUTO_RESIZE_ALL_COLUMNS: cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpillResizing(cols, spill, resizingColumn); break; case AUTO_RESIZE_SUBSEQUENT_COLUMNS: // Subtract the width of the non-resized columns from the spill. int w = 0; int wp = 0; TableColumn column; for (int i = 0; i < rCol; i++) { column = columnModel.getColumn(i); w += column.getWidth(); wp+= column.getPreferredWidth(); } // The number of columns right from the column being resized. int n = ncols-rCol-1; if (n>0) { // If there are any columns on the right sied to resize. spill = (getWidth()-w) - (prefSum-wp); int average = spill / n; // For all columns right from the column being resized: for (int i = rCol+1; i < ncols; i++) { column = columnModel.getColumn(i); column.setWidth(column.getPreferredWidth() + average); } } resizingColumn.setWidth(resizingColumn.getPreferredWidth()); break; case AUTO_RESIZE_OFF: default: int prefWidth = resizingColumn.getPreferredWidth(); resizingColumn.setWidth(prefWidth); } } else { TableColumn [] cols = new TableColumn[ncols]; for (int i = 0; i < ncols; ++i) cols[i] = columnModel.getColumn(i); distributeSpill(cols, spill); } if (editorComp!=null) moveToCellBeingEdited(editorComp); // Repaint fixes the invalid view after the first keystroke if the cell // editing is started immediately after the program start or cell // resizing. repaint(); if (tableHeader!=null) tableHeader.repaint(); } |
setCellEditor(getCellEditor(row, column)); | setCellEditor(editor); | public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; } |
return true; | return editor.shouldSelectCell(null); } | public boolean editCellAt (int row, int column) { // Complete the previous editing session, if still active. if (isEditing()) editingStopped(new ChangeEvent("editingStopped")); editingRow = row; editingColumn = column; setCellEditor(getCellEditor(row, column)); editorComp = prepareEditor(cellEditor, row, column); // Remove the previous editor components, if present. Only one // editor component at time is allowed in the table. removeAll(); add(editorComp); moveToCellBeingEdited(editorComp); scrollRectToVisible(editorComp.getBounds()); editorComp.requestFocusInWindow(); return true; } |
if (accessibleContext == null) { AccessibleJTable ctx = new AccessibleJTable(); addPropertyChangeListener(ctx); TableColumnModel tcm = getColumnModel(); tcm.addColumnModelListener(ctx); tcm.getSelectionModel().addListSelectionListener(ctx); getSelectionModel().addListSelectionListener(ctx); accessibleContext = ctx; } | public AccessibleContext getAccessibleContext() { return accessibleContext; } |
|
int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; | Rectangle cellRect = new Rectangle(0, 0, 0, 0); | public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; } |
column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); | if (row >= getRowCount()) { cellRect.height = getHeight(); } else if (row >= 0) { cellRect.height = getRowHeight(row); if (rowHeights == null) cellRect.y = row * cellRect.height; else cellRect.y = rowHeights.getPosition(row); | public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; } |
int x = 0; int y = (height + y_gap) * row; | if (! includeSpacing) { int rMargin = getRowMargin(); cellRect.y += rMargin / 2; cellRect.height -= rMargin; } } | public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; } |
for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth(); | if (column < 0) { if (! getComponentOrientation().isLeftToRight()) { cellRect.x = getWidth(); } } else if (column >= getColumnCount()) { if (getComponentOrientation().isLeftToRight()) { cellRect.x = getWidth(); } } else { TableColumnModel tcm = getColumnModel(); if (getComponentOrientation().isLeftToRight()) { for (int i = 0; i < column; i++) cellRect.x += tcm.getColumn(i).getWidth(); } else { for (int i = tcm.getColumnCount() - 1; i > column; i--) cellRect.x += tcm.getColumn(i).getWidth(); } cellRect.width = tcm.getColumn(column).getWidth(); if (! includeSpacing) { int cMargin = tcm.getColumnMargin(); cellRect.x += cMargin / 2; cellRect.width -= cMargin; } } | public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; } |
Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; | return cellRect; | public Rectangle getCellRect(int row, int column, boolean includeSpacing) { int height = getRowHeight(row); int width = columnModel.getColumn(column).getWidth(); int x_gap = columnModel.getColumnMargin(); int y_gap = rowMargin; column = Math.max(0, Math.min(column, getColumnCount() - 1)); row = Math.max(0, Math.min(row, getRowCount() - 1)); int x = 0; int y = (height + y_gap) * row; for (int i = 0; i < column; ++i) x += columnModel.getColumn(i).getWidth(); Rectangle rect = new Rectangle(); if (includeSpacing) rect.setBounds(x, y, width, height +y_gap); else rect.setBounds(x, y, width - x_gap, height); return rect; } |
this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); | protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; } |
|
this.rowHeight = 16; | setRowHeight(16); | protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); this.columnModel.addColumnModelListener(this); this.defaultRenderersByColumnClass = new Hashtable(); createDefaultRenderers(); this.defaultEditorsByColumnClass = new Hashtable(); createDefaultEditors(); this.autoResizeMode = AUTO_RESIZE_SUBSEQUENT_COLUMNS; this.rowHeight = 16; this.rowMargin = 1; this.rowSelectionAllowed = true; // this.accessibleContext = new AccessibleJTable(); this.cellEditor = null; // COMPAT: Both Sun and IBM have drag enabled this.dragEnabled = true; this.preferredViewportSize = new Dimension(450,400); this.showHorizontalLines = true; this.showVerticalLines = true; this.editingColumn = -1; this.editingRow = -1; } |
int height = getRowHeight() + getRowMargin(); | int r; | public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; } |
int r = y / height; | public int rowAtPoint(Point point) { if (point != null) { int nrows = getRowCount(); int height = getRowHeight() + getRowMargin(); int y = point.y; int r = y / height; if (r < 0 || r >= nrows) return -1; else return r; } else return -1; } |
|
if (getRowCount() == 0 || getColumnCount() == 0) return; | public void selectAll() { // rowLead and colLead store the current lead selection indices int rowLead = selectionModel.getLeadSelectionIndex(); int colLead = getColumnModel().getSelectionModel().getLeadSelectionIndex(); // the following calls to setSelectionInterval change the lead selection // indices setColumnSelectionInterval(0, getColumnCount() - 1); setRowSelectionInterval(0, getRowCount() - 1); // the following addSelectionInterval calls restore the lead selection // indices to their previous values addColumnSelectionInterval(colLead,colLead); addRowSelectionInterval(rowLead, rowLead); } |
|
tableChanged(new TableModelEvent(dataModel, TableModelEvent.HEADER_ROW)); | public void setModel(TableModel m) { // Throw exception is m is null. if (m == null) throw new IllegalArgumentException(); // Don't do anything if setting the current model again. if (dataModel == m) return; TableModel oldModel = dataModel; // Remove table as TableModelListener from old model. if (dataModel != null) dataModel.removeTableModelListener(this); if (m != null) { // Set property. dataModel = m; // Add table as TableModelListener to new model. dataModel.addTableModelListener(this); // Automatically create columns. if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); } // This property is bound, so we fire a property change event. firePropertyChange("model", oldModel, dataModel); // Repaint table. revalidate(); repaint(); } |
|
rowHeights = null; | public void setRowHeight(int r) { if (r < 1) throw new IllegalArgumentException(); clientRowHeightSet = true; rowHeight = r; revalidate(); repaint(); } |
|
createDefaultEditors(); createDefaultRenderers(); | public void setUI(TableUI ui) { super.setUI(ui); } |
|
if (!isCellEditable(row, column)) return; | public void setValueAt(Object value, int row, int column) { if (!isCellEditable(row, column)) return; dataModel.setValueAt(value, row, convertColumnIndexToModel(column)); repaint(getCellRect(row, column, true)); } |
|
if (rowHeights != null) rowHeights.removeEntries(first, last - first + 1); | public void tableChanged (TableModelEvent event) { // update the column model from the table model if the structure has // changed and the flag autoCreateColumnsFromModel is set if ((event == null || (event.getFirstRow() == TableModelEvent.HEADER_ROW)) && autoCreateColumnsFromModel) createDefaultColumnsFromModel(); // If the structure changes, we need to revalidate, since that might // affect the size parameters of the JTable. Otherwise we only need // to perform a repaint to update the view. if (event == null || event.getType() == TableModelEvent.INSERT) { // Sync selection model with data model. if (event != null) { int first = event.getFirstRow(); if (first < 0) first = 0; int last = event.getLastRow(); if (last < 0) last = getRowCount() - 1; selectionModel.insertIndexInterval(first, last - first + 1, true); } revalidate(); } if (event == null || event.getType() == TableModelEvent.DELETE) { // Sync selection model with data model. if (event != null) { int first = event.getFirstRow(); if (first < 0) first = 0; int last = event.getLastRow(); if (last < 0) last = getRowCount() - 1; selectionModel.removeIndexInterval(first, last); } if (dataModel.getRowCount() == 0) clearSelection(); revalidate(); } repaint(); } |
|
if (getRowCount() < 2) return; | if (isEditing()) editingStopped(null); | public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); } |
int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); | int first = Math.max(0, Math.min(getRowCount() - 1, event.getFirstIndex())); int last = Math.max(0, Math.min(getRowCount() - 1, event.getLastIndex())); Rectangle rect1 = getCellRect(first, 0, false); Rectangle rect2 = getCellRect(last, getColumnCount() - 1, false); Rectangle dirty = SwingUtilities.computeUnion(rect2.x, rect2.y, rect2.width, rect2.height, rect1); repaint(dirty); | public void valueChanged (ListSelectionEvent event) { // Does not make sense for the table with the single row. if (getRowCount() < 2) return; int y_gap = rowMargin; int y0 = (getRowHeight() + y_gap) * (event.getFirstIndex()); int yn = (getRowHeight() + y_gap) * (event.getLastIndex()+1); repaint(0, y0, getWidth(), yn-y0); } |
north.requestFocus(); | public SwingTest(String title) { super(title); getRootPane().setDoubleBuffered(false); setLocation(100, 100); setSize(400, 400); getContentPane().add(north = new JButton("JButton north"), BorderLayout.NORTH); getContentPane().add(new JTextArea("JTextArea test"), BorderLayout.CENTER); getContentPane().add(south = new JButton("JButton south"), BorderLayout.SOUTH); } |
|
System.out.println("frame.size: " + getSize()); System.out.println("frame.insets: " + getInsets()); System.out.println("frame.peer.insets: " + ((FramePeer)getPeer()).getInsets()); System.out.println("frame.cp.bounds: " + getContentPane().getBounds()); System.out.println("north.bounds " + north.getBounds()); System.out.println("south.bounds " + south.getBounds()); | public void dumpInfo() { System.out.println("frame.size: " + getSize()); System.out.println("frame.insets: " + getInsets()); System.out.println("frame.peer.insets: " + ((FramePeer)getPeer()).getInsets()); System.out.println("frame.cp.bounds: " + getContentPane().getBounds()); System.out.println("north.bounds " + north.getBounds()); System.out.println("south.bounds " + south.getBounds()); } |
|
public InterruptedException() { super(); | public InterruptedException() { | public InterruptedException() { super(); } |
itemListener = new ItemHandler(); | public BasicMenuItemUI() { mouseInputListener = createMouseInputListener(menuItem); menuDragMouseListener = createMenuDragMouseListener(menuItem); menuKeyListener = createMenuKeyListener(menuItem); propertyChangeListener = new PropertyChangeHandler(); } |
|
menuItem.addItemListener(itemListener); | protected void installListeners() { menuItem.addMouseListener(mouseInputListener); menuItem.addMouseMotionListener(mouseInputListener); menuItem.addMenuDragMouseListener(menuDragMouseListener); menuItem.addMenuKeyListener(menuKeyListener); menuItem.addPropertyChangeListener(propertyChangeListener); } |
|
menuItem.removeItemListener(itemListener); | protected void uninstallListeners() { menuItem.removeMouseListener(mouseInputListener); menuItem.removeMenuDragMouseListener(menuDragMouseListener); menuItem.removeMenuKeyListener(menuKeyListener); menuItem.removePropertyChangeListener(propertyChangeListener); } |
|
attributes.put(RSAKeyPairGenerator.PREFERRED_ENCODING_FORMAT, new Integer(Registry.ASN1_ENCODING_ID)); | public void initialize(int keysize, SecureRandom random) { HashMap attributes = new HashMap(); attributes.put(RSAKeyPairGenerator.MODULUS_LENGTH, new Integer(keysize)); if (random != null) { attributes.put(RSAKeyPairGenerator.SOURCE_OF_RANDOMNESS, random); } adaptee.setup(attributes); } |
|
public boolean hasNext() { int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { return true; } } return false; | public boolean hasNext() { return HasNext; | public boolean hasNext() { int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { return true; } } return false; } |
boolean outofDataCells = true; | boolean outOfDataCells = true; HasNext = true; | public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; } |
outofDataCells = false; | outOfDataCells = false; | public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; } |
return !outofDataCells; | if (outOfDataCells) HasNext = false; return !outOfDataCells; | public boolean next() { boolean outofDataCells = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); if (index < axis.getLength()-1) { outofDataCells = false; index++; locations.put(axis, new Integer(index)); break; //get out of the for loop } locations.put(axis, new Integer(0)); } return !outofDataCells; } |
boolean outofDataCell = true; | boolean outOfDataCells = true; HasNext = true; | public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; } |
outofDataCell = false; | outOfDataCells = false; | public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; } |
return !outofDataCell; | if (outOfDataCells) HasNext = false; return !outOfDataCells; | public boolean prev() { boolean outofDataCell = true; int size = axisOrderList.size(); for (int i = 0; i < size ; i++) { AxisInterface axis = (AxisInterface) axisOrderList.get(i); int index = ((Integer) locations.get(axis)).intValue(); index--; if (index < 0) { locations.put(axis, new Integer(axis.getLength()-1)); } else { locations.put(axis, new Integer(index)); outofDataCell = false; break; //get out of the for loop } } return !outofDataCell; } |
getView(i).setParent(this); | getView(i).setParent(null); | public void setParent(View parent) { if (parent == null) { int numChildren = getViewCount(); for (int i = 0; i < numChildren; i++) getView(i).setParent(this); } this.parent = parent; } |
header = null; tagTable = null; | protected void finalize() { // XXX What resources should we free? } |
|
throw new Error("not implemented"); | int size = getSize(); byte[] data = new byte[size]; System.arraycopy(header.getData(size), 0, data, 0, ProfileHeader.HEADERSIZE); byte[] tt = getTagTable(); System.arraycopy(tt, 0, data, ProfileHeader.HEADERSIZE, tt.length); Enumeration e = tagTable.elements(); while (e.hasMoreElements()) { TagEntry tag = (TagEntry) e.nextElement(); System.arraycopy(tag.getData(), 0, data, tag.getOffset(), tag.getSize()); } return data; | public byte[] getData() { throw new Error("not implemented"); } |
throw new Error("not implemented"); | ProfileHeader header = new ProfileHeader(data); header.verifyHeader(data.length); Hashtable tags = createTagTable(data); if (isRGBProfile(header, tags)) return new ICC_ProfileRGB(data); if (isGrayProfile(header, tags)) return new ICC_ProfileGray(data); return new ICC_Profile(header, tags); | public static ICC_Profile getInstance(byte[] data) { throw new Error("not implemented"); } |
throw new Error("not implemented"); | return header.getMajorVersion(); | public int getMajorVersion() { throw new Error("not implemented"); } |
throw new Error("not implemented"); | return header.getMinorVersion(); | public int getMinorVersion() { throw new Error("not implemented"); } |
throw new Error("not implemented"); | return header.getProfileColorSpace(); | public int getPCSType() { throw new Error("not implemented"); } |
throw new Error("not implemented"); | return header.getProfileClass(); | public int getProfileClass() { throw new Error("not implemented"); } |
throw new Error("not implemented"); | s.defaultReadObject(); String predef = (String) s.readObject(); byte[] data = (byte[]) s.readObject(); if (data != null) { header = new ProfileHeader(data); tagTable = createTagTable(data); profileID = -1; } if (predef != null) { predef = predef.intern(); if (predef.equals("CS_sRGB")) createProfile(ColorSpace.CS_sRGB); if (predef.equals("CS_LINEAR_RGB")) createProfile(ColorSpace.CS_LINEAR_RGB); if (predef.equals("CS_CIEXYZ")) createProfile(ColorSpace.CS_CIEXYZ); if (predef.equals("CS_GRAY")) createProfile(ColorSpace.CS_GRAY); if (predef.equals("CS_PYCC")) createProfile(ColorSpace.CS_PYCC); } | private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { throw new Error("not implemented"); } |
throw new Error("not implemented"); | if (isRGBProfile(header, tagTable)) return new ICC_ProfileRGB(getData()); if (isGrayProfile(header, tagTable)) return new ICC_ProfileGray(getData()); return this; | protected Object readResolve() throws ObjectStreamException { throw new Error("not implemented"); } |
throw new Error("not implemented"); | profileID = -1; if (tagSignature == icSigHead) header = new ProfileHeader(data); else { TagEntry t = new TagEntry(tagSignature, data); tagTable.put(t.hashKey(), t); } | public void setData(int tagSignature, byte[] data) { throw new Error("not implemented"); } |
write(new FileOutputStream(filename)); | FileOutputStream out = new FileOutputStream(filename); write(out); out.flush(); out.close(); | public void write(String filename) throws IOException { write(new FileOutputStream(filename)); } |
throw new Error("not implemented"); | s.defaultWriteObject(); if (profileID == ColorSpace.CS_sRGB) s.writeObject("CS_sRGB"); else if (profileID == ColorSpace.CS_LINEAR_RGB) s.writeObject("CS_LINEAR_RGB"); else if (profileID == ColorSpace.CS_CIEXYZ) s.writeObject("CS_CIEXYZ"); else if (profileID == ColorSpace.CS_GRAY) s.writeObject("CS_GRAY"); else if (profileID == ColorSpace.CS_PYCC) s.writeObject("CS_PYCC"); else { s.writeObject(null); s.writeObject(getData()); return; } s.writeObject(null); | private void writeObject(ObjectOutputStream s) throws IOException { throw new Error("not implemented"); } |
System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length); | final int c_length = c_as_bytes.length; System.arraycopy(c_as_bytes, 0, buf, pos, c_length); pos += c_length; | public static String unquote(String str) throws MalformedURLException { if (str == null) return null; final int MAX_BYTES_PER_UTF_8_CHAR = 3; byte[] buf = new byte[str.length()*MAX_BYTES_PER_UTF_8_CHAR]; int pos = 0; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '%') { if (i + 2 >= str.length()) throw new MalformedURLException(str + " : Invalid quoted character"); int hi = Character.digit(str.charAt(++i), 16); int lo = Character.digit(str.charAt(++i), 16); if (lo < 0 || hi < 0) throw new MalformedURLException(str + " : Invalid quoted character"); buf[pos++] = (byte) (hi * 16 + lo); } else if (c > 127) { try { byte [] c_as_bytes = Character.toString(c).getBytes("utf-8"); System.arraycopy(c_as_bytes, 0, buf, pos, c_as_bytes.length); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } } else buf[pos++] = (byte) c; } try { return new String(buf, 0, pos, "utf-8"); } catch (java.io.UnsupportedEncodingException x2) { throw (Error) new InternalError().initCause(x2); } } |
internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); | protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); } |
|
frame.addVetoableChangeListener(internalFrameVetoableChangeListener); | protected void installListeners() { glassPaneDispatcher = createGlassPaneDispatcher(); createInternalFrameListener(); borderListener = createBorderListener(frame); componentListener = createComponentListener(); propertyChangeListener = createPropertyChangeListener(); internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener(); frame.addMouseListener(borderListener); frame.addMouseMotionListener(borderListener); frame.addInternalFrameListener(internalFrameListener); frame.addPropertyChangeListener(propertyChangeListener); frame.addVetoableChangeListener(internalFrameVetoableChangeListener); frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher); frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher); } |
|
throw new BAD_OPERATION(); | BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; | public static ServiceDetail extract(Any a) { try { return ((ServiceDetailHolder) a.extract_Streamable()).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } } |
ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList.size() > 0) list.add(childList); } | if (childStruct != null) { ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList != null && childList.size() > 0) { Iterator childIter = childList.iterator(); while (childIter.hasNext()) list.add(childIter.next()); } } } | protected ArrayList findAllChildHrefObjects () { ArrayList list = new ArrayList(); if (this instanceof Structure) { List arrayList = ((Structure) this).getArrayList(); synchronized (arrayList) { Iterator iter = arrayList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Array childArray = (Array) iter.next(); Href hrefObj = childArray.getDataCube().getHref(); if (hrefObj != null) list.add(hrefObj); } } // sychronized arrayList List structList = ((Structure) this).getStructList(); synchronized (structList) { Iterator iter = structList.iterator(); // Must be in synchronized block while (iter.hasNext()) { Structure childStruct = (Structure) iter.next(); ArrayList childList = childStruct.findAllChildHrefObjects(); if (childList.size() > 0) list.add(childList); } } // sychronized structList } return list; } |
public abstract void getInts(int memPtr, char[] dst, int dstOfs, int length); | public abstract void getInts(int memPtr, int[] dst, int dstOfs, int length); | public abstract void getInts(int memPtr, char[] dst, int dstOfs, int length); |
serverHostName = new String(tmp, "US-ASCII").trim(); | try { serverHostName = new String(tmp, "US-ASCII").trim(); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); } | public BOOTPHeader(SocketBuffer skbuf) { this.opcode = skbuf.get(0); this.hwType = skbuf.get(1); this.hopCount = skbuf.get(3); this.transactionID = skbuf.get32(4); this.secondsElapsed = skbuf.get16(8); this.flags = skbuf.get16(10); this.clientIPAddress = IPv4Address.readFrom(skbuf, 12); this.yourIPAddress = IPv4Address.readFrom(skbuf, 16); this.serverIPAddress = IPv4Address.readFrom(skbuf, 20); this.gatewayIPAddress = IPv4Address.readFrom(skbuf, 24); if (hwType == 1) { clientHwAddress = new EthernetAddress(skbuf, 28); } else { clientHwAddress = null; } byte[] tmp = new byte[128]; skbuf.get(tmp, 0, 32, 64); serverHostName = new String(tmp, "US-ASCII").trim(); skbuf.get(tmp, 0, 96, 128); bootFileName = new String(tmp, "US-ASCII").trim(); } |
bootFileName = new String(tmp, "US-ASCII").trim(); | try { bootFileName = new String(tmp, "US-ASCII").trim(); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); } | public BOOTPHeader(SocketBuffer skbuf) { this.opcode = skbuf.get(0); this.hwType = skbuf.get(1); this.hopCount = skbuf.get(3); this.transactionID = skbuf.get32(4); this.secondsElapsed = skbuf.get16(8); this.flags = skbuf.get16(10); this.clientIPAddress = IPv4Address.readFrom(skbuf, 12); this.yourIPAddress = IPv4Address.readFrom(skbuf, 16); this.serverIPAddress = IPv4Address.readFrom(skbuf, 20); this.gatewayIPAddress = IPv4Address.readFrom(skbuf, 24); if (hwType == 1) { clientHwAddress = new EthernetAddress(skbuf, 28); } else { clientHwAddress = null; } byte[] tmp = new byte[128]; skbuf.get(tmp, 0, 32, 64); serverHostName = new String(tmp, "US-ASCII").trim(); skbuf.get(tmp, 0, 96, 128); bootFileName = new String(tmp, "US-ASCII").trim(); } |
skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); | try { skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); } | public void prefixTo(SocketBuffer skbuf) { skbuf.insert(SIZE); skbuf.set(0, opcode); skbuf.set(1, hwType); skbuf.set(2, clientHwAddress.getLength()); skbuf.set(3, hopCount); skbuf.set32(4, transactionID); skbuf.set16(8, secondsElapsed); skbuf.set16(10, flags); if (clientIPAddress != null) { IPv4Address.writeTo(skbuf, 12, clientIPAddress); } if (yourIPAddress != null) { IPv4Address.writeTo(skbuf, 16, yourIPAddress); } if (serverIPAddress != null) { IPv4Address.writeTo(skbuf, 20, serverIPAddress); } if (gatewayIPAddress != null) { IPv4Address.writeTo(skbuf, 24, gatewayIPAddress); } if (clientHwAddress != null) { clientHwAddress.writeTo(skbuf, 28); } if (serverHostName != null) { skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); } if (bootFileName != null) { skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); } } |
skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); | try { skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); } catch(UnsupportedEncodingException ex) { throw new RuntimeException(ex); } | public void prefixTo(SocketBuffer skbuf) { skbuf.insert(SIZE); skbuf.set(0, opcode); skbuf.set(1, hwType); skbuf.set(2, clientHwAddress.getLength()); skbuf.set(3, hopCount); skbuf.set32(4, transactionID); skbuf.set16(8, secondsElapsed); skbuf.set16(10, flags); if (clientIPAddress != null) { IPv4Address.writeTo(skbuf, 12, clientIPAddress); } if (yourIPAddress != null) { IPv4Address.writeTo(skbuf, 16, yourIPAddress); } if (serverIPAddress != null) { IPv4Address.writeTo(skbuf, 20, serverIPAddress); } if (gatewayIPAddress != null) { IPv4Address.writeTo(skbuf, 24, gatewayIPAddress); } if (clientHwAddress != null) { clientHwAddress.writeTo(skbuf, 28); } if (serverHostName != null) { skbuf.set(32, serverHostName.getBytes("US-ASCII"), 0, serverHostName.length()); } if (bootFileName != null) { skbuf.set(96, bootFileName.getBytes("US-ASCII"), 0, bootFileName.length()); } } |
this.setUndecorated(true); this.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG); | public HeavyWeightPopup(Container c) { this.setContentPane(c); } |
|
public abstract XMLEventWriter createXMLEventWriter(Result result) | public abstract XMLEventWriter createXMLEventWriter(OutputStream stream) | public abstract XMLEventWriter createXMLEventWriter(Result result) throws XMLStreamException; |
public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) | public static XMLInputFactory newInstance() | public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); //return new gnu.xml.stream.XMLInputFactoryImpl(); throw new FactoryConfigurationError(); } |
ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); throw new FactoryConfigurationError(); | return newInstance(null, null); | public static XMLInputFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError { ClassLoader loader = classLoader; if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } if (loader == null) { loader = XMLInputFactory.class.getClassLoader(); } String className = null; int count = 0; do { className = getFactoryClassName(loader, count++); if (className != null) { try { Class t = (loader != null) ? loader.loadClass(className) : Class.forName(className); return (XMLInputFactory) t.newInstance(); } catch (ClassNotFoundException e) { className = null; } catch (Exception e) { throw new FactoryConfigurationError(e, "error instantiating class " + className); } } } while (className == null && count < 3); //return new gnu.xml.stream.XMLInputFactoryImpl(); throw new FactoryConfigurationError(); } |
enableEvents(AWTEvent.MOUSE_EVENT_MASK); | enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK); | public synchronized void addMouseMotionListener(MouseMotionListener listener) { mouseMotionListener = AWTEventMulticaster.add(mouseMotionListener, listener); if (mouseMotionListener != null) enableEvents(AWTEvent.MOUSE_EVENT_MASK); } |
if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE) | if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE && !ignoreFocus) | void dispatchEventImpl(AWTEvent e) { Event oldEvent = translateEvent (e); if (oldEvent != null) postEvent (oldEvent); if (eventTypeEnabled (e.id)) { // the trick we use to communicate between dispatch and redispatch // is to have KeyboardFocusManager.redispatch synchronize on the // object itself. we then do not redispatch to KeyboardFocusManager // if we are already holding the lock. if (! Thread.holdsLock(e)) { switch (e.id) { case WindowEvent.WINDOW_GAINED_FOCUS: case WindowEvent.WINDOW_LOST_FOCUS: case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: case FocusEvent.FOCUS_GAINED: case FocusEvent.FOCUS_LOST: if (KeyboardFocusManager .getCurrentKeyboardFocusManager() .dispatchEvent(e)) return; case MouseEvent.MOUSE_PRESSED: if (isLightweight()) requestFocus(); break; } } if (e.id != PaintEvent.PAINT && e.id != PaintEvent.UPDATE) processEvent(e); } if (peer != null) peer.handleEvent(e); } |
return (mouseListener != null || mouseMotionListener != null || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0); | return (mouseMotionListener != null || (eventMask & AWTEvent.MOUSE_MOTION_EVENT_MASK) != 0); | boolean eventTypeEnabled (int type) { if (type > AWTEvent.RESERVED_ID_MAX) return true; switch (type) { case ComponentEvent.COMPONENT_HIDDEN: case ComponentEvent.COMPONENT_MOVED: case ComponentEvent.COMPONENT_RESIZED: case ComponentEvent.COMPONENT_SHOWN: return (componentListener != null || (eventMask & AWTEvent.COMPONENT_EVENT_MASK) != 0); case KeyEvent.KEY_PRESSED: case KeyEvent.KEY_RELEASED: case KeyEvent.KEY_TYPED: return (keyListener != null || (eventMask & AWTEvent.KEY_EVENT_MASK) != 0); case MouseEvent.MOUSE_CLICKED: case MouseEvent.MOUSE_ENTERED: case MouseEvent.MOUSE_EXITED: case MouseEvent.MOUSE_PRESSED: case MouseEvent.MOUSE_RELEASED: case MouseEvent.MOUSE_MOVED: case MouseEvent.MOUSE_DRAGGED: return (mouseListener != null || mouseMotionListener != null || (eventMask & AWTEvent.MOUSE_EVENT_MASK) != 0); case FocusEvent.FOCUS_GAINED: case FocusEvent.FOCUS_LOST: return (focusListener != null || (eventMask & AWTEvent.FOCUS_EVENT_MASK) != 0); case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED: case InputMethodEvent.CARET_POSITION_CHANGED: return (inputMethodListener != null || (eventMask & AWTEvent.INPUT_METHOD_EVENT_MASK) != 0); case PaintEvent.PAINT: case PaintEvent.UPDATE: return (eventMask & AWTEvent.PAINT_EVENT_MASK) != 0; default: return false; } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.