rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
span = getComponent().getPreferredSize().height; | span = interceptor.getPreferredSize().height; | public float getPreferredSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getPreferredSize().width; else if (axis == Y_AXIS) span = getComponent().getPreferredSize().height; else throw new IllegalArgumentException(); return span; } |
throw new IllegalArgumentException(); | assert false : "Must not reach here"; } | public float getPreferredSpan(int axis) { float span; if (axis == X_AXIS) span = getComponent().getPreferredSize().width; else if (axis == Y_AXIS) span = getComponent().getPreferredSize().height; else throw new IllegalArgumentException(); return span; } |
Element el = getElement(); if (pos < el.getStartOffset() || pos >= el.getEndOffset()) throw new BadLocationException("Illegal offset for this view", pos); Rectangle r = a.getBounds(); Component c = getComponent(); return new Rectangle(r.x, r.y, c.getWidth(), c.getHeight()); | int p0 = getStartOffset(); int p1 = getEndOffset(); if (pos >= p0 && pos <= p1) { Rectangle viewRect = a.getBounds(); if (pos == p1) viewRect.x += viewRect.width; viewRect.width = 0; return viewRect; } else throw new BadLocationException("Illegal position", pos); | public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { Element el = getElement(); if (pos < el.getStartOffset() || pos >= el.getEndOffset()) throw new BadLocationException("Illegal offset for this view", pos); Rectangle r = a.getBounds(); Component c = get... |
Rectangle r = a.getBounds(); getComponent().setBounds(r.x, r.y, r.width, r.height); | if (interceptor != null) { Rectangle r = a instanceof Rectangle ? (Rectangle) a : a.getBounds(); interceptor.setBounds(r.x, r.y, r.width, r.height); } | public void paint(Graphics g, Shape a) { Rectangle r = a.getBounds(); getComponent().setBounds(r.x, r.y, r.width, r.height); } |
setParentImpl(p); | setParentImpl(); | public void setParent(final View p) { if (SwingUtilities.isEventDispatchThread()) setParentImpl(p); else SwingUtilities.invokeLater (new Runnable() { public void run() { setParentImpl(p); } }); } |
setParentImpl(p); | setParentImpl(); | public void run() { setParentImpl(p); } |
private void setParentImpl(View p) | void setParentImpl() | private void setParentImpl(View p) { super.setParent(p); if (p != null) { Component c = getComponent(); p.getContainer().add(c); } else { Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; } } |
super.setParent(p); | View p = getParent(); | private void setParentImpl(View p) { super.setParent(p); if (p != null) { Component c = getComponent(); p.getContainer().add(c); } else { Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; } } |
Component c = getComponent(); p.getContainer().add(c); | Container c = getContainer(); if (c != null) { if (interceptor == null) { Component created = createComponent(); if (created != null) { comp = created; interceptor = new Interceptor(comp); } } if (interceptor != null) { if (interceptor.getParent() == null) c.add(interceptor, this); } } | private void setParentImpl(View p) { super.setParent(p); if (p != null) { Component c = getComponent(); p.getContainer().add(c); } else { Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; } } |
Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; | if (interceptor != null) { Container parent = interceptor.getParent(); if (parent != null) parent.remove(interceptor); } | private void setParentImpl(View p) { super.setParent(p); if (p != null) { Component c = getComponent(); p.getContainer().add(c); } else { Component c = getComponent(); Container parent = c.getParent(); parent.remove(c); comp = null; } } |
Element el = getElement(); return el.getStartOffset(); | int pos; Rectangle r = (Rectangle) a; if (x < r.x + r.width / 2) { b[0] = Position.Bias.Forward; pos = getStartOffset(); } else { b[0] = Position.Bias.Backward; pos = getEndOffset(); } return pos; | public int viewToModel(float x, float y, Shape a, Position.Bias[] b) { // The element should only have one character position and it is clear // that this position is the position that best matches the given screen // coordinates, simply because this view has only this one position. Element el = getEleme... |
try { long before, after, sleep; stop: while (isUp()) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); } catch (InterruptedException ignore) { } if (!isUp()) break stop; } } if (hasRoom... | repaint(); } | public void run() { try { long before, after, sleep; stop: while (isUp()) { before = System.currentTimeMillis(); synchronized (Tetris.class) { while (pause) { try { System.out.println("waiting"); Tetris.class.wait(); System.out.println("back from waiting"); ... |
int kc = e.getKeyCode(); if (kc == KeyEvent.VK_N) { newGame(); return; } if (kc == KeyEvent.VK_P) { flipPause(); return; } if (!isUp() || pause) return; switch (e.getKeyCode()) { case KeyEvent.VK_UP: rot(1); break; case KeyEvent.VK_LEFT: trans(-1); break; case KeyEvent.VK_DOWN: rot(3); break; case KeyEvent.VK_RIGHT: tr... | int kc = e.getKeyCode(); if (kc == KeyEvent.VK_N) { newGame(); return; } if (kc == KeyEvent.VK_P) { flipPause(); return; } if (!isUp() || pause) return; switch (e.getKeyCode()) { case KeyEvent.VK_UP: rot(1); break; case KeyEvent.VK_LEFT: trans(-1); break; case KeyEvent.VK_DOWN: rot(3); break; case KeyEvent.VK_RIGHT: tr... | public void keyPressed(KeyEvent e) { int kc = e.getKeyCode(); if (kc == KeyEvent.VK_N) { newGame(); return; } if (kc == KeyEvent.VK_P) { flipPause(); return; } if (!isUp() || pause) return; switch (e.getKeyCode()) { case KeyEvent.VK_UP: rot(1); break; case KeyEvent.VK_LEFT: trans(-1); break;... |
public static void main(String[] argv) { int delay = 500; | public static void main(final String[] argv) { SwingUtilities.invokeLater(new Runnable() { public void run() { int delay = 500; | public static void main(String[] argv) { int delay = 500; try { if(argv.length > 0) delay = Integer.parseInt(argv[0]); } catch (Exception e) { // ignore } JFrame wnd = new JFrame("JNode Tetris"); Tetris tetris = new Tetris(); tetris.delay = delay; wnd.add(tetris, BorderLayout.CENTER); wnd.setSize(DI... |
try { if(argv.length > 0) delay = Integer.parseInt(argv[0]); } catch (Exception e) { } JFrame wnd = new JFrame("JNode Tetris"); Tetris tetris = new Tetris(); tetris.delay = delay; wnd.add(tetris, BorderLayout.CENTER); wnd.setSize(DIM.width + 7, DIM.height + CELL + CELL /2); wnd.show(); tetris.requestFocus(); tetris.n... | try { if(argv.length > 0) delay = Integer.parseInt(argv[0]); } catch (Exception e) { } JFrame frame = new JFrame("Tetris"); Tetris tetris = new Tetris(); tetris.delay = delay; frame.add(tetris, BorderLayout.CENTER); frame.setSize(DIM.width + 7, DIM.height + CELL + CELL /2); frame.setVisible(true); tetris.requestFocus(... | public static void main(String[] argv) { int delay = 500; try { if(argv.length > 0) delay = Integer.parseInt(argv[0]); } catch (Exception e) { // ignore } JFrame wnd = new JFrame("JNode Tetris"); Tetris tetris = new Tetris(); tetris.delay = delay; wnd.add(tetris, BorderLayout.CENTER); wnd.setSize(DI... |
if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = fa... | if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1) WORLD[i][j] = COLORS.length - 1; else WORLD[i][j] = 0; } } requestFocus(); end = fa... | public void newGame() { setUp(false); if (thread != null) { if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j ==... |
} } } catch (Throwable ex) { ex.printStackTrace(); } } }); | } } } catch (Throwable ex) { ex.printStackTrace(); } } }, "Tetris"); | public void newGame() { setUp(false); if (thread != null) { if (pause) { flipPause(); } try { thread.join(); } catch (InterruptedException ignore) { } } for (int i = 0; i < WIDTH_C + 2; i++) { for (int j = 0; j < HEIGHT_C + 2; j++) { if (i == 0 || j == 0 || i == WIDTH_C + 1 || j ==... |
if (b.hasFocus() && b.isFocusPainted()) | if (b.isEnabled() && b.hasFocus() && b.isFocusPainted()) | protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) { if (b.hasFocus() && b.isFocusPainted()) { Color savedColor = g.getColor(); g.setColor(getFocusColor()); Rectangle focusRect = iconRect.union(textRect); g.drawRect(fo... |
public Device getDevice(ParsedArguments args) throws SyntaxError { | public Device getDevice(ParsedArguments args) throws SyntaxErrorException { | public Device getDevice(ParsedArguments args) throws SyntaxError { String value = getValue(args); try { return ((DeviceManager)InitialNaming.lookup(DeviceManager.NAME)).getDevice(value); } catch(NameNotFoundException ex) { throw new SyntaxError("DeviceManager not found. Check your system setup"); } catch(Devic... |
throw new SyntaxError("DeviceManager not found. Check your system setup"); | throw new SyntaxErrorException("DeviceManager not found. Check your system setup"); | public Device getDevice(ParsedArguments args) throws SyntaxError { String value = getValue(args); try { return ((DeviceManager)InitialNaming.lookup(DeviceManager.NAME)).getDevice(value); } catch(NameNotFoundException ex) { throw new SyntaxError("DeviceManager not found. Check your system setup"); } catch(Devic... |
throw new SyntaxError("Device " + value + " not found"); | throw new SyntaxErrorException("Device " + value + " not found"); | public Device getDevice(ParsedArguments args) throws SyntaxError { String value = getValue(args); try { return ((DeviceManager)InitialNaming.lookup(DeviceManager.NAME)).getDevice(value); } catch(NameNotFoundException ex) { throw new SyntaxError("DeviceManager not found. Check your system setup"); } catch(Devic... |
column.addPropertyChangeListener(tableColumnPropertyChangeHandler); | public void addColumn(TableColumn column) { if (column.getHeaderValue() == null) { String name = dataModel.getColumnName(column.getModelIndex()); column.setHeaderValue(name); } columnModel.addColumn(column); } | |
column.addPropertyChangeListener(tableColumnPropertyChangeHandler); | public void createDefaultColumnsFromModel() { // remove existing columns int columnIndex = columnModel.getColumnCount() - 1; while (columnIndex >= 0) { columnModel.removeColumn(columnModel.getColumn(columnIndex)); columnIndex--; } // add new columns to match the TableModel int column... | |
cols[i].setWidth(cols[i].getWidth() + average); } | if (cols[i] != null) cols[i].setWidth(cols[i].getWidth() + average); } | private void distributeSpill(TableColumn[] cols, int spill) { int average = spill / cols.length; for (int i = 0; i < cols.length; i++) { cols[i].setWidth(cols[i].getWidth() + average); } } |
this.autoCreateColumnsFromModel = false; if (columnModel == null) { this.autoCreateColumnsFromModel = true; createColumnsFromModel(); } | if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); | protected void initializeLocalVars() { setTableHeader(createDefaultTableHeader()); this.autoCreateColumnsFromModel = false; if (columnModel == null) { this.autoCreateColumnsFromModel = true; createColumnsFromModel(); } this.columnModel.addColumnModelListener(this); this.def... |
if (autoCreateColumnsFromModel) createColumnsFromModel(); | if (autoCreateColumnsFromModel) createDefaultColumnsFromModel(); | 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; // Remove table as TableModelListener from old model. if (dataModel != nul... |
createColumnsFromModel(); | createDefaultColumnsFromModel(); | 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.getFirstRow() ==TableModelEvent.HEADER_ROW) && autoCreateColumnsFromModel) createColumnsFromModel(); r... |
if (isLinux) | mapper.removeKeyStroke(k); if (isLinux) { | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { if (isLinux) mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke); strokeDesc.setText(mapper.getKey... |
else | } else { | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { if (isLinux) mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke); strokeDesc.setText(mapper.getKey... |
} | private void setNewKeyStrokes(KeyEvent ke) { if (!macros && !special) { if (isLinux) mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke,isAltGr); else mapper.setKeyStroke(mnemonicData[functions.getSelectedIndex()],ke); strokeDesc.setText(mapper.getKey... | |
Object thisObject(); | org.omg.CORBA.Object thisObject(); | Object thisObject(); |
"ComboBox.background", new ColorUIResource(light), | "ComboBox.background", new ColorUIResource(Color.white), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"ComboBox.selectionBackground", new ColorUIResource(Color.black), | "ComboBox.selectionBackground", new ColorUIResource(0, 0, 128), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"EditorPane.border", new BasicBorders.MarginBorder(), | "EditorPane.border", new BorderUIResource(BasicBorders.getMarginBorder()), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"List.background", new ColorUIResource(light), | "List.background", new ColorUIResource(Color.white), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"List.foreground", new ColorUIResource(darkShadow), "List.selectionBackground", new ColorUIResource(Color.black), | "List.foreground", new ColorUIResource(Color.black), "List.selectionBackground", new ColorUIResource(0, 0, 128), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"OptionPane.minimumSize", new DimensionUIResource(262, 90), | "OptionPane.minimumSize", new DimensionUIResource(BasicOptionPaneUI.MinimumWidth, BasicOptionPaneUI.MinimumHeight), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Table.background", new ColorUIResource(light), "Table.focusCellBackground", new ColorUIResource(light), "Table.focusCellForeground", new ColorUIResource(darkShadow), | "Table.background", new ColorUIResource(new ColorUIResource(255, 255, 255)), "Table.focusCellBackground", new ColorUIResource(new ColorUIResource(255, 255, 255)), "Table.focusCellForeground", new ColorUIResource(new ColorUIResource(0, 0, 0)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Table.foreground", new ColorUIResource(darkShadow), "Table.gridColor", new ColorUIResource(Color.gray), | "Table.foreground", new ColorUIResource(new ColorUIResource(0, 0, 0)), "Table.gridColor", new ColorUIResource(new ColorUIResource(128, 128, 128)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Table.selectionBackground", new ColorUIResource(Color.black), "Table.selectionForeground", new ColorUIResource(Color.white), "TableHeader.background", new ColorUIResource(light), | "Table.selectionBackground", new ColorUIResource(new ColorUIResource(0, 0, 128)), "Table.selectionForeground", new ColorUIResource(new ColorUIResource(255, 255, 255)), "TableHeader.background", new ColorUIResource(new ColorUIResource(192, 192, 192)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"TableHeader.foreground", new ColorUIResource(darkShadow), | "TableHeader.foreground", new ColorUIResource(new ColorUIResource(0, 0, 0)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"TextArea.background", new ColorUIResource(light), "TextArea.border", new BasicBorders.MarginBorder(), | "TextArea.background", new ColorUIResource(light), "TextArea.border", new BorderUIResource(BasicBorders.getMarginBorder()), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"TextPane.border", new BasicBorders.MarginBorder(), | "TextPane.border", new BorderUIResource(BasicBorders.getMarginBorder()), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Tree.background", new ColorUIResource(light), | "Tree.background", new ColorUIResource(new Color(255, 255, 255)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Tree.font", new FontUIResource(new Font("Helvetica", Font.PLAIN, 12)), | "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Tree.rowHeight", new Integer(20), | "Tree.rowHeight", new Integer(16), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Tree.nonSelectionBackground", new ColorUIResource(new Color(239, 235, 231)), | "Tree.nonSelectionBackground", new ColorUIResource(new Color(255, 255, 255)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
"Tree.textBackground", new ColorUIResource(new Color(255, 255, 255)), "Tree.textForeground", new ColorUIResource(Color.black), | "Tree.textBackground", new ColorUIResource(new Color(192, 192, 192)), "Tree.textForeground", new ColorUIResource(new Color(0, 0, 0)), | protected void initComponentDefaults(UIDefaults defaults) { Object[] uiDefaults; Color highLight = new Color(249, 247, 246); Color light = new Color(239, 235, 231); Color shadow = new Color(139, 136, 134); Color darkShadow = new Color(16, 16, 16); uiDefaults = new Object[] { "AbstractUndoa... |
setBorder(buttonBorder); | public BasicArrowButton(int direction) { super(); setBorder(buttonBorder); setDirection(direction); } | |
if (dumpBytes) { dump(baosin.toByteArray()); } | public final byte[] readIncoming() throws IOException { boolean done = false; boolean negotiate = false; baosin.reset(); int j = -1; int i = 0; while(!done) { i = bin.read(); // We use the values instead of the static values IAC and EOR // because they ... | |
throw new BAD_OPERATION("Contains not a wide string value type"); | { BAD_OPERATION bad = new BAD_OPERATION("WString value type expected"); bad.minor = Minor.Any; throw bad; } | public static String extract(Any an_any) { if (an_any.type().equal(type())) { an_any.type(twString); return an_any.extract_wstring(); } else throw new BAD_OPERATION("Contains not a wide string value type"); } |
throw new MARSHAL("String expected"); | MARSHAL m = new MARSHAL("String expected"); m.minor = Minor.ClassCast; throw m; | public void write_value(OutputStream ostream, Serializable a_string) { try { ostream.write_wstring((String) a_string); } catch (ClassCastException ex) { throw new MARSHAL("String expected"); } } |
if ((patchSize != 4) && (patchSize != 8)) { | if ((patchSize != 1) && (patchSize != 4) && (patchSize != 8)) { | public UnresolvedOffset(int offset, int patchSize) { if ((patchSize != 4) && (patchSize != 8)) { throw new IllegalArgumentException("PatchSize: " + patchSize); } this.offset = offset; this.patchSize = patchSize; } |
EventListener [] listeners = getListeners(TableColumnModelListener.class); | EventListener[] listeners = getListeners(TableColumnModelListener.class); if (changeEvent == null && listeners.length > 0) changeEvent = new ChangeEvent(this); | protected void fireColumnMarginChanged() { EventListener [] listeners = getListeners(TableColumnModelListener.class); for (int i = 0; i < listeners.length; ++i) ((TableColumnModelListener) listeners[i]).columnMarginChanged(changeEvent); } |
else if (timer.isRunning()) timer.stop(); | public boolean isCellEditable(EventObject event) { if (editingComponent == null) configureEditingComponent(tree, renderer, realEditor); if (editingComponent != null && realEditor.isCellEditable(event)) { prepareForEditing(); return true; } // Cell may not be currently edita... | |
Value newvalue = new Value(valueString); | Value newvalue = createCurrentValueListValueObj(valueString); | public void action (SaxDocumentHandler handler, char buf [], int offset, int len) { // IF we get here, we have the delmited case for populating // a value list. // 1. set up information we need // our string that we will parse String valueListString = new String (buf,... |
Value value = new Value (valuePCDATA); | Value value = createCurrentValueListValueObj(valuePCDATA); | public void action (SaxDocumentHandler handler) { // generate valuelist values from algoritm IF we need to // (e.g. values where'nt in a delimited cdata list) // check to see if we didnt alrealy parse from a delmited string. if ( ((String) CurrentValueListParameter.get("isDeli... |
Color lineColor = new Color(238, 238, 238); Border inner = BorderFactory.createLineBorder(lineColor, 1); Color shadowInner = new Color(184, 207, 229); Color shadowOuter = new Color(122, 138, 153); | Color borderColor = defaults.getColor("InternalFrame.borderColor"); Border inner = BorderFactory.createLineBorder(borderColor, 1); Color borderDarkShadow = defaults.getColor ("InternalFrame.borderDarkShadow"); Color borderHighlight = defaults.getColor ("InternalFrame.borderHighlight"); Color borderShadow = defaults.get... | protected void installDefaults() { // This is the border of InternalFrames in the BasicLookAndFeel. // Note that there exist entries for various border colors in // BasicLookAndFeel's defaults, but obviously they differ // from the colors that are actually used by the JDK. UIDefaults default... |
Color.WHITE, Color.WHITE, shadowOuter, shadowInner); | borderShadow, borderHighlight, borderDarkShadow, borderShadow); | protected void installDefaults() { // This is the border of InternalFrames in the BasicLookAndFeel. // Note that there exist entries for various border colors in // BasicLookAndFeel's defaults, but obviously they differ // from the colors that are actually used by the JDK. UIDefaults default... |
frame.setFrameIcon(defaults.getIcon("InternalFrame.icon")); | protected void installDefaults() { // This is the border of InternalFrames in the BasicLookAndFeel. // Note that there exist entries for various border colors in // BasicLookAndFeel's defaults, but obviously they differ // from the colors that are actually used by the JDK. UIDefaults default... | |
titlePane.setOpaque(true); | public void installUI(JComponent c) { if (c instanceof JInternalFrame) { frame = (JInternalFrame) c; internalFrameLayout = createLayoutManager(); frame.setLayout(internalFrameLayout); ((JComponent) frame.getRootPane().getGlassPane()).setOpaque(false); frame.getRootPane().getGlassPane().setVisible(true); inst... | |
public OctetSeqHolder(byte[] initial_value) | public OctetSeqHolder() | public OctetSeqHolder(byte[] initial_value) { value = initial_value; typecode.setLength(value.length); } |
value = initial_value; typecode.setLength(value.length); | public OctetSeqHolder(byte[] initial_value) { value = initial_value; typecode.setLength(value.length); } | |
repaint(x1,y1,x2+1,y2+1); | repaint(); | public void areaBounded(RubberBand band, int x1, int y1, int x2, int y2) { repaint(x1,y1,x2+1,y2+1);// System.out.println(" bound " + band.getEndPoint()); } |
screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()+1, | screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-1, | private void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()+1, ... |
screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()-1, | screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol()-2, | private void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()+1, ... |
screen.getPointFromRowCol(screen.getCurrentRow()+1, screen.getCurrentCol(), | screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, | private void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()+1, ... |
screen.getPointFromRowCol(screen.getCurrentRow()-1, screen.getCurrentCol(), | screen.getPointFromRowCol(screen.getCurrentRow()-2, screen.getCurrentCol() - 1, | private void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()+1, ... |
screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol(), | screen.getPointFromRowCol(screen.getCurrentRow() - 1, screen.getCurrentCol() - 1, | private void doKeyBoundArea(KeyEvent ke,String last) { Point p = new Point(); if (!rubberband.isAreaSelected()) { if (last.equals("[markleft]")) screen.getPointFromRowCol(screen.getCurrentRow(), screen.getCurrentCol()+1, ... |
"Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Slider.trackWidth", new Integer(7), "Slider.majorTickLength", new Integer(6), "Tree.openIcon", MetalIconFact... | protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", new ColorUIResource(getControl()), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", new ColorUIResource(getControlDark... | |
throw new SocketException(e.getMessage()); | SocketException se = new SocketException(); se.initCause(e); throw se; | DatagramSocketImpl getImpl() throws SocketException { try { if (! implCreated) { impl.create(); implCreated = true; } return impl; } catch (IOException e) { throw new SocketException(e.getMessage()); } } |
TableColumn resizeIt = header.getResizingColumn(); if (resizeIt != null && header.getResizingAllowed()) { if (timer == null) { timer = new Timer(1, new ActionListener() { public void actionPerformed(ActionEvent e) { header.getTable().doLayout(); } }); timer.setRepeats(false); timer.setCoalesce(true); } resizeIt.setP... | public void mouseDragged(MouseEvent e) { // TODO: Implement this properly. } | |
if (header.getResizingColumn() != null && header.getResizingAllowed()) endResizing(); if (header.getDraggedColumn() != null && header.getReorderingAllowed()) endDragging(null); | public void mouseExited(MouseEvent e) { // TODO: Implement this properly. } | |
if (e.getButton() == 0 && header.getResizingAllowed()) { TableColumnModel model = header.getColumnModel(); int n = model.getColumnCount(); if (n < 2) 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;... | public void mouseMoved(MouseEvent e) { // TODO: Implement this properly. } | |
if (onBoundary != showingResizeCursor) { if (onBoundary) { if (p < x) header.setCursor(Cursor.getPredefinedCursor (Cursor.W_RESIZE_CURSOR)); else header.setCursor(Cursor.getPredefinedCursor (Cursor.E_RESIZE_CURSOR)); } else { header.setCursor(Cursor.getDefaultCursor()); header.setResizingColumn(null); } showingResiz... | public void mouseMoved(MouseEvent e) { // TODO: Implement this properly. } | |
if (header.getResizingAllowed()) { TableColumn resizingColumn = header.getResizingColumn(); if (resizingColumn != null) { resizingColumn.setPreferredWidth(resizingColumn.getWidth()); return; } | public void mousePressed(MouseEvent e) { // TODO: Implement this properly. } | |
if (header.getReorderingAllowed()) { TableColumnModel model = header.getColumnModel(); int n = model.getColumnCount(); if (n < 2) return; boolean onBoundary = false; int x = e.getX(); int p = 0; int col = - 1; Scan: for (int i = 0; i < n; i++) { p += model.getColumn(i).getWidth(); if (p > x) { col = i; break Scan; ... | public void mousePressed(MouseEvent e) { // TODO: Implement this properly. } | |
if (header.getResizingColumn() != null && header.getResizingAllowed()) endResizing(); if (header.getDraggedColumn() != null && header.getReorderingAllowed()) endDragging(e); | public void mouseReleased(MouseEvent e) { // TODO: Implement this properly. } | |
public Dimension getPreferredSize(JComponent c) | public Dimension getPreferredSize(JComponent ignored) | public Dimension getPreferredSize(JComponent c) { 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... |
header.addMouseMotionListener(mouseInputListener); | protected void installListeners() { header.addMouseListener(mouseInputListener); } | |
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) ... | |
header.removeMouseMotionListener(mouseInputListener); | protected void uninstallListeners() { header.removeMouseListener(mouseInputListener); } | |
toolBar.setOrientation(o); if (dragWindow != null) dragWindow.setOrientation(o); | public void setOrientation(int o) { // FIXME: implement. } | |
Component c = e.getChild(); if (toolBarFocusListener != null) c.addFocusListener(toolBarFocusListener); | public void componentAdded(ContainerEvent e) { if (e.getChild() instanceof JButton) { JButton b = (JButton) e.getChild(); if (b.getBorder() != null) borders.put(b, b.getBorder()); } if (isRolloverBorders()) setBorderToRollover(e.getChild()); else setBorderToNonRollover(e.getC... | |
Component c = e.getChild(); if (toolBarFocusListener != null) c.removeFocusListener(toolBarFocusListener); | public void componentRemoved(ContainerEvent e) { setBorderToNormal(e.getChild()); cachedBounds = toolBar.getPreferredSize(); cachedOrientation = toolBar.getOrientation(); } | |
Component c = e.getComponent(); focusedCompIndex = toolBar.getComponentIndex(c); | public void focusGained(FocusEvent e) { // FIXME: implement. } | |
boolean tmp = ((loc == SwingConstants.NORTH) || (loc == SwingConstants.SOUTH) || (loc == -1)); | boolean tmp = (loc == SwingConstants.NORTH) || (loc == SwingConstants.SOUTH) || (loc == -1); | protected void dragTo(Point position, Point origin) { int loc = areaOfClick(origParent, SwingUtilities.convertPoint(toolBar, position, origParent)); if (loc != -1) { dragWindow.setBorderColor(dockingBorderColor); dragWindow.setB... |
InputMap inputMap = (InputMap) SharedUIDefaults.get("ToolBar.ancestorInputMap"); SwingUtilities.replaceUIInputMap(toolBar, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap); SwingUtilities.replaceUIActionMap(toolBar, getActionMap()); | protected void installKeyboardActions() throws NotImplementedException { // FIXME: implement. } | |
toolBar.addFocusListener(toolBarFocusListener); | if (toolBarFocusListener != null) { int count = toolBar.getComponentCount(); for (int i = 0; i < count; i++) toolBar.getComponent(i).addFocusListener(toolBarFocusListener); } | protected void installListeners() { dockingListener = createDockingListener(); toolBar.addMouseListener(dockingListener); toolBar.addMouseMotionListener(dockingListener); propertyListener = createPropertyListener(); toolBar.addPropertyChangeListener(propertyListener); toolBarContListener = createTo... |
throws NotImplementedException | protected void navigateFocusedComp(int direction) throws NotImplementedException { // FIXME: Implement. } | |
int count = toolBar.getComponentCount(); switch (direction) { case EAST: case SOUTH: if (focusedCompIndex >= 0 && focusedCompIndex < count) { int i = focusedCompIndex + 1; boolean focusRequested = false; while (i != focusedCompIndex && ! focusRequested) { if (i >= count) i = 0; Component comp = toolBar.getComponentAtI... | protected void navigateFocusedComp(int direction) throws NotImplementedException { // FIXME: Implement. } | |
SwingUtilities.replaceUIInputMap(toolBar, JComponent. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(toolBar, null); | protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: implement. } | |
toolBar.removeFocusListener(toolBarFocusListener); | if (toolBarFocusListener != null) { int count = toolBar.getComponentCount(); for (int i = 0; i < count; i++) toolBar.getComponent(i).removeFocusListener(toolBarFocusListener); | protected void uninstallListeners() { toolBar.removeFocusListener(toolBarFocusListener); toolBarFocusListener = null; floatFrame.removeWindowListener(windowListener); windowListener = null; toolBar.removeContainerListener(toolBarContListener); toolBarContListener = null; toolBar.removeMouseMotio... |
} | protected void uninstallListeners() { toolBar.removeFocusListener(toolBarFocusListener); toolBarFocusListener = null; floatFrame.removeWindowListener(windowListener); windowListener = null; toolBar.removeContainerListener(toolBarContListener); toolBarContListener = null; toolBar.removeMouseMotio... | |
throw new BAD_OPERATION("value not set"); | { BAD_OPERATION bad = new BAD_OPERATION("value not set"); bad.minor = Minor.Any; throw bad; } | protected void check(int kind) throws BAD_OPERATION { if (has == null) throw new BAD_OPERATION("value not set"); if (xKind >= 0) { if (xKind != kind) if (!( xKind == TCKind._tk_alias && has._type().kind().value() == kind ) ... |
if (!( xKind == TCKind._tk_alias && has._type().kind().value() == kind ) ) throw new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + " when stored " + typeNamer.nameIt(xKind) ); | if (!(xKind == TCKind._tk_alias && has._type().kind().value() == kind)) { BAD_OPERATION bad = new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + " when stored " + typeNamer.nameIt(xKind)); bad.minor = Minor.Any; throw bad; } | protected void check(int kind) throws BAD_OPERATION { if (has == null) throw new BAD_OPERATION("value not set"); if (xKind >= 0) { if (xKind != kind) if (!( xKind == TCKind._tk_alias && has._type().kind().value() == kind ) ... |
if (!( type().kind().value() == TCKind._tk_alias && has._type().kind().value() == kind ) ) throw new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + " stored " + typeNamer.nameIt(type()) ); | if (!(type().kind().value() == TCKind._tk_alias && has._type().kind().value() == kind)) { BAD_OPERATION bad = new BAD_OPERATION("Extracting " + typeNamer.nameIt(kind) + " stored " + typeNamer.nameIt(type())); bad.minor = Minor.Any; throw bad; } | protected void check(int kind) throws BAD_OPERATION { if (has == null) throw new BAD_OPERATION("value not set"); if (xKind >= 0) { if (xKind != kind) if (!( xKind == TCKind._tk_alias && has._type().kind().value() == kind ) ... |
throw new BAD_OPERATION(); | BAD_OPERATION bad = new BAD_OPERATION(); bad.initCause(ex); bad.minor = Minor.Any; throw bad; | public org.omg.CORBA.Object extract_Object() { try { return ((ObjectHolder) has).value; } catch (ClassCastException ex) { throw new BAD_OPERATION(); } } |
return new BAD_OPERATION("Value type expected"); | BAD_OPERATION bad = new BAD_OPERATION("Value type expected"); bad.minor = Minor.Any; bad.initCause(ex); throw bad; | public Serializable extract_Value() throws BAD_OPERATION { try { if (has instanceof ValueBaseHolder) return ((ValueBaseHolder) has).value; else { // Normally, ValueBase holder must be an instance of the // ValueBaseHolder. Howe... |
BoxedValueHelper helper; try { Class helperClass = Class.forName(ObjectCreator.toHelperName(a_type.id())); helper = (BoxedValueHelper) helperClass.newInstance(); } catch (Exception ex) { helper = null; } Object content = Vio.read(input, helper); | Object content = Vio.read(input, a_type.id()); | public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.