rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
int readBytes = 0; boolean completed = false; try { begin(); socket.getPlainSocketImpl().setInChannelOperation(true); readBytes = input.read (data, offset, len); completed = true; } finally { end (completed); socket.getPlainSocketImpl().setInChannelOperation(false); } if (readBytes > 0) if (dst.hasArray()) { dst.posi...
public int read(ByteBuffer dst) throws IOException { if (!isConnected()) throw new NotYetConnectedException(); byte[] data; int offset = 0; InputStream input = socket.getInputStream(); int available = input.available(); int len = dst.remaining(); if ((! isBlocking()) && available == 0) ...
byte[] data; int offset = 0; int len = src.remaining(); if (!src.hasArray()) { data = new byte [len]; src.get (data, 0, len); } else { offset = src.arrayOffset() + src.position(); data = src.array(); } OutputStream output = socket.getOutputStream(); boolean completed = false; try { begin(); socket.getPlainSocketImpl...
return channel.write(src);
public int write (ByteBuffer src) throws IOException { if (!isConnected()) throw new NotYetConnectedException(); byte[] data; int offset = 0; int len = src.remaining(); if (!src.hasArray()) { data = new byte [len]; src.get (data, 0, len); } else { offset...
force ();
public void force (boolean metaData) throws IOException { if (!isOpen ()) throw new ClosedChannelException (); }
throw new IllegalArgumentException ();
throw new IllegalArgumentException ("mode: " + mode);
public MappedByteBuffer map (FileChannel.MapMode mode, long position, long size) throws IOException { char nmode = 0; if (mode == MapMode.READ_ONLY) { nmode = 'r'; if ((this.mode & READ) == 0) throw new NonReadableChannelException(); } else if (mode == MapMode.READ_WRITE || mode == M...
throw new IllegalArgumentException ();
throw new IllegalArgumentException ("position: " + position + ", size: " + size);
public MappedByteBuffer map (FileChannel.MapMode mode, long position, long size) throws IOException { char nmode = 0; if (mode == MapMode.READ_ONLY) { nmode = 'r'; if ((this.mode & READ) == 0) throw new NonReadableChannelException(); } else if (mode == MapMode.READ_WRITE || mode == M...
throw new IllegalArgumentException ();
throw new IllegalArgumentException ("position: " + position + ", size: " + size);
public FileLock tryLock (long position, long size, boolean shared) throws IOException { if (position < 0 || size < 0) throw new IllegalArgumentException (); if (!isOpen ()) throw new ClosedChannelException (); if (shared && (mode & READ) == 0) throw new NonReadableChannelException (...
if (shared && (mode & READ) == 0)
if (shared && ((mode & READ) == 0))
public FileLock tryLock (long position, long size, boolean shared) throws IOException { if (position < 0 || size < 0) throw new IllegalArgumentException (); if (!isOpen ()) throw new ClosedChannelException (); if (shared && (mode & READ) == 0) throw new NonReadableChannelException (...
if (!shared && (mode & WRITE) == 0)
if (!shared && ((mode & WRITE) == 0))
public FileLock tryLock (long position, long size, boolean shared) throws IOException { if (position < 0 || size < 0) throw new IllegalArgumentException (); if (!isOpen ()) throw new ClosedChannelException (); if (shared && (mode & READ) == 0) throw new NonReadableChannelException (...
Point p = e.getPoint(); int row = table.rowAtPoint(p); int col = table.columnAtPoint(p); if (table.isCellEditable(row, col)) { TableCellEditor editor = table.getCellEditor(row, col); if (editor instanceof DefaultCellEditor) { DefaultCellEditor ce = (DefaultCellEditor) editor; if (e.getClickCount() < ce.getClickCount...
public void mouseClicked(MouseEvent e) { // TODO: What should be done here, if anything? }
else if (command.equals("stopEditing")) { table.editingStopped(new ChangeEvent(command)); }
public void actionPerformed (ActionEvent e) { DefaultListSelectionModel rowModel = (DefaultListSelectionModel) table.getSelectionModel(); DefaultListSelectionModel colModel = (DefaultListSelectionModel) table.getColumnModel().getSelectionModel(); int rowLead = rowModel.getLeadSelectionIndex(); ...
return new Dimension(maxTotalColumnWidth, table.getRowCount()*table.getRowHeight());
return new Dimension(maxTotalColumnWidth, table.getRowCount()* (table.getRowHeight()+table.getRowMargin()));
public Dimension getMaximumSize(JComponent comp) { int maxTotalColumnWidth = 0; for (int i = 0; i < table.getColumnCount(); i++) maxTotalColumnWidth += table.getColumnModel().getColumn(i).getMaxWidth(); if (maxTotalColumnWidth == 0 || table.getRowCount() == 0) return null; return new Dimension...
int height = table.getRowCount() * table.getRowHeight();
int height = table.getRowCount() * (table.getRowHeight()+table.getRowMargin());
public Dimension getPreferredSize(JComponent comp) { int width = table.getColumnModel().getTotalColumnWidth(); int height = table.getRowCount() * table.getRowHeight(); return new Dimension(width, height); }
int height = table.getRowHeight();
int height = table.getRowHeight() + table.getRowMargin();
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 =...
Rectangle bounds = new Rectangle(x + halfGapWidth, y + halfGapHeight + 1, width - gap.width + 1, height - gap.height);
bounds.x = x + halfGapWidth; bounds.y = y + halfGapHeight + 1; bounds.width = width - gap.width + 1; bounds.height = height - gap.height;
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 =...
paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c), table.getModel(), table.getSelectionModel().getLeadSelectionIndex(), table.getColumnModel().getSelectionModel().getLeadSelectionIndex());
paintCell(gfx, r, c, bounds, table.getCellRenderer(r, c));
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 =...
TableCellRenderer rend, TableModel data, int rowLead, int colLead)
TableCellRenderer rend)
void paintCell(Graphics g, int row, int col, Rectangle bounds, TableCellRenderer rend, TableModel data, int rowLead, int colLead) { Component comp = table.prepareRenderer(rend, row, col); rendererPane.paintComponent(g, comp, table, bounds); // FIXME: this is manual painti...
if (comp instanceof JTextField) { Rectangle oldClip = g.getClipBounds(); g.translate(bounds.x, bounds.y); g.clipRect(0, 0, bounds.width, bounds.height); ((JTextField)comp).getCaret().paint(g); g.translate(-bounds.x, -bounds.y); g.setClip(oldClip); }
void paintCell(Graphics g, int row, int col, Rectangle bounds, TableCellRenderer rend, TableModel data, int rowLead, int colLead) { Component comp = table.prepareRenderer(rend, row, col); rendererPane.paintComponent(g, comp, table, bounds); // FIXME: this is manual painti...
if (value == null) return "";
public String valueToString(Object value) throws ParseException { return value.toString(); }
"Label.disabledForeground", new ColorUIResource(getControlDisabled()), "Label.foreground", new ColorUIResource(getSystemTextColor()),
"Label.disabledForeground", new ColorUIResource(getInactiveControlTextColor()), "Label.foreground", new ColorUIResource(getControlTextColor()),
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...
"TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6),
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...
return super.createLayoutManager();
return new TabbedPaneLayout();
protected LayoutManager createLayoutManager() { return super.createLayoutManager(); }
int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex);
int bottom = h - 1; int right = w - 1; int tabCount = tabPane.getTabCount(); int currentRun = getRunForTab(tabCount, tabIndex);
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGa...
g.fillRect(1, h - 5, 3, 5); g.fillRect(4, h - 2, 2, 2);
g.fillRect(1, bottom - 4, 3, 5); g.fillRect(4, bottom - 1, 2, 2);
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGa...
if (isSelected)
g.translate(x, y); boolean isOcean = MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme; Color oceanSelectedBorder = UIManager.getColor("TabbedPane.borderHightlightColor"); if (isOcean && isSelected) { g.setColor(oceanSelectedBorder); } else { g.setColor(darkShadow); } g.drawLine(1, bottom - 5, 6, bottom); g....
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGa...
g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x + 1, y, x + 1, y + h - 7); g.drawLine(x + 1, y + h - 7, x + 7, y + h - 1); } g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(x, y, x, y + h - 7); g.drawLine(x, y + h - 7, x + 6, y + h - 1); g.drawLine(x + 6, y + h - 1, x + w, y + h - 1); g...
g.setColor(selectHighlight); } else { g.setColor(highlight); } g.drawLine(1, bottom - 4, 1, bottom); } g.translate(-x, -y);
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGa...
if (isSelected)
g.translate(x, y); int bottom = h - 1; int right = w - 1; int tabCount = tabPane.getTabCount(); int currentRun = getRunForTab(tabCount, tabIndex); int firstIndex = tabRuns[currentRun]; if (tabIndex != firstIndex) { Color c; if (tabPane.getSelectedIndex() == tabIndex - 1) c = selectColor; else c = UIManager.getColor...
protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { if (isSelected) { g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x + 1, y + h, x + 1, y + 6); g.drawLine(x + 1, y + 6, x + 6, y + 1); g...
g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x + 1, y + h, x + 1, y + 6); g.drawLine(x + 1, y + 6, x + 6, y + 1); g.drawLine(x + 6, y + 1, x + w - 1, y + 1); } g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(x, y + h, x, y + 6); g.drawLine(x, y + 6, x + 6, y); g.drawLine(x + 6, y, x + ...
g.setColor(oceanSelectedBorder); } else { g.setColor(darkShadow); } g.drawLine(1, 5, 6, 0); g.drawLine(6, 0, right, 0); int lastIndex = lastTabInRun(tabCount, currentRun); if (tabIndex == lastIndex) { g.drawLine(0, bottom, right, bottom); } if (isOcean) { if (tabPane.getSelectedIndex() == tabIndex - 1) { g.drawLin...
protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { if (isSelected) { g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x + 1, y + h, x + 1, y + 6); g.drawLine(x + 1, y + 6, x + 6, y + 1); g...
if (isSelected)
g.translate(x, y); int bottom = h - 1; int right = w - 1; int tabCount = tabPane.getTabCount(); int currentRun = getRunForTab(tabCount, tabIndex); int firstIndex = tabRuns[currentRun]; if (tabIndex != firstIndex) { Color c; if (tabPane.getSelectedIndex() == tabIndex - 1) c = UIManager.getColor("TabbedPane.tabAreaBac...
protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { if (isSelected) { g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x, y + 1, x + w - 7, y + 1); g.drawLine(x + w - 7, y + 1, x + w - 1, y + 7...
g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x, y + 1, x + w - 7, y + 1); g.drawLine(x + w - 7, y + 1, x + w - 1, y + 7); } g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(x, y, x + w - 7, y); g.drawLine(x + w - 7, y, x + w - 1, y + 6); g.drawLine(x + w - 1, y + 6, x + w - 1, y + h - 1...
g.setColor(darkShadow); } int lastIndex = lastTabInRun(tabCount, currentRun); if (tabIndex == lastIndex) { g.drawLine(0, bottom, right, bottom); } if (isOcean && tabPane.getSelectedIndex() == tabIndex - 1) { g.setColor(oceanSelectedBorder); } g.drawLine(right - 6, 0, right, 6); g.drawLine(0, 0, right - 6, 0); if (...
protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { if (isSelected) { g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x, y + 1, x + w - 7, y + 1); g.drawLine(x + w - 7, y + 1, x + w - 1, y + 7...
g.setColor(UIManager.getColor("TabbedPane.selected"));
g.setColor(selectColor);
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { if (isSelected) g.setColor(UIManager.getColor("TabbedPane.selected")); else { // This is only present in the OceanTheme, so we must check if it // is actu...
Color background = UIManager.getColor("TabbedPane.unselectedBackground"); if (background == null) background = UIManager.getColor("TabbedPane.background"); g.setColor(background);
case LEFT: g.fillRect(x + 5, y + 1, w - 5, h - 1); g.fillRect(x + 2, y + 4, 3, h - 4); break; case BOTTOM: g.fillRect(x + 2, y, w - 2, h - 3); g.fillRect(x + 5, y + h - 4, w - 5, 3); break; case RIGHT: g.fillRect(x, y + 1, w - 4, h - 1); g.fillRect(x + w - 4, y + 5, 3, h - 5); break; case TOP: default: g.fillRect(x + 4...
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { if (isSelected) g.setColor(UIManager.getColor("TabbedPane.selected")); else { // This is only present in the OceanTheme, so we must check if it // is actu...
int[] px, py; if (tabPlacement == TOP) { px = new int[] {x + 6, x + w - 1, x + w -1, x + 2, x + 2}; py = new int[] {y + 2, y + 2, y + h - 1, y + h -1, y + 6}; } else if (tabPlacement == LEFT) { px = new int[] {x + 6, x + w - 1, x + w -1, x + 2, x + 2}; py = new int[] {y + 2, y + 2, y + h - 1, y + h -1, y + 6}; } else i...
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { if (isSelected) g.setColor(UIManager.getColor("TabbedPane.selected")); else { // This is only present in the OceanTheme, so we must check if it // is actu...
if (tabPlacement == TOP) paintTopTabBorder(tabIndex, g, x, y, w, h, 0, 0, isSelected); else if (tabPlacement == LEFT) paintLeftTabBorder(tabIndex, g, x, y, w, h, 0, 0, isSelected); else if (tabPlacement == BOTTOM) paintBottomTabBorder(tabIndex, g, x, y, w, h, 0, 0, isSelected); else if (tabPlacement == RIGHT) paintRigh...
int bottom = y + h - 1; int right = x + w - 1; switch (tabPlacement) { case LEFT: paintLeftTabBorder(tabIndex, g, x, y, w, h, bottom, right, isSelected); break; case BOTTOM: paintBottomTabBorder(tabIndex, g, x, y, w, h, bottom, right, isSelected); break; case RIGHT: paintRightTabBorder(tabIndex, g, x, y, w, h, bottom...
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { if (tabPlacement == TOP) paintTopTabBorder(tabIndex, g, x, y, w, h, 0, 0, isSelected); else if (tabPlacement == LEFT) paintLeftTabBorder(tabIndex, g, x, y, w, h, 0, ...
int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex);
int tabCount = tabPane.getTabCount(); int currentRun = getRunForTab(tabCount, tabIndex); int right = w - 1; int bottom = h - 1;
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGap(c...
g.setColor(getColorForGap(currentRun, x, y));
g.setColor(getColorForGap(currentRun, x, y + 1));
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGap(c...
if (isSelected)
g.translate(x, y); boolean isOcean = MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme; Color oceanSelectedBorder = UIManager.getColor("TabbedPane.borderHightlightColor"); if (isOcean && isSelected) g.setColor(oceanSelectedBorder); else g.setColor(darkShadow); g.drawLine(1, 5, 6, 0); g.drawLine(6, 0, right, ...
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGap(c...
g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(x + 1, y + h, x + 1, y + 6); g.drawLine(x + 1, y + 6, x + 6, y + 1); g.drawLine(x + 6, y + 1, x + w - 1, y + 1); } g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(x, y + h - 1, x, y + 6); g.drawLine(x, y + 6, x + 6, y); g.drawLine(x + 6, y, ...
g.drawLine(0, 0, 0, bottom); } } else { g.drawLine(0, 6, 0, bottom); } g.setColor(isSelected ? selectHighlight : highlight); g.drawLine(1, 6, 6, 1); g.drawLine(6, 1, right, 1); g.drawLine(1, 6, 1, bottom); int firstIndex = tabRuns[currentRun]; if (tabIndex == firstIndex && tabIndex != tabRuns[runCount - 1]) { if (...
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) { int currentRun = getRunForTab(tabPane.getTabCount(), tabIndex); if (shouldFillGap(currentRun, tabIndex, x, y)) { g.translate(x, y); g.setColor(getColorForGap(c...
return new ContentPane();
ContentPane p = new ContentPane(); p.setName(this.getName() + ".contentPane"); p.setLayout(new BorderLayout()); return p;
protected Container createContentPane() { return new ContentPane(); }
if (!((JMenu)c).isTopLevelMenu()) { JMenuItem menuItem = new JMenuItem(((JMenu)c).getText(), ((JMenu)c).getIcon()); return menuItem.getMaximumSize(); }
public Dimension getMaximumSize(JComponent c) { // If this menu is in a popup menu, treat it like a regular JMenuItem if (!((JMenu)c).isTopLevelMenu()) { JMenuItem menuItem = new JMenuItem(((JMenu)c).getText(), ((JMenu)c).getIcon()); return menuItem.getMaximumSize(); } return c.getPr...
return "job-impressions";
return "job-impressions-completed";
public String getName() { return "job-impressions"; }
numLines = 0;
int determineNumLines() { int end = getEndOffset(); if (end == 0) return 0; numLines = 0; int breakPoint; for (int i = getStartOffset(); i < end;) { numLines ++; // careful: check that there's no off-by-one problem here // depending on...
{ metrics = getContainer().getFontMetrics(getContainer().getFont());
public float getPreferredSpan(int axis) { if (axis == X_AXIS) return getWidth(); else if (axis == Y_AXIS) { metrics = getContainer().getFontMetrics(getContainer().getFont()); return numLines * metrics.getHeight(); } throw new IllegalArgumentException("...
}
public float getPreferredSpan(int axis) { if (axis == X_AXIS) return getWidth(); else if (axis == Y_AXIS) { metrics = getContainer().getFontMetrics(getContainer().getFont()); return numLines * metrics.getHeight(); } throw new IllegalArgumentException("...
metrics = getContainer().getFontMetrics(getContainer().getFont());
public Shape modelToView(int pos, Shape a, Bias b) throws BadLocationException { Segment s = getLineBuffer(); metrics = getContainer().getFontMetrics(getContainer().getFont()); int lineHeight = metrics.getHeight(); Rectangle rect = a.getBounds(); // Return a rectangle with width 1 ...
updateMetrics(); JTextComponent textComponent = (JTextComponent) getContainer(); g.setFont(textComponent.getFont()); selectedColor = textComponent.getSelectedTextColor(); unselectedColor = textComponent.getForeground(); disabledColor = textComponent.getDisabledTextColor(); selectedColor = Color.WHITE; Rectangle re...
public void paint(Graphics g, Shape s) { // TODO Auto-generated method stub }
metrics = getContainer().getFontMetrics(getContainer().getFont());
public int viewToModel(float x, float y, Shape a, Bias[] b) { Segment s = getLineBuffer(); Rectangle rect = a.getBounds(); int currLineStart = getStartOffset(); int end = getEndOffset(); metrics = getContainer().getFontMetrics(getContainer().getFont()); int lineHeight = metrics.getH...
Rectangle alloc = c.getBounds();
Rectangle alloc = c.isValid() ? c.getBounds() : new Rectangle(c.getPreferredSize()); updateMetrics();
protected int calculateBreakPosition(int p0, int p1) { Container c = getContainer(); Rectangle alloc = c.getBounds(); try { getDocument().getText(p0, p1 - p0, getLineBuffer()); } catch (BadLocationException ble) { // this shouldn't happen } // FIXME: Should we account...
alloc.x + alloc.width, this, p0);
alloc.x + alloc.width, this, 0);
protected int calculateBreakPosition(int p0, int p1) { Container c = getContainer(); Rectangle alloc = c.getBounds(); try { getDocument().getText(p0, p1 - p0, getLineBuffer()); } catch (BadLocationException ble) { // this shouldn't happen } // FIXME: Should we account...
alloc.x + alloc.width, this, p0);
alloc.x + alloc.width, this, 0); }
protected int calculateBreakPosition(int p0, int p1) { Container c = getContainer(); Rectangle alloc = c.getBounds(); try { getDocument().getText(p0, p1 - p0, getLineBuffer()); } catch (BadLocationException ble) { // this shouldn't happen } // FIXME: Should we account...
return Utilities.drawTabbedText(segment, x, y, g, this, 0);
return Utilities.drawTabbedText(segment, x, y, g, this, p0);
protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { g.setColor(selectedColor); Segment segment = getLineBuffer(); getDocument().getText(p0, p1 - p0, segment); return Utilities.drawTabbedText(segment, x, y, g, this, 0); }
return Utilities.drawTabbedText(segment, x, y, g, this, segment.offset);
return Utilities.drawTabbedText(segment, x, y, g, this, p0);
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException { JTextComponent textComponent = (JTextComponent) getContainer(); if (textComponent.isEnabled()) g.setColor(unselectedColor); else g.setColor(disabledColor); Segment segment = getLineBuff...
invalidate();
public void updateUI() { setUI((ProgressBarUI) UIManager.getUI(this)); invalidate(); }
return new primitiveArrayTypeCode(TCKind.tk_boolean);
return new ArrayTypeCode(TCKind.tk_boolean);
public static TypeCode type() { return new primitiveArrayTypeCode(TCKind.tk_boolean); }
private Integer computeOffset(String zoneString)
private Integer computeOffset(String zoneString, ParsePosition pos)
private Integer computeOffset(String zoneString) { Pattern pattern = Pattern.compile("(GMT)?([+-])([012])?([0-9]):?([0-9]{2})"); Matcher matcher = pattern.matcher(zoneString); if (matcher.matches()) { int sign = matcher.group(2).equals("+") ? 1 : -1; int hour = (Integer.parseInt(matcher.group(3)) ...
if (matcher.matches())
boolean hasAll = matcher.lookingAt(); try { matcher.group(2); matcher.group(4); matcher.group(5); } catch (IllegalStateException ise) { hasAll = false; } if (hasAll)
private Integer computeOffset(String zoneString) { Pattern pattern = Pattern.compile("(GMT)?([+-])([012])?([0-9]):?([0-9]{2})"); Matcher matcher = pattern.matcher(zoneString); if (matcher.matches()) { int sign = matcher.group(2).equals("+") ? 1 : -1; int hour = (Integer.parseInt(matcher.group(3)) ...
int hour = (Integer.parseInt(matcher.group(3)) * 10) + Integer.parseInt(matcher.group(4));
int hour = Integer.parseInt(matcher.group(4)); if (!matcher.group(3).equals("")) hour += (Integer.parseInt(matcher.group(3)) * 10);
private Integer computeOffset(String zoneString) { Pattern pattern = Pattern.compile("(GMT)?([+-])([012])?([0-9]):?([0-9]{2})"); Matcher matcher = pattern.matcher(zoneString); if (matcher.matches()) { int sign = matcher.group(2).equals("+") ? 1 : -1; int hour = (Integer.parseInt(matcher.group(3)) ...
int offset = sign * ((hour * 60) + minutes) * 60000;
pos.setIndex(pos.getIndex() + matcher.end());
private Integer computeOffset(String zoneString) { Pattern pattern = Pattern.compile("(GMT)?([+-])([012])?([0-9]):?([0-9]{2})"); Matcher matcher = pattern.matcher(zoneString); if (matcher.matches()) { int sign = matcher.group(2).equals("+") ? 1 : -1; int hour = (Integer.parseInt(matcher.group(3)) ...
pos.setIndex(pos.getIndex() + 3);
private Integer computeOffset(String zoneString) { Pattern pattern = Pattern.compile("(GMT)?([+-])([012])?([0-9]):?([0-9]{2})"); Matcher matcher = pattern.matcher(zoneString); if (matcher.matches()) { int sign = matcher.group(2).equals("+") ? 1 : -1; int hour = (Integer.parseInt(matcher.group(3)) ...
simpleOffset = computeOffset(dateStr.substring(index));
simpleOffset = computeOffset(dateStr.substring(index), pos);
public Date parse (String dateStr, ParsePosition pos) { int fmt_index = 0; int fmt_max = pattern.length(); calendar.clear(); boolean saw_timezone = false; int quote_start = -1; boolean is2DigitYear = false; try { for (; fmt_index < fmt_max; ++fmt_index) { char ch = pattern.charAt(fm...
Dimension gap = table.getInterCellSpacing();
Dimension gap = table.getIntercellSpacing();
private int getColForPoint(Point p) { int x0 = table.getLocation().x; int ncols = table.getColumnCount(); Dimension gap = table.getInterCellSpacing(); TableColumnModel cols = table.getColumnModel(); int x = p.x; for (int i = 0; i < ncols; ++i) { int width = col...
Dimension gap = table.getInterCellSpacing();
Dimension gap = table.getIntercellSpacing();
private int getRowForPoint(Point p) { int y0 = table.getLocation().y; int nrows = table.getRowCount(); Dimension gap = table.getInterCellSpacing(); int height = table.getRowHeight() + (gap == null ? 0 : gap.height); int y = p.y; for (int i = 0; i < nrows; ++i) { ...
Dimension gap = table.getInterCellSpacing();
Dimension gap = table.getIntercellSpacing();
public void paint(Graphics gfx, JComponent ignored) { int ncols = table.getColumnCount(); int nrows = table.getRowCount(); if (nrows == 0 || ncols == 0) return; Rectangle clip = gfx.getClipBounds(); TableColumnModel cols = table.getColumnModel(); int height = table.getRowHeight(); int x0 =...
if (b.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null
if (b.isContentAreaFilled() && UIManager.get(getPropertyPrefix() + "gradient") != null
public void update(Graphics g, JComponent c) { AbstractButton b = (AbstractButton) c; if (b.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null && !b.getModel().isPressed() && b.isEnabled()) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), ...
public Rectangle2D getBounds2D(Raster src)
public final Rectangle2D getBounds2D(Raster src)
public Rectangle2D getBounds2D(Raster src) { return src.getBounds(); }
public float[][] getMatrix()
public final float[][] getMatrix()
public float[][] getMatrix() { return matrix; }
activeObjectMap.Obj exists = aom.findServant(a_servant);
AOM.Obj exists = aom.findServant(a_servant);
public byte[] activate_object(Servant a_servant) throws ServantAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); required(IdAssignmentPolicyValue.SYSTEM_ID); activeObjectMap.Obj exists = aom.findServant(a_servant); if (exists != null)...
byte[] object_key = activeObjectMap.getFreeId(); servantDelegate delegate = new servantDelegate(a_servant, this, object_key);
byte[] object_key = AOM.getFreeId(); ServantDelegateImpl delegate = new ServantDelegateImpl(a_servant, this, object_key);
public byte[] activate_object(Servant a_servant) throws ServantAlreadyActive, WrongPolicy { checkDiscarding(); required(ServantRetentionPolicyValue.RETAIN); required(IdAssignmentPolicyValue.SYSTEM_ID); activeObjectMap.Obj exists = aom.findServant(a_servant); if (exists != null)...
private void connectDelegate(byte[] object_key, servantDelegate delegate)
private void connectDelegate(byte[] object_key, ServantDelegateImpl delegate)
private void connectDelegate(byte[] object_key, servantDelegate delegate) { aom.add(delegate); connect_to_orb(object_key, delegate.object); if (servant_activator != null) incarnate(null, object_key, delegate.servant, false); }
return create_reference_with_id(activeObjectMap.getFreeId(), a_repository_id);
return create_reference_with_id(AOM.getFreeId(), a_repository_id);
public org.omg.CORBA.Object create_reference(String a_repository_id) throws WrongPolicy { required(IdAssignmentPolicyValue.SYSTEM_ID); return create_reference_with_id(activeObjectMap.getFreeId(), a_repository_id); }
activeObjectMap.Obj e = aom.get(an_object_id);
AOM.Obj e = aom.get(an_object_id);
public org.omg.CORBA.Object create_reference_with_id(byte[] an_object_id, String a_repository_id ) { String[] ids; if (a_repository_id == null) ids = null; else ids = new String[] { a_reposit...
activeObjectMap.Obj exists = aom.get(the_Object_Id);
AOM.Obj exists = aom.get(the_Object_Id);
public void deactivate_object(byte[] the_Object_Id) throws ObjectNotActive, WrongPolicy { required(ServantRetentionPolicyValue.RETAIN); activeObjectMap.Obj exists = aom.get(the_Object_Id); if (exists == null || exists.isDeactiveted()) throw new ObjectNotActive(); exists.setDe...
activeObjectMap.Obj other = aom.findServant(exists.servant, false);
AOM.Obj other = aom.findServant(exists.servant, false);
public void deactivate_object(byte[] the_Object_Id) throws ObjectNotActive, WrongPolicy { required(ServantRetentionPolicyValue.RETAIN); activeObjectMap.Obj exists = aom.get(the_Object_Id); if (exists == null || exists.isDeactiveted()) throw new ObjectNotActive(); exists.setDe...
activeObjectMap.Obj obj;
AOM.Obj obj;
protected void etherealizeAll() { if (servant_activator == null) return; ArrayList keys = new ArrayList(); keys.addAll(aom.keySet()); byte[] key; activeObjectMap.Obj obj; boolean last; for (int i = 0; i < keys.size(); i++) { key = (byte[]) keys.get(i); obj = aom.get(key);...
public activeObjectMap.Obj findKey(byte[] object_id, byte[] poa_id)
public AOM.Obj findKey(byte[] object_id, byte[] poa_id)
public activeObjectMap.Obj findKey(byte[] object_id, byte[] poa_id) { activeObjectMap.Obj h = null; if (Arrays.equals(poa_id, id())) h = aom.get(object_id); if (h != null) return h; else { for (int i = 0; i < children.size(); i++) { h = ((gnuPOA) children.get(i))...
activeObjectMap.Obj h = null;
AOM.Obj h = null;
public activeObjectMap.Obj findKey(byte[] object_id, byte[] poa_id) { activeObjectMap.Obj h = null; if (Arrays.equals(poa_id, id())) h = aom.get(object_id); if (h != null) return h; else { for (int i = 0; i < children.size(); i++) { h = ((gnuPOA) children.get(i))...
cdrBufOutput buffer = new cdrBufOutput();
BufferedCdrOutput buffer = new BufferedCdrOutput();
public byte[] id() { if (m_poa_id != null) return m_poa_id; else { cdrBufOutput buffer = new cdrBufOutput(); POA p = this; while (p != null) { buffer.write_string(p.the_name()); p = p.the_parent(); } m_poa_id = buffer.buffer.toByteAr...
activeObjectMap.Obj ref = aom.get(the_Object_Id);
AOM.Obj ref = aom.get(the_Object_Id);
public org.omg.CORBA.Object id_to_reference(byte[] the_Object_Id) throws ObjectNotActive, WrongPolicy { required(ServantRetentionPolicyValue.RETAIN); activeObjectMap.Obj ref = aom.get(the_Object_Id); if (ref == null) throw new ObjectNotActive(); else return...
private Servant incarnate(activeObjectMap.Obj x, byte[] object_key,
private Servant incarnate(AOM.Obj x, byte[] object_key,
private Servant incarnate(activeObjectMap.Obj x, byte[] object_key, Servant a_servant, boolean use_forwarding ) { if (servant_activator != null) { Servant servant; try { servant = servant_activator.incarnate(object_key, th...
activeObjectMap.Obj exists, boolean use_forwarding
AOM.Obj exists, boolean use_forwarding
private void locateServant(byte[] an_Object_Id, Servant a_servant, activeObjectMap.Obj exists, boolean use_forwarding ) throws InternalError { // An object was created with create_reference. gnuServantObject object = (gnuServantObject)...
servantDelegate delegate = new servantDelegate(exists.servant, this, an_Object_Id);
ServantDelegateImpl delegate = new ServantDelegateImpl(exists.servant, this, an_Object_Id);
private void locateServant(byte[] an_Object_Id, Servant a_servant, activeObjectMap.Obj exists, boolean use_forwarding ) throws InternalError { // An object was created with create_reference. gnuServantObject object = (gnuServantObject)...
activeObjectMap.Obj ref = aom.findObject(the_Object);
AOM.Obj ref = aom.findObject(the_Object);
public byte[] reference_to_id(org.omg.CORBA.Object the_Object) throws WrongAdapter, WrongPolicy { activeObjectMap.Obj ref = aom.findObject(the_Object); if (ref == null) throw new WrongAdapter(); return ref.key; }
activeObjectMap.Obj ref = aom.findObject(the_Object);
AOM.Obj ref = aom.findObject(the_Object);
public Servant reference_to_servant(org.omg.CORBA.Object the_Object) throws ObjectNotActive, WrongPolicy, WrongAdapter { if (applies(ServantRetentionPolicyValue.RETAIN)) { activeObjectMap.Obj ref = aom.findObject(the_Object); if...
activeObjectMap.Obj ref = null;
AOM.Obj ref = null;
public byte[] servant_to_id(Servant the_Servant) throws ServantNotActive, WrongPolicy { if (applies(RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) || applies(ServantRetentionPolicyValue.RETAIN) && ( applies(IdUniquenessPolicyValue.UNIQUE_ID) || applies(Impl...
cdrBufOutput buffer = new cdrBufOutput();
BufferedCdrOutput buffer = new BufferedCdrOutput();
public byte[] toIORKey(byte[] object_id) { cdrBufOutput buffer = new cdrBufOutput(); buffer.write_long(SIGNATURE); buffer.write_sequence(object_id); buffer.write_sequence(id()); return buffer.buffer.toByteArray(); }
if (interpolationType == 0)
switch (interpolationType) { case TYPE_BILINEAR:
public AffineTransformOp (AffineTransform xform, int interpolationType) { this.transform = xform; if (interpolationType == 0) hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); else h...
else
break; case TYPE_BICUBIC: hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); break; default:
public AffineTransformOp (AffineTransform xform, int interpolationType) { this.transform = xform; if (interpolationType == 0) hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); else h...
}
public AffineTransformOp (AffineTransform xform, int interpolationType) { this.transform = xform; if (interpolationType == 0) hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); else h...
return parentPeer.createVolatileImage(width, height);
im = parentPeer.createVolatileImage(width, height); } return im;
public VolatileImage createVolatileImage(int width, int height) { Component parent = awtComponent.getParent(); ComponentPeer parentPeer = parent.getPeer(); return parentPeer.createVolatileImage(width, height); }
}
public void handleEvent(AWTEvent e) { switch (e.getID()) { case PaintEvent.UPDATE: case PaintEvent.PAINT: Graphics g = getGraphics(); Rectangle clip = ((PaintEvent)e).getUpdateRect(); g.clipRect(clip.x, clip.y, clip.width, clip.height); //if (this instanceof LightweightPee...
Component parent = awtComponent.getParent(); if (parent != null) parent.repaint(awtComponent.getX(), awtComponent.getY(), awtComponent.getWidth(), awtComponent.getHeight());
public void hide() { if (swingComponent != null) swingComponent.getJComponent().setVisible(false); }
boolean res;
public boolean prepareImage(Image img, int width, int height, ImageObserver ob) { Component parent = awtComponent.getParent(); boolean res; if(parent != null) { ComponentPeer parentPeer = parent.getPeer(); res = parentPeer.prepareImage(img, width, height, ob); } else { res...
res = parentPeer.prepareImage(img, width, height, ob);
return parentPeer.prepareImage(img, width, height, ob);
public boolean prepareImage(Image img, int width, int height, ImageObserver ob) { Component parent = awtComponent.getParent(); boolean res; if(parent != null) { ComponentPeer parentPeer = parent.getPeer(); res = parentPeer.prepareImage(img, width, height, ob); } else { res...
res = Toolkit.getDefaultToolkit().prepareImage(img, width, height, ob);
return Toolkit.getDefaultToolkit().prepareImage(img, width, height, ob);
public boolean prepareImage(Image img, int width, int height, ImageObserver ob) { Component parent = awtComponent.getParent(); boolean res; if(parent != null) { ComponentPeer parentPeer = parent.getPeer(); res = parentPeer.prepareImage(img, width, height, ob); } else { res...
return res;
public boolean prepareImage(Image img, int width, int height, ImageObserver ob) { Component parent = awtComponent.getParent(); boolean res; if(parent != null) { ComponentPeer parentPeer = parent.getPeer(); res = parentPeer.prepareImage(img, width, height, ob); } else { res...
if (swingComponent != null) swingComponent.getJComponent().setVisible(visible);
if (visible) show(); else hide();
public void setVisible(boolean visible) { if (swingComponent != null) swingComponent.getJComponent().setVisible(visible); }
int weeks = (month == 1 && leap == 0) ? 4 : 5;
int weeks = (month == 1 && leap == 0) ? 5 : 6;
private void nonLeniencyCheck() throws IllegalArgumentException { int[] month_days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int year = fields[YEAR]; int month = fields[MONTH]; int leap = isLeapYear(year) ? 1 : 0; if (isSet[ERA] && fields[ERA] != AD && fields[ERA] != BC) throw new Il...
awtContainer.doLayout();
public void layoutContainer(Container parent) { final int cnt = parent.getComponentCount(); final Insets insets = containerPeer.getInsets(); final int dx = insets.left; final int dy = insets.top; for (int i = 0; i < cnt; i++) { final Component child = parent.getComponent(i); if (child instanceof ISwingPeer) {...
return ((1 << getType(ch)) & ((1 << UPPERCASE_LETTER) | (1 << LOWERCASE_LETTER) | (1 << TITLECASE_LETTER) | (1 << MODIFIER_LETTER) | (1 << OTHER_LETTER) | (1 << LETTER_NUMBER) | (1 << CURRENCY_SYMBOL) | (1 << CONNECTOR_PUNCTUATION))) != 0;
return isJavaIdentifierStart((int)ch);
public static boolean isJavaIdentifierStart(char ch) { return ((1 << getType(ch)) & ((1 << UPPERCASE_LETTER) | (1 << LOWERCASE_LETTER) | (1 << TITLECASE_LETTER) | (1 << MODIFIER_LETTER) | (1 << OTHER_LETTER) | (1 << LETTER_NUMBER) ...
piRegistry = new PluginRegistryModel(piList.getDescriptorUrlList());
piRegistry = new PluginRegistryModel(piList.getPluginList());
public final void execute() throws BuildException { final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { piList = getPlugin...
clsMgr = new VmClassLoader(classesURL, arch, new BuildObjectResolver(os, this));
clsMgr = new VmSystemClassLoader(classesURL, arch, new BuildObjectResolver(os, this));
public final void execute() throws BuildException { final long lmJar = jarFile.lastModified(); final long lmKernel = kernelFile.lastModified(); final long lmDest = destFile.lastModified(); final long lmPIL = getPluginListFile().lastModified(); final PluginList piList; final long lmPI; try { piList = getPlugin...