bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
|
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke) keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
| 3,390
|
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
|
public static JTextComponent.KeyBinding[] makeKeyBindings( Object[] keyBindingList) { JTextComponent.KeyBinding[] retBindings = new JTextComponent.KeyBinding[keyBindingList.length / 2]; for (int i = 0; i < keyBindingList.length - 1; i+= 2) { KeyStroke stroke; if (keyBindingList[i] instanceof KeyStroke) stroke = (KeyStroke)keyBindingList[i]; else stroke = KeyStroke.getKeyStroke((String)keyBindingList[i]); retBindings[i/2] = new JTextComponent.KeyBinding(stroke, (String) keyBindingList[i+1]); } return retBindings; }
| 3,391
|
public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out); // listen to the keyboard this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker; // default to separate // threads for commands. aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT)); // ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); } }
|
public CommandShell(TextConsole cons) throws ShellException { try { this.console = cons; this.out = this.console.getOut(); this.err = this.console.getErr(); this.currentLine = new Line(console, this, out); // listen to the keyboard this.console.addKeyboardListener(this); defaultCommandInvoker = new DefaultCommandInvoker(this); threadCommandInvoker = new ThreadCommandInvoker(this); this.commandInvoker = threadCommandInvoker; // default to separate // threads for commands. aliasMgr = ((AliasManager) InitialNaming.lookup(AliasManager.NAME)) .createAliasManager(); AccessController.doPrivileged(new SetPropertyAction( PROMPT_PROPERTY_NAME, DEFAULT_PROMPT)); // ShellUtils.getShellManager().registerShell(this); } catch (NameNotFoundException ex) { throw new ShellException("Cannot find required resource", ex); } }
| 3,392
|
public void exit(){ exitted = true; console.close(); }
|
public void exit(){ exit0(); console.close(); }
| 3,393
|
protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
|
protected String prompt() { String prompt = (String) AccessController.doPrivileged( new GetPropertyAction(PROMPT_PROPERTY_NAME)); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
| 3,395
|
protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
|
protected String prompt() { String prompt = System.getProperty(PROMPT_PROPERTY_NAME); final StringBuffer result = new StringBuffer(); boolean commandMode = false; try { StringReader reader = new StringReader(prompt); int i; while ((i = reader.read()) != -1) { char c = (char) i; if (commandMode) { switch (c) { case 'P': result.append(new File( (String) AccessController .doPrivileged(new GetPropertyAction( "user.dir")))); break; case 'G': result.append("> "); break; case 'D': final Date now = new Date(); DateFormat.getDateTimeInstance().format(now, result, null); break; default: result.append(c); } commandMode = false; } else { switch (c) { case '$': commandMode = true; break; default: result.append(c); } } } } catch (Exception ioex) { // This should never occur log.error("Error in prompt()", ioex); } return result.toString(); }
| 3,396
|
public void start(boolean keepContent) { if (keepContent) { // we stay at the same position in X coordinate // only Y may have changed consoleY = console.getCursorY(); } else { consoleX = console.getCursorX(); consoleY = console.getCursorY(); setContent(""); console.setCursor( consoleX,consoleY);//move the cursor to the start of the line. } }
|
public void start(boolean keepContent) { if (keepContent) { // we stay at the same position in X coordinate // only Y may have changed consoleY = console.getCursorY(); } else { consoleX = console.getCursorX(); consoleY = console.getCursorY(); setContent(""); console.setCursor( consoleX,consoleY);//move the cursor to the start of the line. } }
| 3,398
|
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(reason, minor, completed); }
|
public UNKNOWN(String message) { super(reason, minor, completed); }
| 3,399
|
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(reason, minor, completed); }
|
UNKNOWN(String reason, int minor, CompletionStatus completed) { super(message, 0, CompletionStatus.COMPLETED_NO); }
| 3,400
|
final void lock() { AddressPcEntry p = list; int count = 0; while (p != null) { count++; p = p.next; } final int[] table = new int[count*2]; p = list; int i = 0; while (p != null) { table[i+0] = p.pc; table[i+1] = p.offset; i += 2; p = p.next; } this.table = table; this.list = null; }
|
final void lock() { AddressPcEntry p = list; int count = 0; while (p != null) { count++; p = p.next; } final int[] table = new int[count*2]; p = list; int i = 0; while (p != null) { table[i+0] = p.pc; table[i+1] = p.offset; i += 2; p = p.next; } this.table = table; this.list = null; }
| 3,401
|
public static Border getButtonBorder() { if (buttonBorder == null) { Border outer = new MetalButtonBorder(); Border inner = getMarginBorder(); buttonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return buttonBorder; }
|
public static Border getButtonBorder() { if (buttonBorder == null) { Border outer = new ButtonBorder(); Border inner = getMarginBorder(); buttonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return buttonBorder; }
| 3,402
|
static Border getToolbarButtonBorder() { if (toolbarButtonBorder == null) { Border outer = new MetalButtonBorder(); Border inner = new RolloverMarginBorder(); toolbarButtonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return toolbarButtonBorder; }
|
static Border getToolbarButtonBorder() { if (toolbarButtonBorder == null) { Border outer = new ButtonBorder(); Border inner = new RolloverMarginBorder(); toolbarButtonBorder = new BorderUIResource.CompoundBorderUIResource (outer, inner); } return toolbarButtonBorder; }
| 3,403
|
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Set character attributes like font-family, font-size, colors. Color foreground = view.getForeground(); g.setColor(foreground); Utilities.drawTabbedText(txt, bounds.x, bounds.y, g, tabEx, txt.offset); }
|
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Set character attributes like font-family, font-size, colors. Color foreground = view.getForeground(); g.setColor(foreground); Utilities.drawTabbedText(txt, bounds.x, bounds.y, g, tabEx, txt.offset); }
| 3,404
|
public float getPreferredSpan(int axis) { Element el = getElement(); checkPainter(); GlyphPainter painter = getGlyphPainter(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Figure out how to determine the x parameter. float span = painter.getSpan(this, el.getStartOffset(), el.getEndOffset(), tabEx, 0.F); return span; }
|
public float getPreferredSpan(int axis) { float span = 0; checkPainter(); GlyphPainter painter = getGlyphPainter(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Figure out how to determine the x parameter. float span = painter.getSpan(this, el.getStartOffset(), el.getEndOffset(), tabEx, 0.F); return span; }
| 3,406
|
public float getPreferredSpan(int axis) { Element el = getElement(); checkPainter(); GlyphPainter painter = getGlyphPainter(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Figure out how to determine the x parameter. float span = painter.getSpan(this, el.getStartOffset(), el.getEndOffset(), tabEx, 0.F); return span; }
|
public float getPreferredSpan(int axis) { Element el = getElement(); checkPainter(); GlyphPainter painter = getGlyphPainter(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; // FIXME: Figure out how to determine the x parameter. float span = painter.getSpan(this, el.getStartOffset(), el.getEndOffset(), tabEx, 0.F); return span; }
| 3,407
|
public TabExpander getTabExpander() { // TODO: Figure out if this is correct. TabExpander te = null; View parent = getParent(); if (parent instanceof ParagraphView) te = (ParagraphView) parent; return te; }
|
publicTabExpandergetTabExpander(){//TODO:Figureoutifthisiscorrect.TabExpanderte=null;Viewparent=getParent();if(parentinstanceofParagraphView)te=(ParagraphView)parent;returnte;}
| 3,408
|
public TabExpander getTabExpander() { // TODO: Figure out if this is correct. TabExpander te = null; View parent = getParent(); if (parent instanceof ParagraphView) te = (ParagraphView) parent; return te; }
|
public TabExpander getTabExpander() { // TODO: Figure out if this is correct. TabExpander te = null; View parent = getParent(); if (parent instanceof ParagraphView) te = (ParagraphView) parent; return te; }
| 3,409
|
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { // FIXME: not implemented return 0; }
|
public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { // FIXME: not implemented checkPainter(); GlyphPainter painter = getGlyphPainter(); return painter.viewToModel(this, x, y, a, b); }
| 3,410
|
public View getParent() { return parent; }
|
public View getParent() { return parent; }
| 3,411
|
public View getParent() { return parent; }
|
public View getParent() { return parent; }
| 3,412
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == SwingConstants.VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == SwingConstants.VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
| 3,413
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == SwingConstants.VERTICAL) return visibleRect.height * direction; else return visibleRect.width * direction; }
|
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { if (orientation == SwingConstants.VERTICAL) return visibleRect.height * direction; else { int rowHeight = getRowHeight(); if (rowHeight > 0) block = Math.max(rowHeight, (visibleRect.height / rowHeight) * rowHeight); else block = visibleRect.height; } return block; }
| 3,414
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int h = (rowHeight + rowMargin); int delta = h * direction; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // Completely expose the top row int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff; } return delta; // TODO when scrollng horizontally, scroll into the column boundary. }
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int h = (rowHeight + rowMargin); int delta = h * direction; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // Completely expose the top row int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff; } return delta; // TODO when scrollng horizontally, scroll into the column boundary. }
| 3,415
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int h = (rowHeight + rowMargin); int delta = h * direction; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // Completely expose the top row int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff; } return delta; // TODO when scrollng horizontally, scroll into the column boundary. }
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int h = (rowHeight + rowMargin); int delta = h * direction; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // Completely expose the top row int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff; } return delta; // TODO when scrollng horizontally, scroll into the column boundary. }
| 3,416
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int h = (rowHeight + rowMargin); int delta = h * direction; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // Completely expose the top row int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff; } return delta; // TODO when scrollng horizontally, scroll into the column boundary. }
|
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { int h = (rowHeight + rowMargin); int delta = h * direction; // Round so that the top would start from the row boundary if (orientation == SwingConstants.VERTICAL) { // Completely expose the top row int near = ((visibleRect.y + delta + h / 2) / h) * h; int diff = visibleRect.y + delta - near; delta -= diff; } } return unit; // TODO when scrollng horizontally, scroll into the column boundary. }
| 3,417
|
public void setColumnSelectionAllowed(boolean c) { getColumnModel().setColumnSelectionAllowed(c); repaint(); }
|
public void setColumnSelectionAllowed(boolean c) { if (columnModel.getColumnSelectionAllowed() != c) { columnModel.setColumnSelectionAllowed(c); firePropertyChange("columnSelectionAllowed", !c, c); repaint(); }
| 3,418
|
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) { rowHeights = null; if (getAutoCreateColumnsFromModel()) createDefaultColumnsFromModel(); resizeAndRepaint(); return; } // 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); if (rowHeights != null) rowHeights.insertEntries(first, last - first + 1, rowHeight); } 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 (rowHeights != null) rowHeights.removeEntries(first, last - first + 1); } if (dataModel.getRowCount() == 0) clearSelection(); revalidate(); } repaint(); }
|
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) { rowHeights = null; if (getAutoCreateColumnsFromModel()) createDefaultColumnsFromModel(); resizeAndRepaint(); return; } // 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); if (rowHeights != null) rowHeights.insertEntries(first, last - first + 1, rowHeight); } 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 (rowHeights != null) rowHeights.removeEntries(first, last - first + 1); } if (dataModel.getRowCount() == 0) clearSelection(); revalidate(); } repaint(); }
| 3,422
|
public TableCellRenderer getHeaderRenderer() { return headerRenderer; }
|
public TableCellRenderer getHeaderRenderer() { return headerRenderer; }
| 3,423
|
public Object getHeaderValue() { return headerValue; }
|
public Object getHeaderValue() { return headerValue; }
| 3,424
|
public int getFromIndex() { return fromIndex; } // getFromIndex()
|
public int getFromIndex() { return fromIndex; } // getFromIndex()
| 3,425
|
public int getFromIndex() { return fromIndex; } // getFromIndex()
|
public int getFromIndex() { return fromIndex; } // getFromIndex()
| 3,426
|
public int getToIndex() { return toIndex; } // getToIndex()
|
public int getToIndex() { return toIndex; } // getToIndex()
| 3,427
|
public int getToIndex() { return toIndex; } // getToIndex()
|
public int getToIndex() { return toIndex; } // getToIndex()
| 3,428
|
public static final DateFormat getDateInstance (int style) { return getDateInstance (style, Locale.getDefault()); }
|
public static final DateFormat getDateInstance () { return getDateInstance (style, Locale.getDefault()); }
| 3,429
|
public static final DateFormat getDateInstance (int style) { return getDateInstance (style, Locale.getDefault()); }
|
public static final DateFormat getDateInstance (int style) { return getDateInstance (DEFAULT, Locale.getDefault()); }
| 3,430
|
public int getModelIndex() { return modelIndex; }
|
public int getModelIndex() { return modelIndex; }
| 3,431
|
public void setHeaderValue(Object headerValue) { if (this.headerValue == headerValue) return; Object oldValue = this.headerValue; this.headerValue = headerValue; firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue); }
|
public void setHeaderValue(Object headerValue) { if (this.headerValue == headerValue) return; Object oldValue = this.headerValue; this.headerValue = headerValue; firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue); }
| 3,432
|
public void setHeaderValue(Object headerValue) { if (this.headerValue == headerValue) return; Object oldValue = this.headerValue; this.headerValue = headerValue; firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue); }
|
public void setHeaderValue(Object headerValue) { if (this.headerValue == headerValue) return; Object oldValue = this.headerValue; this.headerValue = headerValue; firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue); }
| 3,433
|
public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { changeSupport.addPropertyChangeListener(listener); }
|
public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { changeSupport.addPropertyChangeListener(listener); }
| 3,434
|
public TableColumn(int modelIndex) { this(modelIndex, 75, null, null); }
|
public TableColumn() { this(modelIndex, 75, null, null); }
| 3,435
|
public TableColumn(int modelIndex) { this(modelIndex, 75, null, null); }
|
public TableColumn(int modelIndex) { this(0, 75, null, null); }
| 3,436
|
public void setIdentifier(Object identifier) { this.identifier = identifier; }
|
public void setIdentifier(Object identifier) { this.identifier = identifier; }
| 3,437
|
public JTableHeader(TableColumnModel cm) { accessibleContext = new AccessibleJTableHeader(); columnModel = cm == null ? createDefaultColumnModel() : cm; draggedColumn = null; draggedDistance = 0; opaque = true; reorderingAllowed = true; resizingAllowed = true; resizingColumn = null; table = null; updateTableInRealTime = true; cellRenderer = createDefaultRenderer(); updateUI(); }
|
public JTableHeader() { accessibleContext = new AccessibleJTableHeader(); columnModel = cm == null ? createDefaultColumnModel() : cm; draggedColumn = null; draggedDistance = 0; opaque = true; reorderingAllowed = true; resizingAllowed = true; resizingColumn = null; table = null; updateTableInRealTime = true; cellRenderer = createDefaultRenderer(); updateUI(); }
| 3,438
|
public JTableHeader(TableColumnModel cm) { accessibleContext = new AccessibleJTableHeader(); columnModel = cm == null ? createDefaultColumnModel() : cm; draggedColumn = null; draggedDistance = 0; opaque = true; reorderingAllowed = true; resizingAllowed = true; resizingColumn = null; table = null; updateTableInRealTime = true; cellRenderer = createDefaultRenderer(); updateUI(); }
|
public JTableHeader(TableColumnModel cm) { accessibleContext = new AccessibleJTableHeader(); columnModel = cm == null ? createDefaultColumnModel() : cm; draggedColumn = null; draggedDistance = 0; opaque = true; reorderingAllowed = true; resizingAllowed = true; resizingColumn = null; table = null; updateTableInRealTime = true; cellRenderer = createDefaultRenderer(); updateUI(); }
| 3,439
|
public int getPreferredWidth() { return preferredWidth; }
|
public int getPreferredWidth() { return preferredWidth; }
| 3,440
|
public void setWidth(int newWidth) { int oldWidth = width; if (newWidth < minWidth) width = minWidth; else if (newWidth > maxWidth) width = maxWidth; else width = newWidth; if (width == oldWidth) return; firePropertyChange(COLUMN_WIDTH_PROPERTY, oldWidth, width); }
|
public void setWidth(int newWidth) { int oldWidth = width; if (newWidth < minWidth) width = minWidth; else if (newWidth > maxWidth) width = maxWidth; else width = newWidth; if (width == oldWidth) return; firePropertyChange("width", oldWidth, width); }
| 3,441
|
public TableCellEditor getCellEditor() { return cellEditor; }
|
public TableCellEditor getCellEditor() { return cellEditor; }
| 3,442
|
public int getPosition(int index) { // Variables int position; int loop; // Process Sizes position = 0; for (loop = 0; loop < index; loop++) { position += sizes[loop]; } // for // Return Position return position; } // getPosition()
|
public int getPosition(int index) { // Variables int position; int loop; // Process Sizes position = 0; for (loop = 0; loop < index; loop++) { position += sizes[loop]; } // for // Return Position return position; } // getPosition()
| 3,443
|
public int getPosition(int index) { // Variables int position; int loop; // Process Sizes position = 0; for (loop = 0; loop < index; loop++) { position += sizes[loop]; } // for // Return Position return position; } // getPosition()
|
public int getPosition(int index) { // Variables int position; int loop; // Process Sizes position = 0; for (loop = 0; loop < index; loop++) { position += sizes[loop]; } // for // Return Position return position; } // getPosition()
| 3,444
|
public int getPosition(int index) { // Variables int position; int loop; // Process Sizes position = 0; for (loop = 0; loop < index; loop++) { position += sizes[loop]; } // for // Return Position return position; } // getPosition()
|
public int getPosition(int index) { // Variables int position; int loop; // Process Sizes position = 0; for (loop = 0; loop < index; loop++) { position += sizes[loop]; return position; } // for // Return Position return position; return position; } // getPosition()
| 3,445
|
public TableCellRenderer getCellRenderer() { return cellRenderer; }
|
public TableCellRenderer getCellRenderer() { return cellRenderer; }
| 3,446
|
int getColumnIndex(Object columnIdentifier);
|
int getColumnIndex(Object columnIdentifier);
| 3,447
|
public int getSize(int index) { return sizes[index]; } // getSize()
|
public int getSize(int index) { return sizes[index]; } // getSize()
| 3,448
|
public void removeEntries(int start, int length) { // Variables int[] array; int index; int arrayIndex; // Sanity Check if ((start + length) > sizes.length) { throw new IllegalArgumentException("Specified start/length that " + "is greater than available sizes"); } // if // Create New Array array = new int[sizes.length - length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { index += length - 1; } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // removeEntries()
|
public void removeEntries(int start, int length) { // Variables int[] array; int index; int arrayIndex; // Sanity Check if ((start + length) > sizes.length) { throw new IllegalArgumentException("Specified start/length that " + "is greater than available sizes"); } // if // Create New Array array = new int[sizes.length - length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { index += length - 1; } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // removeEntries()
| 3,449
|
public void removeEntries(int start, int length) { // Variables int[] array; int index; int arrayIndex; // Sanity Check if ((start + length) > sizes.length) { throw new IllegalArgumentException("Specified start/length that " + "is greater than available sizes"); } // if // Create New Array array = new int[sizes.length - length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { index += length - 1; } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // removeEntries()
|
public void removeEntries(int start, int length) { // Variables int[] array; int index; int arrayIndex; // Sanity Check if ((start + length) > sizes.length) { throw new IllegalArgumentException("Specified start/length that " + "is greater than available sizes"); } // if // Create New Array array = new int[sizes.length - length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { index += length - 1; } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // removeEntries()
| 3,450
|
public void removeEntries(int start, int length) { // Variables int[] array; int index; int arrayIndex; // Sanity Check if ((start + length) > sizes.length) { throw new IllegalArgumentException("Specified start/length that " + "is greater than available sizes"); } // if // Create New Array array = new int[sizes.length - length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { index += length - 1; } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // removeEntries()
|
public void removeEntries(int start, int length) { // Variables int[] array; int index; int arrayIndex; // Sanity Check if ((start + length) > sizes.length) { throw new IllegalArgumentException("Specified start/length that " + "is greater than available sizes"); } // if // Create New Array array = new int[sizes.length - length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { index += length - 1; } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // removeEntries()
| 3,451
|
public void insertEntries(int start, int length, int value) { // Variables int[] array; int index; int arrayIndex; int loop; // Create New Array array = new int[sizes.length + length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { for (loop = 0; loop < length; loop++) { array[arrayIndex] = value; arrayIndex++; } // for } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // insertEntries()
|
public void insertEntries(int start, int length, int value) { // Variables int[] array; int index; int arrayIndex; int loop; // Create New Array array = new int[sizes.length + length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { for (loop = 0; loop < length; loop++) { array[arrayIndex] = value; arrayIndex++; } // for } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // insertEntries()
| 3,452
|
public void insertEntries(int start, int length, int value) { // Variables int[] array; int index; int arrayIndex; int loop; // Create New Array array = new int[sizes.length + length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { for (loop = 0; loop < length; loop++) { array[arrayIndex] = value; arrayIndex++; } // for } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // insertEntries()
|
public void insertEntries(int start, int length, int value) { // Variables int[] array; int index; int arrayIndex; int loop; // Create New Array array = new int[sizes.length + length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { for (loop = 0; loop < length; loop++) { array[arrayIndex] = value; arrayIndex++; } // for } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // insertEntries()
| 3,453
|
public void insertEntries(int start, int length, int value) { // Variables int[] array; int index; int arrayIndex; int loop; // Create New Array array = new int[sizes.length + length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { for (loop = 0; loop < length; loop++) { array[arrayIndex] = value; arrayIndex++; } // for } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // insertEntries()
|
public void insertEntries(int start, int length, int value) { // Variables int[] array; int index; int arrayIndex; int loop; // Create New Array array = new int[sizes.length + length]; arrayIndex = 0; for (index = 0; index < sizes.length; index++) { if (index == start) { for (loop = 0; loop < length; loop++) { array[arrayIndex] = value; arrayIndex++; } // for } else { array[arrayIndex] = sizes[index]; arrayIndex++; } // if } // for } // insertEntries()
| 3,454
|
public int getIndex(int position) { return 0; // TODO } // getIndex()
|
public int getIndex(int position) { return 0; // TODO } // getIndex()
| 3,455
|
public SizeSequence(int numEntries, int value) { insertEntries(0, numEntries, value); } // SizeSequence()
|
public SizeSequence(int numEntries, int value) { insertEntries(0, numEntries, value); } // SizeSequence()
| 3,456
|
public void setSize(int index, int size) { sizes[index] = size; } // setSize()
|
public void setSize(int index, int size) { sizes[index] = size; } // setSize()
| 3,457
|
public OptionGroup(String name) { this.name = name; }
|
OptionGroup() { this.name = name; }
| 3,458
|
public OptionGroup(String name) { this.name = name; }
|
public OptionGroup(String name) { }
| 3,459
|
public synchronized void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", result); }
|
public synchronized void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", result); }
| 3,460
|
public synchronized void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) logp(Level.FINER, sourceClass, sourceMethod, "RETURN {0}", result); }
|
public synchronized void exiting(String sourceClass, String sourceMethod, Object result) { if (isLoggable(Level.FINER)) logp(Level.FINER, sourceClass, sourceMethod, "RETURN"); }
| 3,461
|
void assignFrom(REMatch other) { start = other.start; end = other.end; index = other.index; // need to deep clone? next = other.next; empty = other.empty; }
|
void assignFrom(REMatch other) { start = other.start; end = other.end; index = other.index; // need to deep clone? next = other.next; }
| 3,462
|
public VerifyError(String s) { super(s); }
|
public VerifyError(String s) { super(s); }
| 3,464
|
Authenticator(){}
|
Authenticator(){}
| 3,465
|
getPasswordAuthentication(){ return(null);}
|
getPasswordAuthentication(){ return(null);}
| 3,466
|
protected final String getRequestingHost(){ return(host);}
|
protected final String getRequestingHost(){ return(host);}
| 3,467
|
getRequestingPort(){ return(port);}
|
getRequestingPort(){ return(port);}
| 3,468
|
getRequestingPrompt(){ return(prompt);}
|
getRequestingPrompt(){ return(prompt);}
| 3,469
|
getRequestingProtocol(){ return(protocol);}
|
getRequestingProtocol(){ return(protocol);}
| 3,470
|
getRequestingScheme(){ return(scheme);}
|
getRequestingScheme(){ return(scheme);}
| 3,471
|
getRequestingSite(){ return(addr);}
|
getRequestingSite(){ return(addr);}
| 3,472
|
requestPasswordAuthentication(InetAddress addr, int port, String protocol, String prompt, String scheme) throws SecurityException{ return(requestPasswordAuthentication (null, addr, port, protocol, prompt, scheme));}
|
requestPasswordAuthentication(InetAddress addr, int port, String protocol, String prompt, String scheme) throws SecurityException{ return(requestPasswordAuthentication (null, addr, port, protocol, prompt, scheme));}
| 3,473
|
requestPasswordAuthentication(InetAddress addr, int port, String protocol, String prompt, String scheme) throws SecurityException{ return(requestPasswordAuthentication (null, addr, port, protocol, prompt, scheme));}
|
requestPasswordAuthentication(InetAddress addr, int port, String protocol, String prompt, String scheme) throws SecurityException{ return(requestPasswordAuthentication (null, addr, port, protocol, prompt, scheme));}
| 3,474
|
setDefault(Authenticator def_auth){ SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new NetPermission("setDefaultAuthenticator")); default_authenticator = def_auth;}
|
setDefault(Authenticator def_auth){ SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new NetPermission("setDefaultAuthenticator")); default_authenticator = def_auth;}
| 3,475
|
setDefault(Authenticator def_auth){ SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new NetPermission("setDefaultAuthenticator")); default_authenticator = def_auth;}
|
setDefault(Authenticator def_auth){ SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new NetPermission("setDefaultAuthenticator")); default_authenticator = def_auth;}
| 3,476
|
public ClassNameArgument(String name, String description) { super(name, description); }
|
public ClassNameArgument(String name, String description) { super(name, description); }
| 3,479
|
public void actionPerformed(ActionEvent e) { // process the save transfer information button if (e.getActionCommand().equals("SAVE")) { saveXTFRInfo(); } // process the save transfer information button if (e.getActionCommand().equals("LOAD")) { loadXTFRInfo(); } if (e.getActionCommand().equals("XTFR") || e.getActionCommand().equals("EMAIL")) { saveXTFRFields(); if (e.getActionCommand().equals("EMAIL")) emailIt = true; else emailIt = false; initializeMonitor(); dialog.show(); if (useQuery.isSelected()) { axtfr.login(user.getText(), new String(password.getPassword())); // this will execute in it's own thread and will send a // fileInfoReceived(FTPStatusEvent statusevent) event when // finished without an error. axtfr.setDecimalChar(getDecimalChar()); axtfr.connect(systemName.getText()); } else { if (ftpProtocol.connect(systemName.getText(), 21)) { if (ftpProtocol .login( user.getText(), new String(password.getPassword()))) { // this will execute in it's own thread and will send a // fileInfoReceived(FTPStatusEvent statusevent) event when // finished without an error. ftpProtocol.setDecimalChar(getDecimalChar()); ftpProtocol.getFileInfo( hostFile.getText(), intDesc.isSelected()); } } else { disconnect(); } } } if (e.getActionCommand().equals("BROWSEPC")) { getPCFile(); } if (e.getActionCommand().equals("CUSTOMIZE")) { filter.getOutputFilterInstance().setCustomProperties(); } }
|
public void actionPerformed(ActionEvent e) { // process the save transfer information button if (e.getActionCommand().equals("SAVE")) { saveXTFRInfo(); } // process the save transfer information button if (e.getActionCommand().equals("LOAD")) { loadXTFRInfo(); } if (e.getActionCommand().equals("XTFR") || e.getActionCommand().equals("EMAIL")) { saveXTFRFields(); if (e.getActionCommand().equals("EMAIL")) emailIt = true; else emailIt = false; initializeMonitor(); dialog.show(); if (useQuery.isSelected()) { axtfr.login(user.getText(), new String(password.getPassword())); // this will execute in it's own thread and will send a // fileInfoReceived(FTPStatusEvent statusevent) event when // finished without an error. axtfr.setDecimalChar(getDecimalChar()); axtfr.connect(systemName.getText()); } else { if (ftpProtocol.connect(systemName.getText(), 21)) { if (ftpProtocol .login( user.getText(), new String(password.getPassword()))) { // this will execute in it's own thread and will send a // fileInfoReceived(FTPStatusEvent statusevent) event when // finished without an error. ftpProtocol.setDecimalChar(getDecimalChar()); ftpProtocol.getFileInfo( hostFile.getText(), intDesc.isSelected()); } } else { disconnect(); } } } if (e.getActionCommand().equals("BROWSEPC")) { getPCFile(); } if (e.getActionCommand().equals("CUSTOMIZE")) { filter.getOutputFilterInstance().setCustomProperties(); } }
| 3,480
|
private void initXTFRInfo(Properties XTFRProps) { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); Border emptyBorder = BorderFactory.createEmptyBorder(10, 10, 0, 10); // main panel JPanel mp = new JPanel(); mp.setLayout(borderLayout); // system panel JPanel sp = new JPanel(); sp.setLayout(new BorderLayout()); sp.setBorder(emptyBorder); // host panel for as400 as400p = new JPanel(); as400p.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelAS400"))); as400p.setLayout(new GridBagLayout()); JLabel snpLabel = new JLabel(LangTool.getString("xtfr.labelSystemName")); systemName = new JTextField(vt.getHostName()); systemName.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy =0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(snpLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(systemName,gbc); JLabel hfnpLabel = new JLabel(LangTool.getString("xtfr.labelHostFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(hfnpLabel, gbc); hostFile = new JTextField(); hostFile.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(hostFile, gbc); JLabel idpLabel = new JLabel(LangTool.getString("xtfr.labelUserId")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(idpLabel, gbc); user = new JTextField(); user.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(user, gbc); // password panel JLabel pwpLabel = new JLabel(LangTool.getString("xtfr.labelPassword")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(pwpLabel, gbc); password = new JPasswordField(); password.setColumns(15); password.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { txtONKeyPressed(evt); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(password, gbc); // Query Wizard useQuery = new JCheckBox(LangTool.getString("xtfr.labelUseQuery")); useQuery.addItemListener(this); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(useQuery, gbc); //query button queryWizard = new JButton(LangTool.getString("xtfr.labelQueryWizard")); queryWizard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startWizard(); } }); queryWizard.setEnabled(false); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(queryWizard, gbc); // Field Selection panel fieldsLabel = new JLabel(LangTool.getString("xtfr.labelFields")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(fieldsLabel, gbc); allFields = new JRadioButton(LangTool.getString("xtfr.labelAllFields")); allFields.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(allFields, gbc); selectedFields = new JRadioButton(LangTool.getString("xtfr.labelSelectedFields")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 10); as400p.add(selectedFields, gbc); ButtonGroup fieldGroup = new ButtonGroup(); fieldGroup.add(allFields); fieldGroup.add(selectedFields); // Field Text Description panel textDescLabel = new JLabel(LangTool.getString("xtfr.labelTxtDesc")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 6; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(textDescLabel, gbc); txtDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescFull")); txtDesc.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 5); as400p.add(txtDesc, gbc); intDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescInt")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 10); as400p.add(intDesc, gbc); ButtonGroup txtDescGroup = new ButtonGroup(); txtDescGroup.add(txtDesc); txtDescGroup.add(intDesc); // pc panel for pc information JPanel pcp = new JPanel(new GridBagLayout()); pcp.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelpc"))); JLabel pffLabel = new JLabel(LangTool.getString("xtfr.labelFileFormat")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pffLabel, gbc); fileFormat = new JComboBox(); fileFormat.setPreferredSize(new Dimension(220, 25)); fileFormat.addItem(htmlFilter.getDescription()); fileFormat.addItem(OOFilter.getDescription()); fileFormat.addItem(ExcelFilter.getDescription()); fileFormat.addItem(KSpreadFilter.getDescription()); fileFormat.addItem(DelimitedFilter.getDescription()); fileFormat.addItem(FixedWidthFilter.getDescription()); fileFormat.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); filter = getFilterByDescription(); if (filter.getOutputFilterInstance().isCustomizable()) customize.setEnabled(true); else customize.setEnabled(false); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(fileFormat, gbc); customize = new JButton(LangTool.getString("xtfr.labelCustomize")); customize.setPreferredSize(new Dimension(110, 25)); customize.setActionCommand("CUSTOMIZE"); customize.addActionListener(this); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(customize, gbc); // now make sure we set the customizable button enabled or not // depending on the filter. fileFormat.setSelectedIndex(0); JLabel pcpLabel = new JLabel(LangTool.getString("xtfr.labelPCFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pcpLabel, gbc); localFile = new JTextField(); localFile.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(localFile, gbc); JButton browsePC = new JButton(LangTool.getString("xtfr.labelPCBrowse")); browsePC.setActionCommand("BROWSEPC"); browsePC.addActionListener(this); browsePC.setPreferredSize(new Dimension(110, 25)); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(browsePC, gbc); decimalSeparator = new JComboBox(); decimalSeparator.setPreferredSize(new Dimension(220, 25)); decimalSeparator.addItem(LangTool.getString("xtfr.period")); decimalSeparator.addItem(LangTool.getString("xtfr.comma")); // obtain the decimal separator for the machine locale DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.getDefault()); if (formatter.getDecimalFormatSymbols().getDecimalSeparator() == '.') decimalSeparator.setSelectedIndex(0); else decimalSeparator.setSelectedIndex(1); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 10, 5); pcp.add(new JLabel(LangTool.getString("xtfr.labelDecimal")), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 5, 5); pcp.add(decimalSeparator, gbc); sp.add(as400p, BorderLayout.NORTH); sp.add(pcp, BorderLayout.SOUTH); // options panel JPanel op = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); xtfrButton = new JButton(LangTool.getString("xtfr.labelXTFR")); xtfrButton.addActionListener(this); xtfrButton.setActionCommand("XTFR"); op.add(xtfrButton); JButton emailButton = new JButton(LangTool.getString("xtfr.labelXTFREmail")); emailButton.addActionListener(this); emailButton.setActionCommand("EMAIL"); op.add(emailButton); // add transfer save information button JButton saveButton = new JButton(LangTool.getString("xtfr.labelXTFRSave")); saveButton.addActionListener(this); saveButton.setActionCommand("SAVE"); op.add(saveButton); // add transfer load information button JButton loadButton = new JButton(LangTool.getString("xtfr.labelXTFRLoad")); loadButton.addActionListener(this); loadButton.setActionCommand("LOAD"); op.add(loadButton); mp.add(sp, BorderLayout.CENTER); mp.add(op, BorderLayout.SOUTH); this.getContentPane().add(mp, BorderLayout.CENTER); // this.setModal(false); // this.setModal(true); this.setTitle(LangTool.getString("xtfr.title")); //QueryPanel when Use Query selected as400QueryP = new JPanel(); as400QueryP.setLayout(new BorderLayout()); queryStatement = new JTextArea(2, 40); JScrollPane scrollPane = new JScrollPane(queryStatement); queryStatement.setLineWrap(true); as400QueryP.add(scrollPane, BorderLayout.CENTER); initXTFRFields(XTFRProps); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation( (screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); }
|
private void initXTFRInfo(Properties XTFRProps) { // create some reusable borders and layouts BorderLayout borderLayout = new BorderLayout(); Border emptyBorder = BorderFactory.createEmptyBorder(10, 10, 0, 10); // main panel JPanel mp = new JPanel(); mp.setLayout(borderLayout); // system panel JPanel sp = new JPanel(); sp.setLayout(new BorderLayout()); sp.setBorder(emptyBorder); // host panel for as400 as400p = new JPanel(); as400p.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelAS400"))); as400p.setLayout(new GridBagLayout()); JLabel snpLabel = new JLabel(LangTool.getString("xtfr.labelSystemName")); systemName = new JTextField(vt.getHostName()); systemName.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy =0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(snpLabel, gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(systemName,gbc); JLabel hfnpLabel = new JLabel(LangTool.getString("xtfr.labelHostFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(hfnpLabel, gbc); hostFile = new JTextField(); hostFile.setColumns(30); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.gridwidth = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 10); as400p.add(hostFile, gbc); JLabel idpLabel = new JLabel(LangTool.getString("xtfr.labelUserId")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(idpLabel, gbc); user = new JTextField(); user.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(user, gbc); // password panel JLabel pwpLabel = new JLabel(LangTool.getString("xtfr.labelPassword")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(pwpLabel, gbc); password = new JPasswordField(); password.setColumns(15); password.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { txtONKeyPressed(evt); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 3; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 5, 5, 5); as400p.add(password, gbc); // Query Wizard useQuery = new JCheckBox(LangTool.getString("xtfr.labelUseQuery")); useQuery.addItemListener(this); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(useQuery, gbc); //query button queryWizard = new JButton(LangTool.getString("xtfr.labelQueryWizard")); queryWizard.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startWizard(); } }); queryWizard.setEnabled(false); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 4; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(queryWizard, gbc); // Field Selection panel fieldsLabel = new JLabel(LangTool.getString("xtfr.labelFields")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 5; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(fieldsLabel, gbc); allFields = new JRadioButton(LangTool.getString("xtfr.labelAllFields")); allFields.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 5); as400p.add(allFields, gbc); selectedFields = new JRadioButton(LangTool.getString("xtfr.labelSelectedFields")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 5; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 0, 10); as400p.add(selectedFields, gbc); ButtonGroup fieldGroup = new ButtonGroup(); fieldGroup.add(allFields); fieldGroup.add(selectedFields); // Field Text Description panel textDescLabel = new JLabel(LangTool.getString("xtfr.labelTxtDesc")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 6; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); as400p.add(textDescLabel, gbc); txtDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescFull")); txtDesc.setSelected(true); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 5); as400p.add(txtDesc, gbc); intDesc = new JRadioButton(LangTool.getString("xtfr.labelTxtDescInt")); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 6; gbc.anchor = GridBagConstraints.CENTER; gbc.insets = new Insets(0, 5, 5, 10); as400p.add(intDesc, gbc); ButtonGroup txtDescGroup = new ButtonGroup(); txtDescGroup.add(txtDesc); txtDescGroup.add(intDesc); // pc panel for pc information JPanel pcp = new JPanel(new GridBagLayout()); pcp.setBorder( BorderFactory.createTitledBorder( LangTool.getString("xtfr.labelpc"))); JLabel pffLabel = new JLabel(LangTool.getString("xtfr.labelFileFormat")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pffLabel, gbc); fileFormat = new JComboBox(); fileFormat.setPreferredSize(new Dimension(220, 25)); fileFormat.addItem(htmlFilter.getDescription()); fileFormat.addItem(OOFilter.getDescription()); fileFormat.addItem(ExcelFilter.getDescription()); fileFormat.addItem(KSpreadFilter.getDescription()); fileFormat.addItem(DelimitedFilter.getDescription()); fileFormat.addItem(FixedWidthFilter.getDescription()); fileFormat.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); filter = getFilterByDescription(); if (filter.getOutputFilterInstance().isCustomizable()) customize.setEnabled(true); else customize.setEnabled(false); } }); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(fileFormat, gbc); customize = new JButton(LangTool.getString("xtfr.labelCustomize")); customize.setPreferredSize(new Dimension(110, 25)); customize.setActionCommand("CUSTOMIZE"); customize.addActionListener(this); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 0; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(customize, gbc); // now make sure we set the customizable button enabled or not // depending on the filter. fileFormat.setSelectedIndex(0); JLabel pcpLabel = new JLabel(LangTool.getString("xtfr.labelPCFile")); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 5, 5); pcp.add(pcpLabel, gbc); localFile = new JTextField(); localFile.setColumns(15); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 5); pcp.add(localFile, gbc); JButton browsePC = new JButton(LangTool.getString("xtfr.labelPCBrowse")); browsePC.setActionCommand("BROWSEPC"); browsePC.addActionListener(this); browsePC.setPreferredSize(new Dimension(110, 25)); gbc = new GridBagConstraints(); gbc.gridx = 2; gbc.gridy = 1; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 0, 10); pcp.add(browsePC, gbc); decimalSeparator = new JComboBox(); decimalSeparator.setPreferredSize(new Dimension(220, 25)); decimalSeparator.addItem(LangTool.getString("xtfr.period")); decimalSeparator.addItem(LangTool.getString("xtfr.comma")); // obtain the decimal separator for the machine locale DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.getDefault()); if (formatter.getDecimalFormatSymbols().getDecimalSeparator() == '.') decimalSeparator.setSelectedIndex(0); else decimalSeparator.setSelectedIndex(1); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.insets = new Insets(5, 10, 10, 5); pcp.add(new JLabel(LangTool.getString("xtfr.labelDecimal")), gbc); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 2; gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.insets = new Insets(0, 5, 5, 5); pcp.add(decimalSeparator, gbc); sp.add(as400p, BorderLayout.NORTH); sp.add(pcp, BorderLayout.SOUTH); // options panel JPanel op = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 10)); xtfrButton = new JButton(LangTool.getString("xtfr.labelXTFR")); xtfrButton.addActionListener(this); xtfrButton.setActionCommand("XTFR"); op.add(xtfrButton); JButton emailButton = new JButton(LangTool.getString("xtfr.labelXTFREmail")); emailButton.addActionListener(this); emailButton.setActionCommand("EMAIL"); op.add(emailButton); // add transfer save information button JButton saveButton = new JButton(LangTool.getString("xtfr.labelXTFRSave")); saveButton.addActionListener(this); saveButton.setActionCommand("SAVE"); op.add(saveButton); // add transfer load information button JButton loadButton = new JButton(LangTool.getString("xtfr.labelXTFRLoad")); loadButton.addActionListener(this); loadButton.setActionCommand("LOAD"); op.add(loadButton); mp.add(sp, BorderLayout.CENTER); mp.add(op, BorderLayout.SOUTH); this.getContentPane().add(mp, BorderLayout.CENTER); // this.setModal(false); // this.setModal(true); this.setTitle(LangTool.getString("xtfr.title")); //QueryPanel when Use Query selected as400QueryP = new JPanel(); as400QueryP.setLayout(new BorderLayout()); queryStatement = new JTextArea(2, 40); JScrollPane scrollPane = new JScrollPane(queryStatement); queryStatement.setLineWrap(true); as400QueryP.add(scrollPane, BorderLayout.CENTER); initXTFRFields(XTFRProps); // pack it and center it on the screen pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) frameSize.height = screenSize.height; if (frameSize.width > screenSize.width) frameSize.width = screenSize.width; setLocation( (screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); // now show the world what we can do show(); }
| 3,481
|
private void txtONKeyPressed(java.awt.event.KeyEvent evt) { if (evt.getKeyCode() == evt.VK_ENTER) { xtfrButton.doClick(); } }
|
private void txtONKeyPressed(java.awt.event.KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ENTER) { xtfrButton.doClick(); } }
| 3,482
|
public boolean connect(String host) { connection = null; hostName = host.toUpperCase(); try { printFTPInfo("Connecting to " + hostName); Driver driver2 = (Driver)Class.forName("com.ibm.as400.access.AS400JDBCDriver").newInstance(); DriverManager.registerDriver(driver2); // Get a connection to the database. Since we do not // provide a user id or password, a prompt will appear. // modified the connection string to add the translate binary = true // as suggested from Luca connection = DriverManager.getConnection ("jdbc:as400://" + hostName + ";decimal separator=" + decChar + ";extended metadata=true;translate binary=true", user,pass); printFTPInfo("jdbc:as400://" + hostName + ";decimal separator=" + decChar ); fireInfoEvent(); printFTPInfo("Connected to " + hostName); return true; } catch (NoClassDefFoundError ncdf) { printFTPInfo("Error: JDBC Driver not found. Please check classpath." ); } catch (Exception e) {// JOptionPane.showMessageDialog(this,// "Error: " + e.getMessage() + "\n\n" +// "There was an error connecting to host "// + system.toUpperCase() +// "\n\nPlease make sure that you run " +// "the command STRHOSTSVR",// "Host connection error",// JOptionPane.ERROR_MESSAGE); printFTPInfo("Error: " + e.getMessage() + "\n\n" + "There was an error connecting to host " + host.toUpperCase() + "\n\nPlease make sure that you run " + "the command STRHOSTSVR"); System.out.println ( "Exception while retrieving data : " + e.getMessage()); } return false; }
|
public boolean connect(String host) { connection = null; hostName = host.toUpperCase(); try { printFTPInfo("Connecting to " + hostName); Driver driver2 = (Driver)Class.forName("com.ibm.as400.access.AS400JDBCDriver").newInstance(); DriverManager.registerDriver(driver2); // Get a connection to the database. Since we do not // provide a user id or password, a prompt will appear. // modified the connection string to add the translate binary = true // as suggested from Luca connection = DriverManager.getConnection ("jdbc:as400://" + hostName + ";decimal separator=" + decChar + ";extended metadata=true;translate binary=true", user,pass); printFTPInfo("jdbc:as400://" + hostName + ";decimal separator=" + decChar ); fireInfoEvent(); printFTPInfo("Connected to " + hostName); return true; } catch (NoClassDefFoundError ncdf) { printFTPInfo("Error: JDBC Driver not found. Please check classpath." ); } catch (Exception e) {// JOptionPane.showMessageDialog(this,// "Error: " + e.getMessage() + "\n\n" +// "There was an error connecting to host "// + system.toUpperCase() +// "\n\nPlease make sure that you run " +// "the command STRHOSTSVR",// "Host connection error",// JOptionPane.ERROR_MESSAGE); printFTPInfo("Error: " + e.getMessage() + "\n\n" + "There was an error connecting to host " + host.toUpperCase() + "\n\nPlease make sure that you run " + "the command STRHOSTSVR"); System.out.println ( "Exception while retrieving data : " + e.getMessage()); } return false; }
| 3,483
|
public JProgressBar(int minimum, int maximum) { this(HORIZONTAL, minimum, maximum); }
|
public JProgressBar() { this(HORIZONTAL, minimum, maximum); }
| 3,484
|
public JProgressBar(int minimum, int maximum) { this(HORIZONTAL, minimum, maximum); }
|
public JProgressBar(int minimum, int maximum) { this(HORIZONTAL, 0, 100); }
| 3,485
|
public void setRows(int rows) { if (rows < 0) throw new IllegalArgumentException(); this.rows = rows; }
|
public void setRows(int rows) { if (rows < 0) throw new IllegalArgumentException(); if (rows != this.rows) { this.rows = rows; revalidate(); } }
| 3,486
|
protected boolean getFile(String remoteFile, String localFile) { boolean flag = true; if(ftpOutputStream == null) { printFTPInfo("Not connected to any server!"); return false; } if(!loggedIn) { printFTPInfo("Login was not successful! Aborting!"); return false; } final String localFileF = localFile; final String remoteFileF = remoteFile; Runnable getRun = new Runnable () { // set the thread to run. public void run() { Socket socket = null; DataInputStream datainputstream = null; String localFileFull = localFileF; executeCommand("TYPE","I"); try { socket = createPassiveSocket("RETR " + remoteFileF); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); writeHeader(localFileFull); byte abyte0[] = new byte[recordLength]; StringBuffer rb = new StringBuffer(recordOutLength); int c = 0; int kj = 0; int len = 0; for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == recordLength) { rb.setLength(0); parseFFD(abyte0,rb); len =0; status.setCurrentRecord(c / recordLength); fireStatusEvent(); } getThread.yield(); // if ((c / recordLength) == 200) // aborted = true; } System.out.println(c); if (c == 0) { status.setCurrentRecord(c); fireStatusEvent(); } else { if (!aborted) parseResponse(); } writeFooter();// parseResponse(); printFTPInfo("Transfer complete!"); } } catch(InterruptedIOException iioe) { printFTPInfo("Interrupted! " + iioe.getMessage()); } catch(Exception _ex) { printFTPInfo("Error! " + _ex); } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } try { writeFooter(); } catch(Exception _ex) { } disconnect(); } } }; getThread = new Thread(getRun); getThread.setPriority(2); getThread.start(); return flag; }
|
protected boolean getFile(String remoteFile, String localFile) { boolean flag = true; if(ftpOutputStream == null) { printFTPInfo("Not connected to any server!"); return false; } if(!loggedIn) { printFTPInfo("Login was not successful! Aborting!"); return false; } final String localFileF = localFile; final String remoteFileF = remoteFile; Runnable getRun = new Runnable () { // set the thread to run. public void run() { Socket socket = null; DataInputStream datainputstream = null; String localFileFull = localFileF; executeCommand("TYPE","I"); try { socket = createPassiveSocket("RETR " + remoteFileF); if(socket != null) { datainputstream = new DataInputStream(socket.getInputStream()); writeHeader(localFileFull); byte abyte0[] = new byte[recordLength]; StringBuffer rb = new StringBuffer(recordOutLength); int c = 0; int kj = 0; int len = 0; for(int j = 0; j != -1 && !aborted;) { j = datainputstream.read(); if(j == -1) break; c ++; abyte0[len++] = (byte)j; if (len == recordLength) { rb.setLength(0); parseFFD(abyte0,rb); len =0; status.setCurrentRecord(c / recordLength); fireStatusEvent(); } Thread.yield(); // if ((c / recordLength) == 200) // aborted = true; } System.out.println(c); if (c == 0) { status.setCurrentRecord(c); fireStatusEvent(); } else { if (!aborted) parseResponse(); } writeFooter();// parseResponse(); printFTPInfo("Transfer complete!"); } } catch(InterruptedIOException iioe) { printFTPInfo("Interrupted! " + iioe.getMessage()); } catch(Exception _ex) { printFTPInfo("Error! " + _ex); } finally { try { socket.close(); } catch(Exception _ex) { } try { datainputstream.close(); } catch(Exception _ex) { } try { writeFooter(); } catch(Exception _ex) { } disconnect(); } } }; getThread = new Thread(getRun); getThread.setPriority(2); getThread.start(); return flag; }
| 3,487
|
public JTable (TableModel dm) { this(dm, null, null); }
|
public JTable () { this(dm, null, null); }
| 3,488
|
public JTable (TableModel dm) { this(dm, null, null); }
|
public JTable (TableModel dm) { this(null, null, null); }
| 3,489
|
void endDragging(MouseEvent e) { header.setDraggedColumn(null); draggingHeaderRect = null; TableColumnModel model = header.getColumnModel(); // Find where have we dragged the column. int x = e.getX(); int p = 0; int col = model.getColumnCount()-1; int n = model.getColumnCount(); // This loop does not find the column if the mouse if out of the // right boundary of the table header. Then we make this column the // rightmost column. Scan: for (int i = 0; i < n; i++) { p += model.getColumn(i).getWidth(); if (p > x) { col = i; break Scan; } } header.getTable().moveColumn(draggingColumnNumber, col); }
|
void endDragging(MouseEvent e) { header.setDraggedColumn(null); draggingHeaderRect = null; TableColumnModel model = header.getColumnModel(); // Find where have we dragged the column. int x = e.getX(); int p = 0; int col = model.getColumnCount() - 1; int n = model.getColumnCount(); // This loop does not find the column if the mouse if out of the // right boundary of the table header. Then we make this column the // rightmost column. Scan: for (int i = 0; i < n; i++) { p += model.getColumn(i).getWidth(); if (p > x) { col = i; break Scan; } } header.getTable().moveColumn(draggingColumnNumber, col); }
| 3,490
|
public void mouseMoved(MouseEvent e) { // When dragging, the functionality is handled by the mouseDragged. if (e.getButton() == 0 && header.getResizingAllowed()) { TableColumnModel model = header.getColumnModel(); int n = model.getColumnCount(); if (n < 2) // It must be at least two columns to have at least one boundary. // Otherwise, nothing to do. return; boolean onBoundary = false; int x = e.getX(); int a = x - COLUMN_BOUNDARY_TOLERANCE; int b = x + COLUMN_BOUNDARY_TOLERANCE; int p = 0; Scan: for (int i = 0; i < n - 1; i++) { p += model.getColumn(i).getWidth(); if (p >= a && p <= b) { TableColumn column = model.getColumn(i); onBoundary = true; draggingFrom = x; prevPrefWidth = column.getWidth(); header.setResizingColumn(column); break Scan; } } if (onBoundary != showingResizeCursor) { // Change the cursor shape, if needed. if (onBoundary) { originalCursor = header.getCursor(); if (p < x) header.setCursor(Cursor.getPredefinedCursor (Cursor.W_RESIZE_CURSOR)); else header.setCursor(Cursor.getPredefinedCursor (Cursor.E_RESIZE_CURSOR)); } else { header.setCursor(originalCursor); header.setResizingColumn(null); } showingResizeCursor = onBoundary; } } }
|
public void mouseMoved(MouseEvent e) { // When dragging, the functionality is handled by the mouseDragged. if (e.getButton() == 0 && header.getResizingAllowed()) { TableColumnModel model = header.getColumnModel(); int n = model.getColumnCount(); if (n < 2) // It must be at least two columns to have at least one boundary. // Otherwise, nothing to do. return; boolean onBoundary = false; int x = e.getX(); int a = x - COLUMN_BOUNDARY_TOLERANCE; int b = x + COLUMN_BOUNDARY_TOLERANCE; int p = 0; Scan: for (int i = 0; i < n - 1; i++) { p += model.getColumn(i).getWidth(); if (p >= a && p <= b) { TableColumn column = model.getColumn(i); onBoundary = true; draggingFrom = x; prevPrefWidth = column.getWidth(); header.setResizingColumn(column); break Scan; } } if (onBoundary != showingResizeCursor) { // Change the cursor shape, if needed. if (onBoundary) { originalCursor = header.getCursor(); if (p < x) header.setCursor(Cursor.getPredefinedCursor (Cursor.W_RESIZE_CURSOR)); else header.setCursor(Cursor.getPredefinedCursor (Cursor.E_RESIZE_CURSOR)); } else { header.setCursor(originalCursor); header.setResizingColumn(null); } showingResizeCursor = onBoundary; } } }
| 3,491
|
public void mouseMoved(MouseEvent e) { // When dragging, the functionality is handled by the mouseDragged. if (e.getButton() == 0 && header.getResizingAllowed()) { TableColumnModel model = header.getColumnModel(); int n = model.getColumnCount(); if (n < 2) // It must be at least two columns to have at least one boundary. // Otherwise, nothing to do. return; boolean onBoundary = false; int x = e.getX(); int a = x - COLUMN_BOUNDARY_TOLERANCE; int b = x + COLUMN_BOUNDARY_TOLERANCE; int p = 0; Scan: for (int i = 0; i < n - 1; i++) { p += model.getColumn(i).getWidth(); if (p >= a && p <= b) { TableColumn column = model.getColumn(i); onBoundary = true; draggingFrom = x; prevPrefWidth = column.getWidth(); header.setResizingColumn(column); break Scan; } } if (onBoundary != showingResizeCursor) { // Change the cursor shape, if needed. if (onBoundary) { originalCursor = header.getCursor(); if (p < x) header.setCursor(Cursor.getPredefinedCursor (Cursor.W_RESIZE_CURSOR)); else header.setCursor(Cursor.getPredefinedCursor (Cursor.E_RESIZE_CURSOR)); } else { header.setCursor(originalCursor); header.setResizingColumn(null); } showingResizeCursor = onBoundary; } } }
|
public void mouseMoved(MouseEvent e) { // When dragging, the functionality is handled by the mouseDragged. if (e.getButton() == 0 && header.getResizingAllowed()) { TableColumnModel model = header.getColumnModel(); int n = model.getColumnCount(); if (n < 2) // It must be at least two columns to have at least one boundary. // Otherwise, nothing to do. return; boolean onBoundary = false; int x = e.getX(); int a = x - COLUMN_BOUNDARY_TOLERANCE; int b = x + COLUMN_BOUNDARY_TOLERANCE; int p = 0; Scan: for (int i = 0; i < n - 1; i++) { p += model.getColumn(i).getWidth(); if (p >= a && p <= b) { TableColumn column = model.getColumn(i); onBoundary = true; draggingFrom = x; prevPrefWidth = column.getWidth(); header.setResizingColumn(column); break Scan; } } if (onBoundary != showingResizeCursor) { // Change the cursor shape, if needed. if (onBoundary) { originalCursor = header.getCursor(); if (p < x) header.setCursor(Cursor.getPredefinedCursor (Cursor.W_RESIZE_CURSOR)); else header.setCursor(Cursor.getPredefinedCursor (Cursor.E_RESIZE_CURSOR)); } else { header.setCursor(originalCursor); header.setResizingColumn(null); } showingResizeCursor = onBoundary; } } }
| 3,492
|
public Dimension getPreferredSize(JComponent ignored) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0,0); int spacing = 0; if (header.getTable() != null && header.getTable().getIntercellSpacing() != null) spacing = header.getTable().getIntercellSpacing().width; for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); Dimension d = comp.getPreferredSize(); ret.width += spacing; ret.height = Math.max(d.height, ret.height); } ret.width = cmod.getTotalColumnWidth(); return ret; }
|
public Dimension getPreferredSize(JComponent ignored) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0, 0); int spacing = 0; if (header.getTable() != null && header.getTable().getIntercellSpacing() != null) spacing = header.getTable().getIntercellSpacing().width; for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); Dimension d = comp.getPreferredSize(); ret.width += spacing; ret.height = Math.max(d.height, ret.height); } ret.width = cmod.getTotalColumnWidth(); return ret; }
| 3,493
|
public Dimension getPreferredSize(JComponent ignored) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0,0); int spacing = 0; if (header.getTable() != null && header.getTable().getIntercellSpacing() != null) spacing = header.getTable().getIntercellSpacing().width; for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); Dimension d = comp.getPreferredSize(); ret.width += spacing; ret.height = Math.max(d.height, ret.height); } ret.width = cmod.getTotalColumnWidth(); return ret; }
|
public Dimension getPreferredSize(JComponent ignored) { TableColumnModel cmod = header.getColumnModel(); TableCellRenderer defaultRend = header.getDefaultRenderer(); int ncols = cmod.getColumnCount(); Dimension ret = new Dimension(0,0); int spacing = 0; if (header.getTable() != null && header.getTable().getIntercellSpacing() != null) spacing = header.getTable().getIntercellSpacing().width; for (int i = 0; i < ncols; ++i) { TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent) comp).setBorder(cellBorder); Dimension d = comp.getPreferredSize(); ret.width += spacing; ret.height = Math.max(d.height, ret.height); } ret.width = cmod.getTotalColumnWidth(); return ret; }
| 3,494
|
protected void installKeyboardActions() throws NotImplementedException { // TODO: Implement this properly. }
|
protected void installKeyboardActions() { // TODO: Implement this properly. }
| 3,495
|
protected void installKeyboardActions() throws NotImplementedException { // TODO: Implement this properly. }
|
protected void installKeyboardActions() throws NotImplementedException { // TODO: Implement this properly. }
| 3,496
|
public void paint(Graphics gfx, JComponent c) { TableColumnModel cmod = header.getColumnModel(); int ncols = cmod.getColumnCount(); if (ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableCellRenderer defaultRend = header.getDefaultRenderer(); for (int i = 0; i < ncols; ++i) { Rectangle bounds = header.getHeaderRect(i); if (bounds.intersects(clip)) { Rectangle oldClip = gfx.getClipBounds(); TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); // FIXME: The following settings should be performed in // rend.getTableCellRendererComponent(). comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); rendererPane.paintComponent(gfx, comp, header, bounds.x, bounds.y, bounds.width, bounds.height); } } // This displays a running rectangle that is much simplier than the total // animation, as it is seen in Sun's application. // TODO animate the collumn dragging like in Sun's jre. if (draggingHeaderRect!=null) { gfx.setColor(header.getForeground()); gfx.drawRect(draggingHeaderRect.x, draggingHeaderRect.y+2, draggingHeaderRect.width-1, draggingHeaderRect.height-6); } }
|
public void paint(Graphics gfx, JComponent c) { TableColumnModel cmod = header.getColumnModel(); int ncols = cmod.getColumnCount(); if (ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableCellRenderer defaultRend = header.getDefaultRenderer(); for (int i = 0; i < ncols; ++i) { Rectangle bounds = header.getHeaderRect(i); if (bounds.intersects(clip)) { Rectangle oldClip = gfx.getClipBounds(); TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); // FIXME: The following settings should be performed in // rend.getTableCellRendererComponent(). comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent) comp).setBorder(cellBorder); rendererPane.paintComponent(gfx, comp, header, bounds.x, bounds.y, bounds.width, bounds.height); } } // This displays a running rectangle that is much simplier than the total // animation, as it is seen in Sun's application. // TODO animate the collumn dragging like in Sun's jre. if (draggingHeaderRect!=null) { gfx.setColor(header.getForeground()); gfx.drawRect(draggingHeaderRect.x, draggingHeaderRect.y+2, draggingHeaderRect.width-1, draggingHeaderRect.height-6); } }
| 3,497
|
public void paint(Graphics gfx, JComponent c) { TableColumnModel cmod = header.getColumnModel(); int ncols = cmod.getColumnCount(); if (ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableCellRenderer defaultRend = header.getDefaultRenderer(); for (int i = 0; i < ncols; ++i) { Rectangle bounds = header.getHeaderRect(i); if (bounds.intersects(clip)) { Rectangle oldClip = gfx.getClipBounds(); TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); // FIXME: The following settings should be performed in // rend.getTableCellRendererComponent(). comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); rendererPane.paintComponent(gfx, comp, header, bounds.x, bounds.y, bounds.width, bounds.height); } } // This displays a running rectangle that is much simplier than the total // animation, as it is seen in Sun's application. // TODO animate the collumn dragging like in Sun's jre. if (draggingHeaderRect!=null) { gfx.setColor(header.getForeground()); gfx.drawRect(draggingHeaderRect.x, draggingHeaderRect.y+2, draggingHeaderRect.width-1, draggingHeaderRect.height-6); } }
|
public void paint(Graphics gfx, JComponent c) { TableColumnModel cmod = header.getColumnModel(); int ncols = cmod.getColumnCount(); if (ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableCellRenderer defaultRend = header.getDefaultRenderer(); for (int i = 0; i < ncols; ++i) { Rectangle bounds = header.getHeaderRect(i); if (bounds.intersects(clip)) { Rectangle oldClip = gfx.getClipBounds(); TableColumn col = cmod.getColumn(i); TableCellRenderer rend = col.getHeaderRenderer(); if (rend == null) rend = defaultRend; Object val = col.getHeaderValue(); Component comp = rend.getTableCellRendererComponent(header.getTable(), val, false, // isSelected false, // isFocused -1, i); // FIXME: The following settings should be performed in // rend.getTableCellRendererComponent(). comp.setFont(header.getFont()); comp.setBackground(header.getBackground()); comp.setForeground(header.getForeground()); if (comp instanceof JComponent) ((JComponent)comp).setBorder(cellBorder); rendererPane.paintComponent(gfx, comp, header, bounds.x, bounds.y, bounds.width, bounds.height); } } // This displays a running rectangle that is much simplier than the total // animation, as it is seen in Sun's application. // TODO animate the collumn dragging like in Sun's jre. if (draggingHeaderRect != null) { gfx.setColor(header.getForeground()); gfx.drawRect(draggingHeaderRect.x, draggingHeaderRect.y+2, draggingHeaderRect.width-1, draggingHeaderRect.height-6); } }
| 3,498
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.