bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
12,002
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; if (tabPlacement == SwingConstants.LEFT && startgap >= 0) { g.drawLine(x, y, x, startgap); g.drawLine(x, endgap, x, y + h - 1); if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
12,003
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
12,004
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h); g.setColor(saved); }
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.LEFT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.drawLine(x, y, x, startgap - diff); g.drawLine(x, endgap - diff, x, y + h); } else g.drawLine(x, y, x, y + h - 1); g.setColor(selectedColor); g.drawLine(x + 1, y + 1, x + 1, y + h - 4); g.setColor(saved); }
12,005
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
12,006
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
12,007
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
12,008
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
12,009
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
12,010
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
12,011
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); } g.setColor(saved); }
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height; int diff = 0; if (tabPlacement == SwingConstants.RIGHT) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.y; } g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff); g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w, y, x + w, startgap - diff); g.drawLine(x + w, endgap - diff, x + w, y + h); } else { g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x + w - 1, y, x + w - 1, y + h - 2); } g.setColor(saved); }
12,012
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
12,014
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; if (tabPlacement == SwingConstants.TOP && startgap >= 0) { g.drawLine(x, y, startgap, y); g.drawLine(endgap, y, x + w - 1, y); if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
12,015
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) { Color saved = g.getColor(); g.setColor(lightHighlight); int startgap = rects[selectedIndex].x; int endgap = rects[selectedIndex].x + rects[selectedIndex].width; int diff = 0; if (tabPlacement == SwingConstants.TOP) { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Point p = findPointForIndex(currentScrollLocation); diff = p.x; } g.drawLine(x, y, startgap - diff, y); g.drawLine(endgap - diff, y, x + w, y); } else g.drawLine(x, y, x + w, y); g.setColor(saved); }
12,016
protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) { Rectangle rect = rects[tabIndex]; boolean isSelected = tabIndex == tabPane.getSelectedIndex(); // Paint background if necessary. if (tabsOpaque || tabPane.isOpaque()) { paintTabBackground(g, tabPlacement, tabIndex, rect.x, rect.y, rect.width, rect.height, isSelected); } // Paint border. paintTabBorder(g, tabPlacement, tabIndex, rect.x, rect.y, rect.width, rect.height, isSelected); // Layout label. FontMetrics fm = getFontMetrics(); Icon icon = getIconForTab(tabIndex); String title = tabPane.getTitleAt(tabIndex); layoutLabel(tabPlacement, fm, tabIndex, title, icon, rect, iconRect, textRect, isSelected); // Paint the text. paintText(g, tabPlacement, tabPane.getFont(), fm, tabIndex, title, textRect, isSelected); // Paint icon if necessary. paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); // Paint focus indicator. paintFocusIndicator(g, tabPlacement, rects, tabIndex, iconRect, textRect, isSelected); }
protectedvoidpaintTab(Graphicsg,inttabPlacement,Rectangle[]rects,inttabIndex,RectangleiconRect,RectangletextRect){Rectanglerect=rects[tabIndex];booleanisSelected=tabIndex==tabPane.getSelectedIndex();//Paintbackgroundifnecessary.if(tabsOpaque||tabPane.isOpaque()){paintTabBackground(g,tabPlacement,tabIndex,rect.x,rect.y,rect.width,rect.height,isSelected);}//Paintborder.paintTabBorder(g,tabPlacement,tabIndex,rect.x,rect.y,rect.width,rect.height,isSelected);//Layoutlabel.FontMetricsfm=getFontMetrics();Iconicon=getIconForTab(tabIndex);Stringtitle=tabPane.getTitleAt(tabIndex);layoutLabel(tabPlacement,fm,tabIndex,title,icon,rect,iconRect,textRect,isSelected);//Paintthetext.paintText(g,tabPlacement,tabPane.getFont(),fm,tabIndex,title,textRect,isSelected);//Painticonifnecessary.paintIcon(g,tabPlacement,tabIndex,icon,iconRect,isSelected);//Paintfocusindicator.paintFocusIndicator(g,tabPlacement,rects,tabIndex,iconRect,textRect,isSelected);}
12,019
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
12,021
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, tempIconRect, tempTextRect); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
12,022
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, ir, tr); }
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { Rectangle ir = new Rectangle(); Rectangle tr = new Rectangle(); boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT; // Please note: the ordering of the painting is important. // we WANT to paint the outermost run first and then work our way in. int tabCount = tabPane.getTabCount(); for (int i = runCount - 1; i >= 0; --i) { int start = tabRuns[i]; int next; if (i == runCount - 1) next = tabRuns[0]; else next = tabRuns[i + 1]; int end = next != 0 ? next - 1 : tabCount - 1; for (int j = start; j <= end; ++j) { if (j != selectedIndex) { paintTab(g, tabPlacement, rects, j, ir, tr); } } } // Paint selected tab in front of every other tab. if (selectedIndex >= 0) paintTab(g, tabPlacement, rects, selectedIndex, tempIconRect, tempTextRect); }
12,023
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(selectedColor); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
12,024
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.LIGHT_GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
12,025
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } g.fillRect(x, y, w, h); g.setColor(saved); }
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (isSelected) g.setColor(Color.LIGHT_GRAY); else { Color bg = tabPane.getBackgroundAt(tabIndex); if (bg == null) bg = Color.GRAY; g.setColor(bg); } switch (tabPlacement) { case SwingConstants.TOP: g.fillRect(x + 1, y + 1, w - 1, h - 1); break; case SwingConstants.BOTTOM: g.fillRect(x, y, w - 1, h - 1); break; case SwingConstants.LEFT: g.fillRect(x + 1, y + 1, w - 1, h - 2); break; case SwingConstants.RIGHT: g.fillRect(x, y + 1, w - 1, h - 2); break; } g.setColor(saved); }
12,026
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); switch (tabPlacement) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,027
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + w - 2, y + 2, x + w - 2, y + h); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,028
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,029
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,030
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + 2, y + h - 1, x + w - 1, y + h - 1); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,031
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,032
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,033
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,034
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
12,035
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w, y); } g.setColor(saved); }
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) { Color saved = g.getColor(); if (! isSelected || tabPlacement != SwingConstants.TOP) { g.setColor(shadow); g.drawLine(x + 1, y + h - 1, x + w - 1, y + h - 1); g.setColor(darkShadow); g.drawLine(x, y + h, x + w, y + h); } if (! isSelected || tabPlacement != SwingConstants.LEFT) { g.setColor(darkShadow); g.drawLine(x + w, y, x + w, y + h); g.setColor(shadow); g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1); } if (! isSelected || tabPlacement != SwingConstants.RIGHT) { g.setColor(lightHighlight); g.drawLine(x, y, x, y + h); } if (! isSelected || tabPlacement != SwingConstants.BOTTOM) { g.setColor(lightHighlight); g.drawLine(x, y, x + w - 3, y); g.setColor(darkShadow); g.drawLine(x + w - 2, y + 1, x + w - 1, y + 2); g.drawLine(x + w - 1, y + 3, x + w - 1, y + h - 3); g.drawLine(x + w - 2, y + h - 2, x + w - 3, y + h - 1); g.drawLine(x, y + h - 1, x + w - 4, y + h - 1); g.setColor(shadow); g.drawLine(x + w - 2, y + 2, x + w - 2, y + h - 3); g.drawLine(x, y + h - 2, x + w - 3, y + h - 2); break; } g.setColor(saved); }
12,036
protected void selectNextTab(int current) { tabPane.setSelectedIndex(getNextTabIndex(current)); }
protected void selectNextTab(int current) { current = getNextTabIndex(current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current); }
12,039
protected void selectNextTabInRun(int current) { tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(), current)); }
protected void selectNextTabInRun(int current) { tabPane.setSelectedIndex(getNextTabIndexInRun(tabPane.getTabCount(), current)); }
12,040
protected void selectPreviousTab(int current) { tabPane.setSelectedIndex(getPreviousTabIndex(current)); }
protected void selectPreviousTab(int current) { current = getPreviousTabIndex(current); if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) scrollTab(current, tabPane.getTabPlacement()); tabPane.setSelectedIndex(current); }
12,041
protected void selectPreviousTabInRun(int current) { tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(), current)); }
protected void selectPreviousTabInRun(int current) { tabPane.setSelectedIndex(getPreviousTabIndexInRun(tabPane.getTabCount(), current)); }
12,042
public int tabForCoordinate(JTabbedPane pane, int x, int y) { if (! tabPane.isValid()) tabPane.validate(); int tabCount = tabPane.getTabCount(); int index = -1; for (int i = 0; i < tabCount; ++i) { if (rects[i].contains(x, y)) { index = i; break; } } // FIXME: Handle scrollable tab layout. return index; }
public int tabForCoordinate(JTabbedPane pane, int x, int y) { if (! tabPane.isValid()) tabPane.validate(); int tabCount = tabPane.getTabCount(); int index = tabPane.getSelectedIndex(); for (int i = 0; i < tabCount; ++i) { if (rects[i].contains(x, y)) { index = i; break; } } // FIXME: Handle scrollable tab layout. return index; }
12,043
public int tabForCoordinate(JTabbedPane pane, int x, int y) { if (! tabPane.isValid()) tabPane.validate(); int tabCount = tabPane.getTabCount(); int index = -1; for (int i = 0; i < tabCount; ++i) { if (rects[i].contains(x, y)) { index = i; break; } } // FIXME: Handle scrollable tab layout. return index; }
public int tabForCoordinate(JTabbedPane pane, int x, int y){if (! tabPane.isValid())tabPane.validate();int tabCount = tabPane.getTabCount();int index = -1;for (int i = 0; i < tabCount; ++i){if (rects[i].contains(x, y)){index = i;break;}}// FIXME: Handle scrollable tab layout.return index;}
12,044
protected void uninstallComponents() { // Nothing to be done. }
if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); protectedif (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); voidif (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); uninstallComponents()if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); {if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); //if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); Nothingif (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); toif (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); beif (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); done.if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); if (incrButton != null) tabPane.remove(incrButton); if (decrButton != null) tabPane.remove(decrButton); if (viewport != null) tabPane.remove(viewport); }
12,045
protected void uninstallDefaults() { calcRect = null; tabAreaRect = null; contentRect = null; tabRuns = null; contentBorderInsets = null; tabAreaInsets = null; selectedTabPadInsets = null; tabInsets = null; focus = null; darkShadow = null; shadow = null; lightHighlight = null; highlight = null; // Install UI colors and fonts. LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); }
protected void uninstallDefaults() { calcRect = null; tabAreaRect = null; contentRect = null; tabRuns = null; contentBorderInsets = null; tabAreaInsets = null; selectedTabPadInsets = null; tabInsets = null; focus = null; darkShadow = null; shadow = null; lightHighlight = null; highlight = null; // Install UI colors and fonts. LookAndFeel.installColorsAndFont(tabPane, "TabbedPane.background", "TabbedPane.foreground", "TabbedPane.font"); }
12,046
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
protected void uninstallKeyboardActions() { // FIXME: Implement. }
12,047
protected void uninstallKeyboardActions() throws NotImplementedException { // FIXME: Implement. }
SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); protectedSwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); voidSwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); uninstallKeyboardActions()SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); throwsSwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); NotImplementedExceptionSwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); {SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); //SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); FIXME:SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); Implement.SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); SwingUtilities.replaceUIActionMap(tabPane, null); SwingUtilities.replaceUIInputMap(tabPane, JComponent.WHEN_FOCUSED, null); SwingUtilities .replaceUIInputMap(tabPane, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null); }
12,048
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
12,050
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
12,051
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + Specification.getInstance().getPrettyXDFOutputIndentation(), which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
12,052
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
private void nestedToXDF(OutputStream outputstream, String indent, int which, int stop) { String delimiter = getDelimiter(); String repeatable = getRepeatable(); String recordTerminator = getRecordTerminator(); if (which > stop) { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + classXDFNodeName); if (delimiter !=null) writeOut(outputstream, " delimiter =\"" + delimiter + "\""); writeOut(outputstream, " repeatable=\"" + repeatable + "\""); if (recordTerminator !=null) writeOut(outputstream, " recordTerminator=\"" + recordTerminator + "\"/>"); } else { if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + UntaggedInstructionNodeName + " axisIdRef=\""); writeOut(outputstream, ((AxisInterface) parentArray.getAxisList().get(which)).getAxisId() + "\">"); which++; nestedToXDF(outputstream, indent + sPrettyXDFOutputIndentation, which, stop); if (Specification.getInstance().isPrettyXDFOutput()) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + UntaggedInstructionNodeName + ">"); } }
12,053
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) setSelectionInterval(index0, index1); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) setSelectionInterval(index0, index1); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
12,054
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
public void addSelectionInterval(int index0, int index1) { int lo = Math.min(index0, index1); int hi = Math.max(index0, index1); oldSel = sel.clone(); if (selectionMode == SINGLE_SELECTION) sel.clear(); // COMPAT: Like Sun (but not like IBM), we allow calls to // addSelectionInterval when selectionMode is // SINGLE_SELECTION_INTERVAL iff the interval being added // is adjacent to an already selected interval if (selectionMode == SINGLE_INTERVAL_SELECTION) if (!(isSelectedIndex(index0) || isSelectedIndex(index1) || isSelectedIndex(Math.max(lo-1,0)) || isSelectedIndex(Math.min(hi+1,sel.size())))) sel.clear(); if (selectionMode == SINGLE_SELECTION) index0 = index1; // We have to update the anchorSelectionIndex and leadSelectionIndex // variables // The next if statements breaks down to "if this selection is adjacent // to the previous selection and going in the same direction" if ((isSelectedIndex(leadSelectionIndex)) && ((index0 - 1 == leadSelectionIndex && (index1 >= index0) && (leadSelectionIndex >= anchorSelectionIndex)) || (index0 + 1 == leadSelectionIndex && (index1 <= index0) && (leadSelectionIndex <= anchorSelectionIndex))) && (anchorSelectionIndex != -1 || leadSelectionIndex != -1)) { // setting setLeadCalledFromAdd to true tells setLeadSelectionIndex // not to update oldSel setLeadCalledFromAdd = true; setLeadSelectionIndex(index1); setLeadCalledFromAdd = false; } else { leadSelectionIndex = index1; anchorSelectionIndex = index0; sel.set(lo, hi+1); if (sel.equals(oldSel) == false) fireValueChanged(lo, hi, valueIsAdjusting); } }
12,055
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if (first) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
12,065
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if ((now - timestamp) > millisToDecideToPopup) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
12,066
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
12,067
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if (expected > millisToPopup) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
12,068
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if (progressDialog != null) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
12,069
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ( ( delta * progressBar.getWidth() / (max - min) ) > 0 ) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
public void actionPerformed(ActionEvent ae) { long now = System.currentTimeMillis(); if ( first ) { if (( now - timestamp ) > millisToDecideToPopup ) { first = false; long expected = ( progress - min == 0 ) ? ( now - timestamp ) * ( max - min ) : ( now - timestamp ) * ( max - min ) / ( progress - min ); if ( expected > millisToPopup ) { createDialog(); } } else { // We have not waited long enough to make a decision, // so return and try again when the timer is invoked. return; } } else if ( progressDialog != null ) { // The progress dialog is being displayed. We now calculate // whether setting the progress bar to the current progress // value would result in a visual difference. int delta = progress - progressBar.getValue(); if ((delta * progressBar.getWidth() / (max - min)) > 0) { // At least one pixel would change. progressBar.setValue(progress); } } else { // No dialog necessary timer.stop(); timer = null; } timestamp = now; }
12,070
public void close() { if ( progressDialog != null ) { progressDialog.setVisible(false); } if ( timer != null ) { timer.stop(); timer = null; } }
public void close() { if (progressDialog != null) { progressDialog.setVisible(false); } if ( timer != null ) { timer.stop(); timer = null; } }
12,071
public void close() { if ( progressDialog != null ) { progressDialog.setVisible(false); } if ( timer != null ) { timer.stop(); timer = null; } }
public void close() { if ( progressDialog != null ) { progressDialog.setVisible(false); } if (timer != null) { timer.stop(); timer = null; } }
12,072
public void setNote(String note) { if ( noteLabel != null ) { noteLabel.setText(note); } else { this.note = note; } }
public void setNote(String note) { if (noteLabel != null) { noteLabel.setText(note); } else { this.note = note; } }
12,073
public void setProgress(int progress) { this.progress = progress; // Initializes and starts a timer with a task // which measures the duration and displays // a progress dialog if neccessary. if ( timer == null && progressDialog == null ) { timer = new Timer(25, null); timer.addActionListener(new TimerListener()); timer.start(); } // Cancels timer and hides progress dialog if the // maximum value is reached. if ( progressBar != null && this.progress >= progressBar.getMaximum() ) { // The reason for using progressBar.getMaximum() instead of max is that // we want to prevent that changes to the value have any effect after the // progress dialog is visible (This is how the JDK behaves.). close(); } }
public void setProgress(int progress) { this.progress = progress; // Initializes and starts a timer with a task // which measures the duration and displays // a progress dialog if neccessary. if (timer == null && progressDialog == null) { timer = new Timer(25, null); timer.addActionListener(new TimerListener()); timer.start(); } // Cancels timer and hides progress dialog if the // maximum value is reached. if ( progressBar != null && this.progress >= progressBar.getMaximum() ) { // The reason for using progressBar.getMaximum() instead of max is that // we want to prevent that changes to the value have any effect after the // progress dialog is visible (This is how the JDK behaves.). close(); } }
12,074
public void setProgress(int progress) { this.progress = progress; // Initializes and starts a timer with a task // which measures the duration and displays // a progress dialog if neccessary. if ( timer == null && progressDialog == null ) { timer = new Timer(25, null); timer.addActionListener(new TimerListener()); timer.start(); } // Cancels timer and hides progress dialog if the // maximum value is reached. if ( progressBar != null && this.progress >= progressBar.getMaximum() ) { // The reason for using progressBar.getMaximum() instead of max is that // we want to prevent that changes to the value have any effect after the // progress dialog is visible (This is how the JDK behaves.). close(); } }
public void setProgress(int progress) { this.progress = progress; // Initializes and starts a timer with a task // which measures the duration and displays // a progress dialog if neccessary. if ( timer == null && progressDialog == null ) { timer = new Timer(25, null); timer.addActionListener(new TimerListener()); timer.start(); } // Cancels timer and hides progress dialog if the // maximum value is reached. if (progressBar != null && this.progress >= progressBar.getMaximum()) { // The reason for using progressBar.getMaximum() instead of max is that // we want to prevent that changes to the value have any effect after the // progress dialog is visible (This is how the JDK behaves.). close(); } }
12,075
public void setRollover(boolean r) { // if this call does not represent a CHANGE in state, then return if ((r && isRollover()) || (!r && !isRollover())) return; // cannot set ROLLOVER property unless button is enabled if (!isEnabled()) return; // make the change if (r) stateMask = stateMask | ROLLOVER; else stateMask = stateMask & (~ROLLOVER); // notify interested ChangeListeners fireStateChanged(); }
public void setRollover(boolean r) { // if this call does not represent a CHANGE in state, then return if (r == isRollover()) return; // cannot set ROLLOVER property unless button is enabled if (!isEnabled()) return; // make the change if (r) stateMask = stateMask | ROLLOVER; else stateMask = stateMask & (~ROLLOVER); // notify interested ChangeListeners fireStateChanged(); }
12,076
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
12,077
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
public void setSelected(boolean s) { // if this call does not represent a CHANGE in state, then return if ((s && isSelected()) || (!s && !isSelected())) return; // make the change if (s) stateMask = stateMask | SELECTED; else stateMask = stateMask & (~SELECTED); // notify interested ChangeListeners fireStateChanged(); // fire ItemStateChanged events if (s) { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, null, ItemEvent.SELECTED)); if (group != null) group.setSelected(this, true); } else { fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, ItemEvent.DESELECTED)); if (group != null) group.setSelected(this, false); } }
12,078
protected DSSKey(BigInteger p, BigInteger q, BigInteger g) { super(); this.p = p; this.q = q; this.g = g; }
protected DSSKey(int defaultFormat, BigInteger p, BigInteger q, BigInteger g) { super(); this.p = p; this.q = q; this.g = g; }
12,079
public String getFormat() { return null; }
public String getFormat() { return KeyPairCodecFactory.getEncodingShortName(defaultFormat); }
12,081
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
public void update(Graphics g, JComponent c) { int height = c.getHeight(); if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null && c.getBackground() instanceof UIResource && height > 2) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
12,082
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
public void update(Graphics g, JComponent c) { if (c.isOpaque() && UIManager.get("MenuBar.gradient") != null) { MetalUtils.paintGradient(g, 0, 0, c.getWidth(), height - 2, SwingConstants.VERTICAL, "MenuBar.gradient"); paint(g, c); } else super.update(g, c); }
12,083
public GlobalConfigure() { if (_instance == null) { // initialize the settings information initialize(); // set our instance to this one. _instance = this; } }
public GlobalConfigure() { if (_instance == null) { // initialize the settings information initialize(); // set our instance to this one. _instance = this; } }
12,085
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, offset, len); ValueList thisValueList = CurrentValueList; // safety check if (!thisValueList.getIsDelimitedCase() ) { String noWhiteSpaceList = valueListString.trim(); if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return; } // 2. reconsitute information we need String parentNodeName = thisValueList.getParentNodeName(); // 3. add these values to the lookup table, if the original valueList had an ID String valueListId = thisValueList.getValueListId(); if (valueListId != null) { // a warning check, just in case if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); // add the valueList array into the list of valueList objects ValueListObj.put(valueListId, thisValueList); } // 4. If there is a reference object, clone it to get // the new valueList String valueListIdRef = thisValueList.getValueListIdRef(); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { // Just a simple clone since we have stored the ArrayList rather than the // ValueList object (which actually doesnt exist. :P ValueList refValueListObj = (ValueList) ValueListObj.get(valueListIdRef); try { thisValueList = (ValueList) refValueListObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone valueList object. Aborting read."); System.exit(-1); }// This is missing. Should allow override. // later note to self: Huh?? /* // override attrs with those in passed list // strValueList.setAttributes(attrs); // give the clone a unique Id and remove IdRef // strValueList.setValueListId(findUniqueIdName(ValueListObj,strValueList.getValueListId())); // strValueList.setValueListIdRef(null); // add this into the list of valueList objects // ValueListObj.put(strValueList.getValueListId(), strValueList);*/ } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } // 5. split up string into Value Objects based on declared delimiter ArrayList myValueList = splitStringIntoValueObjects( valueListString, thisValueList); // 6. determine where these values go and then insert them ValueListDelimitedList newValueListObj = new ValueListDelimitedList (myValueList, thisValueList.getDelimiter(), thisValueList.getNoData(), thisValueList.getInfinite(), thisValueList.getInfiniteNegative(), thisValueList.getNotANumber(), thisValueList.getOverflow(), thisValueList.getUnderflow() ); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxes(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); lastAxisObject.addAxisValueList(newValueListObj); } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addValueList( newValueListObj); } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", Ignoring."); } // now add valueObjects to groups Iterator iter = myValueList.iterator(); while (iter.hasNext()) { Value newvalue = (Value) iter.next(); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueList.setIsDelimitedCase(true); // notify that we did the list }
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, offset, len); ValueList thisValueList = CurrentValueList; // safety check if ( !thisValueList.getIsDelimitedCase() ) { String noWhiteSpaceList = valueListString.trim(); if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return; } // 2. reconsitute information we need String parentNodeName = thisValueList.getParentNodeName(); // 3. add these values to the lookup table, if the original valueList had an ID String valueListId = thisValueList.getValueListId(); if (valueListId != null) { // a warning check, just in case if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); // add the valueList array into the list of valueList objects ValueListObj.put(valueListId, thisValueList); } // 4. If there is a reference object, clone it to get // the new valueList String valueListIdRef = thisValueList.getValueListIdRef(); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { // Just a simple clone since we have stored the ArrayList rather than the // ValueList object (which actually doesnt exist. :P ValueList refValueListObj = (ValueList) ValueListObj.get(valueListIdRef); try { thisValueList = (ValueList) refValueListObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone valueList object. Aborting read."); System.exit(-1); }// This is missing. Should allow override. // later note to self: Huh?? /* // override attrs with those in passed list // strValueList.setAttributes(attrs); // give the clone a unique Id and remove IdRef // strValueList.setValueListId(findUniqueIdName(ValueListObj,strValueList.getValueListId())); // strValueList.setValueListIdRef(null); // add this into the list of valueList objects // ValueListObj.put(strValueList.getValueListId(), strValueList);*/ } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } // 5. split up string into Value Objects based on declared delimiter ArrayList myValueList = splitStringIntoValueObjects( valueListString, thisValueList); // 6. determine where these values go and then insert them ValueListDelimitedList newValueListObj = new ValueListDelimitedList (myValueList, thisValueList.getDelimiter(), thisValueList.getNoData(), thisValueList.getInfinite(), thisValueList.getInfiniteNegative(), thisValueList.getNotANumber(), thisValueList.getOverflow(), thisValueList.getUnderflow() ); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxes(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); lastAxisObject.addAxisValueList(newValueListObj); } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addValueList( newValueListObj); } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", Ignoring."); } // now add valueObjects to groups Iterator iter = myValueList.iterator(); while (iter.hasNext()) { Value newvalue = (Value) iter.next(); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueList.setIsDelimitedCase(true); // notify that we did the list }
12,086
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, offset, len); ValueList thisValueList = CurrentValueList; // safety check if (!thisValueList.getIsDelimitedCase() ) { String noWhiteSpaceList = valueListString.trim(); if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return; } // 2. reconsitute information we need String parentNodeName = thisValueList.getParentNodeName(); // 3. add these values to the lookup table, if the original valueList had an ID String valueListId = thisValueList.getValueListId(); if (valueListId != null) { // a warning check, just in case if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); // add the valueList array into the list of valueList objects ValueListObj.put(valueListId, thisValueList); } // 4. If there is a reference object, clone it to get // the new valueList String valueListIdRef = thisValueList.getValueListIdRef(); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { // Just a simple clone since we have stored the ArrayList rather than the // ValueList object (which actually doesnt exist. :P ValueList refValueListObj = (ValueList) ValueListObj.get(valueListIdRef); try { thisValueList = (ValueList) refValueListObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone valueList object. Aborting read."); System.exit(-1); }// This is missing. Should allow override. // later note to self: Huh?? /* // override attrs with those in passed list // strValueList.setAttributes(attrs); // give the clone a unique Id and remove IdRef // strValueList.setValueListId(findUniqueIdName(ValueListObj,strValueList.getValueListId())); // strValueList.setValueListIdRef(null); // add this into the list of valueList objects // ValueListObj.put(strValueList.getValueListId(), strValueList);*/ } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } // 5. split up string into Value Objects based on declared delimiter ArrayList myValueList = splitStringIntoValueObjects( valueListString, thisValueList); // 6. determine where these values go and then insert them ValueListDelimitedList newValueListObj = new ValueListDelimitedList (myValueList, thisValueList.getDelimiter(), thisValueList.getNoData(), thisValueList.getInfinite(), thisValueList.getInfiniteNegative(), thisValueList.getNotANumber(), thisValueList.getOverflow(), thisValueList.getUnderflow() ); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxes(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); lastAxisObject.addAxisValueList(newValueListObj); } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addValueList( newValueListObj); } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", Ignoring."); } // now add valueObjects to groups Iterator iter = myValueList.iterator(); while (iter.hasNext()) { Value newvalue = (Value) iter.next(); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueList.setIsDelimitedCase(true); // notify that we did the list }
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, offset, len); ValueList thisValueList = CurrentValueList; // safety check if (!thisValueList.getIsDelimitedCase() ) { String noWhiteSpaceList = valueListString.trim(); if (noWhiteSpaceList.length() > 0) Log.errorln("Got non-whitespace character data for algorithm valueList. Ignoring."); return; } // 2. reconsitute information we need String parentNodeName = thisValueList.getParentNodeName(); // 3. add these values to the lookup table, if the original valueList had an ID String valueListId = thisValueList.getValueListId(); if (valueListId != null) { // a warning check, just in case if (ValueListObj.containsKey(valueListId)) Log.warnln("More than one valueList node with valueListId=\""+valueListId+"\", using latest node." ); // add the valueList array into the list of valueList objects ValueListObj.put(valueListId, thisValueList); } // 4. If there is a reference object, clone it to get // the new valueList String valueListIdRef = thisValueList.getValueListIdRef(); if (valueListIdRef != null) { if (ValueListObj.containsKey(valueListIdRef)) { // Just a simple clone since we have stored the ArrayList rather than the // ValueList object (which actually doesnt exist. :P ValueList refValueListObj = (ValueList) ValueListObj.get(valueListIdRef); try { thisValueList = (ValueList) refValueListObj.clone(); } catch (java.lang.CloneNotSupportedException e) { Log.errorln("Weird error, cannot clone valueList object. Aborting read."); System.exit(-1); }// This is missing. Should allow override. // later note to self: Huh?? /* // override attrs with those in passed list // strValueList.setAttributes(attrs); // give the clone a unique Id and remove IdRef // strValueList.setValueListId(findUniqueIdName(ValueListObj,strValueList.getValueListId())); // strValueList.setValueListIdRef(null); // add this into the list of valueList objects // ValueListObj.put(strValueList.getValueListId(), strValueList);*/ } else { Log.warnln("Error: Reader got an valueList with ValueListIdRef=\""+valueListIdRef+"\" but no previous valueList has that id! Ignoring add valueList request."); return; } } // 5. split up string into Value Objects based on declared delimiter ArrayList myValueList = splitStringIntoValueObjects( valueListString, thisValueList); // 6. determine where these values go and then insert them ValueListDelimitedList newValueListObj = new ValueListDelimitedList (myValueList, thisValueList.getDelimiter(), thisValueList.getNoData(), thisValueList.getInfinite(), thisValueList.getInfiniteNegative(), thisValueList.getNotANumber(), thisValueList.getOverflow(), thisValueList.getUnderflow() ); if( parentNodeName.equals(XDFNodeName.AXIS) ) { // get the last axis List axisList = (List) CurrentArray.getAxes(); Axis lastAxisObject = (Axis) axisList.get(axisList.size()-1); lastAxisObject.addAxisValueList(newValueListObj); } else if( parentNodeName.equals(XDFNodeName.PARAMETER) ) { LastParameterObject.addValueList( newValueListObj); } else { Log.errorln("Error: weird parent node "+parentNodeName+" for "+XDFNodeName.VALUELIST+", Ignoring."); } // now add valueObjects to groups Iterator iter = myValueList.iterator(); while (iter.hasNext()) { Value newvalue = (Value) iter.next(); // add this object to all open value groups Iterator groupIter = CurrentValueGroupList.iterator(); while (groupIter.hasNext()) { ValueGroup nextValueGroupObj = (ValueGroup) groupIter.next(); newvalue.addToGroup(nextValueGroupObj); } } CurrentValueList.setIsDelimitedCase(true); // notify that we did the list }
12,087
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueList.setIsDelimitedCase(false); return (Object) null; }
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list Hashtable attribs = attribListToHashtable(attrs); CurrentValueList.init(attribs); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueList.setIsDelimitedCase(false); return (Object) null; }
12,088
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) CurrentValueList.setIsDelimitedCase(false); return (Object) null; }
public Object action (SaxDocumentHandler handler, Attributes attrs) { // 1. re-init CurrentValueList = new ValueList(); // 2. populate ValueListparameters from attribute list CurrentValueList.init(attribListToHashtable(attrs)); // 3. populate ValueListparameters w/ parent name String parentNodeName = getParentNodeName(XDFNodeName.VALUEGROUP); CurrentValueList.setParentNodeName(parentNodeName); // 4. set this parameter to false to indicate the future is not // yet determined for this :) if (attribs.containsKey("size")) CurrentValueList.setIsDelimitedCase(false); else CurrentValueList.setIsDelimitedCase(true); return (Object) null; }
12,089
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue); } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue); } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
12,090
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue); } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
private void addByteDataToCurrentArray (Locator location, byte[] data, int amount, String endian) throws SetDataException { ArrayList commandList = (ArrayList) ((FormattedXMLDataIOStyle) CurrentArray.getXMLDataIOStyle()).getFormatCommands(); int nrofIOCmd = commandList.size(); int bytes_added = 0; while (bytes_added < amount) { FormattedIOCmd currentIOCmd = (FormattedIOCmd) commandList.get(CurrentIOCmdIndex); // readCell if (currentIOCmd instanceof ReadCellFormattedIOCmd) { DataFormat currentDataFormat = DataFormatList[CurrentDataFormatIndex]; int bytes_to_add = currentDataFormat.numOfBytes(); if ( currentDataFormat instanceof IntegerDataFormat || currentDataFormat instanceof FloatDataFormat ) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Number Data:["+thisData.trim()+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData.trim(), currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof StringDataFormat) { String thisData = new String(data,bytes_added,bytes_to_add);// Log.errorln("Got Href Formatted Character Data:["+thisData+ "]["+bytes_added+"]["+bytes_to_add+"]"); addDataToCurrentArray(location, thisData, currentDataFormat, IntRadix[CurrentDataFormatIndex]); } else if (currentDataFormat instanceof BinaryFloatDataFormat) { if (bytes_to_add == 4) { float myValue = convert4bytesToFloat(endian, data, bytes_added);// Log.errorln("Got Href Data BFloatSingle:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); CurrentArray.setData(location, myValue); } else if (bytes_to_add == 8) { // Log.errorln("Got Href Data BFloatDouble:["+myValue.toString()+"]["+bytes_added+"]["+bytes_to_add+"]"); double myValue = convert8bytesToDouble(endian, data, bytes_added); CurrentArray.setData(location, myValue); } else { Log.errorln("Error: got floating point with bit size != (32|64). Ignoring data."); } } else if (currentDataFormat instanceof BinaryIntegerDataFormat) {// Integer myValue = convert2bytesToInteger (endian, data, bytes_added);// Log.errorln("Got Href Data Integer:["+myValue.toString()+ "]["+bytes_added+"]["+bytes_to_add+"]"); // int numOfBytes = ((BinaryIntegerDataFormat) currentDataFormat).numOfBytes(); int myValue = convertBytesToInteger (bytes_to_add, endian, data, bytes_added); CurrentArray.setData(location, myValue); } // advance the data pointer to next location location.next(); // advance our global pointer to the current DataFormat if (NrofDataFormats > 1) if (CurrentDataFormatIndex == (NrofDataFormats - 1)) CurrentDataFormatIndex = 0; else CurrentDataFormatIndex++; bytes_added += bytes_to_add; } else if (currentIOCmd instanceof SkipCharFormattedIOCmd) { Integer bytes_to_skip = ((SkipCharFormattedIOCmd) currentIOCmd).getCount(); bytes_added += bytes_to_skip.intValue(); } else if (currentIOCmd instanceof RepeatFormattedIOCmd) { // shouldnt happen Log.errorln("Argh getFormatCommands not working right, got repeat command in addByteData!!!"); System.exit(-1); } // advance our global pointer to the current IOCmd if (nrofIOCmd> 1) if (CurrentIOCmdIndex == (nrofIOCmd - 1)) CurrentIOCmdIndex = 0; else CurrentIOCmdIndex++; } }
12,091
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInt (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
12,093
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInt (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
12,094
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInt (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
12,095
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInteger (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
private int convertBytesToInteger (int numOfBytes, String endianStyle, byte[] bb, int sbyte) { // is it better to use a dispatch table here? switch (numOfBytes) { case 1: // 8-bit return convert1byteToInteger (bb, sbyte); case 2: // 16-bit return convert2bytesToInteger (endianStyle, bb, sbyte); case 3: // 24-bit (unusual) return convert3bytesToInteger (endianStyle, bb, sbyte); case 4: // 32-bit return convert4bytesToInt (endianStyle, bb, sbyte); // This will most likely break the Java Integer. Lets not pretend // that we support it yet. Will have to contemplate BigInteger implementation for this. /* case 8: // 64-bit return convert8bytesToLong (endianStyle, bb, sbyte); break; */ default: Log.errorln("XDF Can't handle binary integers of byte size:"+numOfBytes+". Aborting!"); System.exit(-1); return -1; } }
12,096
public void setCompression (String strCompression) { if (!Utility.isValidDataCompression(strCompression)) Log.warnln("Data compression value is not valid, ignoring request to set it."); else ((XMLAttribute) attribHash.get("compression")).setAttribValue(strCompression); }
public void setCompression (String strCompression) { if (!Utility.isValidDataCompression(strCompression)) Log.warnln("Data compression value is not valid, ignoring request to set it."); else ((XMLAttribute) attribHash.get("compression")).setAttribValue(strCompression); }
12,097
public void setEncoding (String strEncoding) { if (!Utility.isValidDataEncoding(strEncoding)) Log.warnln("Encoding is not valid, ignoring request to setEncoding."); else ((XMLAttribute) attribHash.get("encoding")).setAttribValue(strEncoding); }
public void setEncoding (String strEncoding) { if (!Utility.isValidDataEncoding(strEncoding)) Log.warnln("Encoding is not valid, ignoring request to setEncoding."); else ((XMLAttribute) attribHash.get("encoding")).setAttribValue(strEncoding); }
12,098
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = sPrettyXDFOutput; String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); Number checksum = getChecksum(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum.toString() + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
public void toXMLOutputStream ( OutputStream outputstream, Hashtable XMLDeclAttribs, String strIndent, boolean dontCloseNode, String newNodeNameString, String noChildObjectNodeName ) { boolean niceOutput = Specification.getInstance().isPrettyXDFOutput(); String indent = ""; indent = indent + strIndent; String nodeName = getClassXDFNodeName(); //open node if (niceOutput) writeOut(outputstream, indent); writeOut(outputstream, "<" + nodeName ); String href = getHref(); if (href !=null) writeOut(outputstream, " href = \"" + href + "\""); Number checksum = getChecksum(); if (checksum !=null) writeOut(outputstream, " checksum = \"" + checksum.toString() + "\""); writeOut(outputstream, ">"); //end of opening code //write out just the data XMLDataIOStyle readObj = parentArray.getXMLDataIOStyle(); OutputStream dataOutputStream; if (href !=null) { //write out to another file, try { dataOutputStream = new FileOutputStream(getHref()); } catch (IOException e) { //oops, sth. is wrong, writ out to the passed in OutputStream dataOutputStream = outputstream; } } else { // no *href* attribute specified, write out to the passed in OutputStream dataOutputStream = outputstream; } Locator currentLocator = parentArray.createLocator(); AxisInterface fastestAxis = (AxisInterface) parentArray.getAxisList().get(0); //stores the NoDataValues for the parentArray, //used in writing out when NoDataException is caught String NoDataValues[] = new String[fastestAxis.getLength()]; if (parentArray.hasFieldAxis()) { DataFormat[] dataFormatList = parentArray.getDataFormatList(); for (int i = 0; i < NoDataValues.length; i++) { DataFormat d = dataFormatList[i]; if (d != null && d.getNoDataValue() != null) NoDataValues[i]=d.getNoDataValue().toString(); } } else { DataFormat d = parentArray.getDataFormat(); for (int i = 0; i < NoDataValues.length; i++) { if (d!=null && d.getNoDataValue() != null) NoDataValues[i] = d.getNoDataValue().toString(); } } if (readObj instanceof TaggedXMLDataIOStyle) { String[] tagOrder = ((TaggedXMLDataIOStyle)readObj).getAxisTags(); int stop = tagOrder.length; String[] tags = new String[stop]; for (int i = stop-1; i >= 0 ; i--) { tags[stop-i-1] = tagOrder[i]; // System.out.println(tagOrder.get(i)); } int[] axes = getMaxDataIndex(); stop =axes.length; int[] axisLength = new int[stop]; for (int i = 0; i < stop; i++) { axisLength[i] =axes[stop - 1 - i]; } writeTaggedData(dataOutputStream, currentLocator, indent, axisLength, tags, 0, fastestAxis, NoDataValues); } //done dealing with with TaggedXMLDataIOSytle else { if (readObj instanceof DelimitedXMLDataIOStyle) { writeDelimitedData( dataOutputStream, currentLocator, (DelimitedXMLDataIOStyle) readObj, fastestAxis, NoDataValues ); } else { writeFormattedData(dataOutputStream, currentLocator, (FormattedXMLDataIOStyle) readObj, fastestAxis, NoDataValues); } } //close the data section appropriately if (niceOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + nodeName + ">"); if (niceOutput) writeOut(outputstream, Constants.NEW_LINE); }
12,099
protected void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
private void writeDelimitedData(OutputStream outputstream, Locator locator, DelimitedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { String delimiter = readObj.getDelimiter(); String recordTerminator = readObj.getRecordTerminator(); int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; writeOut(outputstream, "<![CDATA["); do { dataNum ++; try { writeOut(outputstream, getStringData(locator)); } catch (NoDataException e) { //double check, a bug here, "yes" is already printed String noData = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noData == null) { readObj.setRepeatable("no"); } else { writeOut(outputstream, noData); } } //write out delimiter anyway writeOut(outputstream, delimiter); if (dataNum == fastestAxisLength) { writeOut(outputstream, recordTerminator); dataNum = 0; } } while (locator.next()); writeOut(outputstream, "]]>"); }
12,100
protected void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { writeOut(outputstream, "<![CDATA["); List commands = readObj.getCommands(); synchronized (data) { //double check on sync hasMoreData = locator.hasNext(); while (hasMoreData) recursiveWriteFormattedData(outputstream, locator, commands, fastestAxis, noDataValues); writeOut(outputstream, "]]>"); } }
private void writeFormattedData(OutputStream outputstream , Locator locator, FormattedXMLDataIOStyle readObj, AxisInterface fastestAxis, String[] noDataValues) { writeOut(outputstream, "<![CDATA["); List commands = readObj.getCommands(); synchronized (data) { //double check on sync hasMoreData = locator.hasNext(); while (hasMoreData) recursiveWriteFormattedData(outputstream, locator, commands, fastestAxis, noDataValues); writeOut(outputstream, "]]>"); } }
12,101
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,102
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (Specification.getInstance().isPrettyXDFOutput()) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,103
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (Specification.getInstance().isPrettyXDFOutput()) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,104
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,105
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (Specification.getInstance().isPrettyXDFOutput()) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,106
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (Specification.getInstance().isPrettyXDFOutput()) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,107
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (sPrettyXDFOutput) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
protected void writeTaggedData(OutputStream outputstream, Locator locator, String indent, int[] axisLength, String[] tags, int which, AxisInterface fastestAxis, String[] noDataValues) { String tag = (String) tags[which]; if (Specification.getInstance().isPrettyXDFOutput()) { indent += sPrettyXDFOutputIndentation; } //base case (writes the last 2 inner dimensions of the data cube) if (which == tags.length-2) { int stop = axisLength[which]; String tag1 = (String) tags[which+1]; for (int count = 0; count < stop; count++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent + sPrettyXDFOutputIndentation); } int fastestAxisLength = fastestAxis.getLength(); int dataNum = 0; while (dataNum < fastestAxisLength) { writeOut( outputstream, "<" + tag1 ); try { writeOut( outputstream, ">" + getStringData(locator)); writeOut( outputstream, "</" + tag1 + ">"); } catch (NoDataException e) { // opps! no data in that location. Print out accordingly String noDataValueString = noDataValues[locator.getAxisLocation(fastestAxis)]; if (noDataValueString != null) { writeOut(outputstream, ">" + noDataValueString ); writeOut( outputstream, "</" + tag1 + ">"); } else writeOut( outputstream, "/>"); } dataNum ++; locator.next(); } if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag+ ">"); } } else { // the 'outer' data tag wrapper. writes dimension 3 or higher tags int stop = axisLength[which]; which++; for (int i = 0; i < stop; i++) { if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "<" + tag + ">"); writeTaggedData(outputstream, locator, indent, axisLength, tags, which, fastestAxis, noDataValues); if (sPrettyXDFOutput) { writeOut(outputstream, Constants.NEW_LINE); writeOut(outputstream, indent); } writeOut(outputstream, "</" + tag + ">"); } } }
12,108
public Choice() { if (GraphicsEnvironment.isHeadless()) throw new HeadlessException(); }
public Choice() { if (GraphicsEnvironment.isHeadless()) throw new HeadlessException(); }
12,109
public Choice() { if (GraphicsEnvironment.isHeadless()) throw new HeadlessException(); }
public Choice() { if (GraphicsEnvironment.isHeadless()) throw new HeadlessException(); }
12,110
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
12,111
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
12,112
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
12,113
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
12,114
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
public synchronized void add(String item) { if (item == null) throw new NullPointerException("item must be non-null"); pItems.addElement(item); int i = pItems.size() - 1; if (peer != null) { ChoicePeer cp = (ChoicePeer) peer; cp.add(item, i); } if (i == 0) select(0); }
12,115
public synchronized void addItem(String item) { add(item); }
public synchronized void addItem(String item) { add(item); }
12,116
public synchronized void addItem(String item) { add(item); }
public synchronized void addItem(String item) { add(item); }
12,117
public synchronized void addItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.add(item_listeners, listener); }
public synchronized void addItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.add(item_listeners, listener); }
12,118
public synchronized void addItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.add(item_listeners, listener); }
public synchronized void addItemListener(ItemListener listener) { item_listeners = AWTEventMulticaster.add(item_listeners, listener); }
12,119
public void addNotify() { if (peer == null) peer = getToolkit().createChoice(this); super.addNotify(); }
public void addNotify() { if (peer == null) peer = getToolkit().createChoice(this); super.addNotify(); }
12,120